/* =========================================
   Posztamens — Main Stylesheet
   ========================================= */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,700;1,600&family=DM+Sans:opsz,wght@9..40,300&family=Inter:wght@500&display=swap');

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Colors */
  --color-bg:          #1D2229;
  --color-navbar:      #242B33;
  --color-hero-bar:    rgba(29, 34, 41, 0.7);
  --color-text:        #FFFFFF;
  --color-muted:       rgba(255, 255, 255, 0.4);
  --color-divider:     rgba(255, 255, 255, 0.15);
  --color-accent-1:    #6E7987;
  --color-text-secondary: #C1CBD6;

  /* Fonts */
  --font-display:      'Cormorant Garamond', Georgia, serif;
  --font-body:         'DM Sans', Helvetica, sans-serif;
  --font-ui:           'Inter', Helvetica, sans-serif;

  /* Layout */
  --content-max:       900px;
  --pad-desktop:       190px;
  --pad-tablet:        48px;
  --pad-mobile:        24px;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.4;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

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

a { color: inherit; text-decoration: none; }

/* =========================================
   NAVBAR
   ========================================= */

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-navbar);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

/* Nav links (left) */
.nav-links {
  display: flex;
  align-items: center;
  gap: 16px;
  list-style: none;
}

.nav-links a {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 8px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 18px;
  color: var(--color-text);
  letter-spacing: -0.36px;
  line-height: 1.3;
  white-space: nowrap;
  height: 56px;
}

/* Active underline indicator */
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 8px;
  right: 8px;
  height: 2px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.2s;
}

.nav-links a.active::after,
.nav-links a:hover::after {
  opacity: 1;
}

/* Language switcher (right) */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 18px;
  color: var(--color-text);
  letter-spacing: -0.36px;
  line-height: 1.3;
}

.lang-switcher a {
  position: relative;
  padding: 0 0 4px;
}

.lang-switcher a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 4px;
}

.lang-switcher span {
  opacity: 0.6;
}

/* Mobile hamburger (hidden on desktop) */
.nav-hamburger {
  display: none;
  background: #374151;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  padding: 8px;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
  flex-shrink: 0;
}

.nav-hamburger svg {
  display: block;
}

/* Mobile left group (hamburger + page title) — hidden on desktop */
.navbar-mobile-left {
  display: none;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.nav-page-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 18px;
  color: var(--color-text);
  letter-spacing: -0.36px;
  line-height: 1.3;
  white-space: nowrap;
}

/* Mobile menu overlay */
.mobile-menu {
  display: flex;
  position: fixed;
  inset: 0;
  background: var(--color-navbar);
  z-index: 200;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  /* Hidden state */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.mobile-menu.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.mobile-menu a {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 32px;
  color: var(--color-text);
  letter-spacing: -0.64px;
}

.mobile-menu-close {
  position: absolute;
  top: 16px;
  right: 24px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text);
  font-size: 32px;
  line-height: 1;
}

/* Items: start shifted up + invisible, transition to natural position */
.mobile-menu a,
.mobile-menu .mobile-menu-close {
  opacity: 0;
  transform: translateY(-16px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* When open: fall into place with staggered delays */
.mobile-menu.open .mobile-menu-close      { opacity: 1; transform: translateY(0); transition-delay: 0.05s; }
.mobile-menu.open a:nth-of-type(1)        { opacity: 1; transform: translateY(0); transition-delay: 0.10s; }
.mobile-menu.open a:nth-of-type(2)        { opacity: 1; transform: translateY(0); transition-delay: 0.16s; }
.mobile-menu.open a:nth-of-type(3)        { opacity: 1; transform: translateY(0); transition-delay: 0.22s; }
.mobile-menu.open a:nth-of-type(4)        { opacity: 1; transform: translateY(0); transition-delay: 0.28s; }

/* =========================================
   HERO (Home)
   ========================================= */

.hero {
  position: relative;
  width: 100%;
  height: 560px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-end;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
}

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

.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);
}

/* Title bar */
.hero-title {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px 24px;
}

.hero-title-inner {
  display: flex;
  align-items: baseline;
  gap: 8px;
  max-width: var(--content-max);
  width: 100%;
}

.hero-title h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 120px;
  line-height: 0.9;
  letter-spacing: -2.4px;
  color: var(--color-text);
  white-space: nowrap;
}

.hero-title-divider {
  width: 1px;
  align-self: stretch;
  background: var(--color-text);
  flex-shrink: 0;
}

.hero-subtitle {
  font-family: var(--font-display);
  font-weight: 600;
  font-style: italic;
  font-size: 24px;
  line-height: 0.9;
  letter-spacing: -0.48px;
  color: var(--color-text);
  width: 125px;
}

/* Description bar */
.hero-desc {
  position: relative;
  z-index: 1;
  background: var(--color-hero-bar);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 24px;
  display: flex;
  justify-content: center;
}

.hero-desc-inner {
  width: 100%;
  max-width: var(--content-max);
}

.hero-desc p {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.4;
  letter-spacing: -0.32px;
  color: var(--color-text);
}

.hero-desc p + p {
  margin-top: 1em;
}

/* =========================================
   HERO — inner page variant (no subtitle)
   ========================================= */

.hero--inner .hero-subtitle,
.hero--inner .hero-title-divider {
  display: none;
}

.hero--inner .hero-title h1 {
  font-size: 80px;
  white-space: normal;
}

@media (min-width: 1040px) {
  .hero--inner .hero-title h1 {
    font-size: 120px;
  }
}

@media (max-width: 799px) {
  .hero--inner .hero-title h1 {
    font-size: 64px;
  }
}

/* =========================================
   CONTENT WRAPPER
   ========================================= */

.content {
  padding-left: var(--pad-desktop);
  padding-right: var(--pad-desktop);
}

/* On very wide screens, cap the padded content block so the 900px
   column stays centered rather than drifting left */
@media (min-width: 1280px) {
  .content {
    max-width: calc(var(--content-max) + 2 * var(--pad-desktop));
    margin-left: auto;
    margin-right: auto;
  }
}

/* =========================================
   FOOTER
   ========================================= */

.footer {
  position: relative;
  background: #1D2229;
  overflow: hidden;
  padding: 40px 40px 20px;
  height: 503px;
}

/* Background image with luminosity blend */
.footer-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.footer-bg img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  mix-blend-mode: luminosity;
  opacity: 0.3;
  object-fit: cover;
}

.footer-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, #1D2229 0%, rgba(29, 34, 41, 0) 40%);
}

.footer-content {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 40px;
  height: 100%;
  justify-content: flex-end;
}

.footer-sections {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Top row: logo + contact */
.footer-contact {
  display: flex;
  align-items: center;
  gap: 16px;
  white-space: nowrap;
}

.footer-logo {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 64px;
  line-height: 1;
  letter-spacing: -1.28px;
  color: var(--color-text);
}

.footer-contact-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 2px;
}

.footer-contact-list a,
.footer-contact-list p {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 18px;
  line-height: 1.3;
  letter-spacing: -0.36px;
  color: var(--color-text);
}

.footer-contact-list a {
  text-decoration: underline;
}

/* Divider */
.footer-divider {
  width: 100%;
  height: 2px;
  border-top: 1px solid var(--color-accent-1);
}

/* Address row (right-aligned) */
.footer-address {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
}

.footer-address p {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 18px;
  line-height: 1.3;
  letter-spacing: -0.36px;
  color: var(--color-text);
  text-align: right;
}

/* Bottom row: copyright + impresszum + credit */
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 24px;
}

.footer-copy,
.footer-impresszum,
.footer-credit {
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 12px;
  line-height: 20px;
  color: var(--color-accent-1);
  text-align: center;
  white-space: nowrap;
}

.footer-impresszum {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s;
}

.footer-impresszum svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  flex-shrink: 0;
}

.footer-impresszum:hover {
  color: var(--color-text-secondary);
}

/* =========================================
   SECTION INNER — max-width constraint
   ========================================= */

/* Keeps content within the 900px column between 800–1279px where .content
   only applies padding (no max-width), preventing overflow at wide tablets. */
.section-inner {
  max-width: var(--content-max);
  margin-left: auto;
  margin-right: auto;
}

/* =========================================
   COUNTER SECTION
   ========================================= */

.counter-section {
  padding-top: 24px;
}

.counter-grid {
  display: flex;
  align-items: center;
}

.counter-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.counter-metric {
  display: flex;
  align-items: flex-end;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--color-text);
  line-height: 0.9;
}

.counter-value {
  font-size: 58px;
  letter-spacing: -1.16px;
}

.counter-unit {
  font-size: 24px;
  letter-spacing: -0.48px;
  padding-bottom: 3px;
}

.counter-label {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 12px;
  letter-spacing: -0.24px;
  color: #C1CBD6;
  text-align: center;
}

.counter-divider {
  width: 1px;
  background: var(--color-accent-1);
  flex-shrink: 0;
  align-self: stretch;
}

/* =========================================
   VIDEO SECTION
   ========================================= */

.video-section {
  padding-top: 40px;
}

.video-image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  margin-bottom: 16px;
}

.video-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.video-play-btn {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  height: 40px;
  background: #D1D5DB;
  color: #1F2937;
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 14px;
  line-height: 24px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

.video-play-btn svg { width: 16px; height: 16px; }

.section-text {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.4;
  letter-spacing: -0.32px;
  color: var(--color-text);
}

.section-text + .section-text { margin-top: 1em; }

/* Extra paragraph shown only on tablet/mobile in the video section */
.video-contact-text { display: none; }

/* =========================================
   IMAGE SECTIONS (References + Contact)
   ========================================= */

.image-section {
  padding-top: 40px;
}

.image-section-img {
  width: 100%;
  aspect-ratio: 900 / 340;
  object-fit: cover;
  display: block;
  margin-bottom: 24px;
}

.section-cta {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
  flex-wrap: wrap;
}

/* =========================================
   VIDEO MODAL
   ========================================= */

.video-modal {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.92);
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.video-modal.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.video-modal-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text);
  font-size: 32px;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.video-modal-close:hover { opacity: 1; }

.video-modal-inner {
  position: relative;
  width: 90vw;
  max-width: 1280px;
}

.video-modal-inner iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  border: none;
  outline: none;
}

/* =========================================
   BUTTONS
   ========================================= */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  height: 40px;
  background: #374151;
  color: var(--color-text);
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 14px;
  line-height: 24px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  stroke: currentColor;
}

/* Underlined label variant — used where the button text is a literal
   contact detail (e.g. an email address) rather than a CTA phrase */
.btn--underline {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* =========================================
   GALLERY SECTION (homepage)
   ========================================= */

.gallery-section {
  padding-top: 40px;
  padding-bottom: 40px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 16px;
}

.gallery-slot {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--color-navbar);
}

.gallery-slot img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.6s ease;
}

.gallery-slot img.active { opacity: 1; }
.gallery-slot img.next   { opacity: 0; }

.gallery-caption {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.4;
  letter-spacing: -0.32px;
  color: var(--color-text);
  margin-bottom: 24px;
}

.gallery-cta {
  display: flex;
  justify-content: center;
}

/* =========================================
   RESPONSIVE
   ========================================= */

/* Tablet: 800px–1279px */
@media (max-width: 1279px) {
  .navbar { height: 48px; }

  .nav-links a { height: 48px; }

  .page-hero {
    padding-left: var(--pad-tablet);
    padding-right: var(--pad-tablet);
  }

  .content {
    padding-left: var(--pad-tablet);
    padding-right: var(--pad-tablet);
  }

  .hero { height: 560px; }

  .hero-title h1 { font-size: 80px; }

  /* Show extra video copy on tablet */
  .video-contact-text { display: block; }

  /* Less extreme crop for reference/contact images on tablet */
  .image-section-img { aspect-ratio: 7 / 3; }

  .hero-title {
    padding-left: 48px;
    padding-right: 48px;
  }

  .hero-desc {
    padding-left: 48px;
    padding-right: 48px;
  }

  .footer {
    padding: 40px 48px 20px;
  }
}

/* Mobile: <800px */
@media (max-width: 799px) {
  /* Swap desktop nav for mobile hamburger+title */
  nav { display: none; }
  .navbar-mobile-left { display: flex; }
  .nav-hamburger { display: flex; }

  .navbar {
    height: 48px;
    padding: 0 16px;
  }

  .hero { height: 620px; }

  .hero-title h1 {
    font-size: 64px;
    letter-spacing: -1.28px;
    white-space: nowrap;
  }

  /* Home hero: stack title / divider / subtitle instead of the desktop
     inline row (divider becomes a horizontal rule under the title) */
  .hero-title-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .hero-title-divider {
    width: 100%;
    height: 1px;
    align-self: auto;
  }

  .page-hero {
    padding-left: var(--pad-mobile);
    padding-right: var(--pad-mobile);
    padding-top: 40px;
  }

  .page-hero h1 { font-size: 40px; }

  .content {
    padding-left: var(--pad-mobile);
    padding-right: var(--pad-mobile);
  }

  .hero-title {
    padding-left: var(--pad-mobile);
    padding-right: var(--pad-mobile);
  }

  .hero-desc {
    padding-left: var(--pad-mobile);
    padding-right: var(--pad-mobile);
  }

  .footer {
    padding: 24px 24px 20px;
  }

  .footer-contact {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .footer-logo { font-size: 40px; }

  /* Counter: collapse to 2×2 grid */
  .counter-grid {
    display: grid;
    grid-template-columns: 1fr 1px 1fr;
    row-gap: 16px;
  }
  .counter-grid > :nth-child(1) { grid-column: 1; grid-row: 1; }
  .counter-grid > :nth-child(2) { grid-column: 2; grid-row: 1 / span 2; }
  .counter-grid > :nth-child(3) { grid-column: 3; grid-row: 1; }
  .counter-grid > :nth-child(4) { display: none; }
  .counter-grid > :nth-child(5) { grid-column: 1; grid-row: 2; }
  .counter-grid > :nth-child(6) { display: none; }
  .counter-grid > :nth-child(7) { grid-column: 3; grid-row: 2; }

  /* Smaller body text on mobile */
  .section-text { font-size: 14px; }

  /* References/contact image: squarer crop on mobile */
  .image-section-img { aspect-ratio: 5 / 4; }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}


/* ── References Page ─────────────────────────────────────────────────────── */

.ref-section--movies {
  padding-top: 40px;
  padding-bottom: 40px;
}
.ref-section--commercials {
  padding-top: 40px;
  padding-bottom: 120px;
}

/* Intro split panel */
.ref-intro {
  display: flex;
  gap: 24px;
  align-items: stretch;
  height: 340px;
}

.ref-intro-image {
  flex: 0 0 calc(50% - 12px);
  overflow: hidden;
  background: var(--color-navbar);
}
.ref-intro-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ref-intro-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-left: 1px solid var(--color-accent-1);
  padding-left: 24px;
  padding-top: 16px;
}

.ref-intro-copy {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ref-intro-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 40px;
  letter-spacing: -0.8px;
  line-height: 1.2;
}

/* List: 3 rows with title + year, bordered */
.ref-intro-list {
  width: 100%;
  border-bottom: 1px solid var(--color-accent-1);
}
.ref-intro-list-row {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 38px;
  padding: 0 8px;
  border-top: 1px solid var(--color-accent-1);
  cursor: pointer;
  transition: background 0.15s;
}
.ref-intro-list-row:hover,
.ref-intro-list-row:focus-visible {
  background: rgba(255, 255, 255, 0.05);
}

.ref-intro-list-labels {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 0 0;
  min-width: 0;
}

.ref-intro-list-title {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 300;
  letter-spacing: -0.32px;
  color: var(--color-text);
}
.ref-intro-list-year {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 300;
  letter-spacing: -0.32px;
  color: var(--color-accent-1);
}

.ref-intro-list-arrow {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: var(--color-text);
  opacity: 0;
  transition: opacity 0.15s;
}
.ref-intro-list-row:hover .ref-intro-list-arrow,
.ref-intro-list-row:focus-visible .ref-intro-list-arrow {
  opacity: 1;
}

/* Briefly highlights a commercial's grid card after "scroll to item" */
.ref-card--highlight .ref-card-thumb {
  outline: 2px solid var(--color-text);
  outline-offset: 4px;
  transition: outline-color 1.2s ease;
}
.ref-card--highlight.ref-card--highlight-fade .ref-card-thumb {
  outline-color: transparent;
}

.ref-expand-btn {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 8px;
  padding: 8px 16px;
  height: 40px;
  background: #374151;
  color: var(--color-text);
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 14px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}
.ref-expand-btn:hover { background: #4B5563; }

/* Grid container — animated expand */
.ref-grid-wrap {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.5s ease;
}
.ref-grid-wrap.open { /* max-height set by JS to scrollHeight */ }

.ref-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  padding-top: 40px;
  padding-bottom: 8px;
}

.ref-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ref-card-thumb {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--color-navbar);
}
.ref-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.ref-card--movie { cursor: pointer; }
.ref-card--movie:hover .ref-card-thumb img { transform: scale(1.05); }

.ref-card-title {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 300;
  line-height: 1.35;
}

.ref-card-year {
  font-size: 11px;
  color: var(--color-accent-1);
  font-family: var(--font-ui);
}


/* ── Movie Lightbox ──────────────────────────────────────────────────────── */

.movie-lightbox {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s, visibility 0.3s;
}
.movie-lightbox.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.movie-lightbox-inner {
  width: 90vw;
  max-width: 800px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

.movie-lightbox-close {
  position: absolute;
  top: -44px;
  right: 0;
  background: none;
  border: none;
  color: var(--color-text);
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  padding: 6px;
  opacity: 0.7;
  transition: opacity 0.2s;
  z-index: 1;
}
.movie-lightbox-close:hover { opacity: 1; }

/* Scrollable stack of images (hero + on-set photos). Only this area scrolls —
   the toolbar below stays fixed in view regardless of how many photos there are. */
.movie-lightbox-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* No forced aspect ratio here — posters are typically portrait (2:3-ish)
   and on-set photos vary, so each image is shown in full at its own native
   ratio instead of being cropped to fit a fixed box. */
.movie-lightbox-image {
  flex: none;
  background: var(--color-navbar);
}
.movie-lightbox-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* Fixed toolbar — title, IMDb link, pagination. Stays put while the images scroll. */
.movie-lightbox-toolbar {
  flex: none;
  background: var(--color-navbar);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.movie-lightbox-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.movie-lightbox-info { display: flex; flex-direction: column; gap: 4px; }

.movie-lightbox-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: -0.5px;
  line-height: 1.15;
}

.movie-lightbox-year {
  font-size: 13px;
  color: var(--color-accent-1);
  font-family: var(--font-ui);
}

.movie-lightbox-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.movie-lightbox-imdb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  height: 36px;
  background: #F5C518;
  color: #000;
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 13px;
  border-radius: 4px;
  text-decoration: none;
  white-space: nowrap;
}

.movie-lightbox-nfi {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  height: 36px;
  background: #FFA900;
  color: #000;
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 13px;
  border-radius: 4px;
  text-decoration: none;
  white-space: nowrap;
}

.movie-lightbox-nav { display: flex; gap: 8px; }

.movie-lightbox-prev,
.movie-lightbox-next {
  background: #374151;
  border: none;
  color: var(--color-text);
  width: 36px;
  height: 36px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.movie-lightbox-prev:hover,
.movie-lightbox-next:hover { background: #4B5563; }

.movie-lightbox-counter {
  font-size: 11px;
  color: var(--color-accent-1);
  font-family: var(--font-ui);
  text-align: right;
}

/* ── References — Tablet (800–1279px) ───────────────────────────────────── */
@media (max-width: 1279px) {
  .ref-intro {
    flex-direction: column;
    height: auto;
  }

  /* Movies: image first on tablet/mobile (desktop is info-left/image-right via DOM order) */
  .ref-section--movies .ref-intro {
    flex-direction: column-reverse;
  }

  .ref-intro-image {
    flex: none;
    width: 100%;
    height: 340px;
  }

  .ref-intro-info {
    padding-top: 0;
    gap: 24px;
  }

  .ref-intro-title { font-size: 32px; }

  .ref-section--commercials { padding-bottom: 80px; }

  .ref-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .movie-lightbox-title { font-size: 22px; }
}

/* ── References — Mobile (<800px) ───────────────────────────────────────── */
@media (max-width: 799px) {
  .ref-section--movies { padding-top: 24px; padding-bottom: 24px; }
  .ref-section--commercials { padding-top: 24px; padding-bottom: 64px; }

  .ref-intro-info {
    border-left: none;
    padding-left: 0;
  }

  .ref-intro-image { height: 262px; }

  .ref-intro-title { font-size: 28px; }

  .ref-intro-list-title,
  .ref-intro-list-year { font-size: 14px; }

  /* No hover on touch devices — keep the arrow visible at all times */
  .ref-intro-list-arrow { opacity: 1; }

  .ref-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .movie-lightbox-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .movie-lightbox-title { font-size: 20px; }
}


/* ── About Page (Rólunk) ─────────────────────────────────────────────────── */

.about-section {
  padding-top: 40px;
  padding-bottom: 40px;
}
.about-section:last-of-type { padding-bottom: 120px; }

/* Split panel — copy + image side by side (Sections 1 & 2) */
.about-split {
  display: flex;
  gap: 24px;
  align-items: stretch;
  height: 340px;
}

.about-split-image {
  flex: 0 0 calc(50% - 12px);
  overflow: hidden;
  background: var(--color-navbar);
}
.about-split-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.about-split-copy {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-left: 1px solid var(--color-accent-1);
  padding-left: 24px;
}

/* Feature panel — full-width image with title + copy below (Sections 3 & 4) */
.about-feature-image {
  width: 100%;
  height: 340px;
  overflow: hidden;
  margin-bottom: 24px;
  background: var(--color-navbar);
}
.about-feature-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.about-feature-copy {
  border-left: 1px solid var(--color-accent-1);
  padding-left: 24px;
}

.about-feature-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 40px;
  letter-spacing: -0.8px;
  line-height: 1.2;
  margin-bottom: 16px;
}

/* ── About — Tablet (800–1279px) ────────────────────────────────────────── */
@media (max-width: 1279px) {
  .about-split {
    flex-direction: column;
    height: auto;
  }

  /* Section 1: copy comes first in the DOM, but image should show first */
  .about-split--reverse {
    flex-direction: column-reverse;
  }

  .about-split-image {
    flex: none;
    width: 100%;
    height: 340px;
  }

  .about-split-copy {
    padding-top: 0;
  }

  .about-feature-title { font-size: 32px; }
}

/* ── About — Mobile (<800px) ────────────────────────────────────────────── */
@media (max-width: 799px) {
  .about-section { padding-top: 24px; padding-bottom: 24px; }
  .about-section:last-of-type { padding-bottom: 64px; }

  .about-split-copy,
  .about-feature-copy {
    border-left: none;
    padding-left: 0;
  }

  .about-split-image { height: 262px; }
  .about-feature-image { height: 262px; }

  .about-feature-title { font-size: 28px; }
}


/* ── Gallery Page ─────────────────────────────────────────────────────────
   Each gallery is an independent block: title, a fixed 4-image cover grid,
   and a button that opens the gallery lightbox (scrollable photo stack with
   a toolbar fixed to the bottom — same interaction pattern as the movie
   lightbox on the References page, but with no cross-gallery navigation). */

.gallery-block {
  padding-top: 40px;
  padding-bottom: 40px;
}

.gallery-block-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

.gallery-block-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 36px;
  letter-spacing: -0.72px;
  line-height: 1.2;
  color: var(--color-text);
}

.gallery-block-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  width: 100%;
}

.gallery-block-thumb {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--color-navbar);
}
.gallery-block-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-open-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  height: 40px;
  background: #374151;
  color: var(--color-text);
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 14px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}
.gallery-open-btn:hover { background: #4B5563; }

/* ── Gallery Lightbox ─────────────────────────────────────────────────────
   Independent galleries only — no prev/next between galleries. Structurally
   the same as .movie-lightbox: scrollable image stack on top, toolbar fixed
   to the bottom of the lightbox. */

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s, visibility 0.3s;
}
.gallery-lightbox.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.gallery-lightbox-inner {
  width: 90vw;
  max-width: 800px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

.gallery-lightbox-close {
  position: absolute;
  top: -44px;
  right: 0;
  background: none;
  border: none;
  color: var(--color-text);
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  padding: 6px;
  opacity: 0.7;
  transition: opacity 0.2s;
  z-index: 1;
}
.gallery-lightbox-close:hover { opacity: 1; }

.gallery-lightbox-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.gallery-lightbox-image {
  flex: none;
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--color-navbar);
}
.gallery-lightbox-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Per-photo caption — empty by default (see manifest `titleKey`s), only
   rendered when the client has actually filled one in. */
.gallery-lightbox-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 16px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.65), transparent);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 13px;
}

.gallery-lightbox-toolbar {
  flex: none;
  background: var(--color-navbar);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.gallery-lightbox-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 22px;
  color: var(--color-text);
}

.gallery-lightbox-counter {
  font-size: 11px;
  color: var(--color-accent-1);
  font-family: var(--font-ui);
  white-space: nowrap;
}


/* ── Gallery — Tablet (800–1279px) ───────────────────────────────────────── */
@media (max-width: 1279px) {
  .gallery-block-grid { gap: 16px; }

  .gallery-block-title { font-size: 32px; }
}

/* ── Gallery — Mobile (<800px) ───────────────────────────────────────────── */
@media (max-width: 799px) {
  .gallery-block { padding-top: 24px; padding-bottom: 24px; }

  .gallery-block-title { font-size: 28px; }

  .gallery-block-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .gallery-lightbox-title { font-size: 18px; }
}
