﻿/* ── TOKENS ──────────────────────────────────────────── */
:root {
    --bg-base: #0d0a14;
    --bg-surface: #120f1c;
    --bg-elevated: #18142a;
    --bg-hover: #1e1835;
    --border: rgba(167,139,250,.12);
    --border-hover: rgba(167,139,250,.38);
    --accent: #a78bfa;
    --accent-dim: rgba(167,139,250,.15);
    --accent-glow: rgba(167,139,250,.08);
    --violet-soft: #c4b5fd;
    --text-primary: #ede9fe;
    --text-muted: #6d6584;
    --text-dim: #4c4468;
    --active-bg: rgba(167,139,250,.11);
    --active-border: #a78bfa;
    --playing-glow: rgba(167,139,250,.28);
    --sidebar-w: 260px;
    --topbar-h: 56px;
    --radius: 8px;
}

/* light theme overrides */
html.theme-light {
    --bg-base: #f5f3ff;
    --bg-surface: #ffffff;
    --bg-elevated: #faf8ff;
    --bg-hover: #ede9fe;
    --border: rgba(109,65,252,.14);
    --border-hover: rgba(109,65,252,.36);
    --text-primary: #1e1b4b;
    --text-muted: #6b7280;
    --text-dim: #9ca3af;
    --active-bg: rgba(167,139,250,.18);
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color .2s, color .2s;
}

    /* grid texture */
    body::before {
        content: '';
        position: fixed;
        inset: 0;
        background-image: linear-gradient(rgba(167,139,250,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(167,139,250,.025) 1px, transparent 1px);
        background-size: 40px 40px;
        pointer-events: none;
        z-index: 0;
    }

/* ── TOPBAR ──────────────────────────────────────────── */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topbar-h);
    background: rgba(13,10,20,.93);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    gap: 1rem;
    z-index: 1040;
}

html.theme-light .topbar {
    background: rgba(245,243,255,.93);
}

.topbar .brand {
    font-family: 'DM Mono', monospace;
    font-size: .875rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: .05em;
    text-decoration: none;
    white-space: nowrap;
}

    .topbar .brand span {
        color: var(--text-muted);
        font-weight: 400;
    }

.topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.icon-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color .15s, color .15s, background .15s;
    font-size: .85rem;
    text-decoration: none;
}

    .icon-btn:hover {
        border-color: var(--border-hover);
        color: var(--accent);
        background: var(--accent-dim);
    }

/* ── SIDEBAR ─────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    width: var(--sidebar-w);
    height: calc(100vh - var(--topbar-h));
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1030;
    display: flex;
    flex-direction: column;
}

    .sidebar::-webkit-scrollbar {
        width: 4px;
    }

    .sidebar::-webkit-scrollbar-thumb {
        background: var(--border);
        border-radius: 4px;
    }

.sidebar-label {
    font-family: 'DM Mono', monospace;
    font-size: .63rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--text-dim);
    padding: 1.1rem 1.1rem .4rem;
}

.podcast-nav {
    list-style: none;
    margin: 0;
    padding: 0 .5rem 1.5rem;
}

    .podcast-nav li a {
        display: flex;
        align-items: center;
        gap: .6rem;
        padding: .42rem .75rem;
        border-radius: var(--radius);
        font-size: .82rem;
        font-weight: 500;
        color: var(--text-muted);
        text-decoration: none;
        transition: all .15s ease;
        border: 1px solid transparent;
    }

        .podcast-nav li a .pod-icon {
            width: 26px;
            height: 26px;
            border-radius: 6px;
            background: var(--bg-elevated);
            flex-shrink: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            font-family: 'DM Mono', monospace;
            font-size: .65rem;
            font-weight: 700;
            color: var(--text-dim);
            transition: all .15s;
        }

        .podcast-nav li a:hover {
            color: var(--text-primary);
            background: var(--bg-hover);
            border-color: var(--border);
        }

            .podcast-nav li a:hover .pod-icon {
                background: var(--accent-dim);
                color: var(--accent);
            }

        .podcast-nav li a.active {
            color: var(--accent);
            background: var(--active-bg);
            border-color: var(--active-border);
        }

            .podcast-nav li a.active .pod-icon {
                background: var(--accent-dim);
                color: var(--accent);
            }

/* offcanvas overrides */
.offcanvas.offcanvas-start {
    width: var(--sidebar-w) !important;
    background: var(--bg-surface) !important;
    border-right: 1px solid var(--border) !important;
}

.offcanvas-header {
    border-bottom: 1px solid var(--border);
    padding: .9rem 1.1rem;
}

/* ── MAIN ────────────────────────────────────────────── */
.main-content {
    margin-left: var(--sidebar-w);
    padding-top: var(--topbar-h);
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.content-inner {
    padding: 2rem 2rem 7rem;
    max-width: 860px;
}

/* ── PAGE HEADER ─────────────────────────────────────── */
.page-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1.1rem;
    border-bottom: 1px solid var(--border);
}

    .page-header h1 {
        font-size: 1.35rem;
        font-weight: 700;
        color: var(--text-primary);
        margin: 0 0 .2rem;
        display: flex;
        align-items: center;
        gap: .55rem;
    }

.live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 6px #22c55e;
    animation: pulse-dot 2s ease-in-out infinite;
    flex-shrink: 0;
}

@@keyframes pulse-dot {
    0%, 100% {
        opacity: 1
    }

    50% {
        opacity: .25
    }
}

.page-meta {
    font-family: 'DM Mono', monospace;
    font-size: .7rem;
    color: var(--text-dim);
}

    .page-meta .hi {
        color: var(--violet-soft);
    }

/* ── EPISODE LIST ────────────────────────────────────── */
.episode-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.episode-row {
    display: grid;
    grid-template-columns: 50px 1fr auto;
    align-items: center;
    gap: .75rem;
    padding: .55rem .7rem;
    border-radius: var(--radius);
    border: 1px solid transparent;
    background: transparent;
    transition: all .15s ease;
}

    .episode-row:hover {
        background: var(--bg-elevated);
        border-color: var(--border);
    }

    .episode-row.is-playing {
        background: var(--active-bg);
        border-color: rgba(167,139,250,.3);
        box-shadow: inset 0 0 40px var(--playing-glow);
    }

/* date badge */
.ep-date {
    width: 44px;
    height: 44px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.is-playing .ep-date {
    background: var(--accent-dim);
    border-color: var(--accent);
}

.ep-date .day {
    font-family: 'DM Mono', monospace;
    font-size: .95rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1;
}

.ep-date .mon {
    font-family: 'DM Mono', monospace;
    font-size: .52rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-top: 2px;
}

/* info */
.ep-info {
    min-width: 0;
}

.ep-title {
    font-size: .84rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
    transition: color .15s;
    text-decoration: none;
    display: block;
}

    .ep-title:hover, .is-playing .ep-title {
        color: var(--accent);
        text-decoration: none;
    }

.ep-meta {
    font-family: 'DM Mono', monospace;
    font-size: .68rem;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: .4rem;
}

.badge-saved {
    font-family: 'DM Mono', monospace;
    font-size: .58rem;
    padding: 1px 5px;
    border-radius: 4px;
    background: var(--accent-dim);
    color: var(--accent);
    border: 1px solid rgba(167,139,250,.22);
}

/* controls */
.ep-controls {
    display: flex;
    align-items: center;
    gap: .35rem;
    flex-shrink: 0;
}

.waveform {
    display: none;
    align-items: flex-end;
    gap: 2px;
    height: 16px;
}

.is-playing .waveform {
    display: flex;
}

.waveform span {
    width: 3px;
    border-radius: 2px;
    background: var(--accent);
    animation: wave .8s ease-in-out infinite alternate;
}

    .waveform span:nth-child(1) {
        height: 6px;
        animation-delay: 0s
    }

    .waveform span:nth-child(2) {
        height: 14px;
        animation-delay: .1s
    }

    .waveform span:nth-child(3) {
        height: 10px;
        animation-delay: .2s
    }

    .waveform span:nth-child(4) {
        height: 16px;
        animation-delay: .3s
    }

@@keyframes wave {
    from {
        transform: scaleY(.35)
    }

    to {
        transform: scaleY(1)
    }
}

.btn-play {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1.5px solid var(--border-hover);
    background: transparent;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .8rem;
    cursor: pointer;
    padding: 0;
    transition: all .15s ease;
}

    .btn-play:hover, .btn-play.active {
        border-color: var(--accent);
        color: var(--accent);
        background: var(--accent-dim);
        box-shadow: 0 0 12px var(--playing-glow);
    }

/* ── PAGINATION ──────────────────────────────────────── */
.pager-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .3rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

    .pager-wrap .page-link, .pager-wrap .pg-btn {
        min-width: 34px;
        height: 32px;
        border-radius: 6px;
        border: 1px solid var(--border) !important;
        background: transparent !important;
        color: var(--text-muted) !important;
        font-family: 'DM Mono', monospace;
        font-size: .73rem;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 .5rem;
        cursor: pointer;
        transition: all .15s;
        text-decoration: none;
    }

        .pager-wrap .page-link:hover,
        .pager-wrap .pg-btn:hover:not(:disabled) {
            border-color: var(--border-hover) !important;
            color: var(--accent) !important;
            background: var(--accent-dim) !important;
        }

        .pager-wrap .page-item.active .page-link,
        .pager-wrap .pg-btn.active {
            border-color: var(--accent) !important;
            color: var(--accent) !important;
            background: var(--accent-dim) !important;
        }

        .pager-wrap .page-item.disabled .page-link,
        .pager-wrap .pg-btn:disabled {
            opacity: .35;
            cursor: not-allowed;
        }

/* ── MINI PLAYER ─────────────────────────────────────── */
.mini-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(13,10,20,.97);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
    display: none;
    align-items: center;
    padding: 0 1.25rem;
    gap: 1rem;
    z-index: 1050;
}

html.theme-light .mini-player {
    background: rgba(255,255,255,.97);
}

.mini-player.visible {
    display: flex;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: .4rem;
}

.player-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1.5px solid var(--border-hover);
    background: transparent;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: .85rem;
    transition: all .15s;
}

    .player-btn.primary {
        width: 40px;
        height: 40px;
        font-size: 1rem;
        border-color: var(--accent);
        color: var(--accent);
        background: var(--accent-dim);
    }

    .player-btn:hover {
        border-color: var(--accent);
        color: var(--accent);
        background: var(--accent-dim);
    }

.player-info {
    flex: 1;
    min-width: 0;
}

.player-title {
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-sub {
    font-family: 'DM Mono', monospace;
    font-size: .63rem;
    color: var(--accent);
}

.player-progress {
    flex: 2;
    max-width: 340px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.progress-track {
    height: 3px;
    background: var(--bg-elevated);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    width: 0%;
    transition: width .1s linear;
    position: relative;
}

    .progress-fill::after {
        content: '';
        position: absolute;
        right: -4px;
        top: -3px;
        width: 9px;
        height: 9px;
        border-radius: 50%;
        background: var(--accent);
        box-shadow: 0 0 6px var(--accent);
    }

.time-labels {
    display: flex;
    justify-content: space-between;
    font-family: 'DM Mono', monospace;
    font-size: .59rem;
    color: var(--text-dim);
}

/* ── FOOTER ──────────────────────────────────────────── */
.site-footer {
    font-family: 'DM Mono', monospace;
    font-size: .68rem;
    color: var(--text-dim);
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
}

    .site-footer a {
        color: var(--text-muted);
        text-decoration: none;
    }

        .site-footer a:hover {
            color: var(--accent);
        }

/* ── RESPONSIVE ──────────────────────────────────────── */
@@media (max-width: 767.98px) {
    .sidebar {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
        width: 100%;
    }

    .content-inner {
        padding: 1.25rem 1rem 5.5rem;
        max-width: 100%;
    }

    .player-progress {
        display: none;
    }

    .episode-row {
        grid-template-columns: 44px 1fr auto;
    }

    .topbar {
        padding: 0 .85rem;
    }

    .ep-title {
        font-size: .8rem;
    }
}

audio {
    display: none;
}

/* MOBILE FIX — one block only */
@media (max-width: 767.98px) {

    /* remove desktop sidebar offset */
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        padding-top: var(--topbar-h) !important;
    }

    /* tighten inner padding */
    .content-inner {
        padding: 1rem .9rem 5rem !important;
        max-width: 100% !important;
    }

    /* fix episode grid overflow */
    .episode-row {
        grid-template-columns: 40px 1fr 34px !important;
        gap: .55rem !important;
        padding: .55rem .65rem !important;
    }

    .ep-date {
        width: 40px !important;
        height: 40px !important;
    }

    .ep-title {
        font-size: .8rem !important;
    }

    .ep-meta {
        font-size: .63rem !important;
    }

    /* topbar spacing */
    .topbar {
        padding: 0 .75rem !important;
        gap: .6rem !important;
    }
}
