/* ── Search bar ──────────────────────────────────────── */
.filter-bar {
    background: white;
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.filter-bar-label {
    font-size: 13px;
    color: #666;
    font-weight: bold;
    margin-right: 2px;
}

#mediaSearch {
    flex: 1;
    min-width: 200px;
    padding: 8px 14px;
    border: 1px solid #ccc;
    border-radius: 20px;
    font-size: 14px;
    font-family: inherit;
}

.media-result-count {
    font-size: 12px;
    color: #888;
    white-space: nowrap;
}

/* Format filter chips — see renderFormatFilterBar() in media.js. Button
   classes themselves (.dir-filter-btn/.type-filter-btn/.active-teal/
   .active) are defined in shared-styles.css (loaded site-wide) and
   reused as-is, matching the performer directory's type filter. */
.format-filter-bar {
    background: white;
    border-radius: 8px;
    padding: 10px 18px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

/* Format chips — fully self-contained (not reusing shared-styles.css's
   .dir-filter-btn/.type-filter-btn, whose "active" state didn't carry
   over the white text here). Un-selected: plain outline. Selected
   (.active): solid green fill, white text. */
.format-chip {
    font: inherit;
    font-size: 12.5px;
    font-weight: 600;
    padding: 5px 13px;
    border-radius: 20px;
    border: 1px solid #a5d6a7;
    background: white;
    color: #2e7d32;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.format-chip:hover {
    background: #e8f5e9;
}

.format-chip.active {
    background: #2e7d32;
    border-color: #2e7d32;
    color: white;
}

.format-chip.active:hover {
    background: #276029;
}

.format-chip-meta {
    font-style: italic;
}

/* Series-lock banner — shown when the page is opened with
   ?series=<podcast_id> (see readSeriesLockFromUrl() in media.js), e.g.
   from a 🌍 WSC/TTTO badge on the performers page. */
.series-lock-banner {
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    border-radius: 8px;
    padding: 10px 16px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    font-size: 13.5px;
    color: #2e7d32;
    font-weight: bold;
}

.series-lock-clear {
    font-weight: normal;
    font-size: 12.5px;
    color: #2e7d32;
    text-decoration: underline;
}

/* ── Section chrome ──────────────────────────────────── */
.media-section {
    margin-bottom: 34px;
}

.media-section-heading {
    font-size: 20px;
    color: #333;
    margin: 0 0 4px 0;
    text-align: left;
    font-style: normal;
}

.media-section-sub {
    font-size: 13px;
    color: #888;
    margin: 0 0 16px 0;
}

.media-empty-msg,
#loadingMsg,
#noResultsMsg {
    background: white;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    color: #888;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

/* ── Performer groups (collapsible — see makeMediaGroupDetails() in
    media.js). Nothing inside a group is built until it's opened, so
    collapsed performers cost nothing: no video-card thumbnails, no audio
    rows, no fetches. ─────────────────────────────────────────────────── */
.media-group-details {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    margin-bottom: 10px;
    overflow: hidden;
}

.media-group-summary {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 12px 16px;
    cursor: pointer;
    list-style: none;
    user-select: none;
    font-size: 15px;
    font-weight: 700;
    color: #2e7d32;
}

.media-group-summary::-webkit-details-marker {
    display: none;
}

.media-group-summary::before {
    content: "▶";
    font-size: 11px;
    margin-right: 2px;
    transition: transform 0.2s ease;
    display: inline-block;
    flex-shrink: 0;
}

details.media-group-details[open] > .media-group-summary::before {
    transform: rotate(90deg);
}

.media-group-summary a {
    color: inherit;
    text-decoration: none;
}

.media-group-summary a:hover {
    text-decoration: underline;
}

.media-group-count {
    font-weight: 400;
    color: #888;
    font-size: 12.5px;
}

.media-group-body {
    padding: 4px 16px 16px;
    border-top: 1px solid #eee;
}

/* ── Video cards (same component as the Video Trailers section
    on new_troubadours_flyers.html) ─────────────────────── */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.video-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.video-card-thumb {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #222;
    border: none;
    cursor: pointer;
    padding: 0;
    box-sizing: border-box;
    overflow: hidden;
}

.video-card-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.video-card-thumb-img.revealed {
    opacity: 1;
}

/* Highlight whichever thumbnail is currently loaded into the shared
   now-playing panel below (see playVideoInPanel() in media.js). */
.video-card-thumb.playing::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 3px solid #2e7d32;
    box-sizing: border-box;
    pointer-events: none;
}

/* ── Shared "now playing" panel — one per page, not one per thumbnail.
   Clicking any thumbnail (in any performer group) points this at that
   video and scrolls it into view; a real, fixed-size, always-legible
   player rather than a thumbnail card awkwardly stretching in place. See
   getNowPlayingPanel()/playVideoInPanel() in media.js. ────────────────── */
.now-playing-panel {
    position: relative;
    background: #111;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    max-width: 800px;
    margin: 0 auto 24px;
    overflow: hidden;
}

.now-playing-close {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.65);
    color: white;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.now-playing-close:hover {
    background: rgba(0, 0, 0, 0.85);
}

.now-playing-frame-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
}

.now-playing-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.now-playing-title {
    padding: 10px 14px;
    color: white;
    font-size: 0.95em;
    font-weight: 600;
}

.video-card-caption {
    padding: 10px 12px;
}

.video-card-title {
    font-weight: 600;
    font-size: 0.92em;
    margin-bottom: 2px;
}

/* Source/format badges — same convention as the performer profile page's
   Videos section (.perf-video-source-badge/.perf-video-format-badge in
   performers-styles.css). */
.video-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 4px;
}

.video-card-source-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: bold;
    padding: 1px 8px;
    border-radius: 20px;
    white-space: nowrap;
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.video-card-format-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: normal;
    padding: 1px 8px;
    border-radius: 20px;
    white-space: nowrap;
    text-transform: capitalize;
    background: #f5f5f5;
    color: #777;
    border: 1px solid #ddd;
}

/* ── Podcast appearance rows (same component as the performer
    profile's Podcast Appearances section) — title only, audio
    lazy-loaded on click, nothing plays until asked for ────── */
.audio-list {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.audio-row {
    padding: 10px 14px;
    border-top: 1px solid #eee;
}

.audio-row:first-child {
    border-top: none;
}

.audio-row-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.audio-row-body {
    min-width: 0;
    flex: 1;
}

.audio-row-title {
    font-size: 13.5px;
    color: #333;
    line-height: 1.4;
}

.audio-row-meta {
    font-size: 11.5px;
    color: #999;
    margin-top: 2px;
}

.audio-row-meta a {
    color: inherit;
}

.audio-row-format-badge {
    display: inline-block;
    margin-top: 4px;
    font-size: 10px;
    font-weight: normal;
    padding: 1px 8px;
    border-radius: 20px;
    white-space: nowrap;
    text-transform: capitalize;
    background: #f5f5f5;
    color: #777;
    border: 1px solid #ddd;
}

.audio-preview-btn {
    flex-shrink: 0;
    font: inherit;
    font-size: 11px;
    font-weight: bold;
    color: #2e7d32;
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    border-radius: 20px;
    padding: 4px 10px;
    cursor: pointer;
}

.audio-preview-btn:hover {
    background: #d4ecd6;
}

.audio-player-holder {
    margin-top: 8px;
}

.audio-player-holder audio {
    width: 100%;
    display: block;
    height: 32px;
}