/* ==========================================================================
   MAESTRO UNSCRIPTED — Ghost Theme
   A MasterClass-style podcast & videocast theme aligned to maestro.ranbiolinks.com
   ========================================================================== */

/* -------------------------------------------------------------------------- *
 * 1. DESIGN TOKENS
 * -------------------------------------------------------------------------- */

:root {
    /* Brand — MAESTRO red, deep darks */
    --m-red: #ef3b3b;
    --m-red-600: #dc2626;
    --m-red-700: #b91c1c;
    --m-red-soft: rgba(239, 59, 59, 0.12);
    --m-red-glow: rgba(239, 59, 59, 0.45);

    /* Surfaces (dark default) */
    --bg: #0a0a0c;
    --bg-elev-1: #111114;
    --bg-elev-2: #16161b;
    --bg-elev-3: #1c1c23;
    --surface-card: #131318;
    --surface-card-hover: #181820;

    /* Borders */
    --border: rgba(255, 255, 255, 0.06);
    --border-strong: rgba(255, 255, 255, 0.12);

    /* Text */
    --fg: #ffffff;
    --fg-2: #d4d4d8;
    --fg-3: #a1a1aa;
    --fg-4: #71717a;
    --fg-5: #52525b;

    /* Type system — Ghost custom-fonts compatible
       --gh-font-heading and --gh-font-body are required by Ghost (overridable via theme settings). */
    --gh-font-heading: 'Manrope', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --gh-font-body: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-sans: var(--gh-font-body);
    --font-display: var(--gh-font-heading);
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, 'Cascadia Mono',
                 'Roboto Mono', Consolas, monospace;

    /* Radii — generous, MAESTRO-style */
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;
    --r-xl: 20px;
    --r-2xl: 24px;
    --r-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 24px 48px rgba(0, 0, 0, 0.45);
    --shadow-red: 0 8px 32px rgba(239, 59, 59, 0.28);

    /* Layout */
    --container: 1200px;
    --container-wide: 1320px;
    --container-narrow: 820px;
    --gutter: clamp(20px, 4vw, 40px);
    --header-h: 72px;

    /* Motion */
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --t-fast: 160ms;
    --t-med: 240ms;
    --t-slow: 420ms;
}

/* Optional light theme (toggle via [data-theme="light"]) */
[data-theme="light"] {
    --bg: #fafafa;
    --bg-elev-1: #ffffff;
    --bg-elev-2: #f4f4f5;
    --bg-elev-3: #e9e9ee;
    --surface-card: #ffffff;
    --surface-card-hover: #f4f4f5;
    --border: rgba(0, 0, 0, 0.06);
    --border-strong: rgba(0, 0, 0, 0.12);
    --fg: #0a0a0c;
    --fg-2: #27272a;
    --fg-3: #52525b;
    --fg-4: #71717a;
    --fg-5: #a1a1aa;
}

/* -------------------------------------------------------------------------- *
 * 2. RESET / BASE
 * -------------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--fg);
    background: var(--bg);
    background-image:
        radial-gradient(1200px 600px at 80% -10%, rgba(239, 59, 59, 0.08), transparent 60%),
        radial-gradient(800px 500px at -10% 30%, rgba(239, 59, 59, 0.04), transparent 60%);
    background-attachment: fixed;
    min-height: 100vh;
    overflow-x: hidden;
}

img, picture, video, canvas, svg { display: block; max-width: 100%; }
img { height: auto; }

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--t-fast) var(--ease);
}
a:hover { color: var(--m-red); }

button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }

input, textarea, select { font: inherit; }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--fg);
}

h1 { font-size: clamp(2.5rem, 6vw, 5rem); }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); font-weight: 700; }
h4 { font-size: 1.125rem; font-weight: 700; letter-spacing: -0.01em; }

p { color: var(--fg-2); }

::selection { background: var(--m-red); color: white; }

/* Focus states */
:focus-visible {
    outline: 2px solid var(--m-red);
    outline-offset: 3px;
    border-radius: 4px;
}

/* -------------------------------------------------------------------------- *
 * 3. LAYOUT PRIMITIVES
 * -------------------------------------------------------------------------- */

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding-left: max(var(--gutter), env(safe-area-inset-left));
    padding-right: max(var(--gutter), env(safe-area-inset-right));
}

.container-wide { max-width: var(--container-wide); }
.container-narrow { max-width: var(--container-narrow); }

.section { padding: clamp(40px, 6vw, 80px) 0; }
.section-tight { padding: clamp(24px, 4vw, 48px) 0; }

.row { display: flex; flex-wrap: wrap; gap: 24px; }
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 900px) {
    .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* -------------------------------------------------------------------------- *
 * 4. HEADER / NAV
 * -------------------------------------------------------------------------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    background: rgba(10, 10, 12, 0.72);
    border-bottom: 1px solid var(--border);
}
[data-theme="light"] .site-header { background: rgba(250, 250, 250, 0.78); }

.site-header__inner {
    height: var(--header-h);
    display: flex;
    align-items: center;
    gap: 32px;
}

.site-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.125rem;
    letter-spacing: -0.02em;
    color: var(--fg);
    flex-shrink: 0;
}
.site-logo:hover { color: var(--fg); }

.site-logo__mark {
    width: auto;
    height: var(--logo-height, 56px);
    max-height: calc(var(--logo-height, 56px) + 8px);
    max-width: 280px;
    flex-shrink: 0;
    display: block;
    object-fit: contain;
}

/* Two-logo mode: swap the visible mark based on the active theme.
   These rules only do anything when both --dark and --light variants
   were rendered (i.e. the editor uploaded a Light Mode logo). */
[data-theme="light"] .site-logo__mark--dark { display: none; }
[data-theme="dark"] .site-logo__mark--light { display: none; }
html:not([data-theme]) .site-logo__mark--light { display: none; }

.site-nav {
    display: flex;
    gap: 32px;
    margin: 0 auto;
}

.site-nav a {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--fg-2);
    padding: 8px 0;
    position: relative;
}
.site-nav a:hover { color: var(--fg); }
.site-nav a.active {
    color: var(--fg);
}
.site-nav a.active::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: -2px;
    height: 2px;
    background: var(--m-red);
    border-radius: 2px;
}

.site-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--r-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--fg-2);
    transition: all var(--t-fast) var(--ease);
}
.icon-btn:hover {
    background: var(--bg-elev-2);
    color: var(--fg);
}

@media (max-width: 800px) {
    .site-nav { display: none; }
    .site-nav.is-open {
        display: flex;
        position: absolute;
        top: var(--header-h);
        left: 0; right: 0;
        flex-direction: column;
        gap: 0;
        padding: 16px var(--gutter);
        background: var(--bg-elev-1);
        border-bottom: 1px solid var(--border);
    }
    .site-nav.is-open a { padding: 14px 0; border-bottom: 1px solid var(--border); }
}

.nav-toggle { display: none; }
@media (max-width: 800px) { .nav-toggle { display: inline-flex; } }

/* Mobile header — keep everything inside the viewport on phones.
   iPhone SE (375px) → iPhone 15 Plus (430px). */
@media (max-width: 600px) {
    .site-header__inner {
        gap: 8px;
        min-width: 0;
    }
    .site-logo {
        min-width: 0;
        overflow: hidden;
    }
    .site-logo__mark {
        height: clamp(36px, var(--logo-height, 56px), 44px);
        max-height: 48px;
        max-width: 150px;
    }
    .site-actions { gap: 4px; }
    .site-actions .icon-btn { width: 36px; height: 36px; }
    /* Hide search icon on phones — saves ~52px and search is also reachable
       via Ghost's keyboard shortcut + the search portal still works on tablets+. */
    .site-actions > [data-ghost-search] { display: none; }
    /* Subscribe button → icon-only on phones (keeps the CTA visible without
       eating ~110px of header width). Text node is hidden via font-size:0,
       SVG keeps its explicit px dimensions. */
    .site-actions .btn--primary.btn--sm {
        padding: 0;
        width: 36px;
        height: 36px;
        min-height: 36px;
        border-radius: 999px;
        gap: 0;
        font-size: 0;
    }
    .site-actions .btn--primary.btn--sm svg {
        width: 14px;
        height: 14px;
    }
}

/* -------------------------------------------------------------------------- *
 * 5. BUTTONS
 * -------------------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1;
    border-radius: var(--r-md);
    transition: all var(--t-fast) var(--ease);
    white-space: nowrap;
    border: 1px solid transparent;
}
.btn:hover { transform: translateY(-1px); }

.btn--primary {
    background: var(--m-red);
    color: white;
    box-shadow: var(--shadow-red);
}
.btn--primary:hover {
    background: var(--m-red-600);
    color: white;
    box-shadow: 0 12px 36px rgba(239, 59, 59, 0.4);
}

.btn--ghost {
    background: transparent;
    color: var(--fg);
    border-color: var(--border-strong);
}
.btn--ghost:hover {
    background: var(--bg-elev-2);
    border-color: var(--fg-3);
    color: var(--fg);
}

.btn--soft {
    background: var(--bg-elev-2);
    color: var(--fg);
}
.btn--soft:hover { background: var(--bg-elev-3); color: var(--fg); }

.btn--sm { padding: 8px 14px; font-size: 0.8125rem; border-radius: var(--r-sm); }
.btn--lg { padding: 16px 28px; font-size: 1rem; }

.btn svg { width: 18px; height: 18px; }

/* -------------------------------------------------------------------------- *
 * 6. HERO
 * -------------------------------------------------------------------------- */

.hero {
    padding: clamp(40px, 6vw, 64px) 0 clamp(48px, 7vw, 96px);
    position: relative;
}

.hero__inner {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    gap: clamp(32px, 5vw, 80px);
    align-items: center;
}
@media (max-width: 900px) {
    .hero__inner { grid-template-columns: 1fr; gap: 32px; }
}

.hero__kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--m-red);
    margin-bottom: 20px;
}
.hero__kicker::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--m-red);
    box-shadow: 0 0 0 4px var(--m-red-soft);
}

.hero__title {
    font-size: clamp(2.75rem, 7vw, 5.5rem);
    line-height: 0.95;
    letter-spacing: -0.035em;
    font-weight: 800;
    margin-bottom: 24px;
}
.hero__title-accent { color: var(--m-red); }

.hero__description {
    font-size: clamp(1rem, 1.4vw, 1.125rem);
    color: var(--fg-3);
    max-width: 520px;
    margin-bottom: 32px;
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.hero__media {
    position: relative;
    aspect-ratio: 4 / 3;
    border-radius: var(--r-2xl);
    overflow: hidden;
    background: var(--bg-elev-2);
    box-shadow: var(--shadow-lg);
}
.hero__media img,
.hero__media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.hero__media::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(10, 10, 12, 0.5));
    pointer-events: none;
}

/* -------------------------------------------------------------------------- *
 * 7. SECTION HEADER
 * -------------------------------------------------------------------------- */

.section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}
.section-header h2 {
    font-size: clamp(1.5rem, 2.5vw, 1.875rem);
    font-weight: 700;
    letter-spacing: -0.02em;
}
.section-header__link {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--m-red);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.section-header__link:hover { color: var(--m-red-600); }

/* -------------------------------------------------------------------------- *
 * 8. EPISODE CARDS
 * -------------------------------------------------------------------------- */

.ep-card {
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
    transition: transform var(--t-med) var(--ease),
                background var(--t-med) var(--ease),
                border-color var(--t-med) var(--ease);
    display: flex;
    flex-direction: column;
}
.ep-card:hover {
    transform: translateY(-4px);
    background: var(--surface-card-hover);
    border-color: var(--border-strong);
    color: inherit;
}

.ep-card__media {
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--bg-elev-2);
    overflow: hidden;
}
.ep-card__media img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform var(--t-slow) var(--ease);
}
.ep-card:hover .ep-card__media img { transform: scale(1.04); }

.card-thumb-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(120% 80% at 0% 0%, rgba(239, 59, 59, 0.18), transparent 60%),
        radial-gradient(120% 80% at 100% 100%, rgba(239, 59, 59, 0.10), transparent 60%),
        linear-gradient(135deg, #15151A 0%, #0E0E12 100%);
    transition: transform var(--t-slow) var(--ease);
}
.ep-card:hover .card-thumb-placeholder { transform: scale(1.04); }
.card-thumb-placeholder__pill {
    display: inline-block;
    padding: 8px 14px;
    background: rgba(239, 59, 59, 0.16);
    border: 1px solid rgba(239, 59, 59, 0.45);
    color: #FF8A8A;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: center;
    max-width: 80%;
}

.ep-card__duration {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(10, 10, 12, 0.78);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    backdrop-filter: blur(8px);
}

.ep-card__play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--t-med) var(--ease);
    background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.5));
}
.ep-card:hover .ep-card__play { opacity: 1; }
.ep-card__play span {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--m-red);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: var(--shadow-red);
}

.ep-card__body { padding: 18px 18px 22px; flex-grow: 1; display: flex; flex-direction: column; }
.ep-card__meta {
    color: var(--m-red);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 8px;
}
.ep-card__title {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--fg);
    margin-bottom: 8px;
    line-height: 1.3;
    letter-spacing: -0.01em;
}
.ep-card__excerpt {
    font-size: 0.875rem;
    color: var(--fg-3);
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 14px;
    flex-grow: 1;
}
.ep-card__date {
    font-size: 0.75rem;
    color: var(--fg-4);
}

/* Latest episode (large featured card) */
.ep-latest {
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: var(--r-2xl);
    overflow: hidden;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 0;
    transition: all var(--t-med) var(--ease);
}
.ep-latest:hover { border-color: var(--border-strong); }
@media (max-width: 800px) { .ep-latest { grid-template-columns: 1fr; } }

.ep-latest__media {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}
.ep-latest__media img { width: 100%; height: 100%; object-fit: cover; }

.ep-latest__body {
    padding: clamp(24px, 3vw, 36px);
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.ep-latest__meta { color: var(--m-red); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 10px; }
.ep-latest__title {
    font-size: clamp(1.25rem, 2.2vw, 1.75rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 14px;
    letter-spacing: -0.015em;
}
.ep-latest__excerpt { color: var(--fg-3); font-size: 0.9375rem; margin-bottom: 22px; }

.ep-latest__actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.ep-latest__date { color: var(--fg-4); font-size: 0.8125rem; display: inline-flex; align-items: center; gap: 6px; }
.ep-latest__sep { color: var(--fg-5); }

/* -------------------------------------------------------------------------- *
 * 9. HOST CARDS
 * -------------------------------------------------------------------------- */

.host-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    transition: all var(--t-med) var(--ease);
}
.host-card:hover { background: var(--surface-card-hover); border-color: var(--border-strong); color: inherit; }

.host-card__avatar {
    width: 88px; height: 88px;
    border-radius: var(--r-md);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-elev-2);
}
.host-card__avatar img { width: 100%; height: 100%; object-fit: cover; }

.host-card__name { font-size: 1.125rem; font-weight: 700; margin-bottom: 4px; letter-spacing: -0.01em; }
.host-card__bio { color: var(--fg-3); font-size: 0.875rem; line-height: 1.5; margin-bottom: 10px; }
.host-card__link { color: var(--m-red); font-size: 0.8125rem; font-weight: 600; }

/* -------------------------------------------------------------------------- *
 * 10. ABOUT-SHOW BLOCK
 * -------------------------------------------------------------------------- */

.about-show {
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: var(--r-2xl);
    padding: clamp(28px, 3vw, 40px);
    display: grid;
    grid-template-columns: auto 1fr;
    gap: clamp(24px, 3vw, 40px);
    align-items: center;
}
@media (max-width: 700px) { .about-show { grid-template-columns: 1fr; text-align: center; } }

.about-show__hex {
    width: 96px; height: 96px;
    flex-shrink: 0;
}
.about-show__title { font-size: 1.5rem; font-weight: 700; margin-bottom: 12px; letter-spacing: -0.015em; }
.about-show__text { color: var(--fg-3); margin-bottom: 18px; max-width: 700px; }

/* -------------------------------------------------------------------------- *
 * 11. NEWSLETTER
 * -------------------------------------------------------------------------- */

.newsletter {
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: var(--r-2xl);
    padding: clamp(24px, 3vw, 32px);
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 24px;
    align-items: center;
}
@media (max-width: 700px) { .newsletter { grid-template-columns: 1fr; } }

.newsletter__title { font-size: 1.125rem; font-weight: 700; margin-bottom: 4px; }
.newsletter__sub { color: var(--fg-3); font-size: 0.875rem; }

.newsletter__cta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}
@media (max-width: 700px) {
    .newsletter__cta { justify-content: stretch; }
    .newsletter__cta .btn { width: 100%; justify-content: center; }
}

/* -------------------------------------------------------------------------- *
 * 12. EPISODE DETAIL PAGE (post.hbs)
 * -------------------------------------------------------------------------- */

.episode-hero {
    position: relative;
    overflow: hidden;
    border-radius: 0 0 var(--r-2xl) var(--r-2xl);
}
.episode-hero__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}
.episode-hero__bg img { width: 100%; height: 100%; object-fit: cover; opacity: 0.55; }
.episode-hero__bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, var(--bg) 0%, rgba(10,10,12,0.85) 35%, rgba(10,10,12,0.4) 65%, transparent 100%),
        linear-gradient(180deg, transparent 50%, var(--bg) 100%);
}

.episode-hero__inner {
    position: relative;
    z-index: 1;
    padding: clamp(48px, 8vw, 96px) 0 clamp(48px, 6vw, 80px);
    max-width: 720px;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--fg-4);
    font-size: 0.8125rem;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.breadcrumbs a { color: var(--fg-3); }
.breadcrumbs a:hover { color: var(--fg); }
.breadcrumbs svg { width: 14px; height: 14px; opacity: 0.5; }

.episode-hero__meta {
    color: var(--m-red);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.episode-hero__title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.05;
    letter-spacing: -0.025em;
    margin-bottom: 20px;
}
.episode-hero__title strong { color: var(--fg); display: block; }
.episode-hero__title em { font-style: normal; color: var(--fg); font-weight: 600; }

.episode-hero__excerpt {
    font-size: 1.0625rem;
    color: var(--fg-3);
    margin-bottom: 24px;
    max-width: 580px;
}

.episode-hero__factbar {
    display: flex;
    align-items: center;
    gap: 24px;
    color: var(--fg-3);
    font-size: 0.875rem;
    margin-bottom: 28px;
    flex-wrap: wrap;
}
.episode-hero__factbar span { display: inline-flex; align-items: center; gap: 8px; }
.episode-hero__factbar svg { width: 16px; height: 16px; color: var(--m-red); }

.episode-hero__actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* Episode body grid */
.episode-body {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: clamp(24px, 4vw, 48px);
}
@media (max-width: 900px) {
    .episode-body { grid-template-columns: 1fr; }
}

/* Player */
.player {
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    overflow: hidden;
    margin-bottom: 32px;
}

.player__video {
    aspect-ratio: 16 / 9;
    background: #000;
    position: relative;
}
.player__video iframe,
.player__video video {
    width: 100%; height: 100%; border: 0; display: block;
}
.player__video-placeholder {
    width: 100%; height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
    cursor: pointer;
    position: relative;
}
.player__video-placeholder::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(180deg, transparent 30%, rgba(0,0,0,0.6));
}
.player__video-play {
    position: relative;
    width: 80px; height: 80px;
    border-radius: 50%;
    background: var(--m-red);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    z-index: 1;
    box-shadow: var(--shadow-red);
    transition: transform var(--t-med) var(--ease);
}
.player__video-placeholder:hover .player__video-play { transform: scale(1.06); }
.player__video-play svg { width: 32px; height: 32px; margin-left: 4px; }

.player__audio { padding: 20px; display: none; }
.player__audio.is-active { display: block; }
.player__audio audio { width: 100%; }

/* Tabs */
.ep-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 28px;
    overflow-x: auto;
}
.ep-tabs__btn {
    padding: 14px 4px;
    margin-right: 24px;
    color: var(--fg-3);
    font-weight: 600;
    font-size: 0.875rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all var(--t-fast) var(--ease);
    white-space: nowrap;
}
.ep-tabs__btn:hover { color: var(--fg); }
.ep-tabs__btn.is-active { color: var(--fg); border-bottom-color: var(--m-red); }

.ep-tab-panel { display: none; }
.ep-tab-panel.is-active { display: block; }

.ep-content h2 { font-size: 1.375rem; font-weight: 700; margin-top: 32px; margin-bottom: 12px; letter-spacing: -0.015em; }
.ep-content h3 { font-size: 1.125rem; font-weight: 700; margin-top: 24px; margin-bottom: 10px; }
.ep-content p { margin-bottom: 16px; color: var(--fg-2); line-height: 1.7; }
.ep-content ul, .ep-content ol { margin-bottom: 16px; padding-left: 0; list-style: none; }
.ep-content ul li {
    position: relative;
    padding-left: 22px;
    margin-bottom: 8px;
    color: var(--fg-2);
}
.ep-content ul li::before {
    content: '';
    position: absolute;
    left: 0; top: 0.65em;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--m-red);
}
.ep-content ol { counter-reset: item; }
.ep-content ol li {
    counter-increment: item;
    position: relative;
    padding-left: 32px;
    margin-bottom: 8px;
    color: var(--fg-2);
}
.ep-content ol li::before {
    content: counter(item);
    position: absolute;
    left: 0; top: 0;
    color: var(--m-red);
    font-weight: 700;
    font-size: 0.875rem;
    background: var(--m-red-soft);
    width: 22px; height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.ep-content blockquote {
    border-left: 3px solid var(--m-red);
    padding: 8px 0 8px 20px;
    margin: 24px 0;
    color: var(--fg-2);
    font-style: italic;
    font-size: 1.0625rem;
}
.ep-content a { color: var(--m-red); border-bottom: 1px solid currentColor; }
.ep-content a:hover { color: var(--m-red-600); }

/* About guest block */
.guest-card {
    margin-top: 40px;
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding: 28px;
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 24px;
    align-items: start;
}
@media (max-width: 600px) { .guest-card { grid-template-columns: 1fr; text-align: center; } }
.guest-card__avatar { width: 120px; height: 120px; border-radius: var(--r-lg); overflow: hidden; background: var(--bg-elev-2); }
.guest-card__avatar img { width: 100%; height: 100%; object-fit: cover; }
.guest-card__role { color: var(--m-red); font-size: 0.8125rem; font-weight: 600; margin-bottom: 6px; }
.guest-card__name { font-size: 1.25rem; font-weight: 700; margin-bottom: 10px; }
.guest-card__bio { color: var(--fg-3); font-size: 0.9375rem; line-height: 1.6; margin-bottom: 14px; }

/* Sidebar */
.ep-sidebar { display: flex; flex-direction: column; gap: 24px; }

.sidebar-card {
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding: 22px;
}
.sidebar-card__title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 18px;
    letter-spacing: -0.01em;
}

.chapters { list-style: none; padding: 0; margin: 0; }
.chapters li {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
    color: var(--fg-2);
    cursor: pointer;
    transition: color var(--t-fast) var(--ease);
}
.chapters li:last-child { border-bottom: 0; }
.chapters li:hover { color: var(--m-red); }
.chapters .ts {
    color: var(--m-red);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    font-size: 0.8125rem;
}

.mini-ep {
    display: grid;
    grid-template-columns: 88px 1fr;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.mini-ep:last-child { border-bottom: 0; }
.mini-ep__thumb {
    aspect-ratio: 16/10;
    border-radius: var(--r-sm);
    overflow: hidden;
    background: var(--bg-elev-2);
}
.mini-ep__thumb img { width: 100%; height: 100%; object-fit: cover; }
.mini-ep__placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    padding: 6px;
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-align: center;
    color: #FF8A8A;
    background:
        radial-gradient(120% 80% at 0% 0%, rgba(239, 59, 59, 0.18), transparent 60%),
        linear-gradient(135deg, #15151A 0%, #0E0E12 100%);
}
.mini-ep__meta { font-size: 0.6875rem; color: var(--m-red); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 2px; }
.mini-ep__title { font-size: 0.875rem; font-weight: 600; line-height: 1.3; margin-bottom: 4px; color: var(--fg); }
.mini-ep__date { font-size: 0.75rem; color: var(--fg-4); }

/* -------------------------------------------------------------------------- *
 * 12.5 ARTICLE TEMPLATE (custom-article.hbs)
 * -------------------------------------------------------------------------- */

.article-hero {
    padding: clamp(40px, 6vw, 80px) 0 clamp(28px, 3vw, 40px);
}

.article-hero__kicker {
    color: var(--m-red);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 18px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.article-hero__kicker::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--m-red);
    box-shadow: 0 0 0 4px var(--m-red-soft);
}

.article-hero__title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.05;
    letter-spacing: -0.025em;
    font-weight: 800;
    margin-bottom: 20px;
}

.article-hero__dek {
    font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
    color: var(--fg-3);
    line-height: 1.5;
    margin-bottom: 28px;
    max-width: 720px;
}

.article-byline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.article-byline__author {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: inherit;
}
.article-byline__author:hover { color: inherit; }
.article-byline__author img {
    width: 44px; height: 44px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-elev-2);
    flex-shrink: 0;
}
.article-byline__name {
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--fg);
    letter-spacing: -0.01em;
}
.article-byline__role {
    font-size: 0.8125rem;
    color: var(--fg-4);
    margin-top: 2px;
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.article-byline__meta {
    display: inline-flex;
    align-items: center;
    gap: 18px;
    color: var(--fg-3);
    font-size: 0.875rem;
    flex-wrap: wrap;
}
.article-byline__meta span { display: inline-flex; align-items: center; gap: 6px; }
.article-byline__meta svg { width: 14px; height: 14px; color: var(--m-red); }

/* Feature image */
.article-feature {
    margin: clamp(20px, 3vw, 32px) 0 clamp(28px, 4vw, 48px);
    border-radius: var(--r-2xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}
.article-feature img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 580px;
    object-fit: cover;
}
.article-feature figcaption {
    padding: 12px 18px;
    background: var(--bg-elev-1);
    color: var(--fg-4);
    font-size: 0.8125rem;
    text-align: center;
    border-top: 1px solid var(--border);
}

/* Article body grid */
.article-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: clamp(32px, 5vw, 64px);
    align-items: start;
}
@media (max-width: 900px) {
    .article-body { grid-template-columns: 1fr; }
}

.article-body__main { min-width: 0; }

/* Long-form reading typography */
.article-content {
    font-size: 1.125rem;
    line-height: 1.75;
    color: var(--fg-2);
    max-width: 720px;
}
.article-content > * { margin-bottom: 1.4rem; }
.article-content p { font-size: 1.125rem; line-height: 1.75; color: var(--fg-2); }
.article-content p strong { color: var(--fg); font-weight: 600; }

.article-content h2 {
    font-size: clamp(1.5rem, 2.4vw, 1.875rem);
    font-weight: 700;
    letter-spacing: -0.018em;
    margin-top: 3rem;
    margin-bottom: 1rem;
    scroll-margin-top: 90px;
}
.article-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.012em;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    scroll-margin-top: 90px;
}
.article-content h4 {
    font-size: 1.0625rem;
    font-weight: 700;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.article-content blockquote {
    border-left: 3px solid var(--m-red);
    padding: 6px 0 6px 24px;
    margin: 2rem 0;
    color: var(--fg);
    font-size: 1.25rem;
    font-style: italic;
    line-height: 1.5;
    letter-spacing: -0.005em;
}

.article-content figure { margin: 2rem 0; }
.article-content figure img { border-radius: var(--r-md); }
.article-content figcaption {
    text-align: center;
    color: var(--fg-4);
    font-size: 0.875rem;
    margin-top: 8px;
    font-style: italic;
}

.article-content hr {
    border: 0;
    height: 1px;
    background: var(--border);
    margin: 2.5rem 0;
}

.article-content code {
    font-family: var(--font-mono);
    background: var(--bg-elev-2);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    color: var(--m-red);
}
.article-content pre {
    background: var(--bg-elev-2);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 20px;
    overflow-x: auto;
    font-size: 0.875rem;
    line-height: 1.6;
}
.article-content pre code {
    background: transparent;
    padding: 0;
    color: var(--fg-2);
}

.article-content ul li, .article-content ol li {
    font-size: 1.125rem;
    line-height: 1.75;
    color: var(--fg-2);
}

/* Tags row */
.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 32px 0 32px;
    padding: 24px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.tag-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: var(--bg-elev-2);
    border: 1px solid var(--border);
    border-radius: var(--r-full);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--fg-3);
    transition: all var(--t-fast) var(--ease);
}
.tag-pill:hover {
    background: var(--m-red-soft);
    border-color: var(--m-red);
    color: var(--m-red);
}

/* Author card (bottom of article) */
.author-card {
    margin-top: 32px;
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding: 28px;
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 24px;
    align-items: start;
}
@media (max-width: 600px) { .author-card { grid-template-columns: 1fr; text-align: center; } }
.author-card__avatar {
    width: 96px; height: 96px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg-elev-2);
}
@media (max-width: 600px) { .author-card__avatar { margin: 0 auto; } }
.author-card__avatar img { width: 100%; height: 100%; object-fit: cover; }
.author-card__role {
    color: var(--m-red);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 6px;
}
.author-card__name { font-size: 1.25rem; font-weight: 700; margin-bottom: 10px; letter-spacing: -0.015em; }
.author-card__bio { color: var(--fg-3); font-size: 0.9375rem; line-height: 1.6; margin-bottom: 16px; }

/* Sidebar (sticky) */
.article-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: calc(var(--header-h) + 20px);
    align-self: start;
}
@media (max-width: 900px) { .article-sidebar { position: static; } }

.sidebar-card--sticky { padding: 18px 20px; }

/* Table of Contents */
.toc { list-style: none; padding: 0; margin: 0; }
.toc__item { margin-bottom: 6px; }
.toc__item--l3 { padding-left: 14px; }
.toc__item a {
    display: block;
    padding: 6px 10px;
    border-left: 2px solid transparent;
    color: var(--fg-3);
    font-size: 0.8125rem;
    line-height: 1.4;
    transition: all var(--t-fast) var(--ease);
    border-radius: 0 4px 4px 0;
}
.toc__item a:hover { color: var(--fg); background: var(--bg-elev-2); }
.toc__item a.is-active {
    color: var(--m-red);
    border-left-color: var(--m-red);
    background: var(--m-red-soft);
    font-weight: 600;
}

/* Share rail */
.share-rail {
    display: flex;
    gap: 6px;
}
.share-rail a, .share-rail button {
    width: 38px; height: 38px;
    border-radius: var(--r-sm);
    background: var(--bg-elev-2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--fg-3);
    transition: all var(--t-fast) var(--ease);
    border: 1px solid var(--border);
    cursor: pointer;
}
.share-rail a:hover, .share-rail button:hover {
    background: var(--m-red);
    color: white;
    border-color: var(--m-red);
}

/* Article card variant */
.ep-card--article .ep-card__type {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(10, 10, 12, 0.78);
    color: var(--fg);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 6px;
    backdrop-filter: blur(8px);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.ep-card--article .ep-card__type svg { color: var(--m-red); }

.ep-card__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--fg-4);
}
.ep-card__author {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--fg-3);
    font-weight: 500;
}
.ep-card__author img {
    width: 22px; height: 22px;
    border-radius: 50%;
    object-fit: cover;
}

/* -------------------------------------------------------------------------- *
 * 13. FOOTER
 * -------------------------------------------------------------------------- */

.site-footer {
    border-top: 1px solid var(--border);
    background: var(--bg-elev-1);
    padding: clamp(40px, 5vw, 64px) 0 32px;
    margin-top: 64px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 32px;
    margin-bottom: 40px;
}
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }

.footer-brand p { color: var(--fg-3); font-size: 0.875rem; margin: 14px 0 16px; max-width: 320px; }
.footer-socials { display: flex; gap: 8px; }
.footer-socials a {
    width: 36px; height: 36px;
    border-radius: var(--r-sm);
    background: var(--bg-elev-2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--fg-3);
    transition: all var(--t-fast) var(--ease);
}
.footer-socials a:hover { background: var(--m-red); color: white; }

.footer-col h5 {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--fg);
    margin-bottom: 16px;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { color: var(--fg-3); font-size: 0.875rem; }
.footer-col a:hover { color: var(--m-red); }

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    color: var(--fg-4);
    font-size: 0.8125rem;
}
.footer-bottom__links { display: flex; gap: 24px; }

/* -------------------------------------------------------------------------- *
 * 13.5 KOENIG EDITOR (Ghost rich content classes)
 * -------------------------------------------------------------------------- */

.gh-content { font-size: 1.0625rem; }

.gh-content > * { margin-bottom: 1rem; }
.gh-content h1, .gh-content h2, .gh-content h3 { margin-top: 2rem; }

/* Wide & full-width images required by Ghost editor */
.kg-width-wide,
.kg-width-wide img {
    width: 100%;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
    border-radius: var(--r-xl);
}

.kg-width-full,
.kg-width-full img {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    border-radius: 0;
}

.kg-image {
    border-radius: var(--r-md);
    display: block;
    margin: 0 auto;
}

.kg-image-card { margin: 1.5rem 0; }
.kg-image-card figcaption {
    text-align: center;
    color: var(--fg-4);
    font-size: 0.875rem;
    margin-top: 8px;
}

/* Gallery */
.kg-gallery-card { margin: 1.5rem 0; }
.kg-gallery-container { display: flex; flex-direction: column; gap: 8px; }
.kg-gallery-row { display: flex; gap: 8px; }
.kg-gallery-image img { border-radius: var(--r-md); display: block; width: 100%; height: 100%; object-fit: cover; }

/* Bookmark card */
.kg-bookmark-card {
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    overflow: hidden;
    margin: 1.5rem 0;
}
.kg-bookmark-container {
    display: flex;
    color: inherit;
    text-decoration: none;
}
.kg-bookmark-content {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.kg-bookmark-title { font-weight: 700; color: var(--fg); margin-bottom: 6px; }
.kg-bookmark-description { color: var(--fg-3); font-size: 0.9375rem; margin-bottom: 10px; }
.kg-bookmark-metadata { color: var(--fg-4); font-size: 0.8125rem; display: flex; align-items: center; gap: 8px; }
.kg-bookmark-icon { width: 16px; height: 16px; }
.kg-bookmark-thumbnail { width: 200px; flex-shrink: 0; }
.kg-bookmark-thumbnail img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 600px) {
    .kg-bookmark-container { flex-direction: column-reverse; }
    .kg-bookmark-thumbnail { width: 100%; max-height: 200px; }
}

/* Embed (YouTube, Vimeo, etc.) */
.kg-embed-card {
    margin: 1.5rem 0;
    display: flex;
    justify-content: center;
}
.kg-embed-card iframe { max-width: 100%; border-radius: var(--r-md); }

/* Callout */
.kg-callout-card {
    border-radius: var(--r-md);
    padding: 20px;
    margin: 1.5rem 0;
    display: flex;
    gap: 12px;
}
.kg-callout-card-grey { background: var(--bg-elev-2); border: 1px solid var(--border); }
.kg-callout-card-blue { background: rgba(56, 130, 246, 0.1); border: 1px solid rgba(56, 130, 246, 0.2); }
.kg-callout-card-green { background: rgba(34, 197, 94, 0.1); border: 1px solid rgba(34, 197, 94, 0.2); }
.kg-callout-card-yellow { background: rgba(234, 179, 8, 0.1); border: 1px solid rgba(234, 179, 8, 0.2); }
.kg-callout-card-red { background: var(--m-red-soft); border: 1px solid rgba(239, 59, 59, 0.2); }
.kg-callout-emoji { font-size: 1.5rem; line-height: 1; }
.kg-callout-text { color: var(--fg-2); }

/* Toggle */
.kg-toggle-card {
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 18px 20px;
    margin: 1.5rem 0;
}
.kg-toggle-heading { display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
.kg-toggle-heading-text { font-weight: 700; color: var(--fg); margin: 0; }

/* Button card */
.kg-button-card { display: flex; justify-content: center; margin: 1.5rem 0; }
.kg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 22px;
    font-weight: 600;
    border-radius: var(--r-md);
    background: var(--m-red);
    color: white;
    text-decoration: none;
    transition: all var(--t-fast) var(--ease);
}
.kg-btn:hover { background: var(--m-red-600); transform: translateY(-1px); color: white; }

/* Header card */
.kg-header-card { padding: 60px 30px; text-align: center; border-radius: var(--r-lg); margin: 1.5rem 0; }
.kg-header-card-text { color: var(--fg); }

/* Product card */
.kg-product-card {
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 24px;
    margin: 1.5rem 0;
}
.kg-product-card-title { font-weight: 700; }

/* Audio + Video cards */
.kg-audio-card, .kg-video-card {
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 16px;
    margin: 1.5rem 0;
}

/* File card */
.kg-file-card {
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 16px;
    margin: 1.5rem 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* -------------------------------------------------------------------------- *
 * 14. UTILITIES
 * -------------------------------------------------------------------------- */

.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0);
    white-space: nowrap; border: 0;
}

.text-red { color: var(--m-red); }
.text-muted { color: var(--fg-3); }
.text-center { text-align: center; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.mb-5 { margin-bottom: 48px; }

.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mt-5 { margin-top: 48px; }

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 48px;
}
.pagination a {
    padding: 10px 18px;
    border-radius: var(--r-md);
    background: var(--surface-card);
    border: 1px solid var(--border);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--fg);
}
.pagination a:hover { background: var(--surface-card-hover); border-color: var(--border-strong); color: var(--fg); }
.pagination .page { color: var(--fg-3); font-size: 0.8125rem; }

/* Empty state */
.empty {
    text-align: center;
    padding: 80px 20px;
    color: var(--fg-3);
}
.empty h3 { color: var(--fg); margin-bottom: 12px; }

/* -------------------------------------------------------------------------- *
 * 15. EPISODE BUILDER FORM (offline tool)
 * -------------------------------------------------------------------------- */

.builder {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 32px;
}
@media (max-width: 900px) { .builder { grid-template-columns: minmax(0, 1fr); } }
.builder > .form-card { min-width: 0; }

.form-card {
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding: 28px;
}

.form-section {
    border-bottom: 1px solid var(--border);
    padding-bottom: 24px;
    margin-bottom: 24px;
}
.form-section:last-of-type { border-bottom: 0; }
.form-section h3 {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--m-red);
    margin-bottom: 16px;
}

.field { margin-bottom: 14px; }
.field label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--fg-2);
    margin-bottom: 6px;
}
.field input,
.field textarea,
.field select {
    width: 100%;
    background: var(--bg-elev-2);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 12px 14px;
    color: var(--fg);
    font-size: 0.9375rem;
    transition: border-color var(--t-fast) var(--ease);
}
.field input:focus,
.field textarea:focus,
.field select:focus {
    outline: none;
    border-color: var(--m-red);
}
.field textarea { resize: vertical; min-height: 90px; font-family: var(--font-sans); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.field-help {
    font-size: 0.75rem;
    color: var(--fg-4);
    margin-top: 4px;
}

.builder-output pre,
.builder-output textarea#snippet {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 18px;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--fg-2);
    line-height: 1.5;
    max-height: 480px;
    width: 100%;
    box-sizing: border-box;
    /* The actual fix for sideways layout shift: long URLs in the JSON
       get force-wrapped instead of pushing the layout column wider. */
    white-space: pre-wrap;
    word-break: break-all;
    overflow-wrap: anywhere;
    overflow-y: auto;
    overflow-x: hidden;
    resize: vertical;
    min-height: 320px;
    display: block;
}
.builder-output textarea#snippet:focus {
    outline: 2px solid var(--m-red);
    outline-offset: -2px;
}
.builder-output textarea#snippet.is-edited {
    border-color: var(--m-red);
}
.snippet-status {
    font-size: 0.75rem;
    margin-top: 6px;
    color: var(--fg-4);
    min-height: 1.2em;
}
.snippet-status.ok { color: #22c55e; }
.snippet-status.err { color: #ef4444; }

.copy-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 8px; flex-wrap: wrap; }
.copy-row h4 { font-size: 0.875rem; font-weight: 700; color: var(--fg); margin: 0; }
.copy-row .copy-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* Repeater rows */
.repeater-item {
    background: var(--bg-elev-2);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 14px;
    margin-bottom: 10px;
    position: relative;
}
.repeater-item .remove-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    color: var(--fg-4);
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: var(--r-sm);
}
.repeater-item .remove-btn:hover { color: var(--m-red); background: var(--m-red-soft); }

/* Alerts */
.alert {
    padding: 14px 16px;
    border-radius: var(--r-md);
    border: 1px solid var(--border);
    background: var(--bg-elev-2);
    font-size: 0.875rem;
    margin-bottom: 18px;
    color: var(--fg-2);
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.alert--info { border-color: var(--m-red-soft); background: var(--m-red-soft); }
.alert svg { flex-shrink: 0; color: var(--m-red); margin-top: 2px; }
