/* ═══════════════════════════════════════════════════════════════════ */
/* SINGLE PODCAST — single-podcasts.php                                  */
/*                                                                       */
/* Same skeleton as single-events.css: a bespoke two-column grid (main    */
/* column + sticky rail) inside .page-row--no-sidebar, flex content in a  */
/* second grid row. Podcast-specific pieces: the 16:9 media frame with a  */
/* Watch-on-YouTube overlay, the blue audio player card (decorative       */
/* waveform, Libsyn-streamed <audio> driven by podcastPlayer.js), and the */
/* "Keep listening" card strip. Buttons, .pre-title, .link-text, .icon    */
/* sizing are global; only layout + skins live here.                      */

/* ── layout: main column + sticky rail ─────────────────────────────── */
/* Column 1 stacks two rows — the episode, then the flex content blocks.
   The rail spans BOTH rows in column 2 so `position: sticky` holds it
   beside the content blocks too. row-gap stays 0 (only column-gap is set)
   so the empty blocks row — the default until the ACF group is attached —
   adds no phantom space; spacing is margin, applied only when blocks exist. */
.podcast-single__layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    column-gap: 44px;
    align-items: start;
    padding: 44px 0 56px;
}

/* Rail is first in DOM (matching the events skeleton) but placed in
   column 2 on desktop; the main column is explicitly column 1. */
.podcast-single__main {
    grid-column: 1;
    grid-row: 1;
}

.podcast-single__blocks {
    grid-column: 1;
    grid-row: 2;
}

.podcast-single__blocks:not(:empty) {
    margin-top: 44px;
}

/* Blocks sit inside the intro's .container + this grid column, so drop
   their own container width/padding — the column already insets them. */
.podcast-single__blocks .container {
    max-width: none;
    padding-left: 0;
    padding-right: 0;
}

.podcast-single__rail {
    grid-column: 2;
    grid-row: 1 / span 2;
    position: sticky;
    --rail-sticky-top: 190px; /* clears the sticky #masthead (~174px) with a small gap */
    top: var(--rail-sticky-top);

    display: flex;
    flex-direction: column;
    gap: 20px;
}

body.admin-bar .podcast-single__rail {
    --rail-sticky-top: 222px; /* + 32px WP admin bar */
}

/* ── rail: episode card (events card skin, podcast content) ────────── */
.podcast-single__card {
    background: var(--white);
    border-radius: var(--box-border-radius-sm);
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.podcast-single__card-head {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 24px;
    background: var(--blue-dk);
}

.podcast-single__card-episode {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.podcast-single__card-episode__label {
    font-family: "Cachet", sans-serif;
    text-transform: uppercase;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.3px;
    color: var(--blue-lt);
    margin-bottom: 8px;
}

.podcast-single__card-episode__number {
    font-family: "Cachet", sans-serif;
    font-weight: 700;
    font-size: 48px;
    letter-spacing: -1.4px;
    color: var(--white);
}

.podcast-single__card-head-meta {
    border-left: 1px solid rgba(255, 255, 255, 0.35);
    padding-left: 20px;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.podcast-single__card-head-meta strong {
    display: block;
    font-family: "Cachet", sans-serif;
    text-transform: uppercase;
    font-weight: 700;
    font-size: 22px;
    letter-spacing: -0.7px;
    color: var(--white);
}

.podcast-single__card-head-meta span {
    display: block;
    margin-top: 8px;
    font-size: 16px;
    font-weight: 300;
    letter-spacing: -0.5px;
    color: rgba(255, 255, 255, 0.9);
}

/* ── rail: meta rows ───────────────────────────────────────────────── */
.podcast-single__card-body {
    padding: 22px 24px 24px;
}

.podcast-single__card-meta {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.podcast-single__card-meta-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 14px;
    color: var(--gray-dk);
}

.podcast-single__card-meta-item .icon {
    font-size: 16px;
    color: var(--blue-dk);
    margin-top: 1px;
}

.podcast-single__card-meta-item strong {
    display: block;
    color: var(--black);
}

/* ── rail: platform buttons ────────────────────────────────────────── */
.podcast-single__card-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-lt);
}

.podcast-single__card-actions .btn {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.podcast-single__card-actions .btn .icon {
    font-size: 20px;
    color: var(--white);
}

/* ── rail: share row ───────────────────────────────────────────────── */
.podcast-single__share {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 4px;
}

.podcast-single__share-label {
    font-family: "Cachet", sans-serif;
    text-transform: uppercase;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.3px;
    color: var(--gray-dk);
}

.podcast-single__share-links {
    display: flex;
    gap: 8px;
}

.podcast-single__share-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 100px;
    background: var(--blue-tint);
    color: var(--blue-dk);
    transition: all 0.2s ease;
}

.podcast-single__share-links a .icon {
    font-size: 16px;
}

.podcast-single__share-links a:hover {
    background: var(--blue-dk);
    color: var(--white);
}

/* ── rail: all-episodes link ───────────────────────────────────────── */
.podcast-single__all-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 4px;
    color: var(--blue-dk);
    text-decoration: none;
    transition: color 0.2s ease;
}

.podcast-single__all-link .icon {
    font-size: 12px;
}

.podcast-single__all-link:hover {
    color: var(--purple-dk);
}

/* ── main: media frame ─────────────────────────────────────────────── */
.podcast-single__feature {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: var(--box-border-radius-lg);
    overflow: hidden;
    background: var(--gray-lt);
}

.podcast-single__feature-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* bottom fade so the Watch-on-YouTube link reads over any art */
.podcast-single__feature-grad {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 40%;
    background: var(--black-overlay-gradient);
    opacity: 0.7;
    pointer-events: none;
}

/* no art at all → the podcast cards' brand-gradient + play-mark treatment */
.podcast-single__feature--placeholder {
    background: var(--blue-background-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
}

.podcast-single__feature--placeholder > .icon {
    font-size: 64px;
    color: rgba(255, 255, 255, 0.85);
}

.podcast-single__watch {
    position: absolute;
    left: 30px;
    bottom: 26px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--white);
    text-decoration: none;
    transition: color 0.2s ease;
}

.podcast-single__watch .icon {
    font-size: 22px;
}

.podcast-single__watch span {
    font-family: "Cachet", sans-serif;
    text-transform: uppercase;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -0.5px;
    line-height: 1;
    color: inherit;
}

.podcast-single__watch:hover {
    color: var(--blue-lt);
}

/* ── main: audio player card ───────────────────────────────────────── */
.podcast-single__player {
    margin-top: 16px;
    background: var(--blue-dk);
    border-radius: var(--box-border-radius-lg);
    padding: 26px 28px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.podcast-single__player-top {
    display: flex;
    align-items: center;
    gap: 20px;
}

.podcast-single__player-toggle {
    width: 64px;
    height: 64px;
    flex: 0 0 auto;
    border: 0;
    padding: 0;
    border-radius: 100px;
    background: var(--white);
    color: var(--purple-dk);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.podcast-single__player-toggle:hover {
    background: var(--purple-md);
    color: var(--white);
}

.podcast-single__player-toggle-play {
    display: flex;
    margin-left: 4px; /* optical centering of the triangle */
}

.podcast-single__player-toggle-play .icon {
    font-size: 22px;
}

.podcast-single__player-toggle-pause {
    display: none;
    gap: 6px;
}

.podcast-single__player-toggle-pause span {
    display: block;
    width: 6px;
    height: 24px;
    border-radius: 2px;
    background: currentColor;
}

.podcast-single__player.is-playing .podcast-single__player-toggle-play {
    display: none;
}

.podcast-single__player.is-playing .podcast-single__player-toggle-pause {
    display: flex;
}

.podcast-single__player-heading {
    flex: 1;
    min-width: 0;
}

.podcast-single__player-eyebrow {
    display: block;
    font-family: "Cachet", sans-serif;
    text-transform: uppercase;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.3px;
    line-height: 1;
    color: var(--blue-lt);
}

.podcast-single__player-title {
    display: block;
    margin-top: 9px;
    font-family: "Cachet", sans-serif;
    text-transform: uppercase;
    font-weight: 700;
    font-size: 22px;
    letter-spacing: -0.7px;
    line-height: 1;
    color: var(--white);
}

.podcast-single__player-time {
    font-family: "Cachet", sans-serif;
    font-weight: 700;
    font-size: 22px;
    letter-spacing: -0.7px;
    line-height: 1;
    color: var(--white);
    white-space: nowrap;
}

/* ── player: decorative waveform (also the seek control) ───────────── */
.podcast-single__player-wave {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 64px;
    cursor: pointer;
    touch-action: none; /* drag-to-seek owns horizontal touch here */
}

.podcast-single__player-wave:focus-visible {
    outline: 2px solid var(--blue-lt);
    outline-offset: 6px;
    border-radius: 4px;
}

.podcast-single__player-wave span {
    flex: 1;
    border-radius: 2px;
    background: var(--white);
}

.podcast-single__player-wave span.is-played {
    background: var(--blue-lt);
}

/* ── player: transport row ─────────────────────────────────────────── */
.podcast-single__player-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.podcast-single__player-skips {
    display: flex;
    align-items: center;
    gap: 10px;
}

.podcast-single__player-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 14px;
    border: 1px solid var(--white);
    border-radius: 100px;
    background: transparent;
    color: var(--white);
    cursor: pointer;
    font-family: "Cachet", sans-serif;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: -0.4px;
    line-height: 1;
    transition: all 0.2s ease;
}

.podcast-single__player-pill .icon {
    font-size: 10px;
}

.podcast-single__player-pill:hover {
    background: var(--white);
    color: var(--blue-dk);
}

.podcast-single__player-download {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--white);
    text-decoration: none;
    transition: color 0.2s ease;
}

.podcast-single__player-download .icon {
    font-size: 16px;
}

.podcast-single__player-download span {
    font-family: "Cachet", sans-serif;
    text-transform: uppercase;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -0.5px;
    line-height: 1;
}

.podcast-single__player-download:hover {
    color: var(--blue-lt);
}

/* stream failed to load — dim the transport, keep the page readable */
.podcast-single__player.is-unavailable .podcast-single__player-toggle,
.podcast-single__player.is-unavailable .podcast-single__player-pill,
.podcast-single__player.is-unavailable .podcast-single__player-wave {
    opacity: 0.45;
    pointer-events: none;
}

/* ── main: eyebrow + title + description ───────────────────────────── */
.podcast-single__eyebrow {
    margin: 36px 0 0;
}

.podcast-single__title {
    margin: 14px 0 0;
    color: var(--blue-dk);
    text-wrap: pretty;
}

.podcast-single__description {
    margin-top: 26px;
    max-width: 700px;
    /* RSS descriptions carry long bare URLs — never let them force the column wide */
    overflow-wrap: anywhere;
}

.podcast-single__description p {
    margin: 0 0 16px;
}

.podcast-single__description > :last-child {
    margin-bottom: 0;
}

/* ── main: "Keep listening" strip ──────────────────────────────────── */
.podcast-single__more {
    margin-top: 72px;
}

/* The strip is a <section> for semantics, so defaults.css's blanket
   `section { padding: 36px 0 }` and its `section:first-of-type` bump land on
   it — it is the only section among its siblings. Spacing stays the margin
   above, so back the padding out. Two classes to outrank :first-of-type
   without !important; kept apart from the margin rule so the mobile
   margin-top override further down still wins on its own specificity. */
.podcast-single__main .podcast-single__more {
    padding-top: 0;
    padding-bottom: 0;
}

.podcast-single__more-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 36px;
}

.podcast-single__more-card {
    display: block;
    text-decoration: none;
}

.podcast-single__more-card-media {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: var(--box-border-radius-sm);
    overflow: hidden;
    background: var(--gray-lt);
}

.podcast-single__more-card-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.podcast-single__more-card:hover .podcast-single__more-card-media img {
    transform: scale(1.04);
}

.podcast-single__more-card-media--placeholder {
    background: var(--blue-background-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
}

.podcast-single__more-card-media--placeholder .icon {
    font-size: 44px;
    color: rgba(255, 255, 255, 0.85);
}

.podcast-single__more-card-meta {
    margin-top: 16px;
    font-family: "Cachet", sans-serif;
    text-transform: uppercase;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.3px;
    line-height: 1;
    color: var(--blue-lt);
}

.podcast-single__more-card-title {
    margin: 10px 0 0;
    color: var(--blue-dk);
    transition: color 0.25s ease;
}

.podcast-single__more-card:hover .podcast-single__more-card-title {
    color: var(--purple-dk);
}

.podcast-single__more-card-blurb {
    margin-top: 10px;
    font-size: 13px;
    line-height: 1.3;
    color: var(--gray-dk);
}

/* ── responsive ────────────────────────────────────────────────────── */
/* Unlike events (facts rail leads on phones), the player IS this page —
   main column first, rail below it, flex blocks last. */
@media (max-width: 980px) {
    .podcast-single__layout {
        /* minmax(0,…), not bare 1fr — long unbroken description tokens must not
           set the column's min-content width and push the page past the viewport */
        grid-template-columns: minmax(0, 1fr);
        padding: 32px 0 40px;
    }

    .podcast-single__main {
        grid-column: 1;
        grid-row: 1;
    }

    .podcast-single__rail {
        grid-column: 1;
        grid-row: 2;
        position: static;
        margin-top: 32px;
    }

    .podcast-single__blocks {
        grid-column: 1;
        grid-row: 3;
    }

    .podcast-single__blocks:not(:empty) {
        margin-top: 32px;
    }
}

@media (max-width: 768px) {
    .podcast-single__eyebrow {
        margin-top: 28px;
    }

    .podcast-single__more {
        margin-top: 52px;
    }

    .podcast-single__more-grid {
        grid-template-columns: 1fr;
    }

    .podcast-single__player-top {
        flex-wrap: wrap;
        row-gap: 12px;
    }

    .podcast-single__player-time {
        font-size: 18px;
    }
}

@media (max-width: 576px) {
    .podcast-single__player {
        padding: 20px 18px;
    }

    .podcast-single__player-wave {
        height: 48px;
        gap: 2px;
    }

    .podcast-single__player-toggle {
        width: 54px;
        height: 54px;
    }

    .podcast-single__player-title {
        font-size: 20px;
    }

    .podcast-single__player-controls {
        flex-wrap: wrap;
        row-gap: 14px;
    }

    /* time drops below the button + title row, aligned under the title */
    .podcast-single__player-time {
        flex-basis: 100%;
        margin-left: 74px; /* toggle 54px + 20px gap */
        font-size: 16px;
    }

    .podcast-single__watch {
        left: 18px;
        bottom: 16px;
    }

    .podcast-single__card-head {
        padding: 18px 20px;
    }

    .podcast-single__card-episode__number {
        font-size: 38px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .podcast-single__more-card:hover .podcast-single__more-card-media img {
        transform: none;
    }
}
