/* Header */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
}

/* The blurred background lives on a pseudo-element: backdrop-filter on the header
   itself would become the containing block of the fixed mobile menu. */
.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgb(30 10 18 / 0.92);
  backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 0.3s;
}

.site-header.is-scrolled::before {
  opacity: 1;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-m);
  /* Full window width: the logo sits at the left edge and the navigation at the right one,
     not inside the content column. */
  height: var(--header-h);
  padding-inline: var(--gutter);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--paper);
  text-decoration: none;
}

.brand__logo {
  width: auto;
  height: 2rem;
}

.brand__tagline {
  color: var(--paper);
  font-size: var(--step--1);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-l);
}

.site-nav .btn {
  white-space: nowrap;
}

.site-nav__links {
  display: flex;
  gap: var(--space-m);
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav__links a {
  padding-block: 0.25rem;
  border-bottom: 1px solid transparent;
  color: var(--paper);
  text-decoration: none;
  white-space: nowrap;
}

.site-nav__links a:hover {
  border-color: var(--ochre);
}

.lang-switch {
  display: flex;
  overflow: hidden;
  border: 1px solid rgb(245 237 219 / 0.3);
  border-radius: var(--radius-pill);
}

.lang-switch button {
  padding: 0.3rem 0.7rem;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: var(--step--1);
  cursor: pointer;
}

.lang-switch button[aria-pressed='true'] {
  background: rgb(245 237 219 / 0.18);
  color: var(--paper);
}

.nav-toggle {
  display: none;
  padding: 0.5rem;
  border: 0;
  background: none;
  color: var(--paper);
  cursor: pointer;
}

.nav-toggle .icon-close,
.is-menu-open .nav-toggle .icon-open {
  display: none;
}

.is-menu-open .nav-toggle .icon-close {
  display: block;
}

/* Just above the mobile menu the full navigation needs tighter spacing to fit */
@media (min-width: 64.01rem) and (max-width: 75rem) {
  .site-nav {
    gap: 1.1rem;
  }

  .site-nav__links {
    gap: 0.9rem;
  }

  .site-nav__links a {
    font-size: 0.95rem;
  }
}

@media (max-width: 64rem) {
  .nav-toggle {
    position: relative;
    z-index: 2;
    display: block;
  }

  .site-nav {
    position: fixed;
    inset: 0;
    z-index: 1;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: var(--space-l);
    padding: var(--gutter);
    background: var(--night);
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.25s, visibility 0.25s;
  }

  .is-menu-open .site-nav {
    visibility: visible;
    opacity: 1;
  }

  .site-nav__links {
    flex-direction: column;
    gap: var(--space-s);
  }

  .site-nav__links a {
    font-family: var(--font-display);
    font-size: var(--step-3);
  }
}

/* Hero: the one loud moment of the page, over the pouring-wine video */
.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: center;
  min-height: 100vh;
  min-height: 100svh;
  /* The text sits in the middle of what is visible: below the header and above the owners'
     photo reaching up from the welcome band */
  padding: calc(var(--header-h) + var(--space-l)) var(--gutter) calc(var(--space-l) + var(--welcome-photo-lift));
  overflow: hidden;
  background: var(--night);
}

.hero__video {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: hero-media-in 1.6s var(--ease) both;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to top, var(--night) 0%, rgb(30 10 18 / 0.55) 40%, rgb(30 10 18 / 0.1) 75%),
    linear-gradient(to right, rgb(30 10 18 / 0.65), rgb(30 10 18 / 0) 65%),
    linear-gradient(to bottom, rgb(30 10 18 / 0.7), rgb(30 10 18 / 0) 25%);
}

.hero__content {
  position: relative;
  width: 100%;
  max-width: calc(var(--max) - 2 * var(--gutter));
  margin-inline: auto;
}

/* Under the title */
.hero__kicker {
  margin: var(--space-s) 0 0;
}

.hero__title {
  font-size: var(--step-hero);
  line-height: 1;
  letter-spacing: -0.01em;
  white-space: pre-line;
}

.band--ochre .news {
  border-top-color: rgb(42 21 32 / 0.4);
}

.band--ochre .news__text {
  color: var(--ink);
}

.hero__status {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: var(--space-m) 0 var(--space-l);
}

.hero__dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--muted);
}

.hero__status.is-open .hero__dot {
  background: var(--ochre);
  box-shadow: 0 0 0 4px rgb(214 162 67 / 0.25);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-s);
}

.hero__kicker,
.hero__title {
  animation: hero-text-in 0.9s var(--ease) 0.5s both;
}

.hero__status,
.hero__actions {
  animation: hero-text-in 0.9s var(--ease) 0.75s both;
}

@keyframes hero-media-in {
  from {
    opacity: 0;
    transform: scale(1.06);
  }
}

@keyframes hero-text-in {
  from {
    opacity: 0;
    transform: translateY(1.25rem);
  }
}

/* Welcome: the owners. The photo fills the left half edge to edge and its top, cut out along
   Adam's head, reaches up over the hero; a wine stain straddles the seam to the text. */
:root {
  --welcome-photo-w: 50vw;
  /* The top 10 % of the photo (hair and a soft glow) sticks out above the band */
  --welcome-photo-lift: calc(var(--welcome-photo-w) * 1344 / 1008 * 0.1);
}

#o-nas {
  position: relative;
  z-index: 1;
}

.welcome {
  display: grid;
  grid-template-columns: var(--welcome-photo-w) minmax(0, 1fr);
  max-width: none;
  padding: 0;
}

.welcome__figure {
  position: relative;
  margin: calc(-1 * var(--welcome-photo-lift)) 0 0;
}

/* Fills the band even when the text is taller than the photo */
.welcome__figure > img:first-child {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 0;
}

/* Centred on the section: on the seam between photo and text, halfway down the band. The figure
   starts higher than the band by the photo lift, hence the extra half lift. */
:root {
  --welcome-stain-w: min(18vw, 22rem);
}

.welcome__stain {
  position: absolute;
  top: calc(50% + var(--welcome-photo-lift) / 2);
  right: 0;
  width: var(--welcome-stain-w);
  translate: 50% -50%;
  pointer-events: none;
}

/* Vertically in the middle of the right half. The text starts only past the half of the stain
   that reaches into this column, so the two never overlap. */
.welcome__text {
  align-self: center;
  max-width: 46rem;
  padding: var(--space-xl) var(--gutter) var(--space-xl) calc(var(--welcome-stain-w) / 2 + var(--space-m));
}

.welcome h2 {
  margin-bottom: var(--space-m);
}

.welcome__lead {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 1rem + 1.4vw, 2.25rem);
  line-height: 1.35;
}

.welcome__lead + p {
  max-width: none;
  color: var(--ink-muted);
  font-size: clamp(1.125rem, 0.95rem + 0.5vw, 1.375rem);
}

/* Features: three big circles, as on the Lepší Veltlín site, straddling the edge between the
   news band and the gallery. They open the gallery section and a negative margin of half a
   circle pulls them up; the band above gets that half back as padding so they cover nothing.
   Cream, because ochre circles would melt into the ochre news band. */
:root {
  --feature-size: clamp(16rem, 22vw, 25rem);
}

.features {
  position: relative;
  /* Above #o-nas (z-index 1), which sits right above when there is no news */
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, var(--feature-size));
  justify-content: center;
  gap: var(--space-l);
  margin: calc(-0.5 * var(--feature-size)) 0 0;
  padding: 0 var(--gutter);
  list-style: none;
}

/* Keeps the negative margin on the circles instead of letting it collapse into the band */
.band:has(> .features) {
  display: flow-root;
}

.band:has(+ .band > .features) > .band__inner {
  padding-bottom: calc(0.5 * var(--feature-size) + var(--space-xl));
}

.features + .band__inner {
  padding-top: var(--space-section);
}

.feature {
  position: relative;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: var(--space-xs);
  width: var(--feature-size);
  aspect-ratio: 1;
  padding: var(--space-l);
  border-radius: 50%;
  background: var(--cream);
  color: var(--ink);
  text-align: center;
  box-shadow: 0 1.5rem 3rem rgb(30 10 18 / 0.4);
}

/* The whole circle is the link: the title link stretches over it */
.feature__link {
  color: inherit;
  text-decoration: none;
}

.feature__link::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 50%;
}

.band--wine .feature__link:hover {
  color: inherit;
}

.feature:has(.feature__link) {
  transition: translate 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.feature:has(.feature__link:hover) {
  translate: 0 -0.4rem;
  box-shadow: 0 2rem 3.5rem rgb(30 10 18 / 0.5);
}

.feature:has(.feature__link:focus-visible) {
  outline: 2px solid var(--ochre);
  outline-offset: 4px;
}

.feature__link:focus-visible {
  outline: none;
}

/* Every circle carries its own wine-glass stain */
.feature::after {
  content: '';
  position: absolute;
  inset: 1.5%;
  background: url("../images/otisk-1.af740bc4dabd.webp") center / contain no-repeat;
  pointer-events: none;
}

.feature:nth-child(2)::after {
  background-image: url("../images/otisk-2.61564c80d5a0.webp");
}

.feature:nth-child(3)::after {
  background-image: url("../images/otisk-3.3d90b1664917.webp");
}

.feature svg {
  width: clamp(2.75rem, 3.5vw, 3.5rem);
  height: auto;
}

.feature h3 {
  font-size: clamp(1.4rem, 2vw, 2rem);
}

.feature p {
  max-width: 22ch;
  margin: 0;
  font-size: clamp(var(--step--1), 1.2vw, 1.125rem);
  line-height: 1.45;
}

/* Gallery: a 4-column mosaic, each block of three rows holds one wide and two tall photos */
.gallery__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: clamp(5rem, 10.5vw, 9.5rem);
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gallery__item {
  grid-row: span 3;
}

.gallery__item--wide {
  grid-column: span 2;
}

.gallery__item--full {
  grid-column: 1 / -1;
}

.gallery__more {
  max-width: none;
  margin-top: var(--space-l);
  text-align: center;
}

.gallery__item button {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius);
  background: var(--cellar);
  cursor: zoom-in;
}

.gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Bonovino: the ochre band, like "Vína na doma". The bottle is taller than the band and reaches
   up into the gallery and down into the events band; negative margins keep the band low. */
:root {
  --shop-bottle-h: clamp(22rem, 34vw, 30rem);
}

.shop-band {
  position: relative;
  z-index: 1;
}

.shop {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-m) var(--space-l);
  padding-block: var(--space-l);
}

.shop__bottle {
  width: auto;
  height: var(--shop-bottle-h);
  margin-block: calc(var(--shop-bottle-h) * -0.3);
}

/* The band below starts its content the usual section spacing under the bottle, as the gallery
   does under the circles. The bottle reaches 0.3 × its height minus the band padding below the band. */
.shop-band + .band > .band__inner {
  padding-top: calc(var(--space-section) + var(--shop-bottle-h) * 0.3 - var(--space-l));
}

.shop__title {
  margin-bottom: var(--space-xs);
}

.shop p {
  margin: 0;
}

.shop__logo {
  display: block;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  background: var(--cream);
}

.shop__logo img {
  width: auto;
  height: 2.5rem;
}

/* Private events */
.events {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-xl);
}

.events h2 {
  margin-bottom: var(--space-m);
}

.events__lead {
  font-size: var(--step-1);
  line-height: 1.45;
}

.events__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-s);
  margin-top: var(--space-l);
}

.events__photo {
  width: 100%;
  margin-top: var(--space-l);
}

.events__details h3 {
  margin-bottom: var(--space-s);
}

.events__details h3:not(:first-child) {
  margin-top: var(--space-l);
}

.events__details p {
  color: var(--muted);
}

.rule-list {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--cellar-line);
  list-style: none;
}

.rule-list li {
  padding-block: 0.8rem;
  border-bottom: 1px solid var(--cellar-line);
}

/* News: the hand with a bottle beside the heading and the list */
.news-section {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: var(--space-xl);
}

.news-section__art {
  width: clamp(3.5rem, 7vw, 6.5rem);
  /* Animated from the hand at the bottom (js/news-art.js) */
  transform-origin: 50% 100%;
}

.news__list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-l) var(--space-xl);
}

.news {
  padding-top: var(--space-m);
  border-top: 1px solid rgb(42 21 32 / 0.2);
}

.news time {
  display: block;
  margin-bottom: var(--space-xs);
  color: var(--wine);
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.news__title {
  margin-bottom: var(--space-s);
}

/* At most three lines; longer text ends with an ellipsis. Line breaks typed in the admin are
   joined into one flowing text, otherwise an empty line would use up one of the three. */
.news__text {
  display: -webkit-box;
  max-width: 60ch;
  overflow: hidden;
  color: var(--ink-muted);
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

/* Reviews */
.reviews__list {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: var(--space-l) var(--space-xl);
}

.review {
  margin: 0;
  padding-top: var(--space-m);
  border-top: 1px solid rgb(42 21 32 / 0.2);
}

.review--long {
  grid-row: span 2;
}

.review__stars {
  margin-bottom: var(--space-s);
  color: var(--wine);
  letter-spacing: 0.2em;
}

.review__quote {
  margin: 0;
}

.review__quote p {
  max-width: 60ch;
  font-size: 1.125rem;
  line-height: 1.6;
  quotes: '„' '“';
}

:lang(en) .review__quote p {
  quotes: '“' '”';
}

.review--long .review__quote p {
  font-size: clamp(1.125rem, 1.6vw, 1.3rem);
}

.review__quote p::before {
  content: open-quote;
}

.review__quote p::after {
  content: close-quote;
}

.review__author {
  color: var(--ink-muted);
}

/* Sits at the bottom of the left column, under the opening long review; the padding keeps the two apart */
.reviews__list > .review--long:first-child {
  grid-column: 1;
  grid-row: 1 / span 2;
  padding-bottom: 8rem;
}

.reviews__more {
  grid-column: 1;
  grid-row: 2;
  align-self: end;
  margin: 0;
}

.reviews__more img {
  display: block;
  margin-bottom: var(--space-s);
}

.reviews__more a {
  color: var(--wine);
  font-weight: 600;
}

.reviews__more a::after {
  content: ' →';
}

/* Footer: ochre band */
.site-footer {
  padding: var(--space-xl) var(--gutter) var(--space-l);
}

.site-footer__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-l);
  max-width: calc(var(--max) - 2 * var(--gutter));
  margin-inline: auto;
}

.site-footer p {
  margin-bottom: 0.35rem;
}

.site-footer__logo {
  width: auto;
  height: 4.5rem;
  margin-bottom: var(--space-s);
}

.site-footer__title {
  margin-bottom: var(--space-s);
  font-family: var(--font-body);
  font-size: var(--step-0);
  font-weight: 700;
}

.site-footer address {
  font-style: normal;
}

.social {
  display: flex;
  gap: var(--space-s);
  margin: var(--space-s) 0 0;
  padding: 0;
  list-style: none;
}

.social a {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid rgb(42 21 32 / 0.4);
  border-radius: 50%;
}

.social a:hover {
  border-color: var(--ink);
}

/* Dark strip under the ochre footer, edge to edge */
.site-footer {
  padding-bottom: 0;
}

.site-footer__bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-xs) var(--space-m);
  margin: var(--space-xl) calc(-1 * var(--gutter)) 0;
  padding: var(--space-s) max(var(--gutter), (100% + 2 * var(--gutter) - var(--max)) / 2 + var(--gutter));
  background: var(--night);
  color: var(--paper);
  font-size: var(--step--1);
}

.site-footer .site-footer__bar p {
  margin: 0;
}

.site-footer__credits {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs) var(--space-m);
}

.site-footer__heart {
  display: inline-block;
  color: var(--rose);
  vertical-align: -0.15em;
}

.site-footer__bar a:not(.btn) {
  color: var(--ochre);
  font-weight: 600;
  text-decoration: none;
}

/* The ochre band's wine focus ring would vanish on the dark strip */
.site-footer__bar :focus-visible {
  outline-color: var(--rose);
}

.site-footer__bar a:not(.btn):hover {
  color: var(--ochre-hover);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

@media (max-width: 64rem) {
  .news__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Below this the three circles no longer fit side by side */
@media (max-width: 58rem) {
  :root {
    --feature-size: 18rem;
  }

  .features {
    grid-template-columns: var(--feature-size);
    gap: var(--space-m);
  }
}

@media (max-width: 45rem) {
  :root {
    --welcome-photo-w: 100vw;
  }

  .welcome__stain {
    top: auto;
    right: 4%;
    bottom: -8%;
    width: 36vw;
    translate: none;
  }

  .welcome__text {
    padding: var(--space-xl) var(--gutter) var(--space-section);
  }

  .news-section {
    gap: var(--space-m);
  }

  .welcome,
  .events,
  .news__list,
  .reviews__list,
  .site-footer__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .events {
    gap: var(--space-l);
  }

  .review--long,
  .reviews__list > .review--long:first-child,
  .reviews__more {
    grid-row: auto;
  }

  .reviews__list > .review--long:first-child {
    padding-bottom: 0;
  }

  .gallery__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 22vw;
    grid-auto-flow: dense;
  }

  .gallery__item--wide,
  .gallery__item--full {
    grid-row: span 2;
  }

  /* Stacked: the bottle on top reaches up into the gallery */
  :root {
    --shop-bottle-h: 18rem;
  }

  .shop {
    grid-template-columns: minmax(0, 1fr);
  }

  .shop-band + .band > .band__inner {
    padding-top: var(--space-section);
  }

  .shop__bottle {
    justify-self: center;
    margin-block: calc(var(--shop-bottle-h) * -0.3) 0;
  }

  .shop__logo {
    justify-self: start;
  }
}

/* Pause for the hero video (WCAG 2.2.2), in the corner above the owners' photo */
.hero__pause {
  position: absolute;
  right: var(--gutter);
  bottom: calc(var(--welcome-photo-lift) + var(--space-s));
  z-index: 1;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid rgb(255 255 255 / 0.35);
  border-radius: 50%;
  background: rgb(30 10 18 / 0.45);
  color: var(--paper);
  cursor: pointer;
  transition: background-color 0.2s var(--ease);
}

.hero__pause[hidden] {
  display: none;
}

.hero__pause:hover {
  background: rgb(30 10 18 / 0.7);
}

.hero__pause svg {
  width: 1.1rem;
  height: 1.1rem;
}

.hero__play-icon,
.hero__pause.is-paused .hero__pause-icon {
  display: none;
}

.hero__pause.is-paused .hero__play-icon {
  display: block;
}
