/* ==========================================================================
   Primo — poster page
   Mobile-first: fills the viewport height on small screens, image stretches
   to the bottom edge with the social icons overlaid near the bottom.
   Larger screens: content is centered as a poster card.
   ========================================================================== */

:root {
  --color-bg: #ffffff;
  --color-fg: #111111;
  --color-muted: #4a4a4a;
  --poster-max-width: 30rem; /* ~480px */
  --gap: 1rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100vh; /* fallback for browsers without svh support */
  min-height: 100svh; /* dynamic viewport height, excludes mobile browser UI */
  display: flex;
  flex-direction: column;
  background-color: var(--color-bg);
  color: var(--color-fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.4;
}

img {
  max-width: 100%;
  display: block;
}

/* Visually hide content while keeping it available to assistive tech. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Visible focus outline for keyboard users. */
a:focus-visible {
  outline: 3px solid #1a73e8;
  outline-offset: 2px;
}

/* ---------- Poster layout (mobile-first, full height) ---------- */

.poster {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
}

.poster__header {
  display: flex;
  justify-content: center;
  padding: 1.5rem 1rem 1rem;
}

.poster__logo {
  width: min(85%, 28rem);
  height: auto;
}

.poster__main {
  flex: 1;
  display: flex;
  min-height: 0; /* allow child to shrink and scroll image properly */
}

.poster__figure {
  margin: 0;
  flex: 1;
  position: relative;
  overflow: hidden;
}

.poster__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.poster__footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 30px;
  padding: 0 1rem;
}

.social-list {
  list-style: none;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--gap);
  margin: 0;
  padding: 0;
}

.social-list__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  color: var(--color-fg);
  text-decoration: none;
  border-radius: 50%;
  transition: opacity 0.15s ease-in-out;
}

.social-list__link:hover {
  opacity: 0.65;
}

.social-list__icon {
  display: block;
  width: 2.5rem;
  height: 2.5rem;
  fill: currentColor;
}

.wine-link {
  position: absolute;
  right: 1rem;
  bottom: 34px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  color: var(--color-fg);
  text-decoration: none;
  border-radius: 50%;
  transition: opacity 0.15s ease-in-out;
}

.wine-link:hover {
  opacity: 0.65;
}

.wine-link__icon {
  display: block;
  width: 1.5625rem;
  height: 2.5rem;
  fill: currentColor;
}

/* ---------- Larger screens: centered poster card ---------- */

@media (min-width: 48rem) {
  body {
    justify-content: center;
    align-items: center;
    padding: 2rem 1rem;
  }

  .poster {
    flex: none;
    min-height: 0;
    width: 100%;
    max-width: var(--poster-max-width);
    max-height: calc(100vh - 4rem);
    max-height: calc(100svh - 4rem);
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.12);
    border-radius: 0.5rem;
    overflow: hidden;
  }

  .poster__main {
    flex: 1 1 auto;
    min-height: 0;
  }

  .poster__figure {
    aspect-ratio: 1534 / 1597;
  }
}

/* Respect users who prefer reduced motion. */
@media (prefers-reduced-motion: reduce) {
  .social-list__link,
  .wine-link {
    transition: none;
  }
}
