/* assets/css/podcasts.css — podcast clubs.
 *
 *   picker      partials/podcast-picker.php + embedded-pick-podcast.js
 *               (the search bar, Browse menu, chips, note and Load more
 *               come from the film/YouTube pickers' shared styles)
 *   player      partials/podcast-player.php + podcast-player.js
 *   hero        templates/dash-mobile-layout.php .m-hero--podcast
 *
 * Teal (#2B988F) for actions, like the rest of the site; Apple Podcasts
 * purple marks podcast-specific accents.
 */
:root { --pod-purple: #8e44ef; }

/* ── Picker ─────────────────────────────────────────────────────────── */
.pod-picker-empty .material-icons { color: var(--pod-purple) !important; }

/* Shows | Episodes, shown while a search is up. */
.pod-kind {
    display: inline-flex;
    gap: 2px;
    margin: 10px 0 2px;
    padding: 3px;
    border-radius: 999px;
    background: #eef1f4;
}
    .pod-kind[hidden] { display: none; }
.pod-kind-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 30px;
    padding: 0 14px 0 10px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #4b5563;
    font-size: .82rem;
    font-weight: 600;
    transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
    .pod-kind-btn .material-icons { font-size: 17px; }
    .pod-kind-btn:hover { color: #1a1d2e; }
    .pod-kind-btn.is-active { background: #fff; color: #2B988F; box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }

.pod-picker-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    gap: 18px 14px;
    margin-top: 6px;
}
/* A show's episode list reads better as rows: art left, text right. */
.pod-picker-results--episodes { grid-template-columns: 1fr; gap: 10px; }

.pod-card { display: flex; flex-direction: column; min-width: 0; }
    .pod-card-media { position: relative; }
    .pod-card-art {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        aspect-ratio: 1 / 1;
        padding: 0;
        overflow: hidden;
        border: 0;
        border-radius: 12px;
        background: linear-gradient(135deg, #efe7fb, #e4f2f0);
        box-shadow: 0 1px 3px rgba(15, 23, 42, .12);
        cursor: pointer;
        transition: transform .18s ease, box-shadow .18s ease;
    }
    .pod-card-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
    .pod-card-art .material-icons { font-size: 40px; color: var(--pod-purple); }
    .pod-card-art:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(15, 23, 42, .18); }
    .pod-card-art:focus-visible { outline: 2px solid #2B988F; outline-offset: 2px; }
    .pod-card-kind {
        position: absolute;
        top: 7px;
        left: 7px;
        padding: 2px 8px;
        border-radius: 999px;
        background: rgba(15, 15, 15, .72);
        -webkit-backdrop-filter: blur(4px);
        backdrop-filter: blur(4px);
        color: #fff;
        font-size: .66rem;
        font-weight: 700;
        letter-spacing: .03em;
        text-transform: uppercase;
        pointer-events: none;
    }
    .pod-card--show .pod-card-kind { background: rgba(142, 68, 239, .85); }
    /* Episode preview: play/pause in the art's bottom-right corner. */
    .pod-card-play {
        position: absolute;
        right: 8px;
        bottom: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 38px;
        padding: 0;
        border: 0;
        border-radius: 50%;
        background: #fff;
        color: #1a1d2e;
        box-shadow: 0 2px 10px rgba(0, 0, 0, .3);
        transition: transform .15s ease, background .15s ease, color .15s ease;
    }
    .pod-card-play .material-icons { font-size: 24px; }
    .pod-card-play:hover { transform: scale(1.08); }
    .pod-card-play.is-playing,
    .pod-card-play.is-current { background: #2B988F; color: #fff; }
    .pod-card-play.is-loading .material-icons { animation: podPulse 1s ease-in-out infinite; }
    .pod-card-body { display: flex; flex-direction: column; gap: 2px; padding: 8px 2px 0; min-width: 0; }
    .pod-card-title {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        padding: 0;
        border: 0;
        background: none;
        color: #1a1d2e;
        font-size: .9rem;
        font-weight: 700;
        line-height: 1.3;
        text-align: left;
        cursor: pointer;
    }
    .pod-card-title:hover { color: #2B988F; }
    .pod-card-meta {
        overflow: hidden;
        color: #6b7380;
        font-size: .78rem;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .pod-card-show {
        max-width: 100%;
        padding: 0;
        overflow: hidden;
        border: 0;
        background: none;
        color: inherit;
        font: inherit;
        text-overflow: ellipsis;
        white-space: nowrap;
        vertical-align: top;
        cursor: pointer;
    }
    .pod-card-show:hover:not(:disabled) { color: #2B988F; text-decoration: underline; text-underline-offset: 2px; }
    .pod-card-show:disabled { cursor: default; }
    .pod-card-stats { color: #8a929c; font-size: .74rem; }
    .pod-card-stats span + span::before { content: "·"; margin: 0 5px; }
    .pod-card-desc {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        margin: 4px 0 0;
        overflow: hidden;
        color: #4b5563;
        font-size: .78rem;
        line-height: 1.45;
        cursor: pointer;
    }
    .pod-card-desc.is-open { display: block; -webkit-line-clamp: unset; }

/* Add / Select — a full-width pill under the text. */
.pod-pick-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    align-self: flex-start;
    height: 30px;
    margin-top: 8px;
    padding: 0 13px 0 10px;
    border: 1px solid #c8e3df;
    border-radius: 999px;
    background: #f3faf9;
    color: #237d76;
    font-size: .78rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}
    .pod-pick-btn .material-icons { font-size: 17px; }
    .pod-pick-btn > span:not(.material-icons) { display: inline-flex; align-items: center; gap: 5px; }
    .pod-pick-btn:hover { background: #2B988F; border-color: #2B988F; color: #fff; }
    .pod-pick-btn:focus-visible { outline: 2px solid #2B988F; outline-offset: 2px; }
    .pod-pick-btn.is-done,
    .pod-pick-btn.is-queued { background: #2B988F; border-color: #2B988F; color: #fff; }
    .pod-pick-btn .pod-pick-off { display: none !important; }
    .pod-pick-btn.is-queued:hover { background: #b42318; border-color: #b42318; }
    .pod-pick-btn.is-queued:hover .pod-pick-on { display: none !important; }
    .pod-pick-btn.is-queued:hover .pod-pick-off { display: inline-flex !important; }
    .pod-pick-btn:disabled { opacity: .7; cursor: default; }

/* Episode rows (a show's list, or episode search results). */
.pod-picker-results--episodes .pod-card {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    padding: 10px;
    border: 1px solid #eef0f4;
    border-radius: 14px;
    background: #fff;
}
    .pod-picker-results--episodes .pod-card.is-current { border-color: #c8e3df; background: #f6fbfa; }
    .pod-picker-results--episodes .pod-card-art { border-radius: 10px; }
    .pod-picker-results--episodes .pod-card-kind { display: none; }
    .pod-picker-results--episodes .pod-card-play { right: 5px; bottom: 5px; width: 32px; height: 32px; }
    .pod-picker-results--episodes .pod-card-play .material-icons { font-size: 21px; }
    .pod-picker-results--episodes .pod-card-body { padding-top: 0; }
    .pod-picker-results--episodes .pod-card-title { font-size: .92rem; }
    .pod-picker-results--episodes .pod-pick-btn { margin-top: 6px; }

/* ── Show view ──────────────────────────────────────────────────────── */
.pod-show { margin: 4px 0 10px; }
    .pod-show[hidden] { display: none; }
.pod-show-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 30px;
    margin-bottom: 10px;
    padding: 0 12px 0 8px;
    border: 1px solid #dbe7e6;
    border-radius: 999px;
    background: #fff;
    color: #374151;
    font-size: .8rem;
    font-weight: 600;
    transition: border-color .15s ease, color .15s ease, background .15s ease;
}
    .pod-show-back .material-icons { font-size: 17px; }
    .pod-show-back:hover { border-color: #2B988F; background: #f4faf9; color: #2B988F; }
.pod-show-head {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px;
    border: 1px solid #ebe4f7;
    border-radius: 16px;
    background: linear-gradient(135deg, #f7f2fe 0%, #fff 70%);
}
.pod-show-art {
    flex: 0 0 auto;
    width: 104px;
    height: 104px;
    border-radius: 14px;
    object-fit: cover;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .2);
}
    .pod-show-art--blank { display: flex; align-items: center; justify-content: center; background: #efe7fb; color: var(--pod-purple); font-size: 44px; }
.pod-show-info { flex: 1 1 auto; min-width: 0; }
.pod-show-title { margin: 0; color: #1a1d2e; font-size: 1.15rem; font-weight: 800; line-height: 1.25; }
.pod-show-meta { margin-top: 3px; color: #6b7380; font-size: .82rem; }
    .pod-show-meta span + span::before { content: "·"; margin: 0 6px; color: #b5bcc6; }
.pod-show-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
    .pod-show-actions .pod-pick-btn { margin-top: 0; }
.pod-show-out {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 13px 0 10px;
    border-radius: 999px;
    background: #1a1d2e;
    color: #fff;
    font-size: .78rem;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s ease;
}
    .pod-show-out:hover { background: var(--pod-purple); color: #fff; }

@media (max-width: 575px) {
    .pod-picker-results { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 10px; }
    .pod-picker-results--episodes { grid-template-columns: 1fr; }
    .pod-picker-results--episodes .pod-card { grid-template-columns: 76px minmax(0, 1fr); gap: 12px; padding: 8px; }
    .pod-card-title { font-size: .84rem; }
    .pod-show-head { gap: 12px; padding: 12px; }
    .pod-show-art { width: 80px; height: 80px; border-radius: 12px; }
    .pod-show-title { font-size: 1rem; }
}

/* ── Player (Home tab) ──────────────────────────────────────────────── */
.ch-pod-player { margin: 0 14px 20px; }

.pod-listen { display: flex; flex-direction: column; gap: 12px; }
.pod-player {
    display: flex;
    gap: 16px;
    padding: 14px;
    border-radius: 18px;
    background: linear-gradient(135deg, #1d1530 0%, #1a1d2e 60%, #12302d 100%);
    color: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .22);
}
    .pod-player[hidden] { display: none; }
.pod-player-art {
    flex: 0 0 auto;
    width: 112px;
    height: 112px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
}
.pod-player-main { flex: 1 1 auto; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pod-player-eyebrow { display: block; color: #c9b3f5; font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.pod-player-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: .98rem;
    font-weight: 700;
    line-height: 1.3;
}
/* Scrubber: a thin track filled to --pod-pct, with a round thumb. */
.pod-scrub {
    --pod-pct: 0%;
    width: 100%;
    height: 4px;
    margin: 6px 0 0;
    border-radius: 999px;
    background: linear-gradient(to right, #5fd3c8 var(--pod-pct), rgba(255, 255, 255, .22) var(--pod-pct));
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}
    .pod-scrub::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .4); }
    .pod-scrub::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: #fff; }
    .pod-scrub:focus-visible { outline: 2px solid #5fd3c8; outline-offset: 4px; }
.pod-player-times { display: flex; justify-content: space-between; margin-top: 4px; color: rgba(255, 255, 255, .65); font-size: .72rem; font-variant-numeric: tabular-nums; }
.pod-player-controls { display: flex; align-items: center; gap: 14px; }
.pod-ctl {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #fff;
    opacity: .85;
    transition: background .15s ease, opacity .15s ease;
}
    .pod-ctl .material-icons { font-size: 26px; }
    .pod-ctl small { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -38%); font-size: .5rem; font-weight: 800; }
    .pod-ctl:hover { background: rgba(255, 255, 255, .1); opacity: 1; }
.pod-play {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: #1a1d2e;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
    transition: transform .15s ease;
}
    .pod-play .material-icons { font-size: 30px; }
    .pod-play:hover { transform: scale(1.06); }
    .pod-player.is-loading .pod-play .material-icons { animation: podPulse 1s ease-in-out infinite; }
.pod-speed {
    min-width: 46px;
    height: 28px;
    margin-left: auto;
    padding: 0 8px;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 999px;
    background: transparent;
    color: #fff;
    font-size: .76rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
    .pod-speed:hover { background: rgba(255, 255, 255, .1); }
.pod-error { margin: 0; color: #ffb4ab; font-size: .78rem; }
    .pod-error[hidden] { display: none; }

/* A show pick's recent episodes. */
.pod-ep-list { margin: 0; padding: 4px; list-style: none; border: 1px solid #eef0f4; border-radius: 16px; background: #fff; }
.pod-ep-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 12px;
    cursor: pointer;
    transition: background .15s ease;
}
    .pod-ep-row + .pod-ep-row { margin-top: 2px; }
    .pod-ep-row:hover { background: #f6f8fa; }
    .pod-ep-row:focus-visible { outline: 2px solid #2B988F; outline-offset: -2px; }
    .pod-ep-row.is-current { background: #f3faf9; }
.pod-ep-play { flex: 0 0 auto; color: #2B988F; font-size: 30px !important; }
    .pod-ep-row.is-playing .pod-ep-play { color: var(--pod-purple); }
.pod-ep-text { display: flex; flex-direction: column; min-width: 0; }
.pod-ep-title { overflow: hidden; color: #1a1d2e; font-size: .86rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.pod-ep-meta { color: #8a929c; font-size: .74rem; }

/* Embed mode: a facade until tapped, then the official player. */
.pod-embed-facade {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 12px;
    border: 0;
    border-radius: 16px;
    background: linear-gradient(135deg, #f7f2fe, #eef7f6);
    color: #1a1d2e;
    text-align: left;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .1);
    transition: box-shadow .15s ease, transform .15s ease;
}
    .pod-embed-facade:hover { box-shadow: 0 6px 18px rgba(15, 23, 42, .15); transform: translateY(-1px); }
    .pod-embed-facade img { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; flex: 0 0 auto; }
    .pod-embed-facade--spotify { background: linear-gradient(135deg, #e9f8ef, #f4f6f8); }
.pod-embed-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1 1 auto; }
.pod-embed-title { overflow: hidden; font-weight: 700; font-size: .92rem; text-overflow: ellipsis; white-space: nowrap; }
.pod-embed-sub { color: #6b7380; font-size: .78rem; }
.pod-embed-play { color: var(--pod-purple); font-size: 40px !important; }
    .pod-embed-facade--spotify .pod-embed-play { color: #1DB954; }
.pod-embed-frame { width: 100%; height: 175px; border: 0; border-radius: 14px; background: #f4f6f8; }
    .pod-embed-frame--spotify { height: 232px; }

/* Links row: Apple Podcasts / Spotify. */
.pod-links { display: flex; flex-wrap: wrap; gap: 8px; }
.pod-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 34px;
    padding: 0 15px 0 12px;
    border: 1px solid #e3e7ee;
    border-radius: 999px;
    background: #fff;
    color: #1a1d2e;
    font-size: .8rem;
    font-weight: 600;
    text-decoration: none;
    transition: border-color .15s ease, background .15s ease, color .15s ease;
}
    .pod-link .fa-podcast { color: var(--pod-purple); }
    .pod-link .fa-spotify { color: #1DB954; font-size: 1rem; }
    .pod-link:hover { border-color: #2B988F; background: #f4faf9; color: #1a1d2e; }
/* Links-only clubs: the links are the whole player, so make them bigger. */
.pod-listen--links .pod-link { height: 42px; padding: 0 18px 0 14px; font-size: .88rem; }

@media (max-width: 575px) {
    .pod-player { gap: 12px; padding: 12px; }
    .pod-player-art { width: 76px; height: 76px; }
    .pod-player-title { font-size: .9rem; }
    .pod-player-controls { gap: 8px; }
}

/* ── Hero (club page) ───────────────────────────────────────────────── */
/* The cover plays an episode pick in place (podcast-player.js data-pod-toggle). */
.m-hero-art-link--pod {
    position: relative;
    display: block;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
}
.m-hero-pod-play {
    position: absolute;
    top: 50%;
    left: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    color: #1a1d2e;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
    transform: translate(-50%, -50%);
    pointer-events: none;
    transition: transform .15s ease, background .15s ease, color .15s ease;
}
    .m-hero-pod-play .material-icons { font-size: 28px; }
    .m-hero-art-link--pod:hover .m-hero-pod-play { transform: translate(-50%, -50%) scale(1.08); }
    .m-hero-art-link--pod.is-current .m-hero-pod-play { background: #2B988F; color: #fff; }
    .m-hero-art-link--pod.is-loading .m-hero-pod-play .material-icons { animation: podPulse 1s ease-in-out infinite; }
/* The brand badge: Apple Podcasts purple (or Spotify green). */
.m-hero-spotify.m-hero-podcast { background: var(--pod-purple); }
.m-hero-spotify.m-hero-podcast--spotify { background: #1DB954; }
@media (min-width: 992px) {
    .m-hero-podcast .fa-podcast { color: #c9a6ff; }
    .m-hero-podcast:hover .fa-podcast { color: #fff; }
    .m-hero-podcast--spotify .fa-spotify { color: #1DB954; }
}
.m-hero-pod-dur { opacity: .7; }

@keyframes podPulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) {
    .pod-card-play.is-loading .material-icons,
    .pod-player.is-loading .pod-play .material-icons,
    .m-hero-art-link--pod.is-loading .m-hero-pod-play .material-icons { animation: none; }
}

/* Archive tab: the "Apple Podcasts" link-out button (archive.js). */
.arch-spotify-btn.arch-ext-podcast {
    background: rgba(142, 68, 239, .12);
    color: var(--pod-purple) !important;
    border-color: rgba(142, 68, 239, .3);
}
    .arch-spotify-btn.arch-ext-podcast:hover {
        background: var(--pod-purple);
        color: #fff !important;
        box-shadow: 0 0 14px rgba(142, 68, 239, .35);
    }

/* Desktop sidebar "Listen" card (#podListenWidget, dash-mobile-layout.php):
   ~280px wide, and the hero above already shows the artwork. */
#podListenWidget .pod-player { padding: 12px 14px; border-radius: 14px; }
#podListenWidget .pod-player-art { display: none; }
#podListenWidget .pod-player-title { font-size: .88rem; }
#podListenWidget .pod-player-controls { gap: 6px; }
#podListenWidget .pod-play { width: 42px; height: 42px; }
#podListenWidget .pod-play .material-icons { font-size: 26px; }
#podListenWidget .pod-embed-facade img { width: 52px; height: 52px; }
#podListenWidget .pod-embed-frame { height: 160px; }
#podListenWidget .pod-embed-frame--spotify { height: 152px; }
#podListenWidget .pod-ep-list { max-height: 260px; overflow-y: auto; }
#podListenWidget .pod-link { height: 32px; padding: 0 12px 0 10px; font-size: .76rem; }
