/* PodHub — global stylesheet */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg:          #0f0f0f;
    --bg-surface:  #1a1a1a;
    --bg-raised:   #242424;
    --border:      #2e2e2e;
    --text:        #e5e5e5;
    --text-muted:  #888;
    --text-faint:  #555;
    --accent:      #4ade80;
    --accent-dark: #22c55e;
    --danger:      #f87171;
    --radius:      8px;
    --font:        system-ui, -apple-system, sans-serif;
}

html {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
}

a {
    color: var(--accent);
    text-decoration: none;
}
a:hover { text-decoration: underline; }

/* ── Layout ─────────────────────────────────────── */
.site-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

main { flex: 1; }

/* ── Nav ─────────────────────────────────────────── */
.site-nav {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 0;
}

.site-nav .container {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.nav-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: -0.5px;
    flex-shrink: 0;
}
.nav-logo:hover { text-decoration: none; }

.nav-search {
    flex: 1;
    min-width: 180px;
    display: flex;
    gap: 0.5rem;
}

.nav-search input[type="search"],
.nav-search input[type="text"] {
    flex: 1;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.9rem;
    padding: 0.45rem 0.75rem;
}
.nav-search input:focus { outline: 2px solid var(--accent); border-color: var(--accent); }

.nav-search select {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.85rem;
    padding: 0.45rem 0.5rem;
    cursor: pointer;
}

.nav-search button {
    background: var(--accent);
    border: none;
    border-radius: var(--radius);
    color: #000;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.45rem 1rem;
}
.nav-search button:hover { background: var(--accent-dark); }

.nav-locales {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
}

.nav-locales a {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.3rem 0.55rem;
    text-transform: uppercase;
}
.nav-locales a:hover,
.nav-locales a.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #000;
    text-decoration: none;
}

/* ── Footer ──────────────────────────────────────── */
.site-footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 1.25rem 0;
    text-align: center;
}
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--accent); }

/* ── Hero ─────────────────────────────────────────── */
.hero {
    padding: 4rem 0 3rem;
    text-align: center;
}
.hero h1 {
    font-size: clamp(1.8rem, 5vw, 3rem);
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 0.5rem;
}
.hero h1 span { color: var(--accent); }
.hero p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.hero-search {
    display: flex;
    gap: 0.75rem;
    max-width: 700px;
    margin: 0 auto;
    flex-wrap: wrap;
    justify-content: center;
}
.hero-search input[type="search"],
.hero-search input[type="text"] {
    flex: 1;
    min-width: 260px;
    background: var(--bg-surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 1.05rem;
    padding: 0.75rem 1.1rem;
}
.hero-search input:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.hero-search select {
    background: var(--bg-surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 1rem;
    padding: 0.75rem 0.75rem;
}
.hero-search button {
    background: var(--accent);
    border: none;
    border-radius: var(--radius);
    color: #000;
    cursor: pointer;
    font-size: 1.05rem;
    font-weight: 700;
    padding: 0.75rem 1.75rem;
}
.hero-search button:hover { background: var(--accent-dark); }

/* ── Stats bar ───────────────────────────────────── */
.stats-bar {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 1.5rem auto 0;
    text-align: center;
}
.stats-bar strong { color: var(--text); }

/* ── Section ─────────────────────────────────────── */
.section {
    padding: 2.5rem 0;
}
.section-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

/* ── Episode grid ─────────────────────────────────── */
.episode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.episode-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    transition: border-color 0.15s;
}
.episode-card:hover { border-color: var(--accent); }

.episode-card__podcast {
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.episode-card__title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
}
.episode-card__title a { color: var(--text); }
.episode-card__title a:hover { color: var(--accent); text-decoration: none; }

.episode-card__meta {
    color: var(--text-muted);
    font-size: 0.78rem;
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    align-items: center;
}

.episode-card__summary {
    color: var(--text-muted);
    font-size: 0.83rem;
    line-height: 1.5;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* ── Language badge ──────────────────────────────── */
.lang-badge {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.1rem 0.4rem;
    text-transform: uppercase;
}

/* ── Search results ──────────────────────────────── */
.search-bar {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border);
}

.search-form {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.search-form input[type="search"],
.search-form input[type="text"] {
    flex: 1;
    min-width: 220px;
    background: var(--bg-surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 1rem;
    padding: 0.65rem 1rem;
}
.search-form input:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.search-form select {
    background: var(--bg-surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.9rem;
    padding: 0.65rem 0.75rem;
}
.search-form button {
    background: var(--accent);
    border: none;
    border-radius: var(--radius);
    color: #000;
    cursor: pointer;
    font-weight: 700;
    padding: 0.65rem 1.5rem;
}
.search-form button:hover { background: var(--accent-dark); }

.search-meta {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin: 1rem 0;
}
.search-meta strong { color: var(--text); }

.result-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem 0;
}

.result-item {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem 1.25rem;
}
.result-item:hover { border-color: var(--accent); }

.result-item__title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}
.result-item__title a { color: var(--text); }
.result-item__title a:hover { color: var(--accent); text-decoration: none; }

.result-item__meta {
    color: var(--text-muted);
    font-size: 0.8rem;
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.result-item__summary {
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.55;
    margin-bottom: 0.5rem;
}

.matched-phrases {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-top: 0.5rem;
}

.matched-phrase {
    background: var(--bg-raised);
    border-left: 3px solid var(--accent);
    border-radius: 0 4px 4px 0;
    font-size: 0.83rem;
    padding: 0.35rem 0.6rem;
    color: var(--text-muted);
}
.matched-phrase a { color: var(--accent); font-weight: 600; font-size: 0.8rem; }

/* ── Pagination ──────────────────────────────────── */
.pagination {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    padding: 2rem 0;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: 0.875rem;
    padding: 0.4rem 0.8rem;
    text-decoration: none;
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); }
.pagination .current { background: var(--accent); border-color: var(--accent); color: #000; font-weight: 700; }

/* ── Podcast page ─────────────────────────────────── */
.podcast-header {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    padding: 2rem 0 1.5rem;
}
.podcast-cover {
    border-radius: var(--radius);
    flex-shrink: 0;
    height: 120px;
    object-fit: cover;
    width: 120px;
}
.podcast-cover-placeholder {
    align-items: center;
    background: var(--bg-raised);
    border-radius: var(--radius);
    color: var(--text-faint);
    display: flex;
    flex-shrink: 0;
    font-size: 2.5rem;
    height: 120px;
    justify-content: center;
    width: 120px;
}
.podcast-header__info h1 {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 0.4rem;
}
.podcast-header__desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-top: 0.5rem;
    max-width: 600px;
}

.episode-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.episode-list-item {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.episode-list-item:hover { border-color: var(--accent); }
.episode-list-item__title {
    font-size: 0.95rem;
    font-weight: 600;
}
.episode-list-item__title a { color: var(--text); }
.episode-list-item__title a:hover { color: var(--accent); text-decoration: none; }
.episode-list-item__meta {
    color: var(--text-muted);
    font-size: 0.8rem;
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}
.episode-list-item__summary {
    color: var(--text-muted);
    font-size: 0.83rem;
    line-height: 1.5;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-top: 0.25rem;
}

/* ── Episode page ─────────────────────────────────── */
.episode-header {
    padding: 2rem 0 1rem;
}
.episode-breadcrumb {
    color: var(--text-muted);
    font-size: 0.83rem;
    margin-bottom: 0.75rem;
}
.episode-header h1 {
    font-size: clamp(1.4rem, 4vw, 2.2rem);
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.3;
    margin-bottom: 0.75rem;
}
.episode-meta {
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    font-size: 0.85rem;
    gap: 0.75rem;
    align-items: center;
}

.episode-summary-box {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: 0 var(--radius) var(--radius) 0;
    margin: 1.5rem 0;
    padding: 1.25rem 1.5rem;
}
.episode-summary-box h2 {
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 0.6rem;
    text-transform: uppercase;
}
.episode-summary-box p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
}

.listen-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin: 1.25rem 0;
}
.listen-btn {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    text-decoration: none;
}
.listen-btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

.episode-section {
    margin: 2rem 0;
}
.episode-section h2 {
    border-bottom: 1px solid var(--border);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
}

/* FAQ */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.faq-list details {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.faq-list details[open] { border-color: var(--accent); }
.faq-list summary {
    cursor: pointer;
    font-size: 0.93rem;
    font-weight: 600;
    list-style: none;
    padding: 0.8rem 1rem;
    position: relative;
    padding-right: 2rem;
}
.faq-list summary::after {
    content: '+';
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    color: var(--accent);
}
details[open] summary::after { content: '−'; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-answer {
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.65;
    padding: 0.75rem 1rem;
}

/* Transcript */
.transcript {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.88rem;
    line-height: 1.75;
    max-height: 520px;
    overflow-y: auto;
    padding: 1.25rem;
    scroll-behavior: smooth;
}
.transcript p {
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}
.phrase__time {
    color: var(--text-faint);
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 0.4rem;
    display: none;
}
.show-timestamps .phrase__time { display: inline; }

.timestamps-toggle {
    font-size: 0.82rem;
    margin-bottom: 0.75rem;
}
.timestamps-toggle a { color: var(--text-muted); text-decoration: underline; }
.timestamps-toggle a:hover { color: var(--accent); }

/* ── Alert / notice ──────────────────────────────── */
.alert {
    border-radius: var(--radius);
    font-size: 0.9rem;
    padding: 1rem 1.25rem;
}
.alert--info { background: #1e2a20; border: 1px solid #2e4a32; color: #86efac; }
.alert--warning { background: #2a1e1e; border: 1px solid #4a2e2e; color: #fca5a5; }

/* ── Related ─────────────────────────────────────── */
.related-link {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: inline-block;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    padding: 0.6rem 1rem;
}
.related-link:hover { border-color: var(--accent); text-decoration: none; }

/* ── No results / empty ──────────────────────────── */
.empty-state {
    color: var(--text-muted);
    font-size: 0.95rem;
    padding: 3rem 0;
    text-align: center;
}
.empty-state h2 {
    color: var(--text);
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 640px) {
    .podcast-header { flex-direction: column; }
    .hero { padding: 2.5rem 0 2rem; }
}
