/* ============================================
   TABLE OF CONTENTS
   ============================================
   1. Variables & Reset
   2. Base Styles & Utilities
   3. Header
   4. Image Section
   5. Grid Layout
   6. Contact Section
   7. Newsletter
   8. Footer
   9. Slider / Carousel
   ============================================ */

/* ==========================================================================
   FONT IMPORTS
   ========================================================================== */

/* ABCFavorit Regular */
@font-face {
  font-family: "ABCFavorit";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("../fonts/ABCFavorit-Regular.woff2") format("woff2"),
    url("../fonts/ABCFavorit-Regular.woff") format("woff"),
    url("../fonts/ABCFavorit-Regular.ttf") format("truetype"),
    url("../fonts/ABCFavorit-Regular.otf") format("opentype");
}

/* ABCFavorit Medium */
@font-face {
  font-family: "ABCFavorit";
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  src: url("../fonts/ABCFavorit-Medium.ttf") format("woff2"),
    url("../fonts/ABCFavorit-Medium.woff") format("woff"),
    url("../fonts/ABCFavorit-Medium.ttf") format("truetype"),
    url("../fonts/ABCFavorit-Medium.otf") format("opentype");
}

/* ABCFavoritLining Regular */
@font-face {
  font-family: "ABCFavoritLining";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("../fonts/ABCFavoritLining-Regular.woff2") format("woff2"),
    url("../fonts/ABCFavoritLining-Regular.woff") format("woff"),
    url("../fonts/ABCFavoritLining-Regular.ttf") format("truetype"),
    url("../fonts/ABCFavoritLining-Regular.otf") format("opentype");
}

/* ============================================
   1. VARIABLES & RESET
   ============================================ */
:root {
  /* Colors */
  --primary-bg: #382921;
  --white: #ffffff;
  --black: #000000;
  --primary-text: #d8ccb6;
  --accent-color: #ce973e;
  --border-color: #d8ccb6;
  --brand-color-1: #d8ccb6;
  --brand-color-2: #262d18;
  --brand-color-3: #b9c9d6;
  --brand-color-4: #382921;

  /* Spacing */
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-xxl: 60px;

  /* Typography */

  --font-family-sans-serif: "ABCFavorit", sans-serif;
  --font-family-lining: "ABCFavoritLining", sans-serif;
  --font-size-xs: 0.7rem;
  --font-size-sm: 0.8rem;
  --font-size-base: clamp(1.2rem, 5vw, 1.5rem);
  --font-size-md: 1.5rem;
  --font-size-lg: 1.2rem;
  --font-size-xl: 2rem;
  --font-size-xxl: clamp(2rem, 5vw, 4rem);
}

/* Breakpoints 
  
  Tablet: 560px
  Desktop: 768px
  Large Desktop: 877px
  Widescreen: 1160px
  
  */

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ============================================
     2. BASE STYLES & UTILITIES
     ============================================ */
body {
  font-family: var(--font-family-sans-serif), sans-serif;
  background-color: var(--primary-bg);
  color: var(--primary-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  font-weight: 300;
}

html {
  overflow-x: hidden;
}

* {
  text-wrap: balance;
}

body::after {
  content: "";
  position: absolute;
  width: 1000px;
  height: 1000px;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  z-index: -1;
  top: -160px;
  right: -500px;
  opacity: 0.8;
}

@media (min-width: 768px) {
  body::after {
    top: -542px;
    right: -1000px;
    width: 2000px;
    height: 2000px;
  }
}

a {
  color: var(--primary-text);
  text-decoration: none;
}

.underline {
  font-family: var(--font-family-lining), sans-serif;
}

main {
  flex: 1;
}

/* --------------------------------------------
     Utilities
     -------------------------------------------- */
@media (min-width: 560px) and (max-width: 768px) {
  .is-hidden-tablet {
    display: none;
  }
}
@media (min-width: 768px) and (max-width: 877px) {
  .is-hidden-desktop {
    display: none;
  }
}
@media (min-width: 877px) and (max-width: 1160px) {
  .is-hidden-desktop-large {
    display: none;
  }
}
@media (max-width: 768px) {
  .is-hidden-mobile {
    display: none;
  }
}

/* ============================================
     3. HEADER
     ============================================ */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-md);
  background-color: var(--primary-bg);
  width: 100%;
}
@media (min-width: 877px) {
  .header {
    padding: var(--spacing-xxl);
    align-items: flex-end;
  }
}

.logo svg {
  width: 80px;
  height: auto;
  fill: var(--white);
}
@media (min-width: 877px) {
  .logo svg {
    width: 400px;
  }
}

.tagline {
  color: var(--white);
  font-size: var(--font-size-sm);
}
@media (min-width: 877px) {
  .tagline {
    font-size: var(--font-size-xl);
  }
}

/* ============================================
     4. IMAGE SECTION
     ============================================ */
.image-section {
  position: relative;
}

.image-section::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 90%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0));
  pointer-events: none; /* Ensures the overlay doesn't interfere with clicks */
}

.image-section img {
  width: 100%;
  height: calc(100dvh - 56px);
  object-fit: cover;
  display: block;
}
@media (min-width: 877px) {
  .image-section img {
    height: calc(100vh - 209px);
  }
}

.overlay-text {
  position: absolute;
  font-size: var(--font-size-xxl);
  color: var(--white);
  z-index: 1;
  font-family: var(--font-family-sans-serif), sans-serif;
  text-align: left;
  padding-left: 30px;
  padding-bottom: 2rem;
  bottom: 20px;
  right: 0;
}
.overlay-text h1 {
  margin-left: auto;
  width: auto;
  font-weight: 300;
  line-height: 1.2;
  padding-right: var(--spacing-xxl);
  word-break: break-word;
  overflow-wrap: break-word;
}

.image-section > span {
  position: absolute;
  top: 21%;
  right: 6%;
  transform: translate(-50%, -50%) rotate(10deg);
  font-size: var(--font-size-xl);
  line-height: 0.9;
  font-weight: 500;
  color: var(--primary-text);
  text-align: center;
  z-index: 2;
}

.image-section .text {
  z-index: 1;
  font-size: 25px;
  color: var(--black);
}

.image-section > span:after {
  content: "";
  display: block;
  position: absolute;
  width: 150px;
  height: 150px;
  z-index: -1;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: var(--accent-color);
  border-radius: 50%;
}

/* ============================================
     5. GRID LAYOUT
     ============================================ */
.grid-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: min-content min-content 1fr;
  width: 100%;
}
@media (min-width: 768px) {
  .grid-container {
    width: 100%;
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 877px) {
  .grid-container {
    width: 126%;
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1160px) {
  .grid-container {
    width: 128%;
  }
}

.aspect-ratio-1-1 {
  aspect-ratio: 1/1;
}

.grid-cell {
  position: relative;
  box-sizing: border-box;

  width: 100%;
}
@media (min-width: 1160px) {
  .grid-cell {
    width: initial;
    min-height: 36vh;
  }
}
/* Default border style */
.grid-cell::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}
/* --------------------------------------------
     Grid Cell Spacing
     -------------------------------------------- */
#cell-1 {
  align-content: center;
}

#cell-2 {
  min-height: 100%;
  aspect-ratio: 1;
}

@media (min-width: 560px) {
  #cell-2 {
    aspect-ratio: 6/4;
  }
}
@media (min-width: 877px) {
  #cell-2 {
    aspect-ratio: initial;
  }
}

@media (max-width: 444px) {
  #cell-1 {
    aspect-ratio: 1;
  }
}

.cell-span-2 {
  grid-column: span 2;
  aspect-ratio: 2/1;
}

/* Grid Cell Spans */
@media (max-width: 560px) {
  .cell-span-2-mobile {
    grid-column: span 2;
    aspect-ratio: 2/1;
  }
}
/* Grid Cell Spans */
@media (max-width: 768px) {
  .cell-span-2-tablet {
    grid-column: span 2;
  }
}

@media (max-width: 877px) {
  .cell-span-2-desktop {
    grid-column: span 2;
    aspect-ratio: 2/1;
  }
}

@media (max-width: 1160px) {
  .cell-span-2-large-desktop {
    grid-column: span 2;
    aspect-ratio: 2/1;
  }
}

@media (min-width: 1160px) {
  .cell-span-2-widescreen {
    grid-column: span 2;
    aspect-ratio: initial;
  }
}

/* --------------------------------------------
     Grid Cell Borders
     -------------------------------------------- */

/* Individual borders based on data attributes */
.grid-cell[data-borders*="top"]::after {
  border-top: 1px solid var(--border-color);
}

.grid-cell[data-borders*="right"]::after {
  border-right: 1px solid var(--border-color);
}

.grid-cell[data-borders*="right"]::after {
  border-right: 1px solid var(--border-color);
}

.grid-cell[data-borders*="bottom"]::after {
  border-bottom: 1px solid var(--border-color);
}

.grid-cell[data-borders*="left"]::after {
  border-left: 1px solid var(--border-color);
}

/* Grid Cell Content */
.text-content {
  padding: var(--spacing-xxl) var(--spacing-lg);

  line-height: 1.4;
  max-width: 100%;
}
.text-content p {
  font-size: var(--font-size-base);
  font-family: var(--font-family-sans-serif);
  letter-spacing: 0.2pt;
  line-height: 150%;
}
@media (min-width: 768px) {
  .text-content {
    padding: var(--spacing-lg);
    font-size: var(--font-size-md);
  }
}
@media (min-width: 877px) {
  .text-content {
    padding: var(--spacing-xxl);
    font-size: var(--font-size-md);
    max-width: 90%;
  }
}

.text-cell {
  align-content: center;
}

/* ============================================
     6. CONTACT SECTION
     ============================================ */
.contact-section {
  height: 150px;
  min-height: 150px;
  width: 100%;
  align-content: center;
  grid-column: span 2;
}
@media (min-width: 877px) {
  .contact-section {
    grid-column: span 3;
    aspect-ratio: 3/1;
  }
}

.contact-cell-empty {
  height: 150px;
  min-height: 150px;
}

.contact-section .content-box {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 30px;
  font-size: var(--font-size-base);
}
@media (min-width: 877px) {
  .contact-section .content-box {
    flex-direction: row;
    gap: 60px;
  }
}

.contact-section * {
  font-family: var(--font-family-sans-serif), sans-serif;
}

/* ============================================
     7. NEWSLETTER
     ============================================ */
.newsletter-link {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  text-align: center;
}

.newsletter-link a {
  color: var(--black);
  isolation: isolate;
  text-decoration: none;
  font-size: var(--font-size-base);
  line-height: 1.4;
  font-family: var(--font-family-sans-serif), sans-serif;
  padding-bottom: 2px;
  transition: opacity 0.3s ease;
  position: relative;
  font-weight: 500;
}

.newsletter-link a::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 180px;
  height: 180px;
  background-color: var(--accent-color);
  border-radius: 50%;
  z-index: -1;
}

.newsletter-link a:hover {
  opacity: 0.8;
}

/* ============================================
     8. FOOTER
     ============================================ */
.footer {
  display: flex;
  justify-content: center;
  padding: var(--spacing-sm) var(--spacing-md);
  width: 100%;
  border-top: 1px solid #e0dbcb;
}
@media (min-width: 877px) {
  .footer {
    padding: 0.75rem var(--spacing-lg);
    justify-content: flex-start;
  }
}

.footer-links {
  display: flex;
  gap: var(--spacing-md);
}
@media (min-width: 877px) {
  .footer-links {
    gap: var(--spacing-lg);
  }
}

.footer-links a {
  text-decoration: none;
  font-size: var(--font-size-xs);
}
@media (min-width: 877px) {
  .footer-links a {
    font-size: var(--font-size-sm);
  }
}

.footer-links a:hover {
  text-decoration: underline;
}

/* ============================================
     9. SLIDER / CAROUSEL
     ============================================ */

.slider-cell {
  position: relative;
}

.slider-container {
  position: absolute;
  inset: 20px;
  top: 30px;
  left: 0;
  width: 200%;
  z-index: 2;
  height: 100%;
}

@media (min-width: 877px) {
  .slider-container {
    width: 300%;
  }
}

@media (min-width: 560px) {
  .slider-container {
    top: 0;
  }
}

.splide {
  position: relative;
  margin: 0 auto;
  max-width: 100%;
  flex: 1;
  padding: 20px;
}
@media (min-width: 768px) {
  .splide {
    padding: 60px;
  }
}

/* Slide Images */
.splide__slide img {
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
  aspect-ratio: 3/4;
}
@media (min-width: 560px) {
  .splide__slide img {
    aspect-ratio: 20/19;
  }
}
@media (min-width: 877px) {
  .splide__slide img {
    aspect-ratio: 16/9;
  }
}

/* Text Overlay for Image Slides */
.slide-content {
  position: relative;
  height: 100%;
}

.text-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: var(--white);
  z-index: 2;
  padding: var(--spacing-sm);

  width: 80%;
  max-width: 300px;
}

.text-overlay p {
  margin: 0;
  font-size: var(--font-size-xl);
  font-weight: 300;
}

/* Text Slides */
.text-slide {
  display: flex;
  align-items: center;
  justify-content: center;
}

.text-slide--color-1 {
  background-color: var(--brand-color-1);
}
.text-slide--color-1 * {
  color: var(--brand-color-4) !important;
}
.text-slide--color-2 {
  background-color: var(--brand-color-2);
}
.text-slide--color-2 * {
  color: var(--brand-color-3) !important;
}
.text-slide--color-3 {
  background-color: var(--brand-color-3);
}
.text-slide--color-3 * {
  color: var(--black) !important;
}

.text-slide-content {
  text-align: center;
  color: var(--primary-bg);
  padding: var(--spacing-lg);
  max-width: 80%;
}

.text-slide-content p {
  margin: 0 0 var(--spacing-sm);
  font-size: var(--font-size-xl);
  line-height: 1.4;
  font-weight: 300;
}

@media (min-width: 768px) {
  .text-overlay p {
    font-size: var(--font-size-xxl);
  }

  .text-slide-content p {
    font-size: var(--font-size-xxl);
  }

  .text-slide-content .author {
    font-size: var(--font-size-base);
  }
}

/* Pagination Dots */
.splide__pagination {
  bottom: -10px;
  padding: 10px 0;
  justify-content: flex-start;
}

.splide__pagination__page {
  background: #fff;
  border: 0;
  border-radius: 50%;
  display: inline-block;
  height: 8px;
  margin: 3px;
  padding: 0;
  width: 8px;
}

.splide__pagination__page.is-active {
  background: var(--accent-color) !important;
}

@media (min-width: 768px) {
  .splide__pagination__page {
    height: 10px;
    width: 10px;
  }
}

.splide__pagination__page.is-active {
  background: #333;
  opacity: 1;
}
/* ============================================
   10. MODAL
   ============================================ */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(56, 41, 33, 0.9); /* Primary background with opacity */
  z-index: 1000;
  overflow: auto;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal.active {
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 1;
}

.modal-content {
  position: relative;
  background-color: var(--primary-bg);
  border: 1px solid var(--border-color);
  width: 90%;
  max-width: 900px;
  max-height: 80vh;
  overflow-y: scroll;
  overflow-x: hidden;

  padding: var(--spacing-xl);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  transform: translateY(-20px);
  transition: transform 0.3s ease;
}

.modal-content h2 {
  padding-top: var(--spacing-xl);
  padding-bottom: var(--spacing-sm);
}

.modal-content * {
  word-break: break-word;
  overflow-wrap: break-word;
}

.modal.active .modal-content {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: var(--spacing-md);
  right: var(--spacing-md);
  color: var(--primary-text);
  font-size: var(--font-size-xl);
  font-weight: bold;
  cursor: pointer;
  transition: color 0.2s ease;
}

.modal-close:hover {
  color: var(--accent-color);
}

.modal-title {
  color: var(--primary-text);
  font-family: var(--font-family-lining), sans-serif;
  font-size: var(--font-size-lg);
  margin-bottom: var(--spacing-lg);
  padding-bottom: var(--spacing-md);
}

@media (min-width: 768px) {
  .modal-title {
    font-size: var(--font-size-xl);
  }
}

.modal-body {
  color: var(--primary-text);
  font-family: var(--font-family-sans-serif), sans-serif;
  font-size: var(--font-size-base);
  line-height: 1.5;
}

.modal-body * {
  font-weight: 300;
}

@media (min-width: 768px) {
  .modal-body {
    font-size: var(--font-size-md);
  }
}

/* For modal trigger links */
.modal-trigger {
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.modal-trigger:hover {
  opacity: 0.8;
}
