/* ==========================================================================
   INKUZO GHOST THEME — Option 2: Koma Visual Covers
   Self-hosted WOFF2 fonts + Ghost Custom Fonts + Light / Dark / Paper Tint
   ========================================================================== */

@font-face {
    font-family: 'Newsreader Variable';
    font-style: normal;
    font-display: swap;
    font-weight: 200 800;
    src: url('../fonts/newsreader-latin-opsz-normal.woff2') format('woff2-variations');
}

@font-face {
    font-family: 'Newsreader Variable';
    font-style: italic;
    font-display: swap;
    font-weight: 200 800;
    src: url('../fonts/newsreader-latin-opsz-italic.woff2') format('woff2-variations');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-display: swap;
    font-weight: 400;
    src: url('../fonts/inter-latin-400-normal.woff2') format('woff2');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-display: swap;
    font-weight: 500;
    src: url('../fonts/inter-latin-500-normal.woff2') format('woff2');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-display: swap;
    font-weight: 600;
    src: url('../fonts/inter-latin-600-normal.woff2') format('woff2');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-display: swap;
    font-weight: 700;
    src: url('../fonts/inter-latin-700-normal.woff2') format('woff2');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-display: swap;
    font-weight: 800;
    src: url('../fonts/inter-latin-800-normal.woff2') format('woff2');
}

/* ==========================================================================
   1. DESIGN TOKENS (LIGHT, DARK & ISOLATED PAPER/SEPIA TINT)
   ========================================================================== */
:root,
html[data-theme="light"] {
    --font-sans: var(--gh-font-body, 'Inter'), -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-serif: var(--gh-font-heading, 'Newsreader Variable'), Georgia, 'Times New Roman', serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

    --bg: #FAF7F2;
    --surface: #FFFFFF;
    --surface-subtle: #F3EEE5;
    --surface-hover: #E7DFCF;
    --text: #171412;
    --muted: #524C44;
    --border: #DFD7C8;
    --border-strong: #171412;

    --accent: var(--ghost-accent-color, #EA580C);
    --accent-hover: #C2410C;
    --accent-text: #FFFFFF;
    --accent-soft: rgba(234, 88, 12, 0.11);
    --link: #C2410C;

    --yellow-bg: #FACC15;
    --yellow-text: #171412;

    --pill-bg: rgba(255, 255, 255, 0.94);
    --grid-line: rgba(23, 20, 18, 0.055);

    --btn-bg: #F3EEE5;
    --btn-text: #171412;
    --btn-border: #D6CCBA;
    --btn-hover-bg: #E7DFCF;
    --btn-active-bg: #171412;
    --btn-active-text: #FACC15;

    --reader-bg: #FAF7F2;
    --toc-bg: #FFFFFF;
    --toc-border: #DFD7C8;
    --toc-link: #C2410C;
    --yt-bg: #FFFFFF;
    --yt-header-bg: #F3EEE5;
    --callout-bg: #F3EEE5;
    --bookmark-bg: #FFFFFF;
    --next-bg: #171412;
    --next-text: #FFFFFF;
    --next-muted: #D6D3D1;
    --next-border: #F97316;

    --pub-bg: #171412;
    --pub-text: #F2EFE9;
    --pub-muted: #B8B2A8;
    --pub-border: #2C2A27;
    --pub-icon-bg: rgba(255, 255, 255, 0.09);
    --pub-icon-text: #F2EFE9;

    --dock-bg: rgba(23, 20, 18, 0.95);
    --dock-text: #F2EFE9;

    --shadow-sm: 0 4px 16px rgba(23, 20, 18, 0.05);
    --shadow-md: 0 12px 30px rgba(23, 20, 18, 0.09);
    --shadow-lg: 0 20px 48px rgba(23, 20, 18, 0.14);
}

html[data-theme="dark"] {
    --bg: #111110;
    --surface: #1B1A18;
    --surface-subtle: #242320;
    --surface-hover: #2E2C28;
    --text: #F2EFE9;
    --muted: #B0AAA0;
    --border: #2E2C28;
    --border-strong: #F2EFE9;

    --accent: var(--ghost-accent-color, #F97316);
    --accent-hover: #EA580C;
    --accent-text: #FFFFFF;
    --accent-soft: rgba(249, 115, 22, 0.16);
    --link: #FB923C;

    --yellow-bg: #FACC15;
    --yellow-text: #171412;

    --pill-bg: rgba(27, 26, 24, 0.94);
    --grid-line: rgba(250, 204, 21, 0.048);

    --btn-bg: #242320;
    --btn-text: #F2EFE9;
    --btn-border: #3A3833;
    --btn-hover-bg: #2E2C28;
    --btn-active-bg: #FACC15;
    --btn-active-text: #171412;

    --reader-bg: #111110;
    --toc-bg: #1B1A18;
    --toc-border: #2E2C28;
    --toc-link: #FB923C;
    --yt-bg: #1B1A18;
    --yt-header-bg: #242320;
    --callout-bg: #242320;
    --bookmark-bg: #1B1A18;
    --next-bg: #1B1A18;
    --next-text: #F2EFE9;
    --next-muted: #B0AAA0;
    --next-border: #F97316;

    --pub-bg: #1B1A18;
    --pub-text: #F2EFE9;
    --pub-muted: #B0AAA0;
    --pub-border: #2E2C28;
    --pub-icon-bg: rgba(255, 255, 255, 0.08);
    --pub-icon-text: #F2EFE9;

    --dock-bg: rgba(27, 26, 24, 0.96);
    --dock-text: #F2EFE9;

    --shadow-sm: 0 6px 22px rgba(0, 0, 0, 0.36);
    --shadow-md: 0 14px 36px rgba(0, 0, 0, 0.50);
    --shadow-lg: 0 22px 54px rgba(0, 0, 0, 0.64);
}

/* Isolated Sepia / Paper Tint Scope (Guaranteed WCAG AA even inside Dark Mode) */
.reader-scope[data-reader-tint="sepia"] {
    --bg: #F4ECD8;
    --reader-bg: #F4ECD8;
    --surface: #EFE5CE;
    --surface-subtle: #EAE0C8;
    --surface-hover: #DFD3B8;
    --text: #231D15;
    --muted: #5A4C3B;
    --border: #D2C3A3;
    --border-strong: #231D15;
    --link: #9A3412;
    --accent: #C2410C;
    --accent-hover: #9A3412;
    --accent-text: #FFFFFF;
    --accent-soft: rgba(194, 65, 12, 0.13);
    --yellow-bg: #FACC15;
    --yellow-text: #231D15;

    --btn-bg: #EAE0C8;
    --btn-text: #231D15;
    --btn-border: #C4B28E;
    --btn-hover-bg: #DFD3B8;
    --btn-active-bg: #231D15;
    --btn-active-text: #F4ECD8;

    --toc-bg: #EAE0C8;
    --toc-border: #CBBBA0;
    --toc-link: #9A3412;
    --yt-bg: #EFE5CE;
    --yt-header-bg: #E4D7BA;
    --callout-bg: #EAE0C8;
    --bookmark-bg: #EFE5CE;
    --next-bg: #EAE0C8;
    --next-text: #231D15;
    --next-muted: #5A4C3B;
    --next-border: #C2410C;

    --shadow-sm: 0 4px 16px rgba(35, 29, 21, 0.07);
    --shadow-md: 0 10px 26px rgba(35, 29, 21, 0.11);
}

/* Fix Sodo Search host color-scheme in Dark Mode */
#sodo-search-root,
#sodo-search-root iframe {
    color-scheme: light;
}

/* ==========================================================================
   2. BASE RESET & TYPOGRAPHY
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--gh-font-body, 'Inter'), -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow-x: clip;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--gh-font-body, 'Inter'), -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    overflow-x: clip;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.2s ease, color 0.2s ease;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--gh-font-heading, 'Newsreader Variable'), Georgia, serif;
    margin-top: 0;
    color: var(--text);
}

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

a {
    color: inherit;
}

.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;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0.75rem;
    z-index: 200;
    padding: 0.65rem 1.1rem;
    border-radius: 9999px;
    background: var(--yellow-bg);
    color: var(--yellow-text);
    font-weight: 800;
    font-size: 0.85rem;
    text-decoration: none;
}

.skip-link:focus {
    left: 1rem;
}

.container {
    width: 100%;
    max-width: 1240px;
    margin-inline: auto;
    padding-inline: 1rem;
}

@media (min-width: 640px) {
    .container {
        padding-inline: 1.5rem;
    }
}

.icon-svg {
    width: 16px;
    height: 16px;
    display: block;
    flex-shrink: 0;
}

.icon-svg--lg {
    width: 24px;
    height: 24px;
}

.site-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-main {
    flex: 1 0 auto;
}

/* ==========================================================================
   3. REUSABLE BUTTONS & BADGES (FIT-CONTENT SAFE)
   ========================================================================== */
.cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    background-color: var(--accent);
    color: var(--accent-text);
    border: 1px solid var(--accent);
    border-radius: 9999px;
    padding: 0.65rem 1.35rem;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.cta-btn:hover {
    background-color: var(--accent-hover);
    border-color: var(--accent-hover);
    transform: translateY(-1px);
}

.pill-btn,
.comfort-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background-color: var(--btn-bg);
    color: var(--btn-text);
    border: 1px solid var(--btn-border);
    border-radius: 9999px;
    padding: 0.42rem 0.82rem;
    font-family: var(--font-sans);
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.pill-btn:hover,
.comfort-btn:hover {
    background-color: var(--btn-hover-bg);
    border-color: var(--accent);
}

.comfort-btn.is-active,
.comfort-btn[aria-pressed="true"] {
    background-color: var(--btn-active-bg);
    color: var(--btn-active-text);
    border-color: var(--btn-active-bg);
}

.badge-genre {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    width: fit-content;
    max-width: 100%;
    padding: 0.18rem 0.65rem;
    border-radius: 9999px;
    background-color: var(--yellow-bg);
    color: var(--yellow-text);
    font-family: var(--font-sans);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-decoration: none;
    line-height: 1.4;
}

.badge-yt {
    position: absolute;
    top: 0.65rem;
    left: 0.65rem;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    align-self: flex-start;
    width: fit-content;
    padding: 0.2rem 0.62rem;
    border-radius: 9999px;
    background-color: rgba(20, 20, 19, 0.9);
    color: #FACC15;
    border: 1px solid rgba(250, 204, 21, 0.35);
    font-family: var(--font-sans);
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.badge-yt--inline {
    position: static;
    background-color: #F97316;
    color: #FFFFFF;
    border-color: #F97316;
    text-transform: uppercase;
}

/* ==========================================================================
   4. STICKY PILL NAVBAR
   ========================================================================== */
.floating-pill-outer {
    position: sticky;
    top: 0;
    z-index: 50;
    background: transparent;
    pointer-events: none;
    padding: 0.75rem 0.75rem 0.35rem;
}

@media (min-width: 640px) {
    .floating-pill-outer {
        padding: 0.85rem 1.25rem 0.35rem;
    }
}

.floating-pill-inner {
    pointer-events: auto;
    max-width: 1240px;
    margin-inline: auto;
    background-color: var(--pill-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border);
    border-radius: 9999px;
    box-shadow: var(--shadow-md);
    padding: 0.45rem 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

@media (min-width: 640px) {
    .floating-pill-inner {
        padding: 0.5rem 1.15rem;
        gap: 1rem;
    }
}

.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    flex-shrink: 0;
}

.site-logo-img {
    height: 30px;
    width: auto;
    object-fit: contain;
}

.brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 0.7rem;
    background: linear-gradient(135deg, #FACC15 0%, #F97316 100%);
    color: #171412;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    box-shadow: var(--shadow-sm);
}

.brand-mark--sm {
    width: 28px;
    height: 28px;
    border-radius: 0.55rem;
}

.brand-wordmark {
    font-family: var(--font-sans);
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
    color: var(--text);
}

.primary-nav {
    display: none;
}

@media (min-width: 900px) {
    .primary-nav {
        display: flex;
        align-items: center;
    }
}

.nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    padding: 0.38rem 0.85rem;
    border-radius: 9999px;
    font-family: var(--font-sans);
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--muted);
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-link:hover {
    color: var(--text);
    background-color: var(--surface-subtle);
}

.nav-link.is-active,
.nav-link.nav-current {
    background-color: var(--yellow-bg);
    color: var(--yellow-text);
    font-weight: 800;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.header-socials {
    display: flex;
    align-items: center;
    padding-right: 0.35rem;
    border-right: 1px solid var(--border);
}

.header-socials:empty,
.header-socials:has(.social-links:empty) {
    display: none;
}

.social-links {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.social-links--header .social-btn {
    width: 30px;
    height: 30px;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.social-links--header .social-btn:hover {
    color: var(--accent);
    background-color: var(--surface-subtle);
}

/* On ultra-narrow phones (< 520px), show primary YT + TikTok in pill and all 5 in drawer/footer */
@media (max-width: 520px) {
    .social-links--header .social-btn:nth-child(n+3) {
        display: none;
    }
}

.btn-label-desktop,
.theme-label {
    display: none;
}

@media (min-width: 640px) {
    .theme-label {
        display: inline;
    }
}

@media (min-width: 1024px) {
    .btn-label-desktop {
        display: inline;
    }
}

.pill-btn--theme {
    background-color: var(--btn-active-bg);
    color: var(--btn-active-text);
    border-color: var(--btn-active-bg);
    font-weight: 800;
}

.pill-btn--theme:hover {
    background-color: var(--btn-active-bg);
    border-color: var(--accent);
}

.pill-btn--menu {
    padding: 0.42rem 0.55rem;
}

@media (min-width: 900px) {
    .pill-btn--menu {
        display: none;
    }
}

.mobile-nav-panel {
    pointer-events: auto;
    max-width: 1240px;
    margin: 0.5rem auto 0;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1.25rem;
    padding: 0.85rem 1rem;
    box-shadow: var(--shadow-lg);
}

.mobile-nav-panel[hidden] {
    display: none;
}

.mobile-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.mobile-nav-list .nav-link {
    width: 100%;
    padding: 0.55rem 0.85rem;
}

.mobile-nav-socials {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.social-links--header-mobile .social-btn {
    width: 34px;
    height: 34px;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--surface-subtle);
    color: var(--text);
    text-decoration: none;
}

/* ==========================================================================
   5. KOMA VISUAL COVERS HERO (ARCHITECTURAL GRID + 1 SPOTLIGHT + 2x2 TILES)
   ========================================================================== */
.arch-grid-bg {
    background-image:
        linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
        linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
    background-size: 32px 32px;
}

.hero-stage {
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 0 2.5rem;
    margin-bottom: 1.5rem;
}

.hero-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.15rem;
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-family: var(--font-sans);
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--link);
    margin-bottom: 0.25rem;
}

.kicker-dot {
    width: 8px;
    height: 8px;
    border-radius: 9999px;
    background-color: var(--yellow-bg);
}

.hero-heading {
    font-size: clamp(1.75rem, 3.2vw, 2.5rem);
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 0;
}

.hero-hint {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--muted);
}

.hero-bento-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (min-width: 1024px) {
    .hero-bento-grid {
        grid-template-columns: repeat(4, 1fr);
        grid-template-rows: repeat(2, minmax(185px, 1fr));
        gap: 1.15rem;
    }
}

.hero-card {
    position: relative;
    border-radius: 1.15rem;
    overflow: hidden;
    border: 1px solid var(--border);
    background-color: #171412;
    box-shadow: var(--shadow-sm);
    transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.2s ease, box-shadow 0.2s ease;
}

.hero-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
}

.hero-card--spotlight {
    grid-column: 1 / -1;
    min-height: 320px;
}

@media (min-width: 1024px) {
    .hero-card--spotlight {
        grid-column: 1 / span 2;
        grid-row: 1 / span 2;
        min-height: 390px;
    }
}

.hero-card--tile {
    aspect-ratio: 4 / 3;
}

@media (min-width: 1024px) {
    .hero-card--tile {
        aspect-ratio: auto;
        min-height: 185px;
    }
}

.hero-card-link {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    position: relative;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: #FFFFFF;
}

.hero-card-media {
    position: absolute;
    inset: 0;
}

.hero-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-card:hover .hero-card-img {
    transform: scale(1.04);
}

.hero-card-overlay {
    position: relative;
    z-index: 2;
    padding: 1.35rem 1.4rem;
    background: linear-gradient(180deg, rgba(17, 17, 16, 0.05) 0%, rgba(17, 17, 16, 0.68) 45%, rgba(17, 17, 16, 0.96) 100%);
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.hero-card--tile .hero-card-overlay {
    padding: 0.9rem 1rem;
}

.hero-card-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}

.hero-spotlight-title {
    font-size: clamp(1.45rem, 2.5vw, 2.1rem);
    font-weight: 700;
    line-height: 1.15;
    color: #FFFFFF;
    margin: 0;
}

.hero-spotlight-excerpt {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    color: #E7E5E4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-spotlight-cta {
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 800;
    color: #FACC15;
    margin-top: 0.2rem;
}

.hero-tile-title {
    font-size: clamp(0.95rem, 1.3vw, 1.12rem);
    font-weight: 700;
    line-height: 1.25;
    color: #FFFFFF;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cover-fallback {
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 75% 25%, rgba(250, 204, 21, 0.28), transparent 52%),
                linear-gradient(135deg, #1E293B 0%, #171412 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cover-fallback-mark {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: 0.08em;
    color: rgba(250, 204, 21, 0.55);
    text-transform: uppercase;
}

/* ==========================================================================
   6. CONTINUE READING SMART BAR (LOCALSTORAGE)
   ========================================================================== */
.continue-wrap {
    margin-bottom: 1.75rem;
}

.continue-wrap[hidden] {
    display: none;
}

.continue-bar {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 0.7rem 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    box-shadow: var(--shadow-sm);
}

.continue-info {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
    flex: 1 1 240px;
}

.continue-thumb {
    width: 42px;
    height: 48px;
    border-radius: 0.5rem;
    object-fit: cover;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.continue-thumb[hidden] {
    display: none;
}

.continue-text {
    min-width: 0;
}

.continue-kicker {
    display: block;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--link);
}

.continue-title-row {
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.continue-title {
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text);
}

.continue-pct {
    font-family: var(--font-mono);
    font-size: 0.76rem;
    color: var(--muted);
}

.continue-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.continue-btn {
    padding: 0.45rem 1rem;
    font-size: 0.78rem;
}

.continue-dismiss {
    width: 30px;
    height: 30px;
    padding: 0;
    font-size: 1rem;
}

/* ==========================================================================
   7. MAIN FEED (2 COLUMNS) & STORY CARDS
   ========================================================================== */
.feed-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    padding-bottom: 3.5rem;
    align-items: start;
}

@media (min-width: 1024px) {
    .feed-layout {
        grid-template-columns: minmax(0, 8fr) minmax(0, 4fr);
        gap: 2.25rem;
    }
}

.feed-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.feed-heading-wrap {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.heading-dot {
    width: 10px;
    height: 10px;
    border-radius: 9999px;
    background-color: var(--accent);
}

.feed-heading {
    font-size: clamp(1.5rem, 2.4vw, 1.95rem);
    font-weight: 700;
    margin: 0;
}

.feed-archive-link {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--link);
    text-decoration: none;
}

.feed-archive-link:hover {
    text-decoration: underline;
}

.story-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.35rem;
}

@media (min-width: 640px) {
    .story-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.story-grid--three {
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .story-grid--three {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .story-grid--three {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.story-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1.15rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.2s ease, box-shadow 0.2s ease;
}

.story-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
}

.story-card-cover-link {
    display: block;
    text-decoration: none;
}

.story-card-media {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
    background-color: #171412;
}

.story-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.story-card:hover .story-card-img {
    transform: scale(1.04);
}

.story-card-body {
    padding: 1.05rem 1.15rem 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    flex: 1 1 auto;
}

.story-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.meta-reading-time {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.story-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.25;
    margin: 0.15rem 0 0;
}

.story-card-title-link {
    text-decoration: none;
    color: var(--text);
}

.story-card-title-link:hover {
    color: var(--link);
}

.story-card-excerpt {
    font-size: 0.84rem;
    color: var(--muted);
    line-height: 1.55;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==========================================================================
   8. STICKY SIDEBAR, GLOWING BRAND CARD, GENRES & ADSENSE
   ========================================================================== */
.sidebar-col {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@media (min-width: 1024px) {
    .sidebar-col {
        position: sticky;
        top: 5.5rem;
    }
}

.pub-card {
    position: relative;
    background-color: var(--pub-bg);
    color: var(--pub-text);
    border: 1px solid var(--pub-border);
    border-radius: 1.25rem;
    padding: 1.5rem;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    text-align: center;
}

.pub-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: linear-gradient(90deg, #FACC15 0%, #F97316 55%, rgba(249, 115, 22, 0.15) 100%);
}

.pub-card::after {
    content: '';
    position: absolute;
    top: -36px;
    left: 50%;
    transform: translateX(-50%);
    width: 210px;
    height: 88px;
    background: radial-gradient(ellipse at center, rgba(250, 204, 21, 0.25) 0%, rgba(249, 115, 22, 0.1) 48%, transparent 74%);
    pointer-events: none;
}

.pub-card-inner {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pub-card-emblem {
    width: 48px;
    height: 48px;
    border-radius: 1rem;
    background: linear-gradient(135deg, #FACC15 0%, #F97316 100%);
    color: #171412;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(255, 255, 255, 0.25);
    overflow: hidden;
}

.pub-card-icon-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pub-card-title {
    font-family: var(--font-sans);
    font-size: 1.15rem;
    font-weight: 800;
    color: #FFFFFF;
    margin-bottom: 0.4rem;
}

.pub-card-tagline {
    font-size: 0.82rem;
    line-height: 1.55;
    color: var(--pub-muted);
    max-width: 265px;
    margin: 0 0 1rem;
}

.pub-card-cta {
    width: 100%;
    padding: 0.65rem 1rem;
    font-size: 0.82rem;
}

.pub-card-socials {
    margin-top: 1rem;
}

.social-links--pub .social-btn {
    width: 34px;
    height: 34px;
    border-radius: 9999px;
    background-color: var(--pub-icon-bg);
    color: var(--pub-icon-text);
    border: 1px solid rgba(255, 255, 255, 0.14);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.social-links--pub .social-btn:hover {
    background-color: #F97316;
    color: #FFFFFF;
    border-color: #F97316;
    transform: translateY(-1px);
}

.sidebar-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1.15rem;
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.sidebar-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.7rem;
    margin-bottom: 0.85rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-card-heading,
.sidebar-kicker {
    font-family: var(--font-sans);
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text);
    margin: 0;
}

.sidebar-kicker {
    color: var(--link);
}

.sidebar-count {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--muted);
}

.featured-series-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.featured-series-desc {
    font-size: 0.82rem;
    color: var(--muted);
    margin: 0 0 0.85rem;
}

.series-spotlight-link {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--link);
    text-decoration: none;
}

.series-spotlight-link:hover {
    text-decoration: underline;
}

.genre-pill-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    max-height: 11.5rem;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.genre-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.38rem 0.75rem;
    border-radius: 9999px;
    background-color: var(--btn-bg);
    color: var(--btn-text);
    border: 1px solid var(--btn-border);
    font-size: 0.76rem;
    font-weight: 700;
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.genre-pill:hover {
    background-color: var(--btn-hover-bg);
    border-color: var(--accent);
}

.genre-pill-count {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--muted);
}

.ad-slot-wrapper {
    background-color: var(--surface-subtle);
    border: 1px solid var(--border);
    border-radius: 1.15rem;
    padding: 0.85rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.ad-slot-label {
    font-family: var(--font-mono);
    font-size: 0.64rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-bottom: 0.45rem;
}

/* ==========================================================================
   9. PAGINATION
   ========================================================================== */
.pagination-bar {
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1.05rem;
    border-radius: 9999px;
    background-color: var(--btn-bg);
    color: var(--btn-text);
    border: 1px solid var(--btn-border);
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
}

.pagination-btn:hover:not(.is-disabled) {
    border-color: var(--accent);
    background-color: var(--btn-hover-bg);
}

.pagination-btn.is-disabled {
    opacity: 0.45;
    cursor: default;
}

.pagination-status {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--muted);
}

/* ==========================================================================
   10. STORY READER (post.hbs) — COMFORT BAR, TOGGLES, YOUTUBE, TOC, KOENIG
   ========================================================================== */
.reading-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3.5px;
    width: 0%;
    z-index: 70;
    background: linear-gradient(90deg, #F97316 0%, #FACC15 100%);
    transition: width 0.08s linear;
}

.reader-scope {
    background-color: var(--reader-bg);
    color: var(--text);
    min-height: 100vh;
    transition: background-color 0.22s ease, color 0.22s ease;
}

.reader-article {
    max-width: 896px;
    margin-inline: auto;
    padding: 1.35rem 1rem 4.5rem;
}

@media (min-width: 640px) {
    .reader-article {
        padding: 1.75rem 1.5rem 5rem;
    }
}

.reader-topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    padding-bottom: 1rem;
    margin-bottom: 1.75rem;
    border-bottom: 1px solid var(--border);
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--muted);
}

.breadcrumb-link {
    color: var(--link);
    text-decoration: none;
}

.breadcrumb-link:hover {
    text-decoration: underline;
}

.breadcrumb-current {
    color: var(--text);
    max-width: 240px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.comfort-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}

.comfort-btn--parts {
    background-color: var(--yellow-bg);
    color: var(--yellow-text);
    border-color: rgba(23, 20, 18, 0.2);
    font-weight: 800;
}

.reader-header {
    text-align: center;
    max-width: 44rem;
    margin: 0 auto 1.85rem;
}

.reader-meta-pills {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
}

.badge-genre--part[hidden] {
    display: none;
}

.reader-tag-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.72rem;
    border-radius: 9999px;
    background-color: var(--surface-subtle);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 0.74rem;
    font-weight: 700;
    text-decoration: none;
}

.reader-tag-pill:hover {
    border-color: var(--accent);
}

.reader-meta-time,
.reader-meta-date {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    color: var(--muted);
}

.reader-title {
    font-size: clamp(2rem, 4.5vw, 3.1rem);
    font-weight: 700;
    line-height: 1.12;
    margin-bottom: 0.65rem;
}

.reader-subtitle {
    font-size: 1.05rem;
    color: var(--muted);
    line-height: 1.55;
    margin: 0;
}

.reader-cover {
    margin: 0 0 2rem;
    border-radius: 1.15rem;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
}

.reader-cover-img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.reader-cover-caption {
    padding: 0.6rem 1rem;
    font-size: 0.78rem;
    color: var(--muted);
    background-color: var(--surface-subtle);
    border-top: 1px solid var(--border);
    text-align: center;
}

/* Collapsible YouTube Bridge Card */
.yt-bridge-card {
    max-width: 68ch;
    margin: 0 auto 1.75rem;
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid var(--border);
    background-color: var(--yt-bg);
    box-shadow: var(--shadow-sm);
}

.yt-bridge-card[hidden] {
    display: none;
}

.yt-bridge-header {
    width: 100%;
    padding: 0.9rem 1.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    background-color: var(--yt-header-bg);
    color: var(--text);
    border: 0;
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 800;
    text-align: left;
}

.yt-bridge-title {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--link);
}

.yt-bridge-state {
    font-size: 0.76rem;
    color: var(--muted);
    flex-shrink: 0;
}

.yt-bridge-body {
    padding: 1rem 1.2rem;
    border-top: 1px solid var(--border);
}

.yt-bridge-body[hidden] {
    display: none;
}

.yt-bridge-body .kg-embed-card {
    margin: 0 !important;
}

.yt-bridge-body iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    border-radius: 0.75rem;
    border: 0;
}

/* Auto Table of Contents */
.reader-toc {
    max-width: 68ch;
    margin: 0 auto 2rem;
    padding: 1.05rem 1.25rem;
    border-radius: 1rem;
    background-color: var(--toc-bg);
    border: 1px solid var(--toc-border);
}

.reader-toc[hidden] {
    display: none;
}

.reader-toc-title {
    font-family: var(--font-sans);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-bottom: 0.65rem;
}

.reader-toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem 1.15rem;
}

.reader-toc-link {
    font-family: var(--font-sans);
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--toc-link);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
}

.reader-toc-link:hover {
    opacity: 0.82;
}

.reader-toc-item--sub .reader-toc-link {
    font-weight: 600;
    font-size: 0.8rem;
}

/* Prose Typography */
.reader-prose {
    max-width: 68ch;
    margin-inline: auto;
    font-size: var(--reader-font-size, 19px);
    line-height: 1.86;
    color: var(--text);
}

.reader-prose.prose-serif {
    font-family: var(--font-serif);
}

.reader-prose.prose-sans {
    font-family: var(--font-sans);
    line-height: 1.8;
}

.reader-prose p {
    margin-top: 0;
    margin-bottom: 1.45em;
}

.reader-prose h2 {
    font-family: var(--font-serif);
    font-size: 1.55em;
    font-weight: 700;
    line-height: 1.25;
    margin-top: 2.1rem;
    margin-bottom: 0.75rem;
    scroll-margin-top: 5.5rem;
}

.reader-prose h3 {
    font-family: var(--font-serif);
    font-size: 1.25em;
    font-weight: 700;
    line-height: 1.3;
    margin-top: 1.6rem;
    margin-bottom: 0.6rem;
    scroll-margin-top: 5.5rem;
}

.reader-prose a {
    color: var(--link);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.reader-prose.has-dropcap > p:first-of-type::first-letter {
    float: left;
    font-family: var(--font-serif);
    font-size: 4.2rem;
    line-height: 0.82;
    font-weight: 700;
    padding-top: 0.2rem;
    padding-right: 0.6rem;
    color: var(--accent);
}

.reader-prose ul,
.reader-prose ol {
    padding-left: 1.4rem;
    margin: 0 0 1.45em;
}

.reader-prose li {
    margin-bottom: 0.45em;
}

.reader-prose hr {
    border: 0;
    height: 1px;
    background-color: var(--border);
    margin: 2.25rem auto;
    max-width: 12rem;
}

/* Prevent horizontal scroll on tables & code on mobile */
.reader-prose pre {
    background-color: var(--surface-subtle);
    border: 1px solid var(--border);
    border-radius: 0.85rem;
    padding: 1rem 1.15rem;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.84rem;
}

.reader-prose code {
    font-family: var(--font-mono);
    font-size: 0.86em;
    background-color: var(--surface-subtle);
    padding: 0.12rem 0.38rem;
    border-radius: 0.35rem;
}

.reader-prose pre code {
    background: transparent;
    padding: 0;
}

.reader-prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.75rem 0;
    font-family: var(--font-sans);
    font-size: 0.9rem;
}

.reader-prose th,
.reader-prose td {
    border: 1px solid var(--border);
    padding: 0.65rem 0.85rem;
    text-align: left;
}

.reader-prose th {
    background-color: var(--surface-subtle);
    font-weight: 700;
}

@media (max-width: 767px) {
    .reader-prose table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }
}

/* ==========================================================================
   11. HIGH-SPECIFICITY KOENIG CARDS OVERRIDES (cards.min.css SAFE)
   ========================================================================== */
.reader-prose figure.kg-card {
    margin: 2rem 0;
    margin-inline: 0;
    max-width: 100%;
}

.reader-prose .kg-width-wide,
.reader-prose .kg-width-full {
    max-width: 100%;
}

.reader-prose .kg-image-card img {
    border-radius: 0.95rem;
    border: 1px solid var(--border);
}

.reader-prose .kg-card figcaption {
    margin-top: 0.55rem;
    font-family: var(--font-sans);
    font-size: 0.78rem;
    color: var(--muted);
    text-align: center;
}

.reader-prose blockquote,
.reader-prose blockquote.kg-blockquote-alt {
    margin: 1.85rem 0;
    padding: 1.15rem 1.4rem;
    border-inline-start: 4px solid var(--accent) !important;
    background-color: var(--callout-bg) !important;
    border-radius: 0 0.9rem 0.9rem 0;
    font-style: italic;
    font-size: 1.12em;
    line-height: 1.55;
    color: var(--text) !important;
}

.reader-prose .kg-card.kg-callout-card {
    margin: 2rem 0 !important;
    padding: 1.15rem 1.35rem !important;
    border-radius: 0.9rem !important;
    background-color: var(--callout-bg) !important;
    border: 1px solid var(--border) !important;
    border-inline-start: 4px solid var(--yellow-bg) !important;
    color: var(--text) !important;
    font-family: var(--font-sans) !important;
    font-size: 0.92rem !important;
    line-height: 1.62 !important;
}

.reader-prose .kg-card.kg-callout-card .kg-callout-text {
    color: var(--text) !important;
}

.reader-prose .kg-card.kg-bookmark-card a.kg-bookmark-container {
    background-color: var(--bookmark-bg) !important;
    border: 1px solid var(--border) !important;
    border-radius: 0.95rem !important;
    color: var(--text) !important;
    box-shadow: var(--shadow-sm);
    text-decoration: none !important;
    overflow: hidden;
}

.reader-prose .kg-card.kg-bookmark-card a.kg-bookmark-container:hover {
    border-color: var(--accent) !important;
}

.reader-prose .kg-card.kg-bookmark-card .kg-bookmark-title {
    color: var(--text) !important;
    font-family: var(--font-serif) !important;
}

.reader-prose .kg-card.kg-bookmark-card .kg-bookmark-description,
.reader-prose .kg-card.kg-bookmark-card .kg-bookmark-metadata {
    color: var(--muted) !important;
}

.reader-prose .kg-card.kg-toggle-card {
    background-color: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: 0.95rem !important;
    color: var(--text) !important;
    box-shadow: none !important;
}

.reader-prose .kg-card.kg-toggle-card .kg-toggle-heading-text,
.reader-prose .kg-card.kg-toggle-card .kg-toggle-content,
.reader-prose .kg-card.kg-toggle-card .kg-toggle-content p {
    color: var(--text) !important;
}

.reader-prose .kg-card.kg-toggle-card .kg-toggle-card-icon svg {
    stroke: var(--text) !important;
}

.reader-prose .kg-card.kg-audio-card,
.reader-prose .kg-card.kg-file-card .kg-file-card-container,
.reader-prose .kg-card.kg-product-card .kg-product-card-container {
    background-color: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: 0.95rem !important;
    color: var(--text) !important;
    box-shadow: var(--shadow-sm) !important;
}

.reader-prose .kg-card.kg-audio-card .kg-audio-title,
.reader-prose .kg-card.kg-file-card .kg-file-card-title,
.reader-prose .kg-card.kg-product-card .kg-product-card-title {
    color: var(--text) !important;
}

.reader-prose .kg-card.kg-audio-card .kg-audio-time,
.reader-prose .kg-card.kg-file-card .kg-file-card-caption,
.reader-prose .kg-card.kg-file-card .kg-file-card-metadata,
.reader-prose .kg-card.kg-product-card .kg-product-card-description {
    color: var(--muted) !important;
}

.reader-prose .kg-card.kg-audio-card svg,
.reader-prose .kg-card.kg-file-card svg {
    fill: var(--text) !important;
}

.reader-prose .kg-embed-card iframe {
    max-width: 100%;
    border-radius: 0.85rem;
}

/* ==========================================================================
   12. SHARE BAR, SERIES NAV, PARTS DRAWER, RELATED & MOBILE DOCK
   ========================================================================== */
.desktop-share-bar {
    display: none;
}

@media (min-width: 768px) {
    .desktop-share-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        max-width: 68ch;
        margin: 2.5rem auto 0;
        padding-top: 1.5rem;
        border-top: 1px solid var(--border);
    }
}

.share-label {
    font-family: var(--font-sans);
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.share-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
}

.share-btn {
    padding: 0.4rem 0.85rem;
    border-radius: 9999px;
    background-color: var(--btn-bg);
    color: var(--btn-text);
    border: 1px solid var(--btn-border);
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
}

.share-btn:hover {
    border-color: var(--accent);
    background-color: var(--btn-hover-bg);
}

.share-copy-btn {
    padding: 0.42rem 0.95rem;
    font-size: 0.78rem;
}

.reader-ad-wrap {
    max-width: 68ch;
    margin: 2rem auto;
}

/* Series Navigation */
.series-nav-section {
    max-width: 68ch;
    margin: 2.25rem auto 0;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.next-part-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.4rem 1.5rem;
    border-radius: 1.15rem;
    background-color: var(--next-bg);
    color: var(--next-text);
    border: 2px solid var(--next-border);
    text-decoration: none;
    box-shadow: var(--shadow-md);
    transition: transform 0.18s ease;
}

@media (min-width: 640px) {
    .next-part-card {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.next-part-card:hover {
    transform: translateY(-2px);
}

.next-part-title {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--next-text);
    margin: 0.45rem 0 0.2rem;
}

.next-part-sub {
    font-size: 0.8rem;
    color: var(--next-muted);
    margin: 0;
}

.series-complete-card {
    padding: 1.4rem 1.5rem;
    border-radius: 1.15rem;
    background-color: var(--surface);
    border: 1px solid var(--border);
    text-align: center;
}

.series-complete-title {
    font-size: 1.4rem;
    margin: 0.5rem 0 0.35rem;
}

.series-complete-sub {
    font-size: 0.88rem;
    color: var(--muted);
    margin: 0;
}

.series-nav-links {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.series-back-link,
.series-index-btn {
    background: transparent;
    border: 0;
    padding: 0;
    font-family: var(--font-sans);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--link);
    text-decoration: underline;
    cursor: pointer;
}

/* Slide-Over Parts Drawer */
.parts-drawer {
    position: fixed;
    inset: 0;
    z-index: 105;
    display: flex;
    justify-content: flex-end;
}

.parts-drawer[hidden] {
    display: none;
}

.parts-drawer-backdrop {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(3px);
}

.parts-drawer-panel {
    position: relative;
    z-index: 2;
    width: 340px;
    max-width: 88vw;
    height: 100%;
    background-color: var(--surface);
    color: var(--text);
    border-left: 1px solid var(--border);
    padding: 1.35rem;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

.parts-drawer-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.parts-drawer-kicker {
    display: block;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--link);
}

.parts-drawer-title {
    font-size: 1.2rem;
    margin: 0.15rem 0 0;
}

.parts-close-btn {
    width: 34px;
    height: 34px;
    padding: 0;
    font-size: 1.15rem;
}

.parts-drawer-list {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    overflow-y: auto;
    flex: 1 1 auto;
}

.parts-drawer-item {
    display: block;
    padding: 0.85rem 1rem;
    border-radius: 0.9rem;
    background-color: var(--btn-bg);
    color: var(--btn-text);
    border: 1px solid var(--btn-border);
    text-decoration: none;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.parts-drawer-item:hover {
    border-color: var(--accent);
}

.parts-drawer-item.is-current {
    background-color: var(--accent);
    color: var(--accent-text);
    border-color: var(--accent);
}

.parts-item-meta {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    opacity: 0.85;
}

.parts-item-title {
    display: block;
    font-weight: 700;
    font-size: 0.92rem;
    margin-top: 0.2rem;
}

/* Related Stories */
.related-section {
    margin-top: 3.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.related-heading {
    font-size: 1.6rem;
    margin-bottom: 1.25rem;
}

.related-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

@media (min-width: 640px) {
    .related-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Mobile Floating Bottom Pill Dock */
.mobile-bottom-dock {
    position: fixed;
    left: 50%;
    bottom: 1rem;
    z-index: 60;
    transform: translateX(-50%) translateY(0);
    background-color: var(--dock-bg);
    color: var(--dock-text);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 9999px;
    padding: 0.45rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45);
    max-width: calc(100vw - 1.25rem);
    transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
}

@media (min-width: 768px) {
    .mobile-bottom-dock {
        display: none;
    }
}

.mobile-bottom-dock.is-hidden {
    transform: translateX(-50%) translateY(160%);
    opacity: 0;
    pointer-events: none;
}

.dock-progress {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding-left: 0.25rem;
    padding-right: 0.55rem;
    border-right: 1px solid rgba(255, 255, 255, 0.18);
}

.dock-ring-svg {
    width: 17px;
    height: 17px;
    transform: rotate(-90deg);
    color: #FACC15;
}

.dock-pct {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.dock-share-btn {
    padding: 0.3rem 0.45rem;
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--dock-text);
    text-decoration: none;
}

.dock-share-btn:hover {
    color: #FACC15;
}

.dock-copy-btn {
    padding: 0.32rem 0.72rem;
    border-radius: 9999px;
    border: 0;
    background-color: #F97316;
    color: #FFFFFF;
    font-size: 0.7rem;
    font-weight: 800;
    cursor: pointer;
}

/* ==========================================================================
   13. PAGES, ARCHIVE, CONTACT, TAG, AUTHOR & ERROR TEMPLATES
   ========================================================================== */
.page-container {
    max-width: 820px;
    padding-top: 2.25rem;
    padding-bottom: 4rem;
}

.page-header {
    margin-bottom: 2rem;
}

.page-title {
    font-size: clamp(2rem, 4vw, 2.85rem);
    margin: 0.65rem 0 0.5rem;
}

.page-excerpt {
    font-size: 1.05rem;
    color: var(--muted);
    margin: 0;
}

.archive-hero {
    border-bottom: 1px solid var(--border);
    padding: 2rem 0 2.25rem;
    margin-bottom: 2rem;
}

.archive-hero-title {
    font-size: clamp(2rem, 4vw, 2.75rem);
    margin: 0.25rem 0 0.4rem;
}

.archive-hero-desc {
    color: var(--muted);
    max-width: 42rem;
    margin: 0;
}

.tag-hero-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    margin-top: 0.75rem;
}

.tag-hero-img {
    border-radius: 0.85rem;
    border: 1px solid var(--border);
    object-fit: cover;
}

.author-hero-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.25rem;
    margin-top: 0.85rem;
}

.author-avatar {
    width: 84px;
    height: 84px;
    border-radius: 9999px;
    object-fit: cover;
    border: 2px solid var(--accent);
}

.author-meta-links {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
    font-size: 0.82rem;
    color: var(--muted);
}

.author-ext-link {
    color: var(--link);
    font-weight: 700;
}

.archive-page {
    padding: 2.25rem 0 4rem;
}

.archive-header {
    margin-bottom: 2rem;
}

.archive-title {
    font-size: clamp(2rem, 4vw, 2.8rem);
    margin-bottom: 0.45rem;
}

.archive-excerpt {
    color: var(--muted);
    max-width: 44rem;
    margin: 0;
}

.archive-spotlight {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: 1.15rem;
    padding: 1.4rem 1.5rem;
    margin-bottom: 2.25rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.archive-spotlight-title {
    font-size: 1.45rem;
    margin: 0.4rem 0 0.25rem;
}

.archive-spotlight-desc {
    color: var(--muted);
    font-size: 0.9rem;
    margin: 0;
}

.archive-section-heading {
    font-size: 1.5rem;
    margin-bottom: 1.1rem;
}

.archive-genres-section {
    margin-bottom: 2.75rem;
}

.archive-genre-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 1rem;
}

.archive-genre-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.1rem 1.2rem;
    text-decoration: none;
    transition: border-color 0.16s ease, transform 0.16s ease;
}

.archive-genre-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.archive-genre-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.35rem;
}

.archive-genre-name {
    font-family: var(--font-serif);
    font-size: 1.18rem;
    font-weight: 700;
    color: var(--text);
}

.archive-genre-desc {
    font-size: 0.82rem;
    color: var(--muted);
    margin: 0;
}

.contact-container {
    padding-top: 2.25rem;
    padding-bottom: 4rem;
}

.contact-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: start;
}

@media (min-width: 900px) {
    .contact-layout {
        grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
    }
}

.full-width-article {
    padding: 2rem 0 4.5rem;
}

.full-width-title {
    font-size: clamp(2.1rem, 4.5vw, 3.2rem);
    margin: 0.65rem 0 0.4rem;
}

.full-width-excerpt {
    font-size: 1.1rem;
    color: var(--muted);
    max-width: 48rem;
    margin: 0 0 1.5rem;
}

.full-width-cover {
    margin-bottom: 2rem;
}

.full-width-prose {
    max-width: 78ch;
}

.empty-state-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1.15rem;
    padding: 2.5rem 1.5rem;
    text-align: center;
}

.empty-state-title {
    font-size: 1.4rem;
    margin-bottom: 0.4rem;
}

.empty-state-desc {
    color: var(--muted);
    margin: 0 0 1.25rem;
}

.error-section {
    padding: 5rem 0;
}

.error-container {
    max-width: 620px;
    text-align: center;
}

.error-title {
    font-size: clamp(2rem, 5vw, 3rem);
    margin: 0.75rem 0 0.5rem;
}

.error-desc {
    color: var(--muted);
    margin: 0 0 1.5rem;
}

.error-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

/* ==========================================================================
   14. PURE EDITORIAL FOOTER & TOAST
   ========================================================================== */
.site-footer {
    background-color: #171412;
    color: #D6D3D1;
    border-top: 1px solid #2C2A27;
    margin-top: auto;
    padding: 2.75rem 0 1.75rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #2C2A27;
}

@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: 5fr 3fr 4fr;
    }
}

.footer-brand-link {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    margin-bottom: 0.75rem;
}

.footer-wordmark {
    font-family: var(--font-sans);
    font-weight: 800;
    font-size: 1.1rem;
    color: #FFFFFF;
}

.footer-description {
    font-size: 0.86rem;
    color: #B0AAA0;
    max-width: 22rem;
    margin: 0;
}

.footer-heading {
    font-family: var(--font-sans);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #FACC15;
    margin-bottom: 0.85rem;
}

.footer-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-nav-list .nav-link {
    padding: 0;
    color: #D6D3D1;
    background: transparent;
    font-size: 0.86rem;
}

.footer-nav-list .nav-link:hover {
    color: #FB923C;
    background: transparent;
}

.footer-bottom {
    padding-top: 1.25rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: #B0AAA0;
}

.footer-top-link {
    color: #FACC15;
    text-decoration: none;
    font-weight: 700;
}

.inkuzo-toast {
    position: fixed;
    bottom: 4.5rem;
    right: 1rem;
    z-index: 120;
    padding: 0.6rem 1rem;
    border-radius: 9999px;
    background-color: #171412;
    color: #FACC15;
    border: 1px solid rgba(250, 204, 21, 0.45);
    box-shadow: var(--shadow-lg);
    font-size: 0.78rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.inkuzo-toast[hidden] {
    display: none;
}

.inkuzo-toast-dot {
    width: 8px;
    height: 8px;
    border-radius: 9999px;
    background-color: #F97316;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    *, *::before, *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}
