/* ════════════════════════════════════════════════════════════
   SITE HEADER — Open the Door
   Fixed overlay: brand mark (left) + film ticket selector (right).
   Sits above the showcase, fades in with #main-content.
   ════════════════════════════════════════════════════════════ */


/* ── Outer bar ───────────────────────────────────────────── */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: clamp(1.4rem, 2.8vh, 2.2rem) clamp(2rem, 4.5vw, 4.5rem);
  pointer-events: none; /* Let showcase receive events under the header */
}


/* ════════════════════════════════════════════════════════════
   BRAND MARK — top left
   ════════════════════════════════════════════════════════════ */

.site-header__brand {
  display: flex;
  flex-direction: column;
  gap: 5px;
  pointer-events: auto;
  text-decoration: none;
  cursor: default;
}

.site-header__brand-logo {
  display: block;
  height: clamp(2rem, 3.2vw, 3.2rem);
  width: auto;
  object-fit: contain;
}


/* ════════════════════════════════════════════════════════════
   FILM TICKET — top right
   Classic cinema ticket shape: cream body, dashed divider,
   circular notch punches at the divider's top and bottom edges.
   ════════════════════════════════════════════════════════════ */

.site-header__ticket {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #ede8df;
  color: #000;
  border-radius: 4px;
  min-width: 330px;
  max-width: 390px;
  pointer-events: auto;
  box-shadow: 0 4px 28px rgba(0, 0, 0, 0.45);
  overflow: visible; /* notch circles protrude outside */
  transition: border-radius 0s;
}

/* Flatten bottom corners when dropdown is attached */
.site-header__ticket:has(.site-header__dropdown.is-open) {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

/*
 * Notch circles — punched at top and bottom of the dashed divider.
 * The circle background must match the dark page behind the ticket.
 * Since body is always #000, this produces the "torn ticket" look.
 *
 * Positioning math:
 *   Menu column width = 70px  →  divider is 70px from right edge.
 *   Circle is 18px wide → center it:  right = 70px - 9px = 61px.
 */
.site-header__ticket::before,
.site-header__ticket::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  background: rgba(0, 0, 0, 0.75);
  border-radius: 50%;
  right: 61px;  /* centers the 18px circle on the dashed divider */
  z-index: 2;
}

.site-header__ticket::before { top:    -9px; }
.site-header__ticket::after  { bottom: -9px; }


/* ── Ticket top row ──────────────────────────────────────── */

.site-header__ticket-top {
  display: flex;
  align-items: stretch;
  height: 62px;
}


/* Film selector button (thumbnail + title + chevron) */
.site-header__ticket-selector {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0 1rem;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  text-align: left;
  min-width: 0;
  height: 100%;
  -webkit-tap-highlight-color: transparent;
}

.site-header__ticket-selector:hover .site-header__ticket-title {
  opacity: 0.6;
}


/* Film thumbnail in ticket */
.site-header__ticket-thumb {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 3px;
  background-size: cover;
  background-position: center;
  background-color: #2e2a20;
  overflow: hidden;
  transition: opacity 0.3s ease;
}


/* Film title text */
.site-header__ticket-title {
  flex: 1;
  font-family: 'Bebas Neue', 'Arial Narrow', Impact, sans-serif;
  font-size: clamp(0.88rem, 1.05vw, 1.15rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.12;
  color: #000;
  white-space: normal;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  transition: opacity 0.28s ease;
}


/* Chevron ∨ icon */
.site-header__ticket-chevron {
  flex-shrink: 0;
  width: 10px;
  height: 6px;
  color: #000;
  margin-right: 0.4rem;
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

.site-header__ticket-selector[aria-expanded="true"] .site-header__ticket-chevron {
  transform: rotate(180deg);
}


/* Dashed vertical divider */
.site-header__ticket-divider {
  flex-shrink: 0;
  width: 1px;
  align-self: stretch;
  border-left: 1.5px dashed #000;
  margin: 10px 0;
}


/* Hamburger menu button */
.site-header__ticket-menu {
  flex-shrink: 0;
  width: 70px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: #000;
  -webkit-tap-highlight-color: transparent;
}

.site-header__ticket-menu:hover .site-header__menu-icon span {
  opacity: 0.5;
}

/* Three-line hamburger icon */
.site-header__menu-icon {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.site-header__menu-icon span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: #000;
  border-radius: 1px;
  transition: opacity 0.2s ease;
}


/* ── Ticket meta row (category · year · duration) ────────── */

.site-header__ticket-meta {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  border-top: 1px solid #000;
}

.site-header__ticket-meta span {
  display: block;
  padding: 0.48rem 0.6rem;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 0.54rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #000;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.28s ease;
}

.site-header__ticket-meta span + span {
  border-left: 1px solid #000;
}


/* ════════════════════════════════════════════════════════════
   DROPDOWN — film list panel
   Appears below the ticket when selector is clicked.
   ════════════════════════════════════════════════════════════ */

.site-header__dropdown {
  position: absolute;
  /* Flush against the ticket bottom — notch circles sit at the junction */
  top: 100%;
  left: 0;
  right: 0;
  background: #ede8df;
  /* Only round the bottom corners; top is flush with ticket */
  border-radius: 0 0 4px 4px;
  border-top: 1px solid #000;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.38);
  overflow: hidden;
  z-index: 10;

  /* Hidden state */
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition:
    opacity 0.26s ease,
    transform 0.26s cubic-bezier(0.16, 1, 0.3, 1);
}

.site-header__dropdown.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}


/* Individual film row in dropdown */
.site-header__dropdown-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: 0.95rem 1.1rem;
  background: none;
  border: none;
  /* Dashed separator — matches the cinema ticket aesthetic */
  border-bottom: 1px dashed #000;
  cursor: pointer;
  color: #000;
  text-align: left;
  transition: background 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

.site-header__dropdown-item:last-child {
  border-bottom: none;
}

.site-header__dropdown-item:hover,
.site-header__dropdown-item.is-active {
  background: rgba(0, 0, 0, 0.05);
}

/* Thumbnail in dropdown */
.site-header__dropdown-thumb {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 3px;
  background-size: cover;
  background-position: center;
  background-color: #2e2a20;
}

/* Text block in dropdown */
.site-header__dropdown-info {
  flex: 1;
  min-width: 0;
}

.site-header__dropdown-title {
  display: block;
  font-family: 'Bebas Neue', 'Arial Narrow', Impact, sans-serif;
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #000;
  line-height: 1;
}

/* Meta text hidden — reference design shows title only */
.site-header__dropdown-meta {
  display: none;
}

/* Active indicator dot */
.site-header__dropdown-dot {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #000;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.site-header__dropdown-item.is-active .site-header__dropdown-dot {
  opacity: 1;
}


/* ════════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE
   ════════════════════════════════════════════════════════════ */

@media (max-width: 700px) {

  /* Tighter padding so header stays short enough to clear the card */
  .site-header {
    padding: 0.85rem 1rem;
    align-items: center;
  }

  .site-header__brand-logo {
    height: 1.7rem;
  }

  /* Remove the fixed min-width that causes overflow on narrow screens */
  .site-header__ticket {
    min-width: 0;
    max-width: min(260px, calc(100vw - 5.5rem));
  }

  .site-header__ticket-top {
    height: 52px;
  }

  .site-header__ticket-thumb {
    width: 36px;
    height: 36px;
  }

  .site-header__ticket-title {
    font-size: 0.80rem;
  }

  /* Hide meta row — saves ~28 px so header height clears the card top offset */
  .site-header__ticket-meta {
    display: none;
  }

  /* Flatten bottom corners when dropdown is open (recalculate because meta is gone) */
  .site-header__ticket:has(.site-header__dropdown.is-open) {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }

}
