/* ───────────────────────────────────────────────
   Songs mode — audio-synced story beats.
   Loaded with story.css/story.js on single-work posts
   where _eh_story_mode = 'songs'. Each song is one
   scroll-snap stage; its beats are stacked layers that
   crossfade as the track plays.
   ─────────────────────────────────────────────── */

/* Screenplay / typewriter type for the whole Songs page. */
body.eh-songs { --screenplay: 'Courier Prime', 'Courier New', 'Courier', monospace; }

/* The song stage is a positioning context, not a flex row. */
.song-screen { display: block; }

/* Stacked beat layers fill the stage; only the active one shows. */
.song-beats { position: absolute; inset: 0; z-index: 0; }

.song-beat {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: flex;                 /* the block visuals (overlay/split/text) expect a flex box */
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.7s ease;
}
.song-beat.is-active {
    opacity: 1;
    pointer-events: auto;
    z-index: 1;
}

/* Active-beat motion: copy rises in, imagery drifts (slow Ken Burns). */
.song-beat.is-active .story-overlay-text,
.song-beat.is-active .story-split-text,
.song-beat.is-active .story-text-inner {
    animation: eh-beat-rise 0.85s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.song-beat.is-active .story-bg img,
.song-beat.is-active .story-split-media img {
    animation: eh-beat-zoom 9s ease-out both;
}
@keyframes eh-beat-rise {
    from { opacity: 0; transform: translateY(22px); }
    to   { opacity: 1; transform: none; }
}
@keyframes eh-beat-zoom {
    from { transform: scale(1.07); }
    to   { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
    .song-beat.is-active .story-overlay-text,
    .song-beat.is-active .story-split-text,
    .song-beat.is-active .story-text-inner,
    .song-beat.is-active .story-bg img,
    .song-beat.is-active .story-split-media img { animation: none; }
}

/* When a song has no beats yet, keep the stage from being pure black. */
.song-screen.is-empty { background: var(--dark); }

/* Keep beat copy clear of the floating transport bar. Split media stays
   full-bleed (its image sits behind the bar); only its text column is inset. */
.song-beat.story-overlay,
.song-beat.story-text { padding-bottom: 7rem; }
.song-beat.story-split .story-split-text { padding-bottom: 7rem; }

/* ───────────────────────────────────────────────
   TRANSPORT — a floating glass pill at the bottom.
   ─────────────────────────────────────────────── */
.song-transport {
    position: absolute;
    left: 1.5rem; right: 1.5rem;
    bottom: calc(1.4rem + env(safe-area-inset-bottom));
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 1.1rem;
    padding: 0.7rem 1.1rem;
    border-radius: 999px;
    color: var(--text);
    background: rgba(14, 14, 14, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(14px) saturate(1.2);
    -webkit-backdrop-filter: blur(14px) saturate(1.2);
}

.song-play {
    flex: 0 0 auto;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: var(--accent);
    border: none;
    color: #0a0a0a;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.2s ease;
}
.song-play:hover { transform: scale(1.07); filter: brightness(1.1); }
.song-play:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.6); }
.song-play .icon-pause { display: none; }
.song-play.is-playing .icon-play  { display: none; }
.song-play.is-playing .icon-pause { display: block; }
.song-play .icon-play { margin-left: 2px; }   /* optically centre the ▶ */

.song-time {
    flex: 0 0 auto;
    font-family: var(--screenplay);
    font-size: 0.78rem;
    letter-spacing: 0.03em;
    color: #d6d6d6;
    min-width: 5.6rem;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.song-time [data-song-cur] { color: #fff; }

/* ── scrub track ── */
.song-track {
    position: relative;
    flex: 1 1 auto;
    height: 1.4rem;                /* tall hit area … */
    display: flex;
    align-items: center;
    cursor: pointer;
    align-self: center;
}
.song-track::before {              /* … but a slim visible rail */
    content: '';
    position: absolute;
    left: 0; right: 0;
    height: 0.32rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
}
.song-progress {
    position: absolute;
    left: 0;
    height: 0.32rem;
    width: 0;
    border-radius: 999px;
    background: var(--accent);   /* fallback for no color-mix() */
    background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 70%, #fff) 0%, var(--accent) 100%);
    box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 60%, transparent);
    pointer-events: none;
}
.song-progress::after {            /* draggable-looking thumb at the playhead */
    content: '';
    position: absolute;
    right: -0.5rem;
    top: 50%;
    width: 0.95rem;
    height: 0.95rem;
    transform: translateY(-50%) scale(0.6);
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 45%, transparent);
    opacity: 0;
    transition: opacity 0.18s ease, transform 0.18s ease;
}
.song-track:hover .song-progress::after,
.song-screen.is-playing .song-progress::after {
    opacity: 1;
    transform: translateY(-50%) scale(1);
}

/* ── beat markers ── */
.song-marker {
    position: absolute;
    top: 50%;
    width: 0.34rem;
    height: 0.78rem;
    margin-left: -0.17rem;
    transform: translateY(-50%);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.85);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease, height 0.15s ease;
}
.song-marker:hover { transform: translateY(-50%) scaleY(1.3); background: #fff; }
.song-marker.is-passed { background: var(--accent); background: color-mix(in srgb, var(--accent) 85%, #fff); }
.song-marker:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.7); }
/* hover tooltip — beat title · time */
.song-marker::after {
    content: attr(data-label);
    position: absolute;
    bottom: calc(100% + 0.7rem);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    white-space: nowrap;
    font-family: var(--screenplay);
    font-size: 0.66rem;
    letter-spacing: 0.06em;
    color: #fff;
    background: rgba(10, 10, 10, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 0.3rem 0.55rem;
    border-radius: 5px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
}
.song-marker:hover::after { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── now-playing meta: equaliser + title ── */
.song-meta {
    flex: 0 1 auto;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
    max-width: 30%;
}
.song-eq {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    height: 0.95rem;
    width: 1rem;
}
.song-eq i {
    width: 3px;
    height: 30%;
    border-radius: 2px;
    background: var(--accent);
    opacity: 0.5;
}
.song-screen.is-playing .song-eq i { animation: eh-eq 0.9s ease-in-out infinite; opacity: 1; }
.song-screen.is-playing .song-eq i:nth-child(2) { animation-delay: 0.18s; }
.song-screen.is-playing .song-eq i:nth-child(3) { animation-delay: 0.36s; }
@keyframes eh-eq {
    0%, 100% { height: 25%; }
    50%      { height: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    .song-screen.is-playing .song-eq i { animation: none; height: 60%; }
}
.song-name {
    font-family: var(--screenplay);
    font-size: 0.74rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ───────────────────────────────────────────────
   CTA — centred play prompt before a track starts.
   ─────────────────────────────────────────────── */
.song-cta {
    position: absolute;
    z-index: 2;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.9rem;
    color: #fff;
    background: none;
    border: none;
    cursor: pointer;
    text-shadow: 0 1px 14px rgba(0, 0, 0, 0.6);
    transition: opacity 0.4s ease, transform 0.4s ease;
}
.song-screen.is-playing .song-cta,
.song-screen.has-played  .song-cta { opacity: 0; transform: translate(-50%, -50%) scale(0.9); pointer-events: none; }
.song-cta-btn {
    position: relative;
    width: 4.8rem; height: 4.8rem;
    border-radius: 50%;
    background: rgba(8, 8, 8, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.7);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: background 0.2s ease, transform 0.2s ease;
}
.song-cta:hover .song-cta-btn { background: var(--accent); color: #0a0a0a; border-color: var(--accent); transform: scale(1.05); }
.song-cta-btn::before {                 /* pulsing ring */
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.5);
    animation: eh-pulse 2.2s ease-out infinite;
}
@keyframes eh-pulse {
    0%   { transform: scale(1);   opacity: 0.7; }
    100% { transform: scale(1.7); opacity: 0; }
}
.song-cta-label {
    font-family: var(--screenplay);
    font-size: 0.72rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
}
@media (prefers-reduced-motion: reduce) {
    .song-cta-btn::before { animation: none; }
}

/* ── mobile ── */
@media (max-width: 760px) {
    .song-transport { left: 0.8rem; right: 0.8rem; gap: 0.7rem; padding: 0.55rem 0.7rem; }
    .song-play { width: 2.6rem; height: 2.6rem; }
    .song-meta { display: none; }
    .song-time { min-width: 4.8rem; font-size: 0.7rem; }
    .song-beat.story-overlay,
    .song-beat.story-text,
    .song-beat.story-split .story-split-text { padding-bottom: 5.5rem; }
}

/* ═══════════════════════════════════════════════
   THEATER HERO — first slide, "now showing" poster.
   ═══════════════════════════════════════════════ */
.theater-hero {
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    background:
        radial-gradient(120% 75% at 50% -15%, rgba(255,255,255,0.06), transparent 60%),
        radial-gradient(90% 65% at 50% 120%, rgba(255, 26, 26, 0.10), transparent 70%),
        var(--dark);
}
.theater-ambient {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(55% 45% at 50% 0%, rgba(255, 205, 130, 0.12), transparent 70%);
}
.theater-inner {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1080px;
    max-height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.3) transparent;
}
.theater-inner::-webkit-scrollbar { width: 6px; }
.theater-inner::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.3); border-radius: 3px; }
.theater-inner::-webkit-scrollbar-track { background: transparent; }

/* ── marquee ── */
.theater-marquee { text-align: center; margin-bottom: 1.8rem; }
.marquee-text {
    display: inline-block;
    font-family: var(--screenplay);
    font-size: clamp(1rem, 2.4vw, 1.5rem);
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: #f5c518;
    padding: 0.45rem 1.4rem;
    border-top: 2px solid rgba(245, 197, 24, 0.55);
    border-bottom: 2px solid rgba(245, 197, 24, 0.55);
    text-shadow: 0 0 14px rgba(245, 197, 24, 0.55);
}

/* ── layout: poster | details ── */
.theater-layout {
    display: grid;
    grid-template-columns: minmax(210px, 310px) 1fr;
    gap: clamp(1.6rem, 4vw, 3.5rem);
    align-items: start;
}

/* poster in a glass case */
.theater-poster { margin: 0; }
.poster-case {
    position: relative;
    aspect-ratio: 2 / 3;
    border-radius: 6px;
    overflow: hidden;
    background: #0c0c0c;
    border: 1px solid rgba(255,255,255,0.14);
    box-shadow:
        0 30px 60px rgba(0,0,0,0.6),
        0 0 0 8px rgba(255,255,255,0.03),
        inset 0 0 50px rgba(0,0,0,0.5);
}
.poster-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.poster-case::after {            /* glass sheen */
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.16), transparent 42%);
    pointer-events: none;
}
.poster-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-family: var(--screenplay);
    font-size: 1.6rem;
    letter-spacing: 0.12em;
    color: var(--dim);
}
.poster-rated {
    position: absolute;
    top: 0.7rem; right: 0.7rem;
    z-index: 2;
    font-family: var(--screenplay);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #fff;
    background: rgba(0,0,0,0.7);
    border: 1px solid rgba(255,255,255,0.5);
    padding: 0.18rem 0.5rem;
    border-radius: 3px;
}

/* ── details column ── */
.theater-details { min-width: 0; }
.detail-genres { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.7rem; }
.detail-genres span {
    font-family: var(--screenplay);
    font-size: 0.66rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text);
    border: 1px solid rgba(255,255,255,0.22);
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
}
.theater-title {
    font-family: var(--screenplay);
    font-size: clamp(2.6rem, 7vw, 5.5rem);
    line-height: 0.9;
    letter-spacing: 0.03em;
    color: var(--text);
    margin: 0.1rem 0 0.8rem;
}
.detail-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem 1.1rem;
    margin-bottom: 1.2rem;
}
.meta-pill { font-family: var(--screenplay); font-size: 0.8rem; color: #d2d2d2; }
.meta-runtime::before { content: '◷ '; opacity: 0.75; }
.meta-rating { display: inline-flex; align-items: center; gap: 0.5rem; }
.rating-num { font-family: var(--screenplay); font-size: 1.3rem; color: #f5c518; line-height: 1; }
.rating-count { font-family: var(--screenplay); font-size: 0.72rem; color: var(--dim); }

.theater-desc {
    font-size: clamp(0.98rem, 1.4vw, 1.12rem);
    line-height: 1.6;
    font-weight: 300;
    color: #cfcfcf;
    max-width: 60ch;
    margin-bottom: 1.5rem;
}

/* ── star rating widget (shared with review cards) ── */
.stars { position: relative; display: inline-block; line-height: 1; white-space: nowrap; letter-spacing: 0.08em; }
.stars-bg { color: rgba(255,255,255,0.22); }
.stars-fg {
    position: absolute;
    left: 0; top: 0;
    width: var(--fill, 0%);
    overflow: hidden;
    color: #f5c518;
}

/* ── actions ── */
.theater-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 1.2rem; margin-bottom: 2rem; }
.ticket-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--screenplay);
    font-size: 1.15rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #0a0a0a;
    background: var(--accent);
    border: none;
    padding: 0.75rem 1.7rem;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(255, 26, 26, 0.32);
    transition: transform 0.15s ease, filter 0.15s ease;
}
.ticket-btn:hover { transform: translateY(-2px); filter: brightness(1.08); }
.ticket-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(255,255,255,0.6); }
.ticket-ic { font-size: 0.82em; }
.ticket-secondary {
    font-family: var(--screenplay);
    font-size: 0.74rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--dim);
    text-decoration: none;
    transition: color 0.2s ease;
}
.ticket-secondary:hover { color: var(--text); }

/* ── audience reviews ── */
.theater-reviews { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 1.2rem; }
.reviews-head {
    font-family: var(--screenplay);
    font-size: 0.72rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.9rem;
}
/* carousel: one review per view, sliding track */
.review-carousel { position: relative; }
.review-viewport { overflow: hidden; }
.review-track {
    display: flex;
    align-items: stretch;          /* all cards match the tallest → no height jump */
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}
.review-card {
    flex: 0 0 100%;
    box-sizing: border-box;
    margin: 0;
    display: flex;
    flex-direction: column;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 1.1rem 1.2rem;
}

.review-ctrl { display: flex; align-items: center; gap: 0.9rem; margin-top: 0.9rem; }
.review-arrow {
    flex: 0 0 auto;
    width: 2rem; height: 2rem;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.18);
    color: var(--text);
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.review-arrow:hover { border-color: var(--accent); color: var(--accent); background: rgba(255,255,255,0.1); }
.review-arrow:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(255,255,255,0.5); }
.review-dots { display: flex; align-items: center; gap: 0.45rem; margin: 0 auto; }
.review-dot {
    width: 0.5rem; height: 0.5rem;
    padding: 0;
    border-radius: 50%;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.4);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.review-dot:hover { border-color: var(--text); }
.review-dot.is-active { background: var(--accent); border-color: var(--accent); transform: scale(1.25); }

.review-stars { font-size: 0.82rem; margin-bottom: 0.5rem; }
.review-quote {
    flex: 1 1 auto;
    font-size: 0.95rem;
    line-height: 1.55;
    font-weight: 300;
    color: #e6e6e6;
    margin: 0 0 0.7rem;
}
.review-quote::before { content: '\201C'; color: var(--accent); }
.review-quote::after  { content: '\201D'; color: var(--accent); }
.review-author { font-family: var(--screenplay); font-size: 0.72rem; letter-spacing: 0.08em; color: var(--dim); }

@media (max-width: 760px) {
    .theater-hero { padding: 2rem 1.2rem; }
    .theater-layout { grid-template-columns: 1fr; gap: 1.5rem; }
    .theater-poster { max-width: 230px; margin: 0 auto; }
    .theater-title { text-align: left; }
}

/* ═══════════════════════════════════════════════
   SCREENPLAY / TYPEWRITER TYPOGRAPHY (Songs mode)
   Courier is much wider than the condensed display
   face, so headings come down in size and are set
   like scene slugs — uppercase and lightly tracked.
   ═══════════════════════════════════════════════ */
body.eh-songs .theater-inner,
body.eh-songs .song-beat,
body.eh-songs .story-outro {
    font-family: var(--screenplay);
}

/* Title-page heading. */
body.eh-songs .theater-title {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    font-size: clamp(1.9rem, 4.6vw, 3.4rem);
    line-height: 1.08;
}
body.eh-songs .marquee-text { letter-spacing: 0.22em; font-weight: 700; }
body.eh-songs .rating-num   { font-size: 1.05rem; font-weight: 700; }
body.eh-songs .ticket-btn   { font-size: 0.95rem; letter-spacing: 0.08em; }

/* Beat headings → scene-heading treatment. */
body.eh-songs .story-overlay-text h2,
body.eh-songs .story-split-text h2,
body.eh-songs .story-text h2,
body.eh-songs .story-outro .outro-next {
    font-family: var(--screenplay);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1.14;
}
body.eh-songs .story-overlay-text h2     { font-size: clamp(1.7rem, 4vw, 3rem); margin-bottom: 1rem; }
body.eh-songs .story-split-text h2       { font-size: clamp(1.5rem, 3.2vw, 2.4rem); }
body.eh-songs .story-text.size-large h2  { font-size: clamp(2rem, 5vw, 3.4rem); }
body.eh-songs .story-text.size-regular h2{ font-size: clamp(1.4rem, 3vw, 2.1rem); }
body.eh-songs .story-outro .outro-next   { font-size: clamp(2rem, 5vw, 3.4rem); }

/* Other monospace labels → keep the screenplay face. */
body.eh-songs .outro-eyebrow,
body.eh-songs .outro-home { font-family: var(--screenplay); }

/* Body copy spaced like script action lines. */
body.eh-songs .story-overlay-text p,
body.eh-songs .story-split-text p,
body.eh-songs .story-text p,
body.eh-songs .theater-desc,
body.eh-songs .review-quote {
    line-height: 1.75;
    letter-spacing: 0.005em;
}
body.eh-songs .story-text.size-large p { font-size: clamp(1.1rem, 2vw, 1.5rem); line-height: 1.6; }
