/* public/_chicane/chrome.css — modern Chicane chrome.
 * Loads after overlay.css. Self-contained — does not depend on Divi class names.
 *
 * Sections (in order): tokens · navbar · drawer · footer · reduced-motion.
 */

:root {
  /* Light cream chrome — matches the live site's actual palette
   * (#F4F4F4 cream, #212121 near-black text, #C9821E warm gold accent).
   * This lets the LOGO1.png (white-bg line art) read in the footer and
   * lets the colourful signature mark pop in the navbar. */
  --chrome-bg:        #F4F4F4;
  --chrome-floor:     #FFFFFF;          /* footer — pure white so the LOGO1.png white-bg line-art reads */
  --chrome-fg:        #212121;          /* near-black text */
  --chrome-fg-dim:    rgba(33, 33, 33, 0.62);
  --chrome-fg-mute:   rgba(33, 33, 33, 0.50);
  --chrome-rule:      rgba(33, 33, 33, 0.10);
  --chrome-accent:    #C9821E;          /* warm gold */
  --chrome-display-ff: 'Aqua Grotesque', Helvetica, Arial, sans-serif;
  --chrome-body-ff:    'Roboto Slab Thin', Helvetica, Arial, sans-serif;
  --chrome-ease:      cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* Reset only what we need — never use universal selectors that fight Divi. */
.chrome-nav,
.chrome-nav *,
.chrome-drawer,
.chrome-drawer *,
.chrome-footer,
.chrome-footer * {
  box-sizing: border-box;
}

.chrome-nav ul,
.chrome-drawer ul,
.chrome-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.chrome-nav a,
.chrome-drawer a,
.chrome-footer a {
  color: inherit;
  text-decoration: none;
}

#chrome-sentinel {
  /* 24px-tall sentinel above the navbar; data-scrolled flips when it leaves
   * the viewport (i.e. after ~24px of scroll). No rootMargin needed. */
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 24px;
  pointer-events: none;
}

/* ─── Navbar (desktop ≥980px) ─────────────────────────────────────────── */
.chrome-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--chrome-bg);
  border-bottom: 1px solid transparent;
  transition: background 280ms ease, border-color 280ms ease, height 280ms ease;
  height: 112px;
  display: flex;
  align-items: center;
}

/* Scrolled state: SOLID background on purpose. The earlier translucent
 * rgba + backdrop-filter combo hits a Chromium compositing bug on sticky
 * elements — the background layer intermittently fails to paint during
 * scroll, leaving page text visible behind the nav links. A solid paint
 * has no such failure mode; a soft shadow keeps the lifted feel. */
.chrome-nav[data-scrolled="true"] {
  background: var(--chrome-bg);
  border-bottom-color: var(--chrome-rule);
  box-shadow: 0 1px 14px rgba(33, 33, 33, 0.07);
  height: 80px;
}

.chrome-nav__inner {
  width: 100%;
  max-width: 1440px;
  margin-inline: auto;
  padding-inline: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
}

.chrome-nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  text-decoration: none;
}
.chrome-nav__mark {
  display: block;
  max-height: 64px;
  width: auto;
  transition: max-height 280ms ease;
}
.chrome-nav[data-scrolled="true"] .chrome-nav__mark {
  max-height: 48px;
}

.chrome-nav__wordmark {
  display: inline-flex;
  flex-direction: column;
  font-family: var(--chrome-display-ff);
  color: var(--chrome-fg);
  line-height: 1.05;
  letter-spacing: 0.02em;
  /* Hairline divider between the mark and the wordmark. */
  padding-left: 18px;
  border-left: 1px solid var(--chrome-rule);
  transition: opacity 200ms ease, transform 200ms ease;
}
.chrome-nav__wordmark-line {
  display: block;
  font-size: 17px;
  white-space: nowrap;
}
.chrome-nav__wordmark-line:nth-child(2) {
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--chrome-fg-dim);
  margin-top: 4px;
}
.chrome-nav[data-scrolled="true"] .chrome-nav__wordmark-line {
  font-size: 15px;
}
.chrome-nav[data-scrolled="true"] .chrome-nav__wordmark-line:nth-child(2) {
  font-size: 11px;
}

.chrome-nav__list {
  display: flex;
  align-items: center;
  gap: 40px;
}

.chrome-nav__link {
  display: inline-block;
  position: relative;
  font-family: var(--chrome-display-ff);
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--chrome-fg);
  padding: 6px 0;
  transition: color 200ms ease;
}

.chrome-nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 1px;
  width: 100%;
  background: var(--chrome-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 200ms var(--chrome-ease);
}

.chrome-nav__link[data-active="true"]::after {
  transform: scaleX(1);
}

.chrome-nav__link:hover {
  color: var(--chrome-accent);
}
.chrome-nav__link:hover::after {
  transform: scaleX(1);
}

.chrome-nav__link:focus-visible {
  outline: 2px solid var(--chrome-accent);
  outline-offset: 3px;
  border-radius: 1px;
}

.chrome-nav__hamburger {
  display: none;
}

/* ─── Mobile navbar + drawer (<980px) ─────────────────────────────────── */
@media (max-width: 979.98px) {
  .chrome-nav {
    height: 64px;
  }
  .chrome-nav[data-scrolled="true"] {
    background: var(--chrome-bg);
    border-bottom-color: transparent;
    box-shadow: 0 1px 10px rgba(33, 33, 33, 0.07);
    height: 64px;
  }
  .chrome-nav__mark {
    max-height: 36px;
    filter: brightness(1.18) drop-shadow(0 0 8px rgba(201, 130, 30, 0.18));
  }
  .chrome-nav__wordmark {
    /* Hide wordmark on mobile — the mark alone is enough next to a hamburger. */
    display: none;
  }

  .chrome-nav__list { display: none; }

  .chrome-nav__hamburger {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    padding: 8px;
    background: transparent;
    border: 0;
    cursor: pointer;
  }

  .chrome-nav__hamburger-bar {
    display: block;
    height: 1px;
    width: 100%;
    background: var(--chrome-fg);
    transform-origin: center;
    transition: transform 240ms var(--chrome-ease), opacity 200ms ease;
  }

  .chrome-nav__hamburger[aria-expanded="true"] .chrome-nav__hamburger-bar:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }
  .chrome-nav__hamburger[aria-expanded="true"] .chrome-nav__hamburger-bar:nth-child(2) {
    opacity: 0;
  }
  .chrome-nav__hamburger[aria-expanded="true"] .chrome-nav__hamburger-bar:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }

  .chrome-nav__hamburger:focus-visible {
    outline: 2px solid var(--chrome-accent);
    outline-offset: 2px;
    border-radius: 2px;
  }
}

/* Drawer (only ever visible <980px). */
.chrome-drawer {
  position: fixed;
  inset: 0;
  z-index: 99;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  transition: opacity 240ms var(--chrome-ease), visibility 0s linear 240ms;
}

.chrome-drawer[aria-hidden="false"] {
  pointer-events: auto;
  visibility: visible;
  opacity: 1;
  transition: opacity 240ms var(--chrome-ease), visibility 0s linear 0s;
}

.chrome-drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}

.chrome-drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(100%, 360px);
  background: var(--chrome-bg);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  padding: 96px 32px 48px;
  transform: translateX(100%);
  transition: transform 240ms var(--chrome-ease);
}

.chrome-drawer[aria-hidden="false"] .chrome-drawer__panel {
  transform: translateX(0);
}

.chrome-drawer__list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.chrome-drawer__link {
  display: inline-block;
  position: relative;
  font-family: var(--chrome-display-ff);
  font-size: 24px;
  letter-spacing: 0.04em;
  color: var(--chrome-fg);
  padding: 4px 0;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 240ms var(--chrome-ease), transform 240ms var(--chrome-ease), color 200ms ease;
}

.chrome-drawer[aria-hidden="false"] .chrome-drawer__link {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger drawer items 40ms apart on open. */
.chrome-drawer[aria-hidden="false"] .chrome-drawer__item:nth-child(1) .chrome-drawer__link { transition-delay: 0ms; }
.chrome-drawer[aria-hidden="false"] .chrome-drawer__item:nth-child(2) .chrome-drawer__link { transition-delay: 80ms; }
.chrome-drawer[aria-hidden="false"] .chrome-drawer__item:nth-child(3) .chrome-drawer__link { transition-delay: 120ms; }
.chrome-drawer[aria-hidden="false"] .chrome-drawer__item:nth-child(4) .chrome-drawer__link { transition-delay: 160ms; }
.chrome-drawer[aria-hidden="false"] .chrome-drawer__item:nth-child(5) .chrome-drawer__link { transition-delay: 200ms; }

.chrome-drawer__link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 1px;
  width: 100%;
  background: var(--chrome-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 200ms var(--chrome-ease);
}
.chrome-drawer__link[data-active="true"]::after { transform: scaleX(1); }
.chrome-drawer__link:hover { color: var(--chrome-accent); }
.chrome-drawer__link:hover::after { transform: scaleX(1); }
.chrome-drawer__link:focus-visible {
  outline: 2px solid var(--chrome-accent);
  outline-offset: 3px;
  border-radius: 1px;
}

/* ─── Footer ──────────────────────────────────────────────────────────── */
/* Footer overrides the cream tokens with a dark theater photo background
 * — same as the original Divi site. The LOGO1.png line-art was designed
 * for this dark backdrop, and the cinema seats motif anchors the page in
 * the filmmaker identity. */
.chrome-footer {
  position: relative;
  isolation: isolate;
  background-color: #0F0606;
  background-image:
    linear-gradient(rgba(8, 4, 4, 0.55), rgba(8, 4, 4, 0.55)),
    url('/wp-content/uploads/2024/02/theater_alessio.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: #F4F4F4;
  padding: 96px 0 32px;
  font-family: var(--chrome-body-ff);
  /* Soft hairline at the top so the cinema photo doesn't crash into the
   * page-body cream above it. */
  box-shadow: inset 0 1px 0 rgba(244, 244, 244, 0.08);
}

.chrome-footer__inner {
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: 32px;
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: 64px;
  align-items: center;
}

.chrome-footer__col--logo .chrome-footer__logo {
  display: block;
  width: 100%;
  max-width: 300px;
  height: auto;
}

.chrome-footer__eyebrow {
  font-family: var(--chrome-body-ff);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(244, 244, 244, 0.62);
  margin: 0 0 12px;
}

.chrome-footer__value {
  position: relative;
  display: inline-block;
  font-family: var(--chrome-display-ff);
  font-size: 22px;
  color: #F4F4F4;
  padding: 2px 0;
  transition: color 200ms ease;
}

.chrome-footer__value::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 1px;
  width: 100%;
  background: var(--chrome-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 200ms var(--chrome-ease);
}

.chrome-footer__value:hover {
  color: var(--chrome-accent);
}
.chrome-footer__value:hover::after {
  transform: scaleX(1);
}
.chrome-footer__value:focus-visible {
  outline: 2px solid var(--chrome-accent);
  outline-offset: 3px;
  border-radius: 1px;
}

.chrome-footer__bottom {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid rgba(244, 244, 244, 0.10);
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: 32px;
}

.chrome-footer__copyright {
  margin: 0;
  font-family: var(--chrome-body-ff);
  font-size: 12px;
  color: rgba(244, 244, 244, 0.55);
  text-align: center;
}
.chrome-footer__copyright a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Mobile footer */
@media (max-width: 979.98px) {
  .chrome-footer {
    padding: 56px 0 24px;
  }
  .chrome-footer__inner {
    grid-template-columns: 1fr;
    gap: 32px;
    padding-inline: 24px;
  }
  .chrome-footer__col--logo {
    text-align: center;
  }
  .chrome-footer__col--logo .chrome-footer__logo {
    margin-inline: auto;
    max-width: 200px;
  }
  .chrome-footer__bottom {
    margin-top: 32px;
    padding-inline: 24px;
  }
}

/* ─── Reduced motion ──────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .chrome-nav,
  .chrome-nav__mark,
  .chrome-nav__wordmark,
  .chrome-nav__link,
  .chrome-nav__link::after,
  .chrome-nav__hamburger-bar,
  .chrome-drawer,
  .chrome-drawer__panel,
  .chrome-drawer__link,
  .chrome-drawer__link::after,
  .chrome-footer__value,
  .chrome-footer__value::after {
    transition-duration: 0.01ms !important;
  }
}
