
/* ==========================================================
   PHENIX CINEMATIC VIDEO HEADER
   Cleaned stylesheet — v2.2

   Desktop:
   - Proportional 8:3 video
   - Full-height animated overlay
   - Heading-driven panel width (set by JavaScript)
   - Equal horizontal padding
   - Description constrained to heading width

   Mobile:
   - Shorter 16:9 video
   - Full-width content panel below video
   - Readable typography
   - Playback control positioned over video
   ========================================================== */


/* ----------------------------------------------------------
   1. VIDEO HEADER CONTAINER
   ---------------------------------------------------------- */

.phenix-video-header {
    position: relative;
    isolation: isolate;
    display: block;
    width: 100%;
    min-height: 0;
    aspect-ratio: 8 / 3;
    overflow: hidden;
    background: #173b61;
    color: #fff;
}


/* ----------------------------------------------------------
   2. VIDEO AND POSTER
   ---------------------------------------------------------- */

.phenix-video-header .pch-media,
.phenix-video-header .pch-shade {
    position: absolute;
    inset: 0;
}

.phenix-video-header .pch-media {
    z-index: -2;
}

.phenix-video-header .pch-video,
.phenix-video-header .pch-poster {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.phenix-video-header .pch-video {
    opacity: 0;
}

.phenix-video-header.is-playing .pch-video {
    opacity: 1;
}

.phenix-video-header.is-playing .pch-poster {
    opacity: 0;
}

.phenix-video-header .pch-shade {
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(
        90deg,
        rgba(0, 26, 59, 0.10),
        transparent
    );
}


/* ----------------------------------------------------------
   3. ANIMATED MESSAGE CONTAINER
   ---------------------------------------------------------- */

.phenix-video-header .pch-messages {
    position: absolute;
    inset: 0;
    z-index: 2;
    overflow: hidden;
    pointer-events: none;
}

.phenix-video-header .pch-message {
    position: absolute;
    inset: 0 auto 0 0;

    display: flex;
    flex-direction: column;
    justify-content: center;

    box-sizing: border-box;

    width: var(--pch-panel-width, 480px);
    max-width: 100%;
    min-width: 0;
    height: 100%;

    padding:
        24px
        var(--pch-effective-pad, var(--pch-panel-pad, 32px));

    background: rgba(0, 39, 82, 0.78);
    color: #fff;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transform: translate3d(
        var(--pch-offset, 0px),
        0,
        0
    );

    will-change: transform, opacity;
}

.phenix-video-header .pch-message.is-visible {
    visibility: visible;
    pointer-events: auto;
}


/* ----------------------------------------------------------
   4. MESSAGE CONTENT WIDTH
   ---------------------------------------------------------- */

.phenix-video-header .pch-message__inner {
    box-sizing: border-box;

    width: var(--pch-text-width, 100%);
    max-width: 100%;
    min-width: 0;

    flex: none;
}

/*
   JavaScript measures the longest heading line and sets:
   --pch-text-width
   --pch-panel-width

   The description follows the heading width rather than
   determining the width of the panel.
*/

.phenix-video-header .pch-heading {
    width: max-content;
    max-width: 100%;

    margin: 0 0 0.3em;

    font-size: var(
        --pch-heading-size,
        clamp(30px, 2.9vw, 68px)
    );

    font-weight: 800;
    line-height: 1.04;
    letter-spacing: normal;
    text-transform: uppercase;

    color: inherit;

    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
}

.phenix-video-header .pch-eyebrow {
    margin: 0 0 0.8em;

    font-size: clamp(10px, 0.75vw, 15px);
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.phenix-video-header .pch-description {
    box-sizing: border-box;

    width: 100%;
    max-width: 100%;
    min-width: 0;

    font-size: clamp(13px, 1.08vw, 23px);
    line-height: 1.4;

    overflow-wrap: break-word;
    word-break: normal;
    text-wrap: pretty;
}

.phenix-video-header .pch-description p {
    margin: 0 0 1em;
    text-wrap: pretty;
}


/* ----------------------------------------------------------
   5. CALL TO ACTION
   ---------------------------------------------------------- */

.phenix-video-header .pch-button {
    display: inline-block;

    padding: 0.7em 1em;

    font-size: clamp(12px, 0.9vw, 18px);
    font-weight: 700;
    line-height: 1.3;

    color: #fff !important;
    background: #c5273d;

    border: 0;
    border-radius: 4px;

    text-decoration: none;
}

.phenix-video-header .pch-button:hover {
    background: #a91d31;
    color: #fff !important;
}

.phenix-video-header .pch-button:focus-visible,
.phenix-video-header .pch-toggle:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 4px;
}


/* ----------------------------------------------------------
   6. PLAY / PAUSE CONTROL
   ---------------------------------------------------------- */

.phenix-video-header .pch-toggle {
    position: absolute !important;
    inset: auto 16px 16px auto !important;

    z-index: 10000 !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    box-sizing: border-box;

    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;

    margin: 0 !important;
    padding: 0 !important;

    appearance: none !important;
    -webkit-appearance: none !important;

    background: rgba(0, 25, 55, 0.85) !important;
    color: #fff !important;

    border: 2px solid #fff !important;
    border-radius: 50% !important;

    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35) !important;

    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;

    transform: none !important;
    cursor: pointer;
    line-height: 1 !important;

    transition: background 0.2s ease;
}

.phenix-video-header .pch-toggle:hover {
    background: rgba(0, 25, 55, 1) !important;
}

.phenix-video-header .pch-toggle svg {
    display: block !important;

    width: 20px !important;
    height: 20px !important;

    fill: currentColor !important;
    stroke: none;
}

.phenix-video-header .pch-toggle[hidden] {
    display: none !important;
}


/* ----------------------------------------------------------
   7. EDITOR PREVIEW
   ---------------------------------------------------------- */

.phenix-video-header .pch-preview-note {
    position: absolute;
    bottom: 8px;
    left: 8px;

    padding: 5px;

    font: 12px sans-serif;
    color: #222;
    background: #fff;
}

.phenix-video-header.is-editor-preview
.pch-message:first-child {
    visibility: visible;
    opacity: 1 !important;
    pointer-events: auto;
}

.phenix-video-header
.pch-message__inner > :last-child {
    margin-bottom: 0;
}


/* ----------------------------------------------------------
   8. LAPTOP / SMALL DESKTOP
   ---------------------------------------------------------- */

@media (min-width: 768px) and (max-width: 1100px) {

    .phenix-video-header .pch-message {
        padding-top: 18px;
        padding-bottom: 18px;
    }

    .phenix-video-header .pch-heading {
        font-size: var(
            --pch-heading-size,
            clamp(22px, 2.6vw, 35px)
        );
    }

    .phenix-video-header .pch-description {
        font-size: clamp(12px, 1.1vw, 16px);
    }
}


/* ----------------------------------------------------------
   9. MOBILE — STACKED VIDEO AND CONTENT
   ---------------------------------------------------------- */

@media (max-width: 767px) {

    /*
       Header becomes a vertical layout:
       Video first, content panel second.
    */

    .phenix-video-header {
        display: flex;
        flex-direction: column;

        width: 100%;
        height: auto;
        min-height: 0;

        aspect-ratio: auto;
        overflow: hidden;
    }

    /* Shorter video */

    .phenix-video-header .pch-media {
        position: relative;
        inset: auto;

        z-index: 0;

        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;

        flex: none;
        overflow: hidden;
    }

    .phenix-video-header .pch-video,
    .phenix-video-header .pch-poster {
        position: absolute;
        inset: 0;

        width: 100%;
        height: 100%;

        object-fit: cover;
        object-position: center;
    }

    .phenix-video-header .pch-shade {
        display: none;
    }

    /* Content beneath the video */

    .phenix-video-header .pch-messages {
        position: relative;
        inset: auto;

        display: block;

        width: 100%;
        height: auto;

        z-index: 1;
        overflow: visible;

        background: #002859;
    }

    .phenix-video-header .pch-message {
        position: relative;
        inset: auto;

        display: flex;
        flex-direction: column;
        justify-content: center;

        width: 100% !important;
        max-width: 100% !important;
        height: auto;
        min-height: 0;

        padding: 32px 24px !important;

        background: #002859;

        transform: none !important;
        will-change: auto;
    }

    .phenix-video-header .pch-message__inner {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0;
    }

    /* Mobile typography */

    .phenix-video-header .pch-eyebrow {
        font-size: 12px;
        margin-bottom: 12px;
    }

    .phenix-video-header .pch-heading {
        width: auto;
        max-width: 100%;

        font-size: clamp(28px, 8vw, 38px);
        line-height: 1.08;

        white-space: normal;

        margin-bottom: 18px;
    }

    .phenix-video-header .pch-description {
        width: 100%;
        max-width: 100%;

        font-size: 16px;
        line-height: 1.55;

        text-wrap: pretty;
    }

    .phenix-video-header .pch-button {
        font-size: 15px;
        padding: 0.8em 1.1em;
    }

    /* Playback control remains on the video */

    .phenix-video-header .pch-toggle {
        inset: 12px 12px auto auto !important;
    }
}


/* ----------------------------------------------------------
   10. REDUCED MOTION
   ---------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {

    .phenix-video-header .pch-video {
        display: none !important;
    }

    .phenix-video-header .pch-poster {
        opacity: 1 !important;
    }

    .phenix-video-header .pch-message {
        transition: none !important;
    }
}

/* v2.3 — Mobile: static primary message, visible immediately. */
@media (max-width: 767px) {
  .phenix-video-header .pch-messages {
    position: relative !important;
    height: auto !important;
    overflow: visible !important;
    background: #002752;
  }
  .phenix-video-header .pch-message:not(.is-primary) {
    display: none !important;
  }
  .phenix-video-header .pch-message.is-primary {
    position: relative !important;
    inset: auto !important;
    display: flex !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
    pointer-events: auto !important;
    will-change: auto !important;
    padding: 32px 24px !important;
  }
  .phenix-video-header .pch-message.is-primary .pch-message__inner {
    width: 100% !important;
    max-width: 100% !important;
  }
}
