/* detail-view.css — Universal Detail-View Page System
   Horizontal scroll paradigm: each section is a panel, user scrolls left→right.
   .detail-view wraps .clearfix-architect-google so the existing scroll JS hooks in automatically. */

/* -----------------------------------------------------------------------
   Outer container
   .clearfix-architect-google provides overflow-x: auto, the JS scroll hook,
   and the left margin/padding compensation for the fixed nav.
   ----------------------------------------------------------------------- */
.detail-view {
    color: #fff;
}

/* -----------------------------------------------------------------------
   Inner track — all panels in a horizontal row
   ----------------------------------------------------------------------- */
.detail-view__track {
    display: inline-flex;
    flex-direction: row;
    align-items: stretch;
    height: 100%;
    min-height: 80vh;
}

/* assets-architect-google (page.css, priority 99) sets height: 100vh which
   makes panels taller than the visible content area. Override with the same
   vh values used by content-main-architect so the track stays in view. */
   /* Note: For me the human I need to examine why this happens. */
@media (min-width: 768px) {
    .detail-view .detail-view__track {
        height: 76vh;
    }
    /* Target only the Elementor assets-architect-google that wraps a detail-view,
       not the global class. :has() avoids touching the rule in page.css. */
    .assets-architect-google:has(.detail-view) {
        overflow-y: hidden;
    }
}
@media (min-width: 768px) and (min-height: 980px) {
    .detail-view .detail-view__track {
        height: 78vh;
    }
}

/* -----------------------------------------------------------------------
   Panel base
   ----------------------------------------------------------------------- */
.detail-view__panel {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    flex-shrink: 0;
    position: relative;
    padding: 60px 50px;
    box-sizing: border-box;
    white-space: normal;
    overflow-y: auto;
    overflow-x: hidden;
    vertical-align: top;
}

/* -----------------------------------------------------------------------
   Section label (replaces h2 headers — smaller, uppercase, tracked)
   ----------------------------------------------------------------------- */
.detail-view__section-label {
    display: block;
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #555;
    margin-bottom: 20px;
    flex-shrink: 0;
}

.detail-view__section-label--spaced {
    margin-top: 36px;
}

/* -----------------------------------------------------------------------
   Panel: Back — standalone nav panel, first in the track (left of hero)
   ----------------------------------------------------------------------- */
.detail-view__panel--back {
    width: fit-content;
    min-width: 120px;
    background: #0d0d0d;
    justify-content: center;
    align-items: center;
    padding: 60px 36px;
}

.detail-view__back a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: color 0.2s;
}

.detail-view__back a:hover {
    color: #fff;
}

/* -----------------------------------------------------------------------
   Panel: Hero — cover art, sized by height so portrait posters fit naturally
   ----------------------------------------------------------------------- */
.detail-view__panel--hero {
    width: fit-content;
    padding: 0;
    overflow: hidden;
    background: #000;
    justify-content: flex-start;
}

/* Two-class selector (specificity 0,2,1) beats Elementor's .elementor img
   (specificity 0,1,1) which sets height:auto and max-width:100% and loads later. */
.detail-view .detail-view__panel--hero img {
    width: auto;
    height: 100%;
    max-width: none;
    object-fit: unset;
    object-position: unset;
    display: block;
}

/* -----------------------------------------------------------------------
   Panel: Info (title, year, synopsis, director)
   ----------------------------------------------------------------------- */
.detail-view__panel--info {
    width: 520px;
    background: #0d0d0d;
    justify-content: center;
}

.detail-view__type-badge {
    display: inline-block;
    padding: 4px 12px;
    border: 1px solid #333;
    border-radius: 2px;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #666;
    margin-bottom: 20px;
    flex-shrink: 0;
    align-self: flex-start;
}

.detail-view__title {
    font-size: clamp(26px, 3vw, 48px);
    font-weight: 700;
    margin: 0 0 12px;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.detail-view__meta {
    color: #666;
    font-size: 13px;
    margin: 0 0 28px;
    flex-shrink: 0;
}

.detail-view__meta-sep {
    color: #333;
}

.detail-view__synopsis {
    font-size: 14px;
    line-height: 1.8;
    color: #999;
    margin: 0 0 28px;
}

.detail-view__director {
    font-size: 13px;
    color: #777;
    margin: 0;
    flex-shrink: 0;
}

.detail-view__director strong {
    display: block;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #444;
    margin-bottom: 4px;
    font-weight: 400;
}

/* -----------------------------------------------------------------------
   Panel: Trailer
   16:9 embed fills most of the panel height.
   ----------------------------------------------------------------------- */
.detail-view__panel--trailer {
    width: min(880px, 85vw);
    background: #000;
    gap: 0;
}

.detail-view__trailer-wrapper {
    width: 100%;
    flex: 1;
    position: relative;
    min-height: 0;
}

.detail-view__trailer-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* -----------------------------------------------------------------------
   Panel: Stills
   Images laid out in a horizontal row at full panel height.
   ----------------------------------------------------------------------- */
.detail-view__panel--stills {
    transition: opacity 0.4s ease;
}

.detail-view__panel--stills img {
    min-width: 20px;
    background-color: #111;
}

.detail-view__panel--stills {
    background: #000;
    padding: 40px 40px 40px 20px;
    width: max-content;
}

.detail-view__stills-row {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 6px;
    flex: 1;
    min-height: 0;
}

.detail-view__still {
    height: 100%;
    width: auto;
    display: block;
    cursor: pointer;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

/* Two-class selector (0,2,0) beats Elementor's .elementor img (0,1,1) */
.detail-view__stills-row .detail-view__still {
    height: 100%;
    width: auto;
    max-width: none;
}

.detail-view__still:hover {
    opacity: 0.8;
}

/* -----------------------------------------------------------------------
   Panel: Credits (cast + crew)
   ----------------------------------------------------------------------- */
.detail-view__panel--credits {
    width: 480px;
    background: #0d0d0d;
    justify-content: flex-start;
    padding-top: 80px;
}

.detail-view__credits-text {
    font-size: 13px;
    line-height: 1.9;
    color: #888;
    margin: 0;
}

/* -----------------------------------------------------------------------
   Panel: Awards
   ----------------------------------------------------------------------- */
.detail-view__panel--awards {
    width: 400px;
    background: #0d0d0d;
}

.detail-view__awards-text {
    font-size: 14px;
    line-height: 1.8;
    color: #888;
    font-style: italic;
    margin: 0;
}

/* -----------------------------------------------------------------------
   Error state
   ----------------------------------------------------------------------- */
.detail-view--error {
    padding: 60px 50px;
    color: #666;
}

/* -----------------------------------------------------------------------
   Mobile — switch to vertical scroll since horizontal doesn't make sense
   on small screens. Override the body overflow-y hidden at this breakpoint
   from within the panel context.
   ----------------------------------------------------------------------- */
@media (max-width: 767px) {
    /* Restore vertical scrolling on mobile — overrides global overflow-y: hidden from main.css */
    html:has(.detail-view),
    body:has(.detail-view) {
        overflow-y: auto !important;
    }
    /* Kill horizontal scroll on parent Elementor containers */
    .clearfix-architect-google:has(.detail-view),
    .assets-architect-google:has(.detail-view) {
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
        display: block !important;
        height: auto !important;
        white-space: normal !important;
    }

    .detail-view {
        overflow-x: hidden;
    }

    .detail-view__track {
        flex-direction: column;
        display: flex;
        min-height: unset;
        height: auto;
    }

    .detail-view__panel {
        width: 100% !important;
        height: auto;
        min-height: unset;
        overflow-y: visible;
        padding: 40px 24px;
    }

    .detail-view__panel--hero {
        padding: 0;
    }

    .detail-view__panel--hero img {
        width: 100%;
        height: auto;
        object-fit: unset;
    }

    .detail-view__panel--back {
        width: 100% !important;
        min-height: unset;
        padding: 24px;
        justify-content: flex-start;
    }

    .detail-view__panel--stills {
        width: 100% !important;
        padding: 40px 0;
    }

    .detail-view__panel--stills .detail-view__section-label {
        padding: 0 24px;
    }

    .detail-view__stills-row {
        flex-wrap: wrap;
        gap: 3px;
    }

    .detail-view__stills-row .detail-view__still {
        height: auto;
        width: 100%;
        max-width: 100%;
    }

    .detail-view__panel--trailer {
        width: 100% !important;
        min-height: auto;
        padding: 40px 0;
    }

    .detail-view__panel--trailer .detail-view__section-label {
        padding: 0 24px;
    }

    .detail-view__trailer-wrapper {
        position: relative;
        padding-bottom: 56.25%;
        height: 0;
    }

    .detail-view__trailer-wrapper iframe {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }

    .detail-view__panel--credits,
    .detail-view__panel--awards {
        min-height: unset;
    }
}
