/* ═══════════════════════════════════════════════════════════════
   quicksack.li — style.css
   Dark film-noir aesthetic: deep blacks, dark red accents, crisp type
   ═══════════════════════════════════════════════════════════════ */

/* ── Variables ─────────────────────────────────────────────────── */
:root {
    --bg-main:        #111111;
    --bg-card:        #1c1c1c;
    --bg-card-hover:  #222222;
    --bg-elevated:    #242424;
    --accent:         #8b0000;
    --accent-bright:  #a00000;
    --accent-glow:    rgba(139,0,0,0.25);
    --text-primary:   #f0f0f0;
    --text-secondary: #cccccc;
    --text-muted:     #b0b0b0;
    --border:         #2e2e2e;
    --border-light:   #3a3a3a;
    --play-btn:       #b50000;
    --play-btn-hover: #cc0000;
    --cache-btn:      #176017;
    --cache-btn-cached: #1a6b1a;
    --progress-bar:   #00bfff;
    --link-color:     #7cb9e8;
    --font-main:      'Source Sans 3', 'Segoe UI', system-ui, sans-serif;
    --font-display:   'Oswald', 'Impact', sans-serif;
    --radius:         6px;
    --radius-lg:      10px;
    --shadow:         0 2px 12px rgba(0,0,0,0.5);
    --shadow-card:    0 1px 4px rgba(0,0,0,0.4);
    --player-height:  2px;       /* collapsed height — player.js removes .footer-player--collapsed on first play to expand */
    --transition:     0.18s ease;
}

/* ── Reset & Base ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    background: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 16px;
    line-height: 1.6;
    min-height: 100vh;
    padding-bottom: calc(var(--player-height) + 20px);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover { color: #fff; }

button { cursor: pointer; font-family: var(--font-main); }

img { max-width: 100%; display: block; }

/* ══════════════════════════════════════════════════════════════════
   PAGE-TOP STICKY BLOCK
   .page-top wraps header + upcoming + filter as one sticky unit.
   The whole block sticks at top:0. No JS-measured offsets needed.
   body.scrolled drives all transitions via CSS.
   ══════════════════════════════════════════════════════════════════ */

.page-top {
    position: sticky;
    top: 0;
    z-index: 100;
    /* Contain the sticky children so they stack inside this block */
}

/* ── Header ─────────────────────────────────────────────────────── */
.site-header {
    background: #0d0d0d;
    border-bottom: 2px solid var(--accent);
    padding: 18px 0 14px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.7);
    transition: padding 0.35s ease;
}

body.scrolled .site-header {
    padding: 8px 0;
}

.header-inner {
    padding: 0 40px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 12px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    overflow: hidden;
}

.site-logo-link {
    display: block;
    flex-shrink: 0;
    line-height: 0; /* remove inline gap below img */
}

.site-logo {
    height: 120px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 6px;
    transition: height 0.35s ease;
}
body.scrolled .site-logo {
    height: 40px;
}

.header-titles { min-width: 0; }

.header-titles h1 {
    font-family: var(--font-display);
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #fff;
    line-height: 1.1;
    white-space: nowrap;
}

.site-tagline {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-top: 2px;
    line-height: 1.3;
    max-width: 560px;
}

.episode-count-header {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-top: 3px;
}

.episode-count-number {
    color: var(--play-btn);
    font-weight: 600;
}

/* Collapsible lines — hidden when scrolled */
.header-collapsible {
    overflow: hidden;
    max-height: 4em;
    opacity: 1;
    transition: max-height 0.3s ease, opacity 0.2s ease, margin-top 0.3s ease;
}
body.scrolled .header-collapsible {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
}

/* ── Nav ────────────────────────────────────────────────────────── */
.site-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: stretch;
    justify-self: end;
    flex-shrink: 0;
}

.nav-link {
    text-align: center;
}

/* Wide screens or scrolled state: buttons side by side */
@media (min-width: 881px) {
    .site-nav { flex-direction: row; align-items: center; }
}
body.scrolled .site-nav {
    flex-direction: row;
    align-items: center;
}

.nav-link {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
    padding: 6px 14px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius);
    background: transparent;
    transition: all var(--transition);
}
.nav-link:hover {
    color: #fff;
    border-color: var(--accent);
    background: var(--accent-glow);
}
.nav-link.active {
    color: #fff;
    background: var(--accent);
    border-color: var(--accent);
}

/* ── Upcoming Bar ───────────────────────────────────────────────── */
.upcoming-bar {
    background: linear-gradient(90deg, #3a0000 0%, #1e0000 100%);
    border-bottom: 2px solid var(--accent);
    font-size: 1rem;
    overflow: hidden;
    max-height: 160px;
    opacity: 1;
    transition: max-height 0.25s ease, opacity 0.2s ease, border-width 0.25s ease;
}

body.scrolled .upcoming-bar {
    max-height: 0;
    opacity: 0;
    border-bottom-width: 0;
}

.upcoming-bar-inner {
    padding: 9px 40px 11px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.upcoming-label {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent-bright);
    flex-shrink: 0;
}

.upcoming-title {
    color: var(--text-primary);
    font-weight: 600;
    flex: 1 1 auto;
    min-width: 0;
}

.upcoming-title-link {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: rgba(240,240,240,0.35);
    text-underline-offset: 3px;
    transition: text-decoration-color var(--transition), color var(--transition);
}
.upcoming-title-link:hover {
    color: #fff;
    text-decoration-color: var(--accent-bright);
}

.upcoming-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.upcoming-links a:hover {
    color: #fff;
    border-color: var(--accent);
    background: var(--accent-glow);
}

/* ── Filter Section ─────────────────────────────────────────────── */
.filter-section {
    background: #161616;
    border-bottom: 1px solid var(--border);
}

.filter-section.shadow {
    box-shadow: 0 2px 12px rgba(0,0,0,0.5);
}

/* ── Filter details/summary (replaces JS toggle) ────────────────── */
.filter-details {
    /* No extra styling — inherits from filter-section */
}

/* The summary IS the toggle bar */
.filter-toggle-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 40px;
    cursor: pointer;
    user-select: none;
    list-style: none;  /* remove default details marker */
    min-height: 36px;
}
/* Remove default marker in all browsers */
.filter-toggle-bar::-webkit-details-marker { display: none; }
.filter-toggle-bar::marker { display: none; }

.filter-toggle-label {
    font-family: var(--font-display);
    font-size: 1rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}
.filter-toggle-label .filter-active-hint {
    color: var(--accent-bright);
    font-style: italic;
    font-family: var(--font-main);
    text-transform: none;
    letter-spacing: 0;
    font-size: 1rem;
}

.filter-toggle-chevron {
    color: var(--text-muted);
    font-size: 1rem;
    transition: transform 0.2s ease;
    line-height: 1;
}
/* Rotate chevron when details is open */
.filter-details[open] .filter-toggle-chevron {
    transform: rotate(180deg);
}

/* Filter inner — animated open/close via max-height */
.filter-inner {
    padding: 0 40px;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.25s ease, padding 0.25s ease;
}
.filter-details[open] .filter-inner {
    max-height: 300px;  /* tall enough for all filter controls */
    padding: 0 40px 14px;
}

/* Wide screens at top: open by default */
@media (min-width: 881px) {
    body:not(.scrolled) .filter-details[open] .filter-inner,
    body:not(.scrolled) .filter-inner {
        max-height: 300px;
        padding: 0 40px 14px;
    }
}

/* Search row */
.filter-search-row { width: 100%; }

.search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 12px;
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    pointer-events: none;
    flex-shrink: 0;
}

.filter-input {
    width: 100%;
    background: var(--bg-card);
    border: 2px solid var(--border-light);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 1rem;
    padding: 9px 38px 9px 38px;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.filter-input:focus {
    border-color: var(--accent-bright);
    box-shadow: 0 0 0 2px var(--accent-glow);
}
.filter-input::placeholder { color: var(--text-muted); }

.filter-clear {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    padding: 4px 6px;
    border-radius: 3px;
    transition: color var(--transition);
}
.filter-clear:hover { color: var(--text-primary); }

/* Secondary row: filter dropdowns left, sort right */
.filter-secondary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    row-gap: 8px;
    padding-top: 8px;
}

.filter-dropdowns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.sort-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
    margin-left: auto;
}

.filter-select {
    background: var(--bg-card);
    border: 2px solid var(--border-light);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 1rem;
    padding: 6px 28px 6px 10px;
    outline: none;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23666'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 9px center;
    transition: border-color var(--transition);
}
.filter-select:focus { border-color: var(--accent-bright); }
.filter-select option { background: #1c1c1c; }
.filter-select optgroup { background: #111; color: var(--text-muted); font-style: normal; }

.sort-btn {
    background: transparent;
    border: 2px solid var(--border-light);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-size: 1rem;
    padding: 6px 14px;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}
.sort-btn:hover {
    color: #fff;
    border-color: var(--accent);
    background: var(--accent-glow);
}

/* ── Filter secondary row: two-column grid at ≤880px ────────────── */
/* Dropdowns stack vertically on left, sort+random stack on right   */
@media (max-width: 880px) {
    .filter-secondary-row {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 8px;
        align-items: start;
        padding-top: 8px;
    }
    .filter-dropdowns {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }
    .filter-dropdowns .filter-select {
        width: 100%;
    }
    .sort-controls {
        flex-direction: column;
        align-items: stretch;
        margin-left: 0;
        gap: 6px;
    }
    .sort-controls .filter-select,
    .sort-controls .sort-btn {
        width: 100%;
        text-align: center;
    }
}
.episode-counter-bar {
    padding: 8px 40px 4px;
}

.episode-counter {
    font-size: 1rem;
    color: var(--text-muted);
    font-style: italic;
}

/* ── Episode List ───────────────────────────────────────────────── */
.episode-list-wrap {
    padding: 8px 40px 40px;
}

.episode-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Loading state */
.loading-state {
    text-align: center;
    padding: 60px 40px;
    color: var(--text-muted);
}

.loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--accent-bright);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 40px;
    color: var(--text-muted);
}

.link-btn {
    background: none;
    border: none;
    color: var(--link-color);
    font-size: inherit;
    text-decoration: underline;
    cursor: pointer;
}
.link-btn:hover { color: #fff; }

/* ── Episode Card ───────────────────────────────────────────────── */
.episode-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 3px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
    position: relative;
    animation: fadeInCard 0.2s ease both;
}

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

.episode-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
    border-left-color: var(--accent);
    box-shadow: var(--shadow-card);
}

.episode-card.is-playing {
    border-left-color: var(--accent-bright);
    background: #1a0d0d;
    box-shadow: 0 0 0 1px var(--accent-glow), var(--shadow-card);
}

.episode-card.is-highlighted {
    border-left-color: #00bfff;
    box-shadow: 0 0 0 2px rgba(0,191,255,0.2);
}

/* Card header */
.card-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 10px;
}

.card-poster {
    flex-shrink: 0;
    width: 52px;
}
.card-poster img {
    width: 52px;
    height: 78px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--border-light);
}
.card-poster-placeholder {
    width: 52px;
    height: 78px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1.31rem;
}

.card-title-block { flex: 1; min-width: 0; }

.card-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--text-primary);
    line-height: 1.3;
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.card-title a.permalink {
    font-size: 1rem;
    color: var(--text-muted);
    text-decoration: none;
    flex-shrink: 0;
    transition: color var(--transition);
}
.card-title a.permalink:hover { color: var(--accent-bright); }

.card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.card-meta-item {
    font-size: 1rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.card-meta-item.type-badge {
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: 3px;
    padding: 1px 7px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.card-meta-item.type-badge--filter {
    cursor: pointer;
    transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.card-meta-item.type-badge--filter:hover {
    border-color: var(--accent);
    color: #fff;
    background: var(--accent-glow);
}

.card-original-title {
    font-size: 1rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 2px;
}

.card-genres {
    margin-top: 3px;
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.genre-tag {
    font-size: 0.875rem;
    background: rgba(139,0,0,0.15);
    border: 1px solid rgba(139,0,0,0.4);
    color: #cc8888;
    border-radius: 3px;
    padding: 1px 7px;
    letter-spacing: 0.03em;
}

.genre-tag--filter {
    cursor: pointer;
    transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.genre-tag--filter:hover {
    background: rgba(139,0,0,0.35);
    border-color: var(--accent-bright);
    color: #ffaaaa;
}

/* Description */
/* Description — full text by default (no-JS safe).
   JS adds .js-clamp to activate 2-line clamping with show/hide toggle. */
.card-description {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.55;
    margin: 10px 0;
    overflow: hidden;
    position: relative;
    transition: max-height 0.3s ease;
}

.card-description p { margin-bottom: 6px; }
.card-description p:last-child { margin-bottom: 0; }

.desc-toggle {
    background: none;
    border: none;
    font-size: 1rem;
    color: var(--text-muted);
    padding: 0;
    margin-bottom: 10px;
    text-decoration: underline;
    transition: color var(--transition);
}
.desc-toggle:hover { color: var(--text-primary); }

/* Card footer / action buttons */
.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.card-actions {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

/* Action buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 40px;
    padding: 0 14px;
    background: transparent;
    border: 2px solid var(--border-light);
    border-radius: var(--radius);
    font-family: var(--font-main);
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition);
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    box-sizing: border-box;
}
.btn:hover {
    color: #fff;
    border-color: var(--accent);
    background: var(--accent-glow);
}

/* Play — primary action, always red fill */
.btn-play {
    background: var(--play-btn);
    border-color: var(--play-btn);
    color: #fff;
    font-weight: 600;
    min-width: 82px;
    justify-content: center;
}
.btn.btn-play:hover { background: var(--play-btn-hover); border-color: var(--play-btn-hover); color: #fff; }
.btn.btn-play.is-playing { background: rgba(139,0,0,0.3); border-color: var(--accent-bright); color: var(--text-primary); }
.btn.btn-play.is-playing:hover { background: var(--play-btn); border-color: var(--play-btn); color: #fff; }

/* Cache — green accent when cached */
.btn-cache.is-cached {
    background: rgba(26,122,26,0.15);
    border-color: var(--cache-btn);
    color: #6fcf6f;
}
.btn-cache:not(.is-cached):hover { border-color: var(--cache-btn); color: #6fcf6f; background: rgba(26,122,26,0.1); }

/* Copy — green flash when copied */
.btn-copy.copied { color: #6fcf6f; border-color: var(--cache-btn); background: rgba(26,122,26,0.1); }

/* External links row */
.card-external-links {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ext-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 40px;
    padding: 0 14px;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    border: 2px solid var(--border-light);
    border-radius: var(--radius);
    background: transparent;
    text-decoration: none;
    transition: all var(--transition);
    white-space: nowrap;
    box-sizing: border-box;
}
.ext-link:hover {
    color: #fff;
    border-color: var(--accent);
    background: var(--accent-glow);
}

.ext-link-logo {
    display: block;
    height: 20px;
    width: auto;
    flex-shrink: 0;
    vertical-align: middle;
}

.ext-link-label {
    line-height: 1;
    vertical-align: middle;
}

/* Hide text label below 660px — show icon only */
@media (max-width: 660px) {
    .ext-link-label { display: none; }
    .ext-link { padding: 0 10px; }
}

/* ── Footer Player ──────────────────────────────────────────────── */
.footer-player {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: var(--player-height);
    background: #0d0d0d;
    border-top: 2px solid var(--accent);
    z-index: 200;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.6);
}

.player-inner {
    padding: 6px 40px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    gap: 4px;
}

.player-idle {
    width: 100%;
    text-align: center;
}

.player-idle-text {
    font-size: 1rem;
    color: var(--text-muted);
    font-style: italic;
}

/* ── Stats Stub ─────────────────────────────────────────────────── */
.stats-stub {
    padding: 80px 40px;
}

.stats-stub-inner {
    max-width: 480px;
    margin: 0 auto;
    text-align: center;
}

.stats-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 24px;
}

.stats-stub h2 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.stats-stub p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 28px;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent);
    color: #fff;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 10px 22px;
    border-radius: var(--radius);
    text-decoration: none;
    transition: background var(--transition);
    border: none;
}
.btn-primary:hover { background: var(--accent-bright); color: #fff; }

/* ── Scrollbar ──────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: var(--bg-main); }
::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #555; }

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .header-inner { padding: 0 16px; gap: 8px; }
    .header-titles h1 { font-size: 1.1rem; white-space: normal; }
    .upcoming-bar-inner { padding: 9px 16px; }
    .filter-toggle-bar { padding: 7px 16px; }
    .filter-details[open] .filter-inner { padding: 0 16px 14px; }
    .card-header { gap: 10px; }
    .card-footer { flex-direction: column; align-items: flex-start; }
    .card-external-links { margin-top: 4px; }
    .episode-list-wrap { padding: 6px 16px 30px; }
    .episode-counter-bar { padding: 8px 16px 4px; }
    :root { --player-height: 2px; }
    body:has(.footer-player:not(.footer-player--collapsed)) { --player-height: 120px; }
}

@media (max-width: 480px) {
    .card-title { font-size: 1rem; }
    .btn { font-size: 1rem; padding: 0 9px; }
}

@media (max-width: 440px) {
    /* Hide tagline in header */
    .site-tagline { display: none; }
    /* Tighten episode count line so it fits on small phones */
    .episode-count-header { font-size: 0.85rem; line-height: 1.2; margin-top: 2px; }
    /* Icon-only cache / copy link / stats buttons */
    .btn-cache .btn-label,
    .btn-copy .btn-label,
    .btn-stats .btn-label { display: none; }
}

/* ── No-JS notice ───────────────────────────────────────────────── */
.nojs-notice {
    background: #2a1a00;
    border: 1px solid #7a4a00;
    border-radius: var(--radius);
    color: #f0c060;
    font-size: 1rem;
    padding: 10px 16px;
    margin-bottom: 10px;
}

/* ── Decade option in year dropdown ────────────────────────────── */
.filter-select option.decade-option {
    color: var(--accent-bright);
    font-style: italic;
    background: #1a0000;
}

/* ── Scroll anchors ────────────────────────────────────────────── */
#top    { scroll-margin-top: 0; }
#bottom { scroll-margin-bottom: calc(var(--player-height) + 20px); }

/* ── Scroll nav (jump to top / bottom) ─────────────────────────── */
.scroll-nav {
    position: fixed;
    right: 18px;
    bottom: calc(var(--player-height) + 14px);
    z-index: 150;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.scroll-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: #1e1e1e;
    border: 2px solid var(--border-light);
    border-radius: 50%;
    color: var(--text-muted);
    font-size: 1rem;
    text-decoration: none;
    transition: all var(--transition);
    line-height: 1;
    cursor: pointer;
    font-family: var(--font-main);
}
.scroll-nav-btn:hover {
    background: var(--accent);
    border-color: var(--accent-bright);
    color: #fff;
}

@media (max-width: 768px) {
    .scroll-nav { right: 10px; }
    .scroll-nav-btn { width: 30px; height: 30px; font-size: 1rem; }
}
/* ═══════════════════════════════════════════════════════════════════════════
   player-additions.css  —  appended to style.css
   ═══════════════════════════════════════════════════════════════════════════ */


/* ── Card <audio> fallback (no-JS only) ───────────────────────────────────── */

.card-audio-fallback {
    display: none;
    width: 100%;
    margin-top: 10px;
    accent-color: var(--progress-bar);
    color-scheme: dark;
}


/* ── Footer no-JS notice ──────────────────────────────────────────────────── */

.player-nojs-notice {
    width: 100%;
    text-align: center;
    font-size: 1rem;
    color: var(--text-muted);
    font-style: italic;
    padding: 0 20px;
    line-height: 110px;
}


/* ── Active footer player ─────────────────────────────────────────────────── */

.qs-player {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 4px;
    font-family: var(--font-main);
    font-size: 1rem;
    color: var(--text-primary);
}

/* ── Row 1: main ─────────────────────────────────────────────────────────── */

.qs-row-main {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-width: 0;
}

/* Play / Pause */
.qs-play-btn {
    flex: 0 0 auto;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    padding: 3px;
    text-align: center;
    transition: color var(--transition);
}
.qs-play-btn:hover      { color: var(--progress-bar); }
.qs-play-btn.is-playing { color: var(--progress-bar); }

/* Progress slot */
.qs-progress-slot {
    flex: 1 1 auto;
    min-width: 0;
    height: 32px;
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
}

/* Plain bar */
.qs-bar-track {
    width: 100%;
    height: 6px;
    background: #333;
    border-radius: 3px;
    overflow: hidden;
    cursor: pointer;
    transition: height 0.12s ease;
}
.qs-bar-track:hover { height: 10px; }

.qs-bar-fill {
    height: 100%;
    width: 0;
    background: var(--progress-bar);
    border-radius: 3px;
    pointer-events: none;
}

.qs-progress-slot > div { width: 100%; }

/* Time display */
.qs-time {
    flex: 0 0 auto;
    font-size: 1rem;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
    white-space: nowrap;
    letter-spacing: 0.01em;
}
.qs-time-sep { color: var(--text-secondary); margin: 0 2px; }

/* Volume */
/* Volume button — replaces always-visible slider */
.qs-vol-btn {
    flex: 0 0 auto;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1;
    padding: 3px;
    cursor: pointer;
    position: relative;
    transition: color var(--transition), border-color var(--transition), background var(--transition);
    display: flex;
    align-items: center;
}
.qs-vol-btn:hover,
.qs-vol-btn.is-open {
    color: #fff;
    border-color: var(--border-light);
    background: var(--bg-elevated);
}

/* Floating vertical slider popup */
.qs-vol-popup {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-elevated);
    border: 2px solid var(--border-light);
    border-radius: var(--radius);
    padding: 12px 10px;
    z-index: 300;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
    align-items: center;
    flex-direction: column;
    gap: 6px;
}
.qs-vol-popup.is-open {
    display: flex;
}

.qs-vol-popup input[type=range] {
    writing-mode: vertical-lr;
    direction: rtl;
    width: 24px;
    height: 80px;
    cursor: pointer;
    accent-color: var(--progress-bar);
    background: transparent;
    outline: none;
}

.qs-vol-pct {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    min-width: 28px;
    text-align: center;
}

.qs-clear-btn {
    flex: 0 0 auto;
    margin-left: auto;
}

/* Clear cached label — hidden below 660px */
.qs-clear-label {
    /* visible by default */
}
@media (max-width: 660px) {
    .qs-clear-label { display: none; }
}

/* ── Footer responsive ───────────────────────────────────────────────────── */

/* Footer buttons: 3px padding at all widths — no responsive overrides needed */

/* ── Row 2: sub controls ─────────────────────────────────────────────────── */

.qs-row-sub {
    display: flex;
    align-items: center;
    gap: 7px;
    width: 100%;
    min-width: 0;
    font-size: 1rem;
    color: var(--text-primary);
}

.qs-speed-label {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--text-primary);
    font-size: 1rem;
    white-space: nowrap;
}

.qs-speed {
    background: var(--bg-elevated);
    border: 2px solid var(--border-light);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 1rem;
    padding: 3px;
    cursor: pointer;
    outline: none;
}
.qs-speed:focus { border-color: var(--accent-bright); }

.qs-sub-btn {
    flex: 0 0 auto;
    background: transparent;
    border: 2px solid var(--border-light);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-size: 1rem;
    font-weight: 500;
    padding: 3px;
    cursor: pointer;
    white-space: nowrap;
    transition: color var(--transition), background var(--transition),
                border-color var(--transition);
}
.qs-sub-btn:hover {
    color: #fff;
    border-color: var(--accent);
    background: var(--accent-glow);
}

/* Episode title */
.qs-episode-title {
    flex: 1 1 0;          /* 0 base — never grows wider than available space */
    min-width: 0;
    width: 0;             /* belt-and-suspenders: no intrinsic width contribution */
    overflow: hidden;
    position: relative;
    padding: 0 4px;
    height: 1.4em;        /* fixed height so absolute inner doesn't collapse container */
}

/* Inner span absolutely positioned so it never affects flex sizing */
.qs-episode-title-inner {
    position: absolute;
    left: 4px;
    top: 0;
    white-space: nowrap;
    font-size: 1rem;
    line-height: 1.4em;
    color: var(--text-secondary);
    font-style: italic;
}

/* Marquee animation — only when .is-marquee present */
.qs-episode-title.is-marquee .qs-episode-title-inner {
    animation: marquee 18s linear infinite;
}
.qs-episode-title.is-marquee:hover .qs-episode-title-inner {
    animation-play-state: paused;
}

@keyframes marquee {
    0%   { transform: translateX(0); }
    15%  { transform: translateX(0); }
    85%  { transform: translateX(var(--marquee-offset, 0px)); }
    100% { transform: translateX(var(--marquee-offset, 0px)); }
}

/* Clear cache — same style as seek buttons */
.qs-clear-btn {
    flex: 0 0 auto;
    margin-left: auto;
}




/* ── Red text readability shadow ───────────────────────────────── */
.upcoming-label,
.genre-tag,
.card-meta-item.type-badge,
.filter-active-hint,
.nav-link.active,
.nav-link:hover {
    text-shadow: 0 1px 3px rgba(255,255,255,0.08), 0 0 8px rgba(255,255,255,0.04);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Player additions
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Audio progress bar ─────────────────────────────────────────────────── */
:root {
    --progress-bar: #a00000;   /* --accent-bright */
}

/* body.scrolled scroll state — see header section above */

/* old is-compact rules removed — body.scrolled handles all scroll state */

/* Audio player footer — collapsed to 2px before first play */
.footer-player--collapsed {
    height: 2px !important;
    overflow: hidden;
}

/* When expanded (class removed by player.js), use full height */
.footer-player:not(.footer-player--collapsed) {
    height: var(--player-height);
}

/* Once expanded, restore player-height to 110px for body padding + scroll-nav */
body:has(.footer-player:not(.footer-player--collapsed)) {
    --player-height: 110px;
}

/* ── Description clamping — JS adds .js-clamp to activate ──────────────── */
/* Without JS: no max-height, full text visible (no-JS fallback) */
.card-description {
    max-height: none;
}

/* JS present: clamp to 2 lines when .js-clamp is set */
.card-description.js-clamp {
    max-height: 3.6em;
    overflow: hidden;
}
.card-description.js-clamp.expanded {
    max-height: 600px;
}

/* No fade-to-black gradient — removed per request */

/* ── TMDb attribution ───────────────────────────────────────────────────── */
.tmdb-attribution {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 0 8px;
    margin-top: 10px;
    border-top: 1px solid var(--border);
}

.tmdb-logo {
    height: 20px;
    width: auto;
    opacity: 0.75;
    flex-shrink: 0;
}

.tmdb-text {
    font-size: 1rem;
    color: var(--text-muted);
}

.tmdb-text a {
    color: var(--text-secondary);
    text-decoration: underline;
}
.tmdb-text a:hover { color: #fff; }

