/*
  Lekura Wine Cellar
  Measurements come from the Figma frame "Main Page 8" (1920 px wide) and scale down fluidly.
*/

/* Google Sans — latin-ext (variable) */
@font-face {
  font-family: 'Google Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/google-sans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Google Sans — latin (variable) */
@font-face {
  font-family: 'Google Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/google-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Playfair Display — latin-ext (variable) */
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 500 600;
  font-display: swap;
  src: url('../fonts/playfair-display-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Playfair Display — latin (variable) */
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 500 600;
  font-display: swap;
  src: url('../fonts/playfair-display-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --red: #ab2024;
  --red-hover: #8d1a1d;
  --cream: #f5f1eb;
  --cream-hover: #ebe3d6;
  --divider: #c4b39c;
  --field-border: #8f7c66; /* 4.0:1 on white */
  --black: #000;
  --white: #fff;

  --font-sans: 'Google Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;

  --content-max: 109rem;                                 /* 1744 */
  --gutter: clamp(1rem, 4.5833vw, 5.5rem);               /* 88 */
  --section-gap: clamp(3.5rem, 5.4167vw, 6.5rem);        /* 104 */
  --space-56: clamp(2rem, 2.9167vw, 3.5rem);
  --space-48: clamp(1.5rem, 2.5vw, 3rem);
  --space-32: clamp(1.25rem, 1.6667vw, 2rem);

  --fs-display: clamp(2.5rem, 1rem + 3.75vw, 5.5rem);    /* 88 */
  --fs-hero: clamp(2.25rem, 0.5rem + 4.1667vw, 5.5rem);  /* 88 */
  --fs-lead: clamp(1.125rem, 1rem + 0.4167vw, 1.5rem);   /* 24 */
  --fs-title-sm: clamp(1.5rem, 1rem + 0.8333vw, 2rem);   /* 32 */
  --fs-body-lg: clamp(1rem, 0.75rem + 0.4167vw, 1.25rem);/* 20 */
  --fs-nav: clamp(1.125rem, 0.6rem + 0.75vw, 1.5rem);    /* 24 */

  /* logo mark (68/64 of its width) plus paddings; main.js replaces it with the measured height */
  --header-h: calc(clamp(2.5rem, 3.3333vw, 4rem) * 1.0625 + 4rem);

  --ease-out: cubic-bezier(.22, .61, .36, 1);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%; scroll-behavior: smooth;
  scrollbar-gutter: stable;           /* the page does not jump sideways when the age gate unlocks scrolling */
}
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--black);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  padding: .75rem 1.25rem; border-radius: .5rem;
  background: var(--red); color: var(--white); font-weight: 700;
  transition: top .2s ease;
}
.skip-link:focus { top: 1rem; }

.container {
  width: 100%;
  max-width: calc(var(--content-max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section { padding-top: var(--section-gap); }
.section--last { padding-bottom: var(--section-gap); }

.section-title {
  font-weight: 500;
  font-size: var(--fs-display);
  line-height: 1.25;
  color: var(--red);
  text-wrap: balance;
}
.lead { font-size: var(--fs-lead); line-height: 1.6667; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 1.125rem 2rem;
  border: 0;                          /* <button> brings its own UA border */
  border-radius: .5rem;
  background: var(--red);
  color: var(--white);
  font-weight: 700; font-size: 1rem; line-height: 1.25;
  text-transform: uppercase; white-space: nowrap;
  transition: background-color .2s ease, color .2s ease;
}
.btn:hover { background: var(--red-hover); }
.btn--outline { background: transparent; color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.btn--outline:hover { background: var(--red); color: var(--white); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn:focus-visible { outline-offset: 4px; }

/* ---------- header ---------- */
.site-header { position: relative; z-index: 50; background: var(--white); }
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  max-width: 120rem; margin-inline: auto;
  padding: 1rem clamp(1rem, 3.3333vw, 4rem);
}
.brand { display: inline-flex; align-items: center; gap: 1.5rem; padding-block: 1rem; }
.brand__mark { width: clamp(2.5rem, 3.3333vw, 4rem); }
.brand__name {
  font-family: var(--font-serif); font-weight: 600;
  font-size: var(--fs-nav); line-height: 1.2;
  color: var(--red); white-space: nowrap;
}
.site-nav__list { display: flex; align-items: center; gap: 2rem; }
.site-nav__link {
  display: block;
  padding: .5rem 2rem .5rem 0;
  border-right: 1px solid var(--red);
  font-size: var(--fs-nav); line-height: 1.1667;
  color: var(--red);
  transition: opacity .2s ease;
}
.site-nav__item:last-child .site-nav__link { padding-right: 0; border-right: 0; }
.site-nav__link:hover { opacity: .7; }

.nav-toggle {
  display: none;
  position: relative; width: 2.75rem; height: 2.75rem;
  padding: 0; border: 0; background: none; cursor: pointer;
}
.nav-toggle__bar {
  position: absolute; left: .625rem; right: .625rem; height: 2px;
  background: var(--red); border-radius: 1px;
  transition: transform .25s ease, opacity .2s ease;
}
.nav-toggle__bar:nth-child(2) { top: 1rem; }
.nav-toggle__bar:nth-child(3) { top: 1.3125rem; }
.nav-toggle__bar:nth-child(4) { top: 1.625rem; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) { transform: translateY(.3125rem) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(4) { transform: translateY(-.3125rem) rotate(-45deg); }

@media (max-width: 991px) {
  :root { --header-h: calc(clamp(2.5rem, 3.3333vw, 4rem) * 1.0625 + 2.5rem); }
  .brand { padding-block: .25rem; gap: 1rem; }
  .nav-toggle { display: block; }
  .site-nav {
    position: absolute; inset-inline: 0; top: 100%;
    background: var(--white);
    box-shadow: 0 12px 24px -12px rgb(0 0 0 / .25);
    display: none;
  }
  .site-nav.is-open { display: block; }
  .site-nav__list { flex-direction: column; align-items: stretch; gap: 0; padding: .25rem var(--gutter) 1rem; }
  .site-nav__link, .site-nav__item:last-child .site-nav__link {
    padding: 1rem 0; border-right: 0; border-bottom: 1px solid var(--cream);
  }
}

/* ---------- hero ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100svh - var(--header-h));
  padding: clamp(3rem, 24.5svh, 16.5rem) var(--gutter) clamp(1.25rem, 2.7083vw, 3.25rem);
  background: #1b1712;
  color: var(--white);
  touch-action: pan-y;
}
.hero__slides { position: absolute; inset: 0; z-index: -1; }
.hero__slide { position: absolute; inset: 0; transition: transform .5s ease; }
.hero__slide:not(:first-child) { transform: translateX(100%); } /* only the first photo shows before main.js runs */
.hero__slide img { width: 100%; height: 100%; object-fit: cover; }
.hero__title {
  font-family: var(--font-serif); font-weight: 500;
  font-size: var(--fs-hero); line-height: 1.1;
  text-align: center; text-wrap: balance;
  max-width: 15.82em; /* 1392 px at 88 px */
}
.hero__dots { display: flex; margin-top: 2rem; }
.hero__dot {
  position: relative; width: 2.75rem; height: 2.75rem; /* 20 px dot + 24 px gap, as in the design */
  padding: 0; border: 0; background: none; cursor: pointer;
}
.hero__dot::before {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 1.25rem; height: 1.25rem; border-radius: 50%;
  background: var(--white);
  transition: background-color .25s ease, transform .25s ease;
}
.hero__dot[aria-selected="true"]::before { background: var(--red); }
.hero__dot:hover::before { transform: scale(1.15); }
.hero__dot:focus-visible { outline-color: var(--white); outline-offset: -4px; border-radius: 50%; }

/* ---------- journey ---------- */
.journey { display: flex; align-items: flex-start; gap: var(--space-56); }
.journey__text { flex: 0 0 39.22%; display: flex; flex-direction: column; align-items: flex-start; }
.journey__title { max-width: 7.2em; }
.journey__lead { margin-top: var(--space-48); }
.journey__cta { margin-top: var(--space-56); }

.collage { position: relative; flex: 1 1 0; aspect-ratio: 1004 / 913; }
.collage__img { position: absolute; width: auto; object-fit: cover; }
.collage__img--tanks   { left: 42.53%; top: 57.83%; width: 57.47%; height: 42.17%; }
.collage__img--garden  { left: 22.31%; top: 0;      width: 77.69%; height: 55.2%; }
.collage__img--glasses { left: 0;      top: 47.32%; width: 40.14%; height: 50.05%; }

@media (max-width: 991px) {
  .journey { flex-direction: column; }
  .journey__text { flex-basis: auto; }
  .collage { flex: none; width: 100%; }
}

/* ---------- wines slider ---------- */
.wines__title { margin-bottom: var(--space-32); }
.wine-slider-wrap { container-type: inline-size; }
.wine-slider {
  --per: 4;
  --btn: 3.5rem;
  --gap: clamp(1.25rem, 2.6cqw, 2.8333rem);               /* 45.33 px at 1744 */
  --card-w: calc((100cqw - var(--btn) - (var(--per) - 1) * var(--gap)) / var(--per));
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--btn);
}
@container (max-width: 1099px) { .wine-slider { --per: 3; } }
@container (max-width: 799px)  { .wine-slider { --per: 2; } }
@container (max-width: 519px)  { .wine-slider { --per: 1; --btn: 2.75rem; } }

.wine-slider__viewport {
  grid-column: 1;
  overflow: hidden;                   /* moved only by the arrows, a mouse drag or a swipe (main.js) */
  touch-action: pan-y;                /* vertical page scrolling stays native on touch screens */
}
.wine-slider__track {
  display: flex; gap: var(--gap);
  transition: transform .5s var(--ease-out);
}
@media (hover: hover) and (pointer: fine) { .wine-slider__viewport { cursor: grab; } }
.wine-slider.is-dragging .wine-slider__viewport { cursor: grabbing; -webkit-user-select: none; user-select: none; }

.wine-card { flex: 0 0 var(--card-w); text-align: center; }
.wine-card__media { position: relative; aspect-ratio: 388 / 563; }
.wine-card__media img { width: 100%; height: 100%; object-fit: cover; }
.wine-card__media::after {
  content: ""; position: absolute;
  top: 5.77%; bottom: 5.77%;                               /* 498 of 563 */
  right: calc(var(--gap) / -2);
  width: 1px; background: var(--divider);
}
.wine-card:last-child .wine-card__media::after { display: none; }
.wine-card__name {
  margin-top: var(--space-32);
  font-weight: 400; font-size: var(--fs-title-sm); line-height: .875;
  color: var(--red);
}
.wine-card__desc { margin-top: 1.5rem; font-size: var(--fs-body-lg); line-height: 1.6; }

.wine-slider__btn {
  position: absolute; z-index: 2;
  top: calc(var(--card-w) * 563 / 388 / 2);
  translate: 0 -50%;
  display: grid; place-items: center;
  width: var(--btn); height: var(--btn);
  padding: 0; border: 0; border-radius: 50%;
  background: var(--cream);
  cursor: pointer;
  transition: opacity .2s ease, visibility .2s ease, background-color .2s ease;
}
.wine-slider__btn:hover { background: var(--cream-hover); }
.wine-slider__btn--prev { left: 0; }
.wine-slider__btn--next { right: 0; }
.wine-slider__btn--next img { transform: rotate(180deg); }
.wine-slider__btn[aria-disabled="true"] { opacity: 0; visibility: hidden; pointer-events: none; }

.wines__cta { display: flex; justify-content: center; margin-top: var(--space-56); }

/* ---------- Usakhelouri ---------- */
.feature { display: flex; align-items: flex-start; gap: var(--space-56); }
.feature__media { flex: 0 0 25.23%; aspect-ratio: 440 / 744; }
.feature__media img { width: 100%; height: 100%; object-fit: cover; }
.feature__text { flex: 1 1 0; display: flex; flex-direction: column; gap: var(--space-48); }

@media (max-width: 767px) {
  .feature { flex-direction: column; }
  .feature__media { flex: none; width: min(62%, 17.5rem); margin-inline: auto; }
  .feature__title br { display: none; }
}

/* ---------- contact form ---------- */
.contact {
  display: grid;
  grid-template-columns: minmax(0, 39.22%) minmax(0, 1fr); /* same split as the Journey section */
  gap: var(--space-56);
  align-items: start;
}
.contact__lead { margin-top: var(--space-48); }

.contact-form { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-32) 1.5rem; }
.field { display: flex; flex-direction: column; gap: .5rem; min-width: 0; }
.field--full { grid-column: 1 / -1; }
.field__label { font-size: var(--fs-body-lg); line-height: 1.2; }
.field__optional { font-size: .8em; }
.field__input {
  width: 100%;
  min-height: 3.5rem;                 /* same height as the design buttons */
  padding: .8125rem 1.25rem;         /* 13 + 28 + 13 + 2 px border = 56, like the buttons */
  border: 1px solid var(--field-border);
  border-radius: .5rem;
  background: var(--white);
  font: inherit; font-size: var(--fs-body-lg); line-height: 1.4;
  color: var(--black);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.field__input--area { min-height: 10rem; resize: vertical; }
.field__input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 1px var(--red); }
.field__input[aria-invalid="true"] { border-color: var(--red); box-shadow: 0 0 0 1px var(--red); }
.field__error { font-size: 1rem; line-height: 1.4; color: var(--red); }

.contact-form__footer {
  grid-column: 1 / -1;
  display: flex; flex-wrap: wrap; align-items: center; gap: 1rem var(--space-32);
}
.contact-form__note { font-size: 1rem; line-height: 1.5; }
.contact-form__status { grid-column: 1 / -1; font-size: var(--fs-body-lg); line-height: 1.6; }
.contact-form__status:empty { display: none; }
.contact-form__status[data-state="error"] { color: var(--red); }

@media (max-width: 991px) { .contact { grid-template-columns: 1fr; } }
@media (max-width: 599px) { .contact-form { grid-template-columns: 1fr; } }

/* ---------- age gate ---------- */
.is-gated { overflow: hidden; }
.age-gate {
  width: min(100% - 2rem, 36rem);
  max-height: calc(100% - 2rem);
  margin: auto;
  padding: clamp(2rem, 4.1667vw, 3.5rem) clamp(1.5rem, 4.1667vw, 3.5rem);
  border: 0; border-radius: .5rem;
  background: var(--cream);          /* the footer surface */
  color: var(--black);
  text-align: center;
  transition: opacity .6s var(--ease-out), translate .6s var(--ease-out);
}
.age-gate[open] {                    /* only when open, so a closed dialog stays hidden */
  display: flex; flex-direction: column; align-items: center; gap: 1.5rem;
}
.age-gate::backdrop {
  background-color: rgb(0 0 0 / .6);
  backdrop-filter: blur(4px);
  transition: background-color .6s ease, backdrop-filter .6s ease;
}
/* Fades in when it opens... */
@starting-style {
  .age-gate[open] { opacity: 0; translate: 0 1rem; }
  .age-gate[open]::backdrop { background-color: rgb(0 0 0 / 0); backdrop-filter: blur(0); }
}
/* ...and out after "Yes": main.js closes the dialog once this transition ends. */
.age-gate.is-closing { opacity: 0; translate: 0 1rem; transition-duration: .45s; }
.age-gate.is-closing::backdrop { background-color: rgb(0 0 0 / 0); backdrop-filter: blur(0); transition-duration: .45s; }
.age-gate__logo { width: clamp(8.5rem, 9.375vw, 11.25rem); }
.age-gate__title { font-weight: 500; font-size: clamp(1.75rem, 1rem + 1.6667vw, 2.5rem); line-height: 1.25; color: var(--red); }
.age-gate__text { font-size: var(--fs-body-lg); line-height: 1.6; }
.age-gate__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; }
.age-gate__denied {
  font-size: 1rem; line-height: 1.5; color: var(--red);
  transition: opacity .4s var(--ease-out), translate .4s var(--ease-out);
}
@starting-style { .age-gate__denied { opacity: 0; translate: 0 .5rem; } }
.age-gate__ornament { align-self: stretch; margin-top: .5rem; }

/* ---------- footer ---------- */
.site-footer {
  background: var(--cream);
  color: var(--red);
  padding: clamp(3.5rem, 4.5833vw, 5.5rem) 0 3rem;
}
.site-footer__top { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-32); }
.site-footer__contact { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-56); }
.site-footer__logo { width: clamp(8.5rem, 9.375vw, 11.25rem); }
.footer-title { font-weight: 400; font-size: var(--fs-title-sm); line-height: .875; }
.contact-list { display: flex; flex-direction: column; gap: var(--space-32); margin-top: var(--space-32); }
.contact-list li { display: flex; }
.contact-list__item { display: inline-flex; align-items: center; gap: 1rem; font-size: var(--fs-lead); line-height: 1; }
.contact-list__item img { flex: none; width: 1.5rem; height: 1.5rem; }
a.contact-list__item:hover { text-decoration: underline; text-underline-offset: .2em; }

.socials { display: flex; gap: var(--space-32); }
.socials a { display: block; width: clamp(2rem, 2.0833vw, 2.5rem); transition: opacity .2s ease; }
.socials a:hover { opacity: .7; }

.ornament {
  height: 11px; margin-top: var(--space-56);
  background-image: url("../images/ornament.webp");
  background-size: 56px 11px;
  background-repeat: space no-repeat;   /* evenly spaced, first and last touch the edges, like the design */
}
.copyright { margin-top: var(--space-48); text-align: center; font-size: 1rem; line-height: 1.5; }

@media (max-width: 767px) {
  .site-footer__top { flex-direction: column; align-items: flex-start; }
}

/* ---------- motion ---------- */
/* Reveal on scroll: html.js-reveal comes from the inline script in <head>, so nothing is hidden
   without JavaScript. main.js adds .is-revealed as an element scrolls into view, then removes
   data-reveal so the element is back on its own styles. */
.js-reveal [data-reveal] {
  transition: opacity .9s var(--ease-out), translate .9s var(--ease-out);
  transition-delay: var(--reveal-delay, 0s);
}
.js-reveal [data-reveal]:not(.is-revealed) { opacity: 0; translate: 0 1.5rem; }
@media print {
  .js-reveal [data-reveal] { opacity: 1 !important; translate: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
