/**
 * Aradel — Audio Cast Page Template
 * File: /wp-content/mu-plugins/aradel-audio-cast/aradel-audio-cast.css
 * Scoped entirely to .ar-audio-cast — zero bleed into other modules.
 * v1.0
 */

/* ── Wrapper ────────────────────────────────────────────────────────── */
.ar-audio-cast {
    width: 100%;
}


/* ══════════════════════════════════════════════════════════════════════
   BANNER
   Full-bleed dark teal block, aligned to site padding tokens.
   ══════════════════════════════════════════════════════════════════════ */

.ar-audio-cast__banner {
    width: 100%;
    background-color: #01303A;

    /* Break out of Bricks container */
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

.ar-audio-cast__banner-inner {
    max-width: 1440px;
    margin: 0 auto;
    padding: 72px 112px 80px;
    box-sizing: border-box;
}

.ar-audio-cast__banner-eyebrow {
    margin: 0 0 16px;
    font-family: 'Nunito Sans', sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1;
}

.ar-audio-cast__banner-title {
    margin: 0;
    font-family: 'Nunito Sans', sans-serif;
    font-size: clamp(28px, 3.2vw, 52px);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.02em;
    color: #fff;
    max-width: 820px;
}

.ar-audio-cast__banner-date {
    margin: 20px 0 0;
    font-family: 'Nunito Sans', sans-serif;
    font-size: 15px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.4;
}


/* ══════════════════════════════════════════════════════════════════════
   BODY
   White background, standard site padding.
   ══════════════════════════════════════════════════════════════════════ */

.ar-audio-cast__body {
    width: 100%;
    background: #fff;

    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

.ar-audio-cast__body-inner {
    max-width: 1440px;
    margin: 0 auto;
    padding: 64px 112px 96px;
    box-sizing: border-box;
}

/* ── Subtitle / description ────────────────────────────────────────── */
.ar-audio-cast__subtitle {
    margin: 0 0 40px;
    font-family: 'Nunito Sans', sans-serif;
    font-size: 18px;
    font-weight: 400;
    line-height: 27px;
    color: #000;
    max-width: 760px;
}


/* ══════════════════════════════════════════════════════════════════════
   PLAYER
   16:9 container with cover background, dark control bar at bottom.
   ══════════════════════════════════════════════════════════════════════ */

.ar-audio-cast__player {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 600px;
    border-radius: 20px;
    overflow: hidden;
    background-color: #01303A;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 48px;

    /* Entrance animation */
    animation: arPlayerFadeUp 600ms cubic-bezier(0.2, 0.9, 0.2, 1) 80ms both;
}

@keyframes arPlayerFadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0);    }
}

@media (prefers-reduced-motion: reduce) {
    .ar-audio-cast__player { animation: none; }
}

/* Fallback gradient when no cover image */
.ar-audio-cast__player:not([style*="background-image"]) {
    background: linear-gradient(135deg, #01303A 0%, #004d5c 50%, #01303A 100%);
}

/* Dark tint over cover image */
.ar-audio-cast__cover-tint {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    pointer-events: none;
    z-index: 1;
}

/* ── Big centre play button ────────────────────────────────────────── */
.ar-audio-cast__big-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.ar-audio-cast__big-play:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translate(-50%, -50%) scale(1.07);
}

.ar-audio-cast__big-play svg {
    width: 36px;
    height: 36px;
}

/* Hide big play button when playing */
.ar-audio-cast--playing .ar-audio-cast__big-play {
    display: none;
}

/* ── Control bar ───────────────────────────────────────────────────── */
.ar-audio-cast__controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.4) 60%, transparent 100%);
    color: #fff;
}

/* ── Generic control button ────────────────────────────────────────── */
.ar-audio-cast__ctrl {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    flex-shrink: 0;
    transition: opacity 0.15s;
}

.ar-audio-cast__ctrl:hover {
    opacity: 0.8;
}

.ar-audio-cast__ctrl-icon {
    width: 20px;
    height: 20px;
    display: block;
}

/* ── Play / Pause button ────────────────────────────────────────────── */
.ar-audio-cast__ctrl--play .ar-audio-cast__ctrl-icon {
    width: 22px;
    height: 22px;
}

/* ── Time display ───────────────────────────────────────────────────── */
.ar-audio-cast__time {
    font-family: 'Nunito Sans', sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.85);
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: 0.02em;
}

.ar-audio-cast__time-sep {
    margin: 0 3px;
    opacity: 0.6;
}

/* ── Progress / seek bar ────────────────────────────────────────────── */
.ar-audio-cast__progress {
    flex: 1;
    min-width: 0;
    padding: 8px 0;
    cursor: pointer;
    position: relative;
}

.ar-audio-cast__progress-track {
    position: relative;
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.25);
    overflow: visible;
}

.ar-audio-cast__progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0%;
    background: #C1000F;
    border-radius: 2px;
    pointer-events: none;
    transition: width 0.1s linear;
}

.ar-audio-cast__progress-thumb {
    position: absolute;
    top: 50%;
    left: 0%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #C1000F;
    pointer-events: none;
    transition: left 0.1s linear;
    box-shadow: 0 0 0 2px rgba(193, 0, 15, 0.3);
}

.ar-audio-cast__progress:hover .ar-audio-cast__progress-track {
    height: 5px;
}

.ar-audio-cast__progress:focus {
    outline: none;
}

.ar-audio-cast__progress:focus-visible .ar-audio-cast__progress-track {
    box-shadow: 0 0 0 2px #C1000F;
}

/* ── Speed button ────────────────────────────────────────────────────── */
.ar-audio-cast__ctrl--speed {
    min-width: 36px;
    padding: 4px 6px;
}

.ar-audio-cast__speed-label {
    font-family: 'Nunito Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.02em;
}

/* ── Fullscreen: when player is fullscreen ──────────────────────────── */
.ar-audio-cast__player:fullscreen,
.ar-audio-cast__player:-webkit-full-screen,
.ar-audio-cast__player:-moz-full-screen,
.ar-audio-cast__player:-ms-fullscreen {
    max-height: none;
    max-width: none;
    border-radius: 0;
    aspect-ratio: unset;
    width: 100vw;
    height: 100vh;
}

/* ── Back link ───────────────────────────────────────────────────────── */
.ar-audio-cast__back {
    margin-top: 0;
}


/* ══════════════════════════════════════════════════════════════════════
   ERROR STATE
   ══════════════════════════════════════════════════════════════════════ */

.ar-audio-cast--error {
    width: 100%;
    padding: 96px 112px;
    box-sizing: border-box;
    background: #fff;
}

.ar-audio-cast__error-inner {
    max-width: 560px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.ar-audio-cast__error-msg {
    margin: 0;
    font-family: 'Nunito Sans', sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: #01303A;
    line-height: 1.4;
}


/* ══════════════════════════════════════════════════════════════════════
   RESPONSIVE — TABLET  (≤ 1024px)
   ══════════════════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {

    .ar-audio-cast__banner-inner {
        padding: 56px 64px 64px;
    }

    .ar-audio-cast__body-inner {
        padding: 48px 64px 72px;
    }

    .ar-audio-cast__player {
        max-height: none; /* let 16:9 ratio dictate */
    }

    .ar-audio-cast--error {
        padding: 72px 64px;
    }
}


/* ══════════════════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE  (≤ 640px)
   ══════════════════════════════════════════════════════════════════════ */

@media (max-width: 640px) {

    .ar-audio-cast__banner-inner {
        padding: 40px 24px 48px;
    }

    .ar-audio-cast__body-inner {
        padding: 32px 24px 48px;
    }

    .ar-audio-cast__subtitle {
        font-size: 16px;
        line-height: 24px;
        margin-bottom: 32px;
    }

    .ar-audio-cast__player {
        border-radius: 14px;
    }

    .ar-audio-cast__big-play {
        width: 60px;
        height: 60px;
    }

    .ar-audio-cast__big-play svg {
        width: 26px;
        height: 26px;
    }

    .ar-audio-cast__controls {
        padding: 12px 16px 16px;
        gap: 8px;
    }

    .ar-audio-cast__time {
        font-size: 11px;
    }

    .ar-audio-cast__ctrl-icon {
        width: 18px;
        height: 18px;
    }

    .ar-audio-cast--error {
        padding: 48px 24px;
    }
}
