/*
Theme Name: StoryTheme
Theme URI: https://yoursite.com
Author: Your Name
Author URI: https://yoursite.com
Description: A high-performance, modern storytelling platform theme. Built for speed, engagement, and mobile-first reading experiences.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: story-theme
Tags: blog, custom-menu, featured-images, full-width-template, reading, storytelling
*/

/* ============================================================
   DESIGN TOKENS & CSS VARIABLES
   DEFAULT = LIGHT MODE (clean, readable, professional)
   Dark mode activates with [data-theme="dark"] on <html>
   ============================================================ */
:root {
  /* Light mode colors — DEFAULT */
  --clr-bg:            #f8f9fc;
  --clr-bg-2:          #eef0f7;
  --clr-bg-card:       #ffffff;
  --clr-bg-card-hover: #f0f2fa;
  --clr-border:        rgba(0,0,0,0.08);
  --clr-border-light:  rgba(0,0,0,0.14);

  --clr-primary:       #d4891a;
  --clr-primary-dark:  #b5720f;
  --clr-primary-glow:  rgba(212,137,26,0.15);
  --clr-accent:        #5a4ad1;
  --clr-accent-glow:   rgba(90,74,209,0.12);

  --clr-text:          #1a1c2e;
  --clr-text-muted:    #5a6080;
  --clr-text-faint:    #9aa0b8;
  --clr-white:         #1a1c2e;

  --clr-success:       #1a9e5c;
  --clr-danger:        #d63045;
  --clr-badge-ongoing: #1a9e5c;
  --clr-badge-hiatus:  #d4891a;
  --clr-badge-done:    #5a4ad1;

  /* Gradients */
  --grad-hero:    linear-gradient(135deg, #f8f9fc 0%, #eef0f7 50%, #f8f9fc 100%);
  --grad-card:    linear-gradient(145deg, #ffffff 0%, #f4f6fc 100%);
  --grad-primary: linear-gradient(135deg, #d4891a 0%, #b5720f 100%);
  --grad-accent:  linear-gradient(135deg, #5a4ad1 0%, #3d2fb5 100%);
  --grad-glow:    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(90,74,209,0.06) 0%, transparent 70%);

  /* Shadows */
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.08);
  --shadow-md:   0 4px 16px rgba(0,0,0,0.1);
  --shadow-lg:   0 8px 32px rgba(0,0,0,0.12);
  --shadow-card: 0 2px 20px rgba(0,0,0,0.08), 0 0 0 1px var(--clr-border);
  --shadow-glow: 0 0 32px rgba(212,137,26,0.15);

  /* Topbar bg */
  --clr-topbar-bg: rgba(248,249,252,0.95);

  /* Typography */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:    'JetBrains Mono', monospace;
  --font-reading: 'Lora', Georgia, serif;

  --fs-xs:   0.75rem;
  --fs-sm:   0.875rem;
  --fs-base: 1rem;
  --fs-lg:   1.125rem;
  --fs-xl:   1.25rem;
  --fs-2xl:  1.5rem;
  --fs-3xl:  1.875rem;
  --fs-4xl:  2.25rem;
  --fs-5xl:  3rem;
  --fs-6xl:  3.75rem;

  --lh-tight:  1.2;
  --lh-snug:   1.375;
  --lh-normal: 1.6;
  --lh-relaxed:1.75;
  --lh-loose:  2;

  /* Spacing */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Layout */
  --container-sm:  640px;
  --container-md:  768px;
  --container-lg:  1024px;
  --container-xl:  1280px;
  --container-2xl: 1440px;
  --reading-width: 700px;

  /* Radius */
  --radius-sm:   6px;
  --radius-md:   12px;
  --radius-lg:   16px;
  --radius-xl:   24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:   0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg:   0 8px 32px rgba(0,0,0,0.6);
  --shadow-card: 0 2px 20px rgba(0,0,0,0.5), 0 0 0 1px var(--clr-border);
  --shadow-glow: 0 0 32px rgba(244,169,53,0.2);

  /* Transitions */
  --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out:cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast:   150ms;
  --dur-base:   250ms;
  --dur-slow:   400ms;

  /* Z-index layers */
  --z-base:    1;
  --z-dropdown:10;
  --z-sticky:  20;
  --z-modal:   50;
  --z-toast:   100;
}

/* ============================================================
   DARK MODE — activates with [data-theme="dark"] on <html>
   User selects this; it is NOT the default.
   ============================================================ */
[data-theme="dark"] {
  --clr-bg:            #0a0c12;
  --clr-bg-2:          #10131e;
  --clr-bg-card:       #13172a;
  --clr-bg-card-hover: #181d33;
  --clr-border:        rgba(255,255,255,0.07);
  --clr-border-light:  rgba(255,255,255,0.12);

  --clr-primary:       #f4a935;
  --clr-primary-dark:  #d4891a;
  --clr-primary-glow:  rgba(244,169,53,0.18);
  --clr-accent:        #7c6af7;
  --clr-accent-glow:   rgba(124,106,247,0.18);

  --clr-text:          #e8eaf2;
  --clr-text-muted:    #7e8498;
  --clr-text-faint:    #4a5068;
  --clr-white:         #ffffff;

  --clr-success:       #3ecf82;
  --clr-danger:        #f4455a;
  --clr-badge-ongoing: #3ecf82;
  --clr-badge-hiatus:  #f4a935;
  --clr-badge-done:    #7c6af7;

  --grad-hero:    linear-gradient(135deg, #0a0c12 0%, #0f1228 50%, #0a0c12 100%);
  --grad-card:    linear-gradient(145deg, #13172a 0%, #0f1220 100%);
  --grad-primary: linear-gradient(135deg, #f4a935 0%, #e8821a 100%);
  --grad-accent:  linear-gradient(135deg, #7c6af7 0%, #5a4ad1 100%);
  --grad-glow:    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(124,106,247,0.12) 0%, transparent 70%);

  --shadow-sm:   0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:   0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg:   0 8px 32px rgba(0,0,0,0.6);
  --shadow-card: 0 2px 20px rgba(0,0,0,0.5), 0 0 0 1px var(--clr-border);
  --shadow-glow: 0 0 32px rgba(244,169,53,0.2);

  --clr-topbar-bg: rgba(10,12,18,0.92);
}

[data-theme="dark"] body {
  background-image: var(--grad-glow);
}
[data-theme="dark"] .site-header {
  background: rgba(10,12,18,0.85);
}
[data-theme="dark"] .reading-topbar {
  background: rgba(10,12,18,0.92);
}
[data-theme="dark"] .mobile-menu {
  background: rgba(10,12,18,0.97);
}
[data-theme="dark"] .search-overlay {
  background: rgba(10,12,18,0.95);
}
[data-theme="dark"] .story-card {
  background: var(--grad-card);
}
[data-theme="dark"] .sticky-next-bar {
  background: rgba(10,12,18,0.95);
}
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6,
[data-theme="dark"] .episode-title,
[data-theme="dark"] .story-title,
[data-theme="dark"] .logo-text {
  color: var(--clr-white);
}
[data-theme="dark"] .episode-content { color: #e8eaf2; }
[data-theme="dark"] .font-size-opt,
[data-theme="dark"] .reading-theme-opt {
  background: var(--clr-bg-card);
  border-color: var(--clr-border);
  color: var(--clr-text);
}
[data-theme="dark"] .font-size-opt.active,
[data-theme="dark"] .reading-theme-opt.active {
  background: var(--clr-primary-glow);
  border-color: var(--clr-primary);
  color: var(--clr-primary);
}
[data-theme="dark"] .reading-tool-btn { color: var(--clr-text-muted); }
[data-theme="dark"] .reading-tool-btn:hover,
[data-theme="dark"] .reading-tool-btn.active {
  background: rgba(255,255,255,0.08);
  color: var(--clr-white);
}


/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--clr-text);
  background-color: var(--clr-bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: transparent;
  border: none;
  outline: none;
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1,h2,h3,h4,h5,h6 {
  font-family: var(--font-display);
  line-height: var(--lh-tight);
  color: var(--clr-white);
  font-weight: 700;
}
h1 { font-size: clamp(var(--fs-3xl), 5vw, var(--fs-6xl)); }
h2 { font-size: clamp(var(--fs-2xl), 3.5vw, var(--fs-4xl)); }
h3 { font-size: clamp(var(--fs-xl), 2.5vw, var(--fs-3xl)); }
h4 { font-size: var(--fs-xl); }
h5 { font-size: var(--fs-lg); }
h6 { font-size: var(--fs-base); }

p { line-height: var(--lh-relaxed); color: var(--clr-text-muted); }

/* ============================================================
   UTILITIES
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--container-xl);
  margin-inline: auto;
  padding-inline: var(--space-4);
}
@media (min-width: 640px)  { .container { padding-inline: var(--space-6); } }
@media (min-width: 1024px) { .container { padding-inline: var(--space-8); } }

.section { padding-block: var(--space-16); }
.section--sm { padding-block: var(--space-10); }
.section--lg { padding-block: var(--space-24); }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-8);
  gap: var(--space-4);
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(var(--fs-xl), 2.5vw, var(--fs-3xl));
  color: var(--clr-white);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.section-title .emoji { font-size: 1.1em; }
.section-link {
  font-size: var(--fs-sm);
  color: var(--clr-primary);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--space-1);
  transition: gap var(--dur-fast) var(--ease-out);
  white-space: nowrap;
}
.section-link:hover { gap: var(--space-2); }

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

.text-gradient {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.text-accent-gradient {
  background: var(--grad-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge--ongoing  { background: rgba(62,207,130,0.15); color: var(--clr-badge-ongoing); }
.badge--hiatus   { background: rgba(244,169,53,0.15); color: var(--clr-badge-hiatus); }
.badge--completed{ background: rgba(124,106,247,0.15); color: var(--clr-badge-done); }
.badge--genre    { background: var(--clr-bg-card); color: var(--clr-text-muted); border: 1px solid var(--clr-border-light); }
.badge--hot      { background: linear-gradient(135deg, rgba(244,169,53,0.2),rgba(244,69,90,0.2)); color: #ffb443; border: 1px solid rgba(244,169,53,0.3); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
  font-weight: 700;
  font-family: var(--font-body);
  transition: all var(--dur-base) var(--ease-out);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.btn--primary {
  background: var(--grad-primary);
  color: #1a0a00;
  box-shadow: 0 4px 20px rgba(244,169,53,0.3);
}
.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(244,169,53,0.4);
}
.btn--accent {
  background: var(--grad-accent);
  color: #fff;
  box-shadow: 0 4px 20px rgba(124,106,247,0.3);
}
.btn--accent:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(124,106,247,0.4); }
.btn--ghost {
  background: var(--clr-bg-card);
  color: var(--clr-text);
  border: 1px solid var(--clr-border-light);
}
.btn--ghost:hover { background: var(--clr-bg-card-hover); border-color: var(--clr-border-light); color: var(--clr-white); }
.btn--sm { padding: var(--space-2) var(--space-4); font-size: var(--fs-xs); border-radius: var(--radius-sm); }
.btn--lg { padding: var(--space-4) var(--space-8); font-size: var(--fs-base); }
.btn--icon { padding: var(--space-3); border-radius: var(--radius-md); aspect-ratio: 1; }

/* ============================================================
   HEADER & NAVIGATION
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: rgba(248,249,252,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--clr-border);
  transition: background var(--dur-base) var(--ease-in-out);
}
.site-header.scrolled { background: rgba(248,249,252,0.97); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: var(--space-6);
}

.site-logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.site-logo img { height: 36px; width: auto; }
.logo-text {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--clr-white);
}
.logo-text span { color: var(--clr-primary); }

.main-nav { display: none; }
@media (min-width: 1024px) {
  .main-nav {
    display: flex;
    align-items: center;
    gap: var(--space-1);
  }
}
.main-nav a {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--clr-text-muted);
  transition: color var(--dur-fast), background var(--dur-fast);
}
.main-nav a:hover, .main-nav a.current-menu-item { color: var(--clr-white); background: var(--clr-bg-card); }
.main-nav a.current-menu-item { color: var(--clr-primary); }

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.search-toggle {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--clr-text-muted);
  transition: color var(--dur-fast), background var(--dur-fast);
}
.search-toggle:hover { color: var(--clr-primary); background: var(--clr-primary-glow); }

.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px; height: 36px;
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  color: var(--clr-text-muted);
  transition: color var(--dur-fast);
}
@media (min-width: 1024px) { .hamburger { display: none; } }
.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform var(--dur-base) var(--ease-out), opacity var(--dur-base);
}
.hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile Menu */
.mobile-menu {
  display: none;
  position: fixed;
  inset: 64px 0 0 0;
  background: rgba(248,249,252,0.98);
  backdrop-filter: blur(20px);
  z-index: calc(var(--z-sticky) - 1);
  padding: var(--space-8) var(--space-4);
  overflow-y: auto;
  animation: slideDown var(--dur-slow) var(--ease-out);
}
.mobile-menu.is-open { display: block; }
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.mobile-menu nav a {
  display: block;
  padding: var(--space-4) var(--space-4);
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--clr-text);
  border-bottom: 1px solid var(--clr-border);
  transition: color var(--dur-fast), padding-left var(--dur-fast);
}
.mobile-menu nav a:hover { color: var(--clr-primary); padding-left: var(--space-6); }

/* Search Overlay */
.search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(248,249,252,0.97);
  backdrop-filter: blur(20px);
  z-index: var(--z-modal);
  align-items: flex-start;
  justify-content: center;
  padding-top: 120px;
}
.search-overlay.is-open { display: flex; }
.search-box {
  width: 100%;
  max-width: 640px;
  padding-inline: var(--space-4);
  animation: fadeUp var(--dur-slow) var(--ease-out);
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.search-input-wrap input {
  flex: 1;
  padding: var(--space-4) var(--space-5);
  font-size: var(--fs-xl);
  color: var(--clr-white);
  background: transparent;
}
.search-input-wrap input::placeholder { color: var(--clr-text-faint); }
.search-submit {
  padding: var(--space-4) var(--space-5);
  color: var(--clr-primary);
  font-size: var(--fs-xl);
}
.search-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  font-size: var(--fs-2xl);
  color: var(--clr-text-muted);
  cursor: pointer;
}
.search-results-preview {
  margin-top: var(--space-4);
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  max-height: 400px;
  overflow-y: auto;
}
.search-result-item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--clr-border);
  transition: background var(--dur-fast);
}
.search-result-item:hover { background: var(--clr-bg-card-hover); }
.search-result-img { width: 40px; height: 60px; object-fit: cover; border-radius: var(--radius-sm); flex-shrink: 0; }
.search-result-meta { flex: 1; min-width: 0; }
.search-result-title { font-size: var(--fs-sm); font-weight: 600; color: var(--clr-white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-result-sub   { font-size: var(--fs-xs); color: var(--clr-text-muted); margin-top: 2px; }

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero {
  position: relative;
  min-height: 90vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding-block: var(--space-20);
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 80% at 80% 50%, rgba(124,106,247,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 40% 60% at 20% 80%, rgba(244,169,53,0.08) 0%, transparent 60%);
  pointer-events: none;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-12);
  align-items: center;
  position: relative;
  z-index: 1;
}
@media (min-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr 1fr; }
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: rgba(244,169,53,0.1);
  border: 1px solid rgba(244,169,53,0.2);
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--clr-primary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-6);
}
.hero-title {
  font-size: clamp(2.5rem, 6vw, 5rem);
  line-height: 1.05;
  margin-bottom: var(--space-6);
}
.hero-sub {
  font-size: var(--fs-lg);
  color: var(--clr-text-muted);
  max-width: 480px;
  line-height: var(--lh-relaxed);
  margin-bottom: var(--space-8);
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-10);
}
.hero-stats {
  display: flex;
  gap: var(--space-8);
  flex-wrap: wrap;
}
.hero-stat-value {
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  font-weight: 700;
  color: var(--clr-white);
}
.hero-stat-label { font-size: var(--fs-xs); color: var(--clr-text-muted); text-transform: uppercase; letter-spacing: 0.08em; }

/* Hero search bar */
.hero-search {
  display: flex;
  align-items: center;
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  max-width: 480px;
  margin-bottom: var(--space-8);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.hero-search:focus-within {
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px var(--clr-primary-glow);
}
.hero-search input {
  flex: 1;
  padding: var(--space-4) var(--space-5);
  font-size: var(--fs-base);
  color: var(--clr-white);
}
.hero-search input::placeholder { color: var(--clr-text-faint); }
.hero-search button {
  padding: var(--space-3) var(--space-5);
  background: var(--grad-primary);
  color: #1a0a00;
  font-weight: 700;
  font-size: var(--fs-sm);
  border-radius: 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  white-space: nowrap;
}

/* Hero visual (featured stories) */
.hero-visual {
  display: none;
  position: relative;
}
@media (min-width: 1024px) { .hero-visual { display: block; } }
.hero-book-stack {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  align-items: flex-end;
}
.hero-book {
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transition: transform var(--dur-slow) var(--ease-out);
}
.hero-book:nth-child(1) { width: 120px; height: 180px; transform: rotate(-8deg) translateY(10px); }
.hero-book:nth-child(2) { width: 140px; height: 210px; z-index: 2; transform: rotate(0deg); }
.hero-book:nth-child(3) { width: 120px; height: 180px; transform: rotate(6deg) translateY(10px); }
.hero-book img { width: 100%; height: 100%; object-fit: cover; }
.hero-book:hover { transform: rotate(0deg) translateY(-8px) !important; z-index: 3; }

/* ============================================================
   STORY CARDS
   ============================================================ */
.story-card {
  position: relative;
  background: var(--grad-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--dur-base) var(--ease-out), border-color var(--dur-base), box-shadow var(--dur-base);
  cursor: pointer;
}
.story-card:hover {
  transform: translateY(-4px);
  border-color: var(--clr-border-light);
  box-shadow: var(--shadow-lg);
}
.story-card__cover {
  position: relative;
  aspect-ratio: 2/3;
  overflow: hidden;
  background: var(--clr-bg-card);
}
.story-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-slow) var(--ease-out);
}
.story-card:hover .story-card__cover img { transform: scale(1.05); }
.story-card__cover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.2) 50%, transparent 100%);
}
.story-card__status {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
}
.story-card__info {
  padding: var(--space-4);
}
.story-card__genre {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--clr-primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-2);
}
.story-card__title {
  font-family: var(--font-display);
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--clr-white);
  line-height: var(--lh-snug);
  margin-bottom: var(--space-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.story-card__stats {
  display: flex;
  gap: var(--space-4);
  font-size: var(--fs-xs);
  color: var(--clr-text-faint);
  margin-top: var(--space-3);
}
.story-card__stat {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

/* Grid Layouts */
.grid-stories {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}
@media (min-width: 640px)  { .grid-stories { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 768px)  { .grid-stories { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1024px) { .grid-stories { grid-template-columns: repeat(5, 1fr); } }
@media (min-width: 1280px) { .grid-stories { grid-template-columns: repeat(6, 1fr); gap: var(--space-5); } }

/* Horizontal scroll row */
.scroll-row {
  display: flex;
  gap: var(--space-4);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: var(--space-2);
}
.scroll-row::-webkit-scrollbar { display: none; }
.scroll-row .story-card {
  flex: 0 0 160px;
  scroll-snap-align: start;
}
@media (min-width: 768px) { .scroll-row .story-card { flex: 0 0 180px; } }

/* ============================================================
   EPISODE CARD (for Latest Episodes)
   ============================================================ */
.episode-card {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  transition: background var(--dur-fast), border-color var(--dur-fast), transform var(--dur-base) var(--ease-out);
  cursor: pointer;
}
.episode-card:hover {
  background: var(--clr-bg-card-hover);
  border-color: var(--clr-border-light);
  transform: translateY(-2px);
}
.episode-card__cover {
  flex-shrink: 0;
  width: 56px;
  height: 84px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--clr-bg);
}
.episode-card__cover img { width: 100%; height: 100%; object-fit: cover; }
.episode-card__meta { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: var(--space-1); }
.episode-card__story { font-size: var(--fs-xs); color: var(--clr-primary); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.episode-card__title { font-size: var(--fs-sm); font-weight: 600; color: var(--clr-white); line-height: var(--lh-snug); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.episode-card__info  { font-size: var(--fs-xs); color: var(--clr-text-faint); display: flex; gap: var(--space-3); }
.episode-card__new   { font-size: var(--fs-xs); font-weight: 700; color: var(--clr-primary); background: var(--clr-primary-glow); padding: 2px 8px; border-radius: var(--radius-full); align-self: flex-start; }

.grid-episodes {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}
@media (min-width: 640px) { .grid-episodes { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px){ .grid-episodes { grid-template-columns: repeat(3, 1fr); } }

/* ============================================================
   CONTINUE READING BANNER
   ============================================================ */
.continue-reading {
  background: linear-gradient(135deg, rgba(244,169,53,0.08) 0%, rgba(124,106,247,0.08) 100%);
  border: 1px solid rgba(244,169,53,0.15);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-6);
  margin-block: var(--space-10);
  cursor: pointer;
  transition: background var(--dur-base), transform var(--dur-base) var(--ease-out);
}
.continue-reading:hover { transform: translateY(-2px); background: linear-gradient(135deg, rgba(244,169,53,0.12) 0%, rgba(124,106,247,0.12) 100%); }
.continue-reading__cover { flex-shrink: 0; width: 60px; height: 90px; border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-md); }
.continue-reading__cover img { width: 100%; height: 100%; object-fit: cover; }
.continue-reading__label { font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--clr-primary); margin-bottom: var(--space-1); }
.continue-reading__title { font-family: var(--font-display); font-size: var(--fs-lg); color: var(--clr-white); font-weight: 700; margin-bottom: var(--space-1); }
.continue-reading__episode { font-size: var(--fs-sm); color: var(--clr-text-muted); }
.continue-reading__progress { flex: 1; min-width: 0; }
.progress-bar-wrap { height: 4px; background: var(--clr-border); border-radius: var(--radius-full); margin-top: var(--space-3); overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--grad-primary); border-radius: var(--radius-full); transition: width 0.5s var(--ease-out); }
.continue-reading__cta { flex-shrink: 0; }

/* ============================================================
   GENRE CARDS
   ============================================================ */
.genre-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-5) var(--space-4);
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  text-align: center;
  transition: all var(--dur-base) var(--ease-out);
  cursor: pointer;
  min-width: 100px;
}
.genre-card:hover { background: var(--clr-bg-card-hover); border-color: var(--clr-border-light); transform: translateY(-2px); }
.genre-card__emoji { font-size: 2rem; line-height: 1; }
.genre-card__name  { font-size: var(--fs-sm); font-weight: 600; color: var(--clr-text); white-space: nowrap; }
.genre-card__count { font-size: var(--fs-xs); color: var(--clr-text-faint); }

.scroll-row--genres {
  display: flex;
  gap: var(--space-3);
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: var(--space-2);
}
.scroll-row--genres::-webkit-scrollbar { display: none; }

/* ============================================================
   NEWSLETTER
   ============================================================ */
.newsletter-section {
  background: linear-gradient(135deg, rgba(124,106,247,0.08) 0%, rgba(244,169,53,0.06) 100%);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-xl);
  padding: var(--space-12) var(--space-8);
  text-align: center;
}
.newsletter-section h2 { margin-bottom: var(--space-4); font-size: clamp(var(--fs-xl), 3vw, var(--fs-3xl)); }
.newsletter-section p  { color: var(--clr-text-muted); max-width: 480px; margin-inline: auto; margin-bottom: var(--space-8); }
.newsletter-form {
  display: flex;
  gap: var(--space-3);
  max-width: 440px;
  margin-inline: auto;
  flex-wrap: wrap;
  justify-content: center;
}
.newsletter-form input {
  flex: 1;
  min-width: 220px;
  padding: var(--space-3) var(--space-5);
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border-light);
  border-radius: var(--radius-md);
  color: var(--clr-white);
  font-size: var(--fs-sm);
}
.newsletter-form input::placeholder { color: var(--clr-text-faint); }
.newsletter-form input:focus { outline: none; border-color: var(--clr-primary); box-shadow: 0 0 0 3px var(--clr-primary-glow); }
.newsletter-message { margin-top: var(--space-4); font-size: var(--fs-sm); min-height: 1.5em; }
.newsletter-message.success { color: var(--clr-success); }
.newsletter-message.error   { color: var(--clr-danger); }

/* ============================================================
   STORY PAGE (single-story.php)
   ============================================================ */
.story-page { padding-top: var(--space-10); }

.story-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  margin-bottom: var(--space-12);
}
@media (min-width: 768px) {
  .story-hero { grid-template-columns: 240px 1fr; align-items: start; }
}

.story-cover-wrap {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  aspect-ratio: 2/3;
  background: var(--clr-bg-card);
}
@media (min-width: 768px) { .story-cover-wrap { aspect-ratio: auto; height: 360px; } }
.story-cover-wrap img { width: 100%; height: 100%; object-fit: cover; }

.story-meta { flex: 1; }
.story-title {
  font-family: var(--font-display);
  font-size: clamp(var(--fs-2xl), 4vw, var(--fs-5xl));
  line-height: 1.1;
  color: var(--clr-white);
  margin-bottom: var(--space-3);
}
.story-author { font-size: var(--fs-base); color: var(--clr-text-muted); margin-bottom: var(--space-5); }
.story-author a { color: var(--clr-primary); font-weight: 600; }
.story-genres { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-5); }
.story-description {
  font-size: var(--fs-base);
  color: var(--clr-text);
  line-height: var(--lh-relaxed);
  max-width: 600px;
  margin-bottom: var(--space-6);
}
.story-stats-row {
  display: flex;
  gap: var(--space-6);
  flex-wrap: wrap;
  margin-bottom: var(--space-8);
}
.story-stat { text-align: center; }
.story-stat-val  { font-family: var(--font-display); font-size: var(--fs-xl); font-weight: 700; color: var(--clr-white); display: block; }
.story-stat-name { font-size: var(--fs-xs); color: var(--clr-text-faint); text-transform: uppercase; letter-spacing: 0.06em; }
.story-actions { display: flex; gap: var(--space-3); flex-wrap: wrap; }

/* Vote Button */
.vote-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: var(--fs-sm);
  background: rgba(244,169,53,0.1);
  border: 1px solid rgba(244,169,53,0.2);
  color: var(--clr-primary);
  transition: all var(--dur-base) var(--ease-out);
  cursor: pointer;
}
.vote-btn:hover, .vote-btn.voted {
  background: rgba(244,169,53,0.2);
  box-shadow: 0 0 20px var(--clr-primary-glow);
}
.vote-btn.voted { color: var(--clr-primary); }
.vote-btn .vote-count { font-variant-numeric: tabular-nums; }

/* Follow Button */
.follow-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: var(--fs-sm);
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border-light);
  color: var(--clr-text-muted);
  transition: all var(--dur-base) var(--ease-out);
  cursor: pointer;
}
.follow-btn:hover { background: var(--clr-bg-card-hover); color: var(--clr-white); border-color: var(--clr-border-light); }
.follow-btn.following { background: rgba(90,74,209,0.1); border-color: rgba(90,74,209,0.3); color: var(--clr-accent); }

/* Episode List */
.episode-list { margin-top: var(--space-8); }
.episode-list-header { margin-bottom: var(--space-6); display: flex; align-items: center; justify-content: space-between; }
.episode-list-title { font-family: var(--font-display); font-size: var(--fs-2xl); color: var(--clr-white); }

.episode-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-3);
  transition: background var(--dur-fast), border-color var(--dur-fast), transform var(--dur-fast);
  cursor: pointer;
}
.episode-row:hover {
  background: var(--clr-bg-card-hover);
  border-color: var(--clr-border-light);
  transform: translateX(4px);
}
.episode-row__num {
  flex-shrink: 0;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: var(--clr-bg-2);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-sm);
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--clr-text-muted);
}
.episode-row__info { flex: 1; min-width: 0; }
.episode-row__title {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--clr-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.episode-row__meta { font-size: var(--fs-xs); color: var(--clr-text-faint); margin-top: 2px; }
.episode-row__read-icon { flex-shrink: 0; color: var(--clr-success); font-size: var(--fs-sm); }
.episode-row.is-read .episode-row__num { background: rgba(62,207,130,0.1); color: var(--clr-success); }

/* ============================================================
   EPISODE / READING PAGE
   ============================================================ */
.reading-page {
  max-width: var(--reading-width);
  margin-inline: auto;
  padding: var(--space-8) var(--space-4);
}

/* ============================================================
   READING TOOLBAR — sticky, minimal, mobile-first
   ============================================================ */

/* Reading Topbar */
.reading-topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: var(--clr-topbar-bg, rgba(10,12,18,0.92));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--clr-border);
  padding: 0 var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  height: 52px;
  transition: background var(--dur-base);
}
.reading-topbar-back {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--clr-text-muted);
  font-size: var(--fs-sm);
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color var(--dur-fast);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
}
.reading-topbar-back:hover { color: var(--clr-primary); background: var(--clr-primary-glow); }
.reading-topbar-title {
  flex: 1;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--clr-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  padding: 0 var(--space-2);
}
.reading-tools {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex-shrink: 0;
}

/* Individual toolbar buttons */
.reading-tool-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--clr-text-muted);
  font-size: var(--fs-xs);
  font-weight: 700;
  gap: var(--space-1);
  transition: background var(--dur-fast), color var(--dur-fast);
  cursor: pointer;
  white-space: nowrap;
  min-width: 36px;
}
.reading-tool-btn:hover  { background: var(--clr-bg-card-hover); color: var(--clr-white); }
.reading-tool-btn.active { background: var(--clr-bg-card-hover); color: var(--clr-primary); }

/* Divider between tool groups */
.reading-tools-divider {
  width: 1px;
  height: 20px;
  background: var(--clr-border);
  margin: 0 var(--space-1);
  flex-shrink: 0;
}

/* ── FONT SIZE DROPDOWN PANEL ── */
.font-size-panel {
  position: fixed;
  top: 56px;
  right: var(--space-4);
  z-index: calc(var(--z-sticky) + 5);
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 200px;
  animation: fadeUp var(--dur-base) var(--ease-out);
}
.font-size-panel[hidden] { display: none; }

.font-size-panel-label {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--clr-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: var(--space-1) var(--space-2);
}

/* A- / A+ stepper row */
.font-size-stepper {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2);
  background: var(--clr-bg-2);
  border-radius: var(--radius-md);
}
.font-size-step-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  background: var(--clr-bg);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-sm);
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--clr-text);
  cursor: pointer;
  transition: all var(--dur-fast);
  font-family: var(--font-reading);
}
.font-size-step-btn:hover:not(:disabled) { background: var(--clr-bg-card-hover); color: var(--clr-primary); border-color: var(--clr-primary); }
.font-size-step-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.font-size-current {
  flex: 1;
  text-align: center;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--clr-primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Font size level pills */
.font-size-opts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-2);
}
.font-size-opt {
  padding: var(--space-2) var(--space-2);
  text-align: center;
  background: var(--clr-bg);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-reading);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--clr-text-muted);
  cursor: pointer;
  transition: all var(--dur-fast);
  line-height: 1.4;
}
.font-size-opt:hover  { color: var(--clr-text); border-color: var(--clr-border-light); }
.font-size-opt.active { background: var(--clr-primary-glow); border-color: var(--clr-primary); color: var(--clr-primary); }

/* ── THEME TOGGLE PANEL ── */
.reading-theme-panel {
  position: fixed;
  top: 56px;
  right: var(--space-4);
  z-index: calc(var(--z-sticky) + 5);
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 180px;
  animation: fadeUp var(--dur-base) var(--ease-out);
}
.reading-theme-panel[hidden] { display: none; }

.reading-theme-panel-label {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--clr-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: var(--space-1) var(--space-2);
}

.reading-theme-opts {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.reading-theme-opt {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-3);
  background: var(--clr-bg);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--clr-text-muted);
  cursor: pointer;
  transition: all var(--dur-fast);
  text-align: left;
}
.reading-theme-opt:hover  { color: var(--clr-text); border-color: var(--clr-border-light); background: var(--clr-bg-card-hover); }
.reading-theme-opt.active { background: var(--clr-primary-glow); border-color: var(--clr-primary); color: var(--clr-primary); }
.reading-theme-opt .theme-swatch {
  width: 20px; height: 20px;
  border-radius: var(--radius-full);
  border: 2px solid currentColor;
  flex-shrink: 0;
}
.reading-theme-opt[data-theme-val="dark"]  .theme-swatch { background: #0a0c12; }
.reading-theme-opt[data-theme-val="light"] .theme-swatch { background: #f8f9fc; }

/* Reading Progress Bar */
.reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--grad-primary);
  z-index: calc(var(--z-sticky) + 10);
  width: 0%;
  border-radius: 0 var(--radius-full) var(--radius-full) 0;
  transition: width 0.15s linear;
  pointer-events: none;
}

/* ============================================================
   EPISODE CONTENT TYPOGRAPHY + FONT SIZE SYSTEM
   Target: .episode-content (consistent naming throughout)
   ============================================================ */
.episode-header { margin-bottom: var(--space-10); }
.episode-story-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-sm);
  color: var(--clr-primary);
  font-weight: 600;
  margin-bottom: var(--space-4);
  transition: gap var(--dur-fast);
}
.episode-story-link:hover { gap: var(--space-3); }
.episode-chapter {
  font-size: var(--fs-xs);
  color: var(--clr-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: var(--space-3);
  font-weight: 700;
}
.episode-title {
  font-family: var(--font-display);
  font-size: clamp(var(--fs-2xl), 4vw, var(--fs-4xl));
  color: var(--clr-white);
  line-height: 1.1;
  margin-bottom: var(--space-5);
}
.episode-divider {
  width: 60px;
  height: 3px;
  background: var(--grad-primary);
  border-radius: var(--radius-full);
  margin: var(--space-6) 0;
}

/* Base reading typography */
.episode-content {
  font-family: var(--font-reading);
  line-height: 1.9;
  color: var(--clr-text);
  letter-spacing: 0.012em;
  /* Default = Medium */
  font-size: 1.1rem;
}
.episode-content p          { margin-bottom: 1.6em; }
.episode-content p:last-child { margin-bottom: 0; }
.episode-content h2,
.episode-content h3         { font-family: var(--font-display); margin-top: 2em; margin-bottom: 0.75em; color: var(--clr-white); }
.episode-content blockquote {
  border-left: 3px solid var(--clr-primary);
  padding: var(--space-4) var(--space-6);
  margin: var(--space-8) 0;
  color: var(--clr-text-muted);
  font-style: italic;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}
.episode-content em     { font-style: italic; }
.episode-content strong { font-weight: 700; color: var(--clr-white); }
.episode-content a      { color: var(--clr-primary); text-decoration: underline; }

/* ── FONT SIZE LEVELS (applied to html element) ──
   Only affects .episode-content — nothing else */
html.font-sm .episode-content { font-size: 0.95rem; line-height: 1.85; }
html.font-md .episode-content { font-size: 1.1rem;  line-height: 1.9;  }
html.font-lg .episode-content { font-size: 1.22rem; line-height: 1.95; }
html.font-xl .episode-content { font-size: 1.38rem; line-height: 2.0;  }

/* Mobile font sizes (slightly smaller baseline) */
@media (max-width: 640px) {
  html.font-sm .episode-content { font-size: 0.9rem;  }
  html.font-md .episode-content { font-size: 1rem;    }
  html.font-lg .episode-content { font-size: 1.1rem;  }
  html.font-xl .episode-content { font-size: 1.22rem; }
}


/* Episode Navigation */
.episode-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-top: var(--space-12);
  padding-top: var(--space-8);
  border-top: 1px solid var(--clr-border);
}
.ep-nav-btn {
  padding: var(--space-5) var(--space-6);
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  transition: all var(--dur-base) var(--ease-out);
  text-decoration: none;
}
.ep-nav-btn:hover { background: var(--clr-bg-card-hover); border-color: var(--clr-border-light); transform: translateY(-2px); }
.ep-nav-btn--next { text-align: right; }
.ep-nav-direction { font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--clr-primary); margin-bottom: var(--space-1); }
.ep-nav-title { font-size: var(--fs-sm); font-weight: 600; color: var(--clr-white); }

/* Sticky Next Episode Bar */
.sticky-next-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: var(--z-sticky);
  background: var(--clr-bg-card);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--clr-border);
  padding: var(--space-4) var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  transform: translateY(100%);
  transition: transform var(--dur-slow) var(--ease-out);
}
.sticky-next-bar.visible { transform: translateY(0); }
.sticky-next-bar__label { font-size: var(--fs-sm); color: var(--clr-text-muted); }
.sticky-next-bar__title { font-size: var(--fs-base); font-weight: 700; color: var(--clr-white); }

/* Inline suggestion */
.inline-next-suggestion {
  margin: var(--space-12) 0;
  padding: var(--space-6);
  background: linear-gradient(135deg, rgba(244,169,53,0.08) 0%, rgba(124,106,247,0.08) 100%);
  border: 1px solid rgba(244,169,53,0.15);
  border-radius: var(--radius-xl);
  text-align: center;
  display: none;
}
.inline-next-suggestion.visible { display: block; }
.inline-next-suggestion h3 { font-family: var(--font-display); font-size: var(--fs-xl); margin-bottom: var(--space-3); }
.inline-next-suggestion p  { color: var(--clr-text-muted); font-size: var(--fs-sm); margin-bottom: var(--space-5); }

/* ============================================================
   COMMENTS
   ============================================================ */
.comments-section {
  margin-top: var(--space-12);
  padding-top: var(--space-8);
  border-top: 1px solid var(--clr-border);
}
.comments-title { font-family: var(--font-display); font-size: var(--fs-2xl); margin-bottom: var(--space-8); }
.comment-form { margin-bottom: var(--space-8); }
.comment-form__fields { display: flex; flex-direction: column; gap: var(--space-4); margin-bottom: var(--space-4); }
.form-group { display: flex; flex-direction: column; gap: var(--space-2); }
.form-label { font-size: var(--fs-xs); font-weight: 700; color: var(--clr-text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.form-input,
.form-textarea {
  padding: var(--space-3) var(--space-4);
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border-light);
  border-radius: var(--radius-md);
  color: var(--clr-white);
  font-size: var(--fs-sm);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
  resize: vertical;
}
.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px var(--clr-primary-glow);
}

.comment-item {
  padding: var(--space-5);
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
  animation: fadeUp var(--dur-slow) var(--ease-out);
}
.comment-header { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-3); }
.comment-avatar {
  width: 36px; height: 36px;
  background: var(--grad-accent);
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-sm); font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.comment-author { font-size: var(--fs-sm); font-weight: 700; color: var(--clr-white); }
.comment-date   { font-size: var(--fs-xs); color: var(--clr-text-faint); }
.comment-body   { font-size: var(--fs-sm); color: var(--clr-text); line-height: var(--lh-relaxed); }

/* ============================================================
   ARCHIVE / BROWSE PAGE
   ============================================================ */
.archive-header { text-align: center; padding-block: var(--space-16); }
.archive-title  { font-family: var(--font-display); font-size: clamp(var(--fs-3xl), 5vw, var(--fs-6xl)); margin-bottom: var(--space-4); }
.archive-desc   { color: var(--clr-text-muted); max-width: 480px; margin-inline: auto; }

.filter-bar {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-8);
  align-items: center;
}
.filter-select {
  padding: var(--space-3) var(--space-4);
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border-light);
  border-radius: var(--radius-md);
  color: var(--clr-text);
  font-size: var(--fs-sm);
  cursor: pointer;
  -webkit-appearance: none;
}
.filter-tag {
  padding: var(--space-2) var(--space-4);
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--clr-text-muted);
  cursor: pointer;
  transition: all var(--dur-fast);
}
.filter-tag:hover, .filter-tag.active { background: var(--clr-primary-glow); border-color: var(--clr-primary); color: var(--clr-primary); }

/* Load More */
.load-more-btn {
  display: block;
  width: 100%;
  max-width: 280px;
  margin: var(--space-10) auto 0;
  padding: var(--space-4) var(--space-6);
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border-light);
  border-radius: var(--radius-lg);
  color: var(--clr-text);
  font-weight: 700;
  font-size: var(--fs-sm);
  text-align: center;
  transition: all var(--dur-base) var(--ease-out);
  cursor: pointer;
}
.load-more-btn:hover { background: var(--clr-bg-card-hover); transform: translateY(-2px); color: var(--clr-white); }
.load-more-btn.loading { opacity: 0.6; pointer-events: none; }

/* ============================================================
   SHARE BUTTONS
   ============================================================ */
.share-buttons { display: flex; gap: var(--space-3); flex-wrap: wrap; margin-top: var(--space-6); }
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--fs-xs);
  font-weight: 700;
  border: 1px solid var(--clr-border);
  color: var(--clr-text-muted);
  background: var(--clr-bg-card);
  transition: all var(--dur-fast);
  cursor: pointer;
}
.share-btn:hover { color: var(--clr-white); border-color: var(--clr-border-light); background: var(--clr-bg-card-hover); }
.share-btn--copy.copied { color: var(--clr-success); border-color: rgba(62,207,130,0.3); }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--clr-bg-2);
  border-top: 1px solid var(--clr-border);
  padding-top: var(--space-16);
  padding-bottom: var(--space-8);
  margin-top: var(--space-20);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
  margin-bottom: var(--space-12);
}
@media (min-width: 640px)  { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr 1fr; } }

.footer-brand { grid-column: 1 / -1; }
@media (min-width: 1024px) { .footer-brand { grid-column: 1; } }
.footer-logo { margin-bottom: var(--space-4); }
.footer-tagline { font-size: var(--fs-sm); color: var(--clr-text-muted); max-width: 280px; line-height: var(--lh-relaxed); }
.footer-social { display: flex; gap: var(--space-3); margin-top: var(--space-5); }
.footer-social-link {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-md);
  color: var(--clr-text-muted);
  font-size: var(--fs-sm);
  transition: all var(--dur-fast);
}
.footer-social-link:hover { background: var(--clr-primary-glow); color: var(--clr-primary); }

.footer-col-title { font-size: var(--fs-xs); font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; color: var(--clr-white); margin-bottom: var(--space-5); }
.footer-col ul li { margin-bottom: var(--space-3); }
.footer-col ul li a { font-size: var(--fs-sm); color: var(--clr-text-muted); transition: color var(--dur-fast); }
.footer-col ul li a:hover { color: var(--clr-primary); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
  padding-top: var(--space-8);
  border-top: 1px solid var(--clr-border);
}
.footer-copy { font-size: var(--fs-xs); color: var(--clr-text-faint); }
.footer-legal { display: flex; gap: var(--space-5); }
.footer-legal a { font-size: var(--fs-xs); color: var(--clr-text-faint); transition: color var(--dur-fast); }
.footer-legal a:hover { color: var(--clr-text-muted); }

/* ============================================================
   404 PAGE
   ============================================================ */
.page-404 {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-16);
}
.page-404__code { font-family: var(--font-display); font-size: 8rem; font-weight: 700; line-height: 1; background: var(--grad-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; margin-bottom: var(--space-4); }
.page-404__title { font-size: var(--fs-2xl); margin-bottom: var(--space-4); }
.page-404__sub { color: var(--clr-text-muted); max-width: 360px; margin: 0 auto var(--space-8); }

/* ============================================================
   ADMIN ANALYTICS DASHBOARD
   ============================================================ */
.story-admin-page { font-family: var(--font-body); }
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.admin-stat-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
}
.admin-stat-card .val { font-size: 2rem; font-weight: 800; color: #1a1a2e; }
.admin-stat-card .lbl { font-size: 0.75rem; color: #6b7280; text-transform: uppercase; letter-spacing: 0.06em; margin-top: 4px; }

/* ============================================================
   ANIMATIONS & MICRO-INTERACTIONS
   ============================================================ */
@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0 rgba(244,169,53,0.4); }
  70%  { box-shadow: 0 0 0 12px rgba(244,169,53,0); }
  100% { box-shadow: 0 0 0 0 rgba(244,169,53,0); }
}
.pulse { animation: pulse-ring 2s infinite; }

@keyframes shimmer {
  from { background-position: -200% 0; }
  to   { background-position: 200% 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--clr-bg-card) 25%, var(--clr-bg-card-hover) 50%, var(--clr-bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

/* Intersection fade-in */
.reveal {
  opacity: 1;
  transform: translateY(0);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
}
/* Only hide and animate if JS is running (js-ready class added by JS on html element) */
.js-ready .reveal {
  opacity: 0;
  transform: translateY(24px);
}
.js-ready .reveal.in-view { opacity: 1; transform: translateY(0); }

/* Scroll indicator */
.scroll-indicator {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  justify-content: flex-end;
  margin-bottom: var(--space-3);
}
.scroll-indicator button {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-full);
  color: var(--clr-text-muted);
  transition: all var(--dur-fast);
}
.scroll-indicator button:hover { background: var(--clr-bg-card-hover); color: var(--clr-white); }

/* Toast Notification */
.toast {
  position: fixed;
  bottom: var(--space-6);
  left: 50%;
  transform: translateX(-50%) translateY(24px);
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-6);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--clr-white);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-toast);
  opacity: 0;
  transition: all var(--dur-base) var(--ease-out);
  white-space: nowrap;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { border-color: rgba(62,207,130,0.3); color: var(--clr-success); }
.toast.error   { border-color: rgba(244,69,90,0.3); color: var(--clr-danger); }

/* ============================================================
   RESPONSIVE TWEAKS
   ============================================================ */
@media (max-width: 640px) {
  .hero-stats { gap: var(--space-5); }
  .story-hero { gap: var(--space-5); }
  .episode-nav { grid-template-columns: 1fr; }
  .ep-nav-btn--next { text-align: left; }
  .reading-tools-panel { display: none; }
  .continue-reading { flex-direction: column; text-align: center; }
  .continue-reading__cover { margin-inline: auto; }
  .newsletter-form { flex-direction: column; }
  .newsletter-form input { min-width: unset; width: 100%; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .share-buttons { gap: var(--space-2); }
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  .site-header, .site-footer, .sticky-next-bar, .reading-tools-panel,
  .reading-topbar, .reading-progress-bar, .comments-section,
  .episode-nav, .story-actions, .share-buttons { display: none !important; }
  .episode-content { font-size: 12pt; line-height: 1.8; color: #000; }
  body { background: #fff; }
}

/* ============================================================
   INNER PAGES (Our Story, Contact, Submit, Guidelines, Legal)
   ============================================================ */

.inner-page { padding-bottom: var(--space-20); }

/* Inner Hero */
.inner-hero {
  position: relative;
  padding: var(--space-20) 0 var(--space-16);
  text-align: center;
  overflow: hidden;
}
.inner-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: rgba(244,169,53,0.1);
  border: 1px solid rgba(244,169,53,0.2);
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--clr-primary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-5);
}
.inner-hero__title {
  font-size: clamp(2.5rem, 6vw, 5rem);
  line-height: 1.05;
  margin-bottom: var(--space-5);
}
.inner-hero__sub {
  font-size: var(--fs-lg);
  color: var(--clr-text-muted);
  max-width: 520px;
  margin-inline: auto;
  line-height: var(--lh-relaxed);
}
.inner-hero__glow {
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 600px; height: 300px;
  background: radial-gradient(ellipse at center top, rgba(124,106,247,0.15) 0%, transparent 70%);
  pointer-events: none;
}

/* Section eyebrow */
.section-eyebrow {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--clr-primary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-3);
}

/* About page */
.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-12);
  align-items: center;
}
@media (min-width: 768px) {
  .about-grid { grid-template-columns: 1fr 1fr; }
}
.about-heading {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.75rem);
  margin-bottom: var(--space-6);
}
.about-grid__text p {
  color: var(--clr-text);
  margin-bottom: var(--space-4);
  font-size: var(--fs-lg);
  line-height: var(--lh-relaxed);
}
.about-stat-card {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}
@media (max-width: 640px) {
  .about-stat-card { grid-template-columns: 1fr; }
}
.about-stat-card__inner {
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  text-align: center;
}
.about-stat-num {
  font-family: var(--font-display);
  font-size: var(--fs-3xl);
  font-weight: 700;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.about-stat-label {
  font-size: var(--fs-xs);
  color: var(--clr-text-muted);
  margin-top: var(--space-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Values grid */
.values-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-5);
}
@media (min-width: 768px) {
  .values-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 480px) {
  .values-grid { grid-template-columns: 1fr; }
}
.value-card {
  padding: var(--space-6);
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-xl);
  transition: transform var(--dur-base) var(--ease-out), border-color var(--dur-base);
}
.value-card:hover { transform: translateY(-4px); border-color: var(--clr-border-light); }
.value-card__icon  { font-size: 2rem; margin-bottom: var(--space-4); }
.value-card__title { font-family: var(--font-display); font-size: var(--fs-lg); color: var(--clr-white); margin-bottom: var(--space-3); }
.value-card__desc  { font-size: var(--fs-sm); color: var(--clr-text-muted); line-height: var(--lh-relaxed); }

/* Contact page */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-12);
}
@media (min-width: 900px) {
  .contact-grid { grid-template-columns: 1.2fr 1fr; }
}
.contact-form-wrap {
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
}
.contact-form-title {
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  margin-bottom: var(--space-8);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}
@media (min-width: 640px) { .form-row { grid-template-columns: 1fr 1fr; } }
.contact-info-list { display: flex; flex-direction: column; gap: var(--space-6); margin-bottom: var(--space-8); }
.contact-info-item { display: flex; gap: var(--space-4); align-items: flex-start; }
.contact-info-icon { font-size: 1.5rem; flex-shrink: 0; margin-top: 2px; }
.contact-info-label { font-size: var(--fs-xs); color: var(--clr-text-faint); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: var(--space-1); }
.contact-info-value { font-size: var(--fs-sm); color: var(--clr-primary); font-weight: 600; }

.contact-faq { border-top: 1px solid var(--clr-border); padding-top: var(--space-8); }
.faq-item { margin-bottom: var(--space-5); }
.faq-q { font-size: var(--fs-sm); font-weight: 700; color: var(--clr-white); margin-bottom: var(--space-2); }
.faq-a { font-size: var(--fs-sm); color: var(--clr-text-muted); line-height: var(--lh-relaxed); }

/* Submit Story page */
.steps-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}
@media (min-width: 768px) { .steps-grid { grid-template-columns: repeat(3, 1fr); } }
.step-card {
  padding: var(--space-8);
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-xl);
  position: relative;
}
.step-num {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 700;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: var(--space-4);
}
.step-card h3 { font-size: var(--fs-lg); margin-bottom: var(--space-3); }
.step-card p  { font-size: var(--fs-sm); color: var(--clr-text-muted); line-height: var(--lh-relaxed); }

.requirements-box {
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
}
.req-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
}
@media (min-width: 640px) { .req-grid { grid-template-columns: 1fr 1fr; } }
.req-list { display: flex; flex-direction: column; gap: var(--space-3); }
.req-list li {
  font-size: var(--fs-sm);
  color: var(--clr-text);
  padding-left: var(--space-5);
  position: relative;
  line-height: var(--lh-relaxed);
}
.req-list--yes li::before { content: '✓ '; color: var(--clr-success); position: absolute; left: 0; font-weight: 700; }
.req-list--no  li::before { content: '✗ '; color: var(--clr-danger);  position: absolute; left: 0; font-weight: 700; }

.submit-story-form {
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

/* Legal pages (Privacy, Terms, Guidelines) */
.legal-content { color: var(--clr-text); }
.legal-content h2 {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  color: var(--clr-white);
  margin-top: var(--space-10);
  margin-bottom: var(--space-4);
  padding-top: var(--space-8);
  border-top: 1px solid var(--clr-border);
}
.legal-content h2:first-child { border-top: none; padding-top: 0; margin-top: 0; }
.legal-content p {
  font-size: var(--fs-base);
  line-height: var(--lh-relaxed);
  color: var(--clr-text-muted);
  margin-bottom: var(--space-4);
}
.legal-content ul {
  list-style: disc;
  padding-left: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}
.legal-content ul li {
  font-size: var(--fs-sm);
  color: var(--clr-text-muted);
  line-height: var(--lh-relaxed);
}
.legal-content a { color: var(--clr-primary); }
.legal-content a:hover { text-decoration: underline; }
.legal-content strong { color: var(--clr-text); }

.guideline-section { margin-bottom: var(--space-10); }
.guideline-section h2 {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  color: var(--clr-white);
  margin-bottom: var(--space-4);
}
.guideline-section p {
  font-size: var(--fs-base);
  color: var(--clr-text-muted);
  line-height: var(--lh-relaxed);
  margin-bottom: var(--space-4);
}
.guideline-section ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.guideline-section ul li {
  font-size: var(--fs-sm);
  color: var(--clr-text-muted);
  padding-left: var(--space-5);
  position: relative;
  line-height: var(--lh-relaxed);
}
.guideline-section ul li::before {
  content: '→';
  color: var(--clr-primary);
  position: absolute;
  left: 0;
  font-weight: 700;
}

/* Default page template */
.page-wrap { padding: var(--space-16) 0 var(--space-20); }
.page-header { margin-bottom: var(--space-10); border-bottom: 1px solid var(--clr-border); padding-bottom: var(--space-8); }
.page-title { font-family: var(--font-display); font-size: clamp(2rem, 5vw, 4rem); }
.page-body { color: var(--clr-text); font-size: var(--fs-lg); line-height: var(--lh-relaxed); max-width: 720px; }
.page-body p { margin-bottom: var(--space-5); }
.page-body h2 { font-family: var(--font-display); font-size: var(--fs-2xl); margin: var(--space-8) 0 var(--space-4); }
.page-body a { color: var(--clr-primary); }

/* ============================================================
   HEADER THEME TOGGLE (global, always visible)
   ============================================================ */
.header-theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  color: var(--clr-text-muted);
  transition: color var(--dur-fast), background var(--dur-fast);
  flex-shrink: 0;
}
.header-theme-toggle:hover { color: var(--clr-primary); background: var(--clr-primary-glow); }
[data-theme="dark"] .header-theme-toggle { color: #7e8498; }
[data-theme="dark"] .header-theme-toggle:hover { color: #f4a935; background: rgba(244,169,53,0.1); }

/* ============================================================
   GENRE ARCHIVE PAGE
   ============================================================ */
.genre-archive-page { padding-bottom: var(--space-20); }


/* ============================================================
   DARK MODE OVERRIDES for components fixed above
   These restore the original dark look when [data-theme="dark"]
   ============================================================ */

/* Header */
[data-theme="dark"] .site-header         { background: rgba(10,12,18,0.88); }
[data-theme="dark"] .site-header.scrolled{ background: rgba(10,12,18,0.97); }

/* Mobile menu + search overlay */
[data-theme="dark"] .mobile-menu         { background: rgba(10,12,18,0.97); }
[data-theme="dark"] .search-overlay      { background: rgba(10,12,18,0.97); }

/* Nav hover */
[data-theme="dark"] .main-nav a:hover,
[data-theme="dark"] .main-nav a.current-menu-item { background: rgba(255,255,255,0.06); }
[data-theme="dark"] .search-toggle:hover { color: var(--clr-white); background: rgba(255,255,255,0.06); }

/* Ghost button */
[data-theme="dark"] .btn--ghost       { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.12); }
[data-theme="dark"] .btn--ghost:hover { background: rgba(255,255,255,0.1);  border-color: rgba(255,255,255,0.2); color: #fff; }

/* Follow button */
[data-theme="dark"] .follow-btn       { background: rgba(255,255,255,0.06); }
[data-theme="dark"] .follow-btn:hover { background: rgba(255,255,255,0.1); }
[data-theme="dark"] .follow-btn.following { background: rgba(124,106,247,0.15); }

/* Episode row number chip */
[data-theme="dark"] .episode-row__num { background: rgba(255,255,255,0.06); border-color: transparent; }

/* Progress bar track */
[data-theme="dark"] .progress-bar-wrap { background: rgba(255,255,255,0.1); }

/* Search input */
[data-theme="dark"] .search-input-wrap { background: var(--clr-bg-card); }
[data-theme="dark"] .search-input-wrap input { color: #fff; }

/* Mobile menu link colour */
[data-theme="dark"] .mobile-menu nav a { color: var(--clr-text); border-bottom-color: var(--clr-border); }
[data-theme="dark"] .mobile-menu nav a:hover { color: var(--clr-primary); }

/* btn--primary text stays readable on amber in both modes */

/* ============================================================
   ADDITIONAL LIGHT MODE POLISH
   ============================================================ */

/* Story cards in light mode need a subtle shadow, not just a border */
.story-card {
  box-shadow: var(--shadow-sm);
}
.story-card:hover {
  box-shadow: var(--shadow-md);
}

/* Episode cards */
.episode-card {
  box-shadow: var(--shadow-sm);
}
.episode-card:hover {
  box-shadow: var(--shadow-md);
}

/* Episode rows */
.episode-row {
  box-shadow: var(--shadow-sm);
}

/* Search input wrap light */
.search-input-wrap {
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border-light);
}
.search-input-wrap input { color: var(--clr-white); }

/* Footer in light mode */
.site-footer {
  background: var(--clr-bg-2);
  border-top: 1px solid var(--clr-border);
}

/* Progress bar track */
.progress-bar-wrap { background: var(--clr-border); }

/* Comment form inputs */
.form-input, .form-textarea {
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border-light);
  color: var(--clr-white);
}
.form-input:focus, .form-textarea:focus {
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px var(--clr-primary-glow);
}

/* Mobile menu light mode */
.mobile-menu nav a {
  color: var(--clr-white);
  border-bottom: 1px solid var(--clr-border);
}
.mobile-menu nav a:hover { color: var(--clr-primary); }

/* Reading topbar back arrow light mode */
.reading-topbar-back:hover { background: var(--clr-bg-card-hover); }
[data-theme="dark"] .reading-topbar-back:hover { background: rgba(255,255,255,0.06); }

/* Reading tool buttons */
.reading-tool-btn {
  color: var(--clr-text-muted);
}
.reading-tool-btn:hover,
.reading-tool-btn.active {
  background: var(--clr-bg-card-hover);
  color: var(--clr-white);
}

/* Hamburger lines */
.hamburger span { background: var(--clr-text-muted); }

/* Toast */
.toast {
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border-light);
  color: var(--clr-white);
  box-shadow: var(--shadow-lg);
}

/* Share buttons */
.share-btn {
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border);
  color: var(--clr-text-muted);
}
.share-btn:hover {
  background: var(--clr-bg-card-hover);
  color: var(--clr-white);
  border-color: var(--clr-border-light);
}

/* Skeleton shimmer */
.skeleton {
  background: linear-gradient(90deg,
    var(--clr-bg-card) 25%,
    var(--clr-bg-card-hover) 50%,
    var(--clr-bg-card) 75%);
  background-size: 200% 100%;
}

/* Filter selects */
.filter-select {
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border-light);
  color: var(--clr-text);
}

/* Load more */
.load-more-btn {
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border-light);
  color: var(--clr-text);
}
.load-more-btn:hover {
  background: var(--clr-bg-card-hover);
  color: var(--clr-white);
}

/* Sticky bar dark mode */
[data-theme="dark"] .sticky-next-bar { background: rgba(10,12,18,0.95); }

/* ============================================================
   ALL GENRES PAGE (.gp-*)
   ============================================================ */

/* ── Hero ─────────────────────────────────────────────────── */
.gp-hero {
  position: relative;
  overflow: hidden;
  padding: var(--space-16) 0 var(--space-14);
  border-bottom: 1px solid var(--clr-border);
}
.gp-hero__content { position: relative; z-index: 2; }
.gp-hero__tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  background: var(--clr-primary-glow);
  border: 1px solid rgba(212,137,26,.3);
  border-radius: 999px;
  font-size: var(--fs-xs);
  font-weight: 800;
  color: var(--clr-primary);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: var(--space-5);
}
.gp-hero__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.08;
  margin-bottom: var(--space-4);
  color: var(--clr-white);
}
.gp-hero__sub {
  font-size: var(--fs-lg);
  color: var(--clr-text-muted);
}
.gp-hero__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 1;
}
.gp-hero__orb--1 {
  width: 500px; height: 500px;
  top: -200px; right: -100px;
  background: var(--clr-primary-glow);
  opacity: .5;
}
.gp-hero__orb--2 {
  width: 400px; height: 400px;
  bottom: -150px; left: -50px;
  background: var(--clr-accent-glow);
  opacity: .4;
}

/* ── Grid ─────────────────────────────────────────────────── */
.gp-grid-section { padding: var(--space-12) 0 var(--space-20); }

.gp-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-5);
}
@media (min-width: 560px)  { .gp-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 768px)  { .gp-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1024px) { .gp-grid { grid-template-columns: repeat(5, 1fr); } }
@media (min-width: 1280px) { .gp-grid { grid-template-columns: repeat(6, 1fr); gap: var(--space-5); } }

/* ── Card ─────────────────────────────────────────────────── */
.gp-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border);
  text-decoration: none;
  transition: transform .25s cubic-bezier(.16,1,.3,1),
              box-shadow .25s cubic-bezier(.16,1,.3,1),
              border-color .2s;
  cursor: pointer;
}
.gp-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 48px rgba(0,0,0,.14), 0 0 0 1px var(--card-accent);
  border-color: var(--card-accent);
}

/* Cover image strip */
.gp-card__strip {
  position: relative;
  height: 110px;
  display: flex;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--clr-bg-2);
}
.gp-card__strip-img {
  flex: 1;
  background-size: cover;
  background-position: center top;
  transition: transform .5s cubic-bezier(.16,1,.3,1);
}
.gp-card:hover .gp-card__strip-img { transform: scale(1.08); }
.gp-card__strip-img + .gp-card__strip-img { border-left: 2px solid var(--clr-bg); }
.gp-card__strip-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  background: linear-gradient(135deg, var(--clr-bg-2), var(--clr-bg-card-hover));
}
.gp-card__strip-fade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 30%, rgba(0,0,0,.5) 100%);
}
/* Accent bar at top of strip */
.gp-card__accent-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--card-accent);
  z-index: 2;
}

/* Card body */
.gp-card__body {
  padding: var(--space-4) var(--space-4) var(--space-5);
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: var(--space-2);
}
.gp-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}
.gp-card__emoji {
  font-size: 1.6rem;
  line-height: 1;
  transition: transform .25s cubic-bezier(.16,1,.3,1);
  flex-shrink: 0;
}
.gp-card:hover .gp-card__emoji { transform: scale(1.2) rotate(-8deg); }
.gp-card__count {
  font-size: var(--fs-xs);
  font-weight: 800;
  color: var(--card-accent);
  background: color-mix(in srgb, var(--card-accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--card-accent) 30%, transparent);
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
/* Fallback for browsers without color-mix */
@supports not (color: color-mix(in srgb, red 50%, blue)) {
  .gp-card__count { background: var(--clr-primary-glow); border-color: var(--clr-primary); color: var(--clr-primary); }
}
.gp-card__name {
  font-family: var(--font-display);
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--clr-white);
  line-height: 1.25;
  margin: 0;
}
.gp-card__desc {
  font-size: var(--fs-xs);
  color: var(--clr-text-faint);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.gp-card__cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--card-accent);
  margin-top: auto;
  transition: gap .2s;
}
.gp-card:hover .gp-card__cta { gap: var(--space-2); }

/* Empty + CTA */
.gp-empty {
  text-align: center;
  padding: var(--space-20) 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
}
.gp-empty__icon { font-size: 4rem; }

.gp-cta {
  background: var(--clr-bg-2);
  border-top: 1px solid var(--clr-border);
  padding: var(--space-12) 0;
}
.gp-cta__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-8);
  flex-wrap: wrap;
}
.gp-cta__heading { font-family: var(--font-display); font-size: clamp(1.4rem, 2.5vw, 2.2rem); margin-bottom: var(--space-2); }
.gp-cta__sub     { color: var(--clr-text-muted); }
.gp-cta__btns    { display: flex; gap: var(--space-3); flex-shrink: 0; flex-wrap: wrap; }

/* Pagination */
.pagination-wrap { display: flex; justify-content: center; margin-top: var(--space-12); }
.page-numbers { display: inline-flex; align-items: center; gap: var(--space-2); }
.page-numbers a, .page-numbers span {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  font-size: var(--fs-sm); font-weight: 600;
  color: var(--clr-text-muted);
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border);
  transition: all var(--dur-fast);
}
.page-numbers a:hover { color: var(--clr-primary); border-color: var(--clr-primary); }
.page-numbers .current { background: var(--clr-primary-glow); color: var(--clr-primary); border-color: var(--clr-primary); }
.page-numbers .dots { background: none; border: none; color: var(--clr-text-faint); }

@media (max-width: 640px) {
  .gp-cta__inner { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   SINGLE GENRE PAGE (.sg-*)
   ============================================================ */

.sg-page { padding-bottom: var(--space-20); }

/* ── Hero ─────────────────────────────────────────────────── */
.sg-hero {
  position: relative;
  overflow: hidden;
  min-height: 320px;
  display: flex;
  align-items: flex-end;
  padding-bottom: var(--space-10);
}
/* Cover collage background */
.sg-hero__collage {
  position: absolute;
  inset: 0;
  display: flex;
}
.sg-hero__collage-img {
  flex: 1;
  background-size: cover;
  background-position: center;
  transition: transform .5s ease;
}
.sg-hero__collage-img + .sg-hero__collage-img { border-left: 3px solid rgba(0,0,0,.2); }
.sg-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top,
    rgba(0,0,0,.92) 0%,
    rgba(0,0,0,.6) 50%,
    rgba(0,0,0,.3) 100%);
}
/* Accent stripe on top */
.sg-hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--sg-accent, var(--clr-primary));
  z-index: 3;
}
.sg-hero__plain-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--clr-bg-2) 0%, var(--clr-bg) 100%);
}

.sg-hero__inner {
  position: relative;
  z-index: 2;
  width: 100%;
  padding-top: var(--space-10);
}
.sg-breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: rgba(255,255,255,.6);
  margin-bottom: var(--space-6);
}
.sg-breadcrumb a { color: rgba(255,255,255,.8); transition: color var(--dur-fast); }
.sg-breadcrumb a:hover { color: #fff; }

.sg-hero__body {
  display: flex;
  align-items: flex-end;
  gap: var(--space-6);
}
.sg-hero__emoji {
  font-size: 5rem;
  line-height: 1;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 16px rgba(0,0,0,.4));
}
.sg-hero__title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 5rem);
  color: #fff;
  line-height: 1.05;
  margin-bottom: var(--space-3);
  text-shadow: 0 2px 12px rgba(0,0,0,.3);
}
.sg-hero__desc {
  font-size: var(--fs-lg);
  color: rgba(255,255,255,.75);
  max-width: 520px;
  line-height: var(--lh-relaxed);
  margin-bottom: var(--space-4);
}
.sg-hero__meta { display: flex; gap: var(--space-4); flex-wrap: wrap; }
.sg-hero__pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: var(--space-2) var(--space-4);
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  backdrop-filter: blur(8px);
  border-radius: 999px;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: #fff;
}

/* ── Genre nav strip ─────────────────────────────────────── */
.sg-nav {
  background: var(--clr-bg-2);
  border-bottom: 1px solid var(--clr-border);
}
.sg-nav__track {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  scrollbar-width: none;
  padding: var(--space-4) 0;
  align-items: center;
}
.sg-nav__track::-webkit-scrollbar { display: none; }

.sg-nav__btn {
  display: inline-flex;
  align-items: center;
  padding: var(--space-2) var(--space-4);
  border-radius: 999px;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--clr-text-muted);
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border);
  white-space: nowrap;
  flex-shrink: 0;
  transition: all var(--dur-fast);
  text-decoration: none;
}
.sg-nav__btn:hover { color: var(--clr-primary); border-color: var(--clr-primary); background: var(--clr-primary-glow); }
.sg-nav__btn--all { font-weight: 800; }
.sg-nav__btn--active { background: var(--clr-primary-glow); border-color: var(--clr-primary); color: var(--clr-primary); }

/* ── Stories section ─────────────────────────────────────── */
.sg-stories { padding: var(--space-8) 0 var(--space-16); }

/* Toolbar */
.sg-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-8);
  padding: var(--space-4) var(--space-5);
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
}
.sg-toolbar__count { font-size: var(--fs-sm); color: var(--clr-text-muted); }
.sg-toolbar__count strong { color: var(--clr-white); }
.sg-toolbar__sort { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }

.sg-sort {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--clr-text-muted);
  border: 1px solid transparent;
  transition: all var(--dur-fast);
  text-decoration: none;
  white-space: nowrap;
}
.sg-sort:hover   { color: var(--clr-text); background: var(--clr-bg-2); border-color: var(--clr-border); }
.sg-sort--on     { background: var(--clr-primary-glow); border-color: var(--clr-primary); color: var(--clr-primary); }

/* Empty */
.sg-empty {
  text-align: center;
  padding: var(--space-20) 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
}
.sg-empty__emoji { font-size: 5rem; }
.sg-empty h2 { font-family: var(--font-display); font-size: var(--fs-2xl); }
.sg-empty p  { color: var(--clr-text-muted); max-width: 360px; }

/* Responsive */
@media (max-width: 640px) {
  .gp-grid       { grid-template-columns: repeat(2, 1fr); gap: var(--space-3); }
  .sg-hero__body { flex-direction: column; align-items: flex-start; gap: var(--space-3); }
  .sg-hero__emoji { font-size: 3.5rem; }
  .sg-toolbar    { gap: var(--space-3); }
  .sg-sort       { padding: var(--space-2) var(--space-2); font-size: 10px; }
  .gp-cta__inner { flex-direction: column; }
}

/* Dark mode for sg-hero (hero is always on dark bg due to cover images) */
[data-theme="dark"] .gp-card { box-shadow: none; }
[data-theme="dark"] .sg-toolbar__count strong { color: var(--clr-white); }

/* ============================================================
   FEATURE 1: BACK TO TOP BUTTON
   ============================================================ */
.back-to-top {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: calc(var(--z-sticky) - 1);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--clr-primary);
  color: #1a0a00;
  border-radius: var(--radius-full);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  cursor: pointer;
  border: none;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out),
              background var(--dur-fast),
              box-shadow var(--dur-fast);
  pointer-events: none;
}
.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}
.back-to-top:hover {
  background: var(--clr-primary-dark);
  box-shadow: 0 6px 24px rgba(0,0,0,0.25);
  transform: translateY(-2px);
}
/* Push it up on episode pages so it sits above the sticky bar */
.is-episode-page .back-to-top {
  bottom: 80px;
}

/* ============================================================
   FEATURE 2: EPISODE COMPLETION CHECKMARKS
   ============================================================ */
/* Checkmark icon on completed episodes in the episode list */
.episode-row.is-completed .episode-row__num {
  background: var(--clr-primary-glow);
  color: var(--clr-primary);
  border-color: rgba(212,137,26,0.3);
}
.episode-row.is-completed .episode-row__title {
  color: var(--clr-text-muted);
}
.episode-row__check {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--clr-primary);
  opacity: 0;
  transition: opacity var(--dur-fast);
}
.episode-row.is-completed .episode-row__check {
  opacity: 1;
}
/* Completion banner shown at 95%+ scroll on episode page */
.episode-completion-banner {
  display: none;
  margin: var(--space-8) 0 var(--space-4);
  padding: var(--space-5) var(--space-6);
  background: linear-gradient(135deg, var(--clr-primary-glow) 0%, var(--clr-accent-glow) 100%);
  border: 1px solid rgba(212,137,26,0.25);
  border-radius: var(--radius-xl);
  text-align: center;
  animation: fadeUp var(--dur-slow) var(--ease-out);
}
.episode-completion-banner.visible { display: block; }
.episode-completion-banner__icon  { font-size: 2rem; margin-bottom: var(--space-2); display: block; }
.episode-completion-banner__title { font-family: var(--font-display); font-size: var(--fs-xl); color: var(--clr-white); margin-bottom: var(--space-2); }
.episode-completion-banner__sub   { font-size: var(--fs-sm); color: var(--clr-text-muted); }

/* ============================================================
   FEATURE 5: READING STREAK
   ============================================================ */
.reading-streak {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: linear-gradient(135deg, rgba(244,169,53,0.12) 0%, rgba(244,100,53,0.08) 100%);
  border: 1px solid rgba(244,169,53,0.25);
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
  font-weight: 800;
  color: var(--clr-primary);
  letter-spacing: 0.04em;
}
.reading-streak__flame { font-size: 1rem; line-height: 1; }
.reading-streak__count { font-variant-numeric: tabular-nums; }
.reading-streak__label { color: var(--clr-text-muted); font-weight: 600; }

/* Streak shown in episode header */
.episode-streak-wrap {
  margin-top: var(--space-3);
}

/* ============================================================
   FEATURE 6: COMMENT REPLIES
   ============================================================ */
.comment-replies {
  margin-top: var(--space-4);
  margin-left: var(--space-10);
  border-left: 2px solid var(--clr-border);
  padding-left: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.comment-reply-item {
  padding: var(--space-4);
  background: var(--clr-bg-2);
  border-radius: var(--radius-lg);
  border: 1px solid var(--clr-border);
}
.reply-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  margin-top: var(--space-3);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--clr-text-faint);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color var(--dur-fast), background var(--dur-fast);
}
.reply-btn:hover { color: var(--clr-primary); background: var(--clr-primary-glow); }
.reply-form {
  display: none;
  margin-top: var(--space-4);
  padding: var(--space-4);
  background: var(--clr-bg-2);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  gap: var(--space-3);
  flex-direction: column;
}
.reply-form.open { display: flex; }
.reply-form input,
.reply-form textarea {
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border-light);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-size: var(--fs-sm);
  color: var(--clr-white);
  width: 100%;
  font-family: var(--font-body);
  resize: vertical;
  transition: border-color var(--dur-fast);
}
.reply-form input:focus,
.reply-form textarea:focus {
  outline: none;
  border-color: var(--clr-primary);
}
.reply-form__actions {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}
.reply-cancel {
  padding: var(--space-2) var(--space-4);
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--clr-text-muted);
  background: none;
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--dur-fast);
}
.reply-cancel:hover { color: var(--clr-text); border-color: var(--clr-border-light); }

/* Dark mode adjustments */
[data-theme="dark"] .comment-reply-item { background: var(--clr-bg-card); }
[data-theme="dark"] .reply-form { background: var(--clr-bg-card); }

/* ============================================================
   FEATURE 3: SEARCH RESULTS PAGE
   ============================================================ */
.search-results-page { padding-bottom: var(--space-20); }

.search-results-hero {
  padding: var(--space-10) 0;
  border-bottom: 1px solid var(--clr-border);
  background: var(--clr-bg-2);
}
.search-results-hero__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  flex-wrap: wrap;
}
.search-results-hero__title {
  font-family: var(--font-display);
  font-size: clamp(var(--fs-xl), 3vw, var(--fs-3xl));
  color: var(--clr-white);
  font-weight: 700;
}
.search-results-hero__title strong {
  color: var(--clr-primary);
}

/* Inline search form */
.search-results-form__wrap {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-2) var(--space-3);
  min-width: 280px;
}
.search-results-form__wrap svg { color: var(--clr-text-faint); flex-shrink: 0; }
.search-results-form__input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: var(--fs-sm);
  color: var(--clr-white);
  font-family: var(--font-body);
  min-width: 0;
}
.search-results-form__input::placeholder { color: var(--clr-text-faint); }

.search-results-body { padding-top: var(--space-10); }

/* No results */
.search-no-results {
  text-align: center;
  padding: var(--space-20) 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
}
.search-no-results__icon { font-size: 4rem; }
.search-no-results h2 { font-family: var(--font-display); font-size: var(--fs-2xl); }
.search-no-results p  { color: var(--clr-text-muted); }

@media (max-width: 640px) {
  .search-results-hero__inner { flex-direction: column; align-items: flex-start; }
  .search-results-form__wrap  { min-width: 100%; }
}

/* Synopsis heading on story page */
.story-synopsis {
  margin-top: var(--space-6);
  margin-bottom: var(--space-2);
}
.story-synopsis__heading {
  font-family: var(--font-display);
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--clr-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--clr-border);
}
