/*
Theme Name: Epyso Premium
Theme URI: https://www.epyso.com
Author: Brajola Crafts
Author URI: https://www.brajolacrafts.com
Description: A high-performance, modern storytelling platform theme. Built for speed, engagement, and mobile-first reading experiences. Made with love by Brajola Crafts.
Version: 8.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
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
*/

/* ============================================================
   ACCESSIBILITY: screen-reader-only text + skip link
   .screen-reader-text was already used in markup (hero search
   label, hero live-region) with no definition anywhere — this
   was rendering as visible text instead of being hidden.
   ============================================================ */
.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  z-index: 100000;
  top: -100px;
  left: 6px;
}

.skip-link:focus {
  position: fixed !important;
  clip: auto;
  width: auto;
  height: auto;
  top: 6px;
  padding: 10px 18px;
  background: #1a1c2e;
  color: #fff;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

/* ============================================================
   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);

  /* ── Reading Room (rr-*) homepage tokens — dark mode equivalents ── */
  --rr-paper:        #14161d;
  --rr-paper-2:      #1a1d26;
  --rr-paper-3:      #21242f;
  --rr-ink:          #f0ead8;
  --rr-ink-soft:     #c9c2b0;
  --rr-ink-faint:    #8b8576;
  --rr-line:         rgba(240,234,216,0.12);
  --rr-line-soft:    rgba(240,234,216,0.08);
  --rr-clay:         #e0825c;
  --rr-clay-dark:    #f0966f;
  --rr-clay-tint:    rgba(224,130,92,0.12);
  --rr-panel:        #1f1409;
  --rr-panel-text:   #f7f1e3;
}

[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 h2,
[data-theme="dark"] .episode-content h3 { color: #e8eaf2; }
[data-theme="dark"] .episode-content strong { color: #e8eaf2; }

[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: 3px 9px;
  border-radius: 4px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.badge--ongoing  { background: #1f9d5c; color: #ffffff; }
.badge--hiatus   { background: #c2780f; color: #ffffff; }
.badge--completed{ background: #5b4bd6; color: #ffffff; }
.badge--coming-soon { background: linear-gradient(135deg, #c0392b 0%, #e74c3c 100%); color: #ffffff; box-shadow: 0 2px 8px rgba(192,57,43,.35); }
.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__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: var(--space-1);
}
.main-nav__list li { list-style: none; margin: 0; padding: 0; }
.main-nav a,
.main-nav__list 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);
  display: block;
}
.main-nav a:hover, .main-nav a.current-menu-item,
.main-nav__list a:hover, .main-nav__list a.current-menu-item { color: var(--clr-white); background: var(--clr-bg-card); }
.main-nav__list a.current-menu-item { color: var(--clr-primary); }

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

/* ── Challenge Header Button — glassy, glowing pill ── */
.ch-header-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 16px;
  height: 34px;
  border-radius: 17px;
  background: rgba(212,137,26,0.08);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(212,137,26,0.35);
  color: var(--clr-primary-dark, #b5720f);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .03em;
  text-decoration: none;
  white-space: nowrap;
  transition: background .2s, border-color .2s, transform .15s, box-shadow .2s, color .2s;
  position: relative;
  box-shadow: var(--shadow-glow);
}
.ch-header-btn:hover {
  background: rgba(212,137,26,0.15);
  border-color: rgba(212,137,26,0.6);
  color: var(--clr-primary-dark, #b5720f);
  transform: translateY(-1px);
  box-shadow: 0 0 28px rgba(212,137,26,0.35), 0 4px 14px rgba(0,0,0,0.1);
}
.ch-header-btn--soon {
  background: transparent;
  border: 1.5px solid var(--clr-border-light);
  color: var(--clr-text-muted);
  box-shadow: none;
}
.ch-header-btn--soon:hover {
  background: var(--clr-bg-card);
  transform: translateY(-1px);
  box-shadow: none;
  color: var(--clr-text);
}
/* Live pulsing dot — only on open */
.ch-header-btn__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c993;
  flex-shrink: 0;
  box-shadow: 0 0 6px rgba(34,201,147,0.8);
  animation: ch-btn-pulse 2s ease infinite;
}
.ch-header-btn--soon .ch-header-btn__dot {
  background: var(--clr-text-faint);
  box-shadow: none;
  animation: none;
}
@keyframes ch-btn-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .5; transform: scale(1.4); }
}
/* Vertical hairline separating the CTA from the toggle/search/menu cluster */
.header-actions__divider {
  width: 1px;
  height: 20px;
  background: var(--clr-border-light);
  flex-shrink: 0;
}
/* Dark mode */
[data-theme="dark"] .ch-header-btn {
  background: rgba(244,169,53,0.08);
  border: 1px solid rgba(244,169,53,0.3);
  color: #f4a935;
  box-shadow: 0 0 28px rgba(244,169,53,0.18);
}
[data-theme="dark"] .ch-header-btn:hover {
  background: rgba(244,169,53,0.16);
  border-color: rgba(244,169,53,0.55);
  box-shadow: 0 0 32px rgba(244,169,53,0.35), 0 4px 14px rgba(0,0,0,0.4);
}
[data-theme="dark"] .ch-header-btn--soon {
  background: transparent;
  border-color: rgba(255,255,255,0.1);
  color: var(--clr-text-muted);
}
[data-theme="dark"] .header-actions__divider {
  background: rgba(255,255,255,0.12);
}
/* Hide on very small screens — mobile menu covers it */
@media (max-width: 400px) { .ch-header-btn, .header-actions__divider { display: none; } }

.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,
.mobile-menu nav li 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,
.mobile-menu nav li a:hover { color: var(--clr-primary); padding-left: var(--space-6); }
.mobile-nav__list { list-style: none; margin: 0; padding: 0; }
.mobile-nav__list li { list-style: none; margin: 0; padding: 0; }

/* 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;
  cursor: pointer;
}
.story-card:hover,
.story-card:focus-within {
  border-color: var(--clr-border-light);
}
.story-card__cover {
  position: relative;
  aspect-ratio: 2/3;
  overflow: hidden;
  background: var(--clr-bg-card);
}
.story-card__cover-fallback {
  width: 100%;
  height: 100%;
  background: var(--clr-bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--clr-text-faint);
}
.story-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.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;
  bottom: var(--space-3);
  left: var(--space-3);
  z-index: 1;
}
/* Episode count chip — bottom right of cover */
.story-card__ep-chip {
  position: absolute;
  bottom: var(--space-3);
  right: var(--space-3);
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-size: 0.65rem;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  line-height: 1;
  letter-spacing: .03em;
  border: 1px solid rgba(255,255,255,0.12);
}
.story-card__trophy {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  z-index: 2;
  font-size: 1rem;
  line-height: 1;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.4));
}
.story-card__info {
  padding: var(--space-3) var(--space-4) var(--space-4);
}
.story-card__genre {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--clr-primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.story-card__title {
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--clr-white);
  line-height: var(--lh-snug);
  margin-bottom: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color var(--dur-fast);
}
.story-card:hover .story-card__title { color: var(--clr-primary); }
.story-card__stats {
  display: flex;
  gap: var(--space-3);
  font-size: 0.68rem;
  color: var(--clr-text-faint);
  margin-top: var(--space-2);
}
.story-card__stat {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}
/* Smooth cover zoom on hover */
.story-card__cover img {
  transition: transform var(--dur-slow) var(--ease-out);
}
.story-card:hover .story-card__cover img {
  transform: scale(1.04);
}

/* 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: 140px;
  max-width: 180px;
}
.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: normal; word-break: break-word; line-height: 1.3; }
.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) — REDESIGNED
   ============================================================ */
.story-page { padding-top: 0; }

/* Cinematic banner: blurred cover image behind everything */
.sp-banner {
  position: relative;
  height: 240px;
  overflow: hidden;
}
@media (min-width: 768px) { .sp-banner { height: 320px; } }
.sp-banner__bg {
  position: absolute; inset: 0;
}
.sp-banner__bg img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: blur(28px) saturate(0.6);
  transform: scale(1.08);
}
.sp-banner__overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom,
    rgba(10,9,8,0.45) 0%,
    rgba(10,9,8,0.85) 100%);
}

/* Two-column layout: cover left, meta right */
.sp-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  margin-top: -140px; /* pull up into banner */
  margin-bottom: var(--space-12);
  position: relative;
  z-index: 1;
}
@media (min-width: 720px) {
  .sp-layout {
    grid-template-columns: 200px 1fr;
    align-items: start;
    margin-top: -180px;
    gap: var(--space-10);
  }
}
@media (min-width: 900px) {
  .sp-layout { grid-template-columns: 220px 1fr; }
}

/* Cover column */
.sp-cover-col { display: flex; flex-direction: column; gap: var(--space-4); }
.sp-cover {
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
  aspect-ratio: 2/3;
  background: var(--clr-bg-card);
}
.sp-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sp-cover__placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 4rem; background: var(--clr-bg-card);
}

/* Desktop action buttons stacked below cover */
.sp-cover-actions { display: none; }
@media (min-width: 720px) {
  .sp-cover-actions {
    display: flex; flex-direction: column; gap: var(--space-3);
  }
}

/* Two compact icon buttons: vote + follow */
/* Vote + Save — one unified box with a divider between them */
.sp-icon-actions {
  display: flex;
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-md);
  background: var(--clr-bg-card);
  overflow: hidden;
  margin-top: var(--space-2);
}
.sp-icon-actions__divider {
  width: 1px;
  background: var(--clr-border);
  flex-shrink: 0;
}
.sp-icon-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: var(--space-4) var(--space-2);
  border: none;
  background: transparent;
  color: var(--clr-text-muted);
  font-size: var(--fs-xs);
  font-weight: 700;
  cursor: pointer;
  transition: all var(--dur-fast);
}
.sp-icon-btn__count { font-size: 15px; font-weight: 700; color: var(--clr-white); line-height: 1; }
.sp-icon-btn__label { font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--clr-text-faint); }
.sp-icon-btn:hover { background: var(--clr-bg-card-hover); color: var(--clr-white); }
.sp-icon-btn.vote-btn:hover,
.sp-icon-btn.vote-btn.voted { color: var(--clr-primary); background: rgba(244,169,53,0.06); }
.sp-icon-btn.vote-btn.voted .sp-icon-btn__count { color: var(--clr-primary); }
.sp-icon-btn.follow-btn.following { color: var(--clr-accent); background: rgba(90,74,209,0.07); }

/* Mobile CTA: big Start Reading + icon vote side by side */
.sp-mobile-cta {
  display: flex;
  gap: var(--space-3);
  align-items: stretch;
  margin-bottom: var(--space-5);
}
@media (min-width: 720px) { .sp-mobile-cta { display: none; } }
.sp-mobile-cta .sp-icon-btn {
  flex-direction: row;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  flex: 0 0 auto;
}

/* Meta column */
.sp-meta-col { padding-top: 0; }
@media (min-width: 720px) { .sp-meta-col { padding-top: 160px; } }

.sp-tags-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}
.sp-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-2);
}
.sp-author {
  font-size: var(--fs-sm);
  color: var(--clr-text-muted);
  margin-bottom: var(--space-5);
}
.sp-author a { color: var(--clr-primary); font-weight: 600; }

/* Horizontal stats strip with dividers */
.sp-stats {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--clr-border);
}
.sp-stat { display: flex; flex-direction: column; gap: 2px; }
.sp-stat strong { font-family: var(--font-display); font-size: var(--fs-xl); font-weight: 700; color: var(--clr-white); }
.sp-stat span { font-size: var(--fs-xs); color: var(--clr-text-faint); text-transform: uppercase; letter-spacing: 0.06em; }
.sp-stat-divider {
  width: 1px; height: 32px;
  background: var(--clr-border);
  flex-shrink: 0;
}

/* Synopsis */
.sp-synopsis { margin-bottom: var(--space-6); }
.sp-synopsis__label {
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--clr-primary);
  margin-bottom: var(--space-2);
}
.sp-synopsis__body {
  font-size: var(--fs-base);
  color: var(--clr-text-muted);
  line-height: var(--lh-relaxed);
  max-width: 580px;
}

/* Share strip */
.sp-share {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid var(--clr-border);
}
.sp-share__label {
  font-size: var(--fs-xs);
  color: var(--clr-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-right: var(--space-1);
}
.sp-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--clr-border);
  background: none;
  color: var(--clr-text-muted);
  font-size: var(--fs-xs);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--dur-fast);
}
.sp-share-btn:hover { color: var(--clr-white); border-color: var(--clr-border-light); background: var(--clr-bg-card); }
.sp-share-btn--wa:hover { background: #1da851; border-color: #1da851; color: #fff; }
.sp-share-btn.copied { color: var(--clr-success); border-color: rgba(62,207,130,0.3); }

/* Episode List — new design */
.sp-episodes {
  margin-top: var(--space-2);
  padding-top: var(--space-8);
  border-top: 1px solid var(--clr-border);
  margin-bottom: var(--space-12);
}
.sp-episodes__header {
  display: flex;
  align-items: center;
  margin-bottom: var(--space-6);
}
.sp-episodes__title {
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  color: var(--clr-white);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.sp-episodes__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 99px;
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border);
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--clr-text-muted);
  font-family: var(--font-body);
}
.sp-ep-list { display: flex; flex-direction: column; gap: 0; }
/* sp-ep-row carries both classes; neutralize old episode-row defaults */
a.sp-ep-row {
  background: none;
  border: none;
  border-radius: 0;
  margin-bottom: 0;
  box-shadow: none;
  transform: none;
}
a.sp-ep-row:hover {
  background: var(--clr-bg-card);
  transform: none;
}
.sp-ep-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-3);
  border-bottom: 1px solid var(--clr-border);
  transition: background var(--dur-fast), padding-left var(--dur-fast);
  text-decoration: none;
}
.sp-ep-row:first-child { border-top: 1px solid var(--clr-border); }
.sp-ep-row:hover {
  background: var(--clr-bg-card);
  padding-left: var(--space-5);
}
.sp-ep-row__num {
  width: 32px; height: 32px;
  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);
  flex-shrink: 0;
}
.sp-ep-row__body { flex: 1; min-width: 0; }
.sp-ep-row__title {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--clr-white);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sp-ep-row__meta {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: var(--fs-xs);
  color: var(--clr-text-faint);
  margin-top: 2px;
}
.sp-ep-row__arrow { color: var(--clr-text-faint); flex-shrink: 0; opacity: 0; transition: opacity var(--dur-fast); }
.sp-ep-row:hover .sp-ep-row__arrow { opacity: 1; }

/* Keep old .episode-row/.episode-row__* in sync for JS compat */
.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 (legacy — kept for JS compatibility) */
.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: 5px;
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  color: var(--clr-text-muted);
  font-weight: 600;
  margin-bottom: var(--space-5);
  text-decoration: none;
  transition: color var(--dur-fast);
}
.episode-story-link:hover { color: var(--clr-white); }
.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-6);
}

/* Clean horizontal rule instead of gradient bar */
.episode-divider { display: none; }

/* Dateline-style meta row — quiet, horizontal, comma-like separators */
.episode-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: var(--space-8);
}
.episode-meta-item {
  font-size: var(--fs-xs);
  color: var(--clr-text-faint);
}
.episode-meta-sep {
  width: 3px;
  height: 3px;
  background: var(--clr-text-faint);
  border-radius: 50%;
  opacity: 0.4;
  flex-shrink: 0;
}
.episode-meta-genre {
  font-size: var(--fs-xs);
  color: var(--clr-primary);
  font-weight: 600;
  text-decoration: none;
}
.episode-meta-genre:hover { text-decoration: underline; }

/* Base reading typography */
.episode-content {
  font-family: var(--font-reading);
  line-height: 2.0;
  color: #1a1c2e;
  letter-spacing: 0.01em;
  font-size: 1.1rem;
}
[data-theme="dark"] .episode-content { color: #e8eaf2; }
.episode-content p          { margin-bottom: 1.75em; color: inherit; }
.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-text); }
.episode-content blockquote {
  border-left: 2px solid var(--clr-primary);
  padding: var(--space-3) var(--space-6);
  margin: var(--space-8) 0;
  color: var(--clr-text-muted);
  font-style: italic;
}
.episode-content em     { font-style: italic; }
.episode-content strong { font-weight: 700; color: var(--clr-text); }
.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 {
  display: block;
  padding: var(--space-5) var(--space-5);
  background: transparent;
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: border-color var(--dur-fast), background var(--dur-fast);
  min-height: 64px; /* thumb-friendly tap target */
}
.ep-nav-btn:hover {
  background: var(--clr-bg-card);
  border-color: var(--clr-border-light);
}
.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-text-faint);
  margin-bottom: 4px;
}
.ep-nav-title {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--clr-white);
  line-height: 1.3;
}

/* Share row */
.episode-share {
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--clr-border);
}
.episode-share__label {
  display: block;
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--clr-text-faint);
  margin-bottom: var(--space-4);
}
.share-buttons {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--clr-text-muted);
  text-decoration: none;
  cursor: pointer;
  background: transparent;
  transition: color var(--dur-fast), border-color var(--dur-fast), background var(--dur-fast);
  white-space: nowrap;
}
.share-btn:hover { color: var(--clr-white); border-color: var(--clr-border-light); background: var(--clr-bg-card); }
.share-btn--whatsapp {
  background: #25D366;
  border-color: #25D366;
  color: #fff;
}
.share-btn--whatsapp:hover { background: #1da851; border-color: #1da851; color: #fff; }
.share-btn--copy.copied { color: var(--clr-success); border-color: rgba(62,207,130,0.3); }

@media (max-width: 480px) {
  .share-btn--whatsapp { flex: 1; justify-content: center; }
}

/* 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 next — a quiet reading nudge, not a gradient box */
.inline-next-suggestion {
  margin: var(--space-12) 0;
  padding: var(--space-8) 0;
  border-top: 1px solid var(--clr-border);
  display: none;
}
.inline-next-suggestion.visible { display: block; }
.inline-next-suggestion__kicker {
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--clr-primary);
  display: block;
  margin-bottom: var(--space-3);
}
.inline-next-suggestion h3 {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  color: var(--clr-white);
  margin-bottom: var(--space-5);
  line-height: 1.25;
}
.inline-next-suggestion p { display: none; }

/* Completion banner — confident typographic confirmation, no gradient glow */
.episode-completion-banner {
  display: none;
  margin: var(--space-8) 0 var(--space-4);
  padding: var(--space-5) 0;
  border-top: 1px solid var(--clr-border);
  border-bottom: 1px solid var(--clr-border);
}
.episode-completion-banner.visible { display: block; }
.episode-completion-banner__icon  { display: none; }
.episode-completion-banner__title {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  color: var(--clr-white);
  margin-bottom: 4px;
}
.episode-completion-banner__sub {
  font-size: var(--fs-sm);
  color: var(--clr-text-faint);
}

/* ============================================================
   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; }

/* ============================================================
   FOOTER
   ============================================================ */
/* ── SITE FOOTER — always dark, gold accents ──────────────── */
.site-footer {
  background: #0d0b08;
  border-top: 1px solid rgba(201,150,63,0.15);
  padding-top: var(--space-16);
  padding-bottom: var(--space-10);
  margin-top: var(--space-20);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-10) 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; gap: var(--space-8); } }

.footer-brand { grid-column: 1 / -1; }
@media (min-width: 1024px) { .footer-brand { grid-column: 1; } }

.footer-logo { margin-bottom: var(--space-4); }
.footer-logo .logo-text {
  font-family: var(--rr-font-display, Georgia, serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: #f0ead8;
  letter-spacing: -0.01em;
}
.footer-logo img { filter: brightness(0) invert(1); max-height: 32px; width: auto; }

.footer-tagline {
  font-size: 13px;
  color: rgba(240,234,216,0.45);
  max-width: 260px;
  line-height: 1.65;
  margin: 0;
}

/* Social icons — bare, no box */
.footer-social {
  display: flex;
  gap: 20px;
  margin-top: var(--space-6);
  align-items: center;
}
.footer-social-link {
  color: rgba(240,234,216,0.35);
  display: flex;
  align-items: center;
  transition: color 0.15s;
  background: none;
  border: none;
  border-radius: 0;
  width: auto;
  height: auto;
  font-size: inherit;
}
.footer-social-link:hover { color: #c9963f; }

/* Column headings */
.footer-col-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #c9963f;
  margin-bottom: var(--space-5);
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul li a {
  font-size: 13px;
  color: rgba(240,234,216,0.5);
  text-decoration: none;
  transition: color 0.15s;
}
.footer-col ul li a:hover { color: #f0ead8; }

/* Bottom bar */
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding-top: var(--space-6);
  border-top: 1px solid rgba(240,234,216,0.07);
}
.footer-copy {
  font-size: 11px;
  color: rgba(240,234,216,0.25);
}
.footer-legal { display: flex; gap: var(--space-5); }
.footer-legal a {
  font-size: 11px;
  color: rgba(240,234,216,0.25);
  text-decoration: none;
  transition: color 0.15s;
}
.footer-legal a:hover { color: rgba(240,234,216,0.6); }


/* ── More Like This — cinematic horizontal scroll ──────────── */
.sp-related {
  padding: var(--space-12) 0 var(--space-16);
  border-top: 1px solid var(--clr-border);
  margin-top: var(--space-4);
}
.sp-related__heading {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  font-weight: 700;
  color: var(--clr-white);
  margin-bottom: var(--space-6);
}
.sp-related__row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 4px;
}
.sp-related__row::-webkit-scrollbar { display: none; }

.sp-rel-card {
  flex: 0 0 140px;
  scroll-snap-align: start;
}
@media (min-width: 480px) { .sp-rel-card { flex: 0 0 155px; } }
@media (min-width: 768px) { .sp-rel-card { flex: 0 0 175px; } }

.sp-rel-card__link {
  display: block;
  text-decoration: none;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}
.sp-rel-card__cover {
  position: relative;
  aspect-ratio: 2/3;
  background: var(--clr-bg-card);
  border-radius: 6px;
  overflow: hidden;
}
.sp-rel-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}
.sp-rel-card__link:hover .sp-rel-card__cover img {
  transform: scale(1.04);
}
.sp-rel-card__cover-fallback {
  width: 100%;
  height: 100%;
  background: var(--clr-bg-card);
}
/* Strong gradient from bottom — title lives inside the image */
.sp-rel-card__gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.92) 0%,
    rgba(0,0,0,0.55) 40%,
    transparent 70%
  );
  border-radius: 6px;
}
.sp-rel-card__overlay-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px 10px 11px;
  z-index: 2;
}
.sp-rel-card__genre {
  display: block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #c9963f;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sp-rel-card__title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
  margin: 0 0 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sp-rel-card__eps {
  font-size: 10px;
  color: rgba(255,255,255,0.45);
  font-weight: 500;
}

/* ============================================================
   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 (ct-*) ── */
.ct-page { padding-bottom: var(--space-20); }

/* Quiet editorial header — no glow orb, no pill badge */
.ct-header {
  padding: var(--space-16) 0 var(--space-12);
  border-bottom: 1px solid var(--clr-border);
  margin-bottom: var(--space-14);
}
.ct-header__kicker {
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--clr-primary);
  margin-bottom: var(--space-4);
}
.ct-header__title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 1.08;
  color: var(--clr-white);
  margin-bottom: var(--space-5);
}
.ct-header__sub {
  font-size: var(--fs-base);
  color: var(--clr-text-muted);
  max-width: 480px;
  line-height: var(--lh-relaxed);
}

/* Two-column layout */
.ct-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-14);
  align-items: start;
}
@media (min-width: 860px) {
  .ct-grid { grid-template-columns: 1fr 380px; gap: var(--space-16); }
}

/* ── Form ── */
.ct-form { display: flex; flex-direction: column; gap: var(--space-6); }

.ct-field-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
}
@media (min-width: 540px) { .ct-field-row { grid-template-columns: 1fr 1fr; } }

.ct-field { display: flex; flex-direction: column; gap: var(--space-2); }

.ct-label {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--clr-text-muted);
  letter-spacing: 0.01em;
}
.ct-required { color: var(--clr-primary); }

.ct-input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: transparent;
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-md);
  color: var(--clr-white);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
  outline: none;
  box-sizing: border-box;
}
.ct-input::placeholder { color: var(--clr-text-faint); }
.ct-input:focus {
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px rgba(201,150,63,0.1);
}

/* Select with custom arrow */
.ct-select-wrap { position: relative; }
.ct-select { -webkit-appearance: none; appearance: none; padding-right: 2.5rem; }
.ct-select-icon {
  position: absolute;
  right: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  color: var(--clr-text-faint);
  pointer-events: none;
}

/* Textarea */
.ct-textarea { resize: vertical; min-height: 160px; }

/* Char count */
.ct-char-count {
  font-size: var(--fs-xs);
  color: var(--clr-text-faint);
  text-align: right;
  margin-top: -var(--space-1);
}

/* Status message */
.ct-form-msg { font-size: var(--fs-sm); min-height: 1.4rem; }
.ct-form-msg--error   { color: var(--clr-danger); }
.ct-form-msg--success { color: var(--clr-success); }

/* Submit button */
.ct-submit {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  align-self: flex-start;
  padding: var(--space-4) var(--space-7);
  background: var(--clr-primary);
  color: #1a0a00;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  font-weight: 700;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--dur-fast), transform var(--dur-fast);
}
.ct-submit:hover { background: #d4a44a; transform: translateY(-1px); }
.ct-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* ── Info side ── */
.ct-info-side { display: flex; flex-direction: column; gap: var(--space-10); }

.ct-reach__heading {
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--clr-text-faint);
  margin-bottom: var(--space-5);
}
.ct-reach { display: flex; flex-direction: column; gap: 0; }
.ct-reach-item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5) 0;
  border-bottom: 1px solid var(--clr-border);
  text-decoration: none;
  color: inherit;
  transition: padding-left var(--dur-fast);
}
.ct-reach-item:first-of-type { border-top: 1px solid var(--clr-border); }
.ct-reach-item:not(.ct-reach-item--static):hover {
  padding-left: var(--space-2);
}
.ct-reach-item--static { cursor: default; }

.ct-reach-item__icon {
  width: 38px; height: 38px;
  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);
  flex-shrink: 0;
}
.ct-reach-item:not(.ct-reach-item--static):hover .ct-reach-item__icon {
  border-color: var(--clr-primary);
  color: var(--clr-primary);
}
.ct-reach-item__label {
  font-size: var(--fs-xs);
  color: var(--clr-text-faint);
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.ct-reach-item__value {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--clr-white);
}
.ct-reach-item__arrow {
  margin-left: auto;
  color: var(--clr-text-faint);
  flex-shrink: 0;
  opacity: 0;
  transition: opacity var(--dur-fast);
}
.ct-reach-item:not(.ct-reach-item--static):hover .ct-reach-item__arrow { opacity: 1; }

/* FAQ with native details/summary — no JS, no AI accordion */
.ct-faq { border-top: 1px solid var(--clr-border); padding-top: var(--space-8); }
.ct-faq__heading {
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--clr-text-faint);
  margin-bottom: var(--space-5);
}
.ct-faq-item {
  border-bottom: 1px solid var(--clr-border);
  padding: var(--space-4) 0;
}
.ct-faq-item:first-of-type { border-top: 1px solid var(--clr-border); }
.ct-faq-item__q {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--clr-white);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
}
.ct-faq-item__q::-webkit-details-marker { display: none; }
.ct-faq-item__q::after {
  content: '+';
  font-size: var(--fs-lg);
  color: var(--clr-text-faint);
  font-weight: 300;
  flex-shrink: 0;
}
.ct-faq-item[open] .ct-faq-item__q::after { content: '−'; color: var(--clr-primary); }
.ct-faq-item__a {
  font-size: var(--fs-sm);
  color: var(--clr-text-muted);
  line-height: var(--lh-relaxed);
  padding-top: var(--space-3);
  max-width: 340px;
}

/* Keep .form-row for other pages that use it */
.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}
@media (min-width: 640px) { .form-row { grid-template-columns: 1fr 1fr; } }

/* Legacy contact classes — kept for back-compat */
.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__list a:hover,
[data-theme="dark"] .main-nav a.current-menu-item,
[data-theme="dark"] .main-nav__list 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,
[data-theme="dark"] .mobile-menu nav li a { color: var(--clr-text); border-bottom-color: var(--clr-border); }
[data-theme="dark"] .mobile-menu nav a:hover,
[data-theme="dark"] .mobile-menu nav li 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); }

/* 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,
.mobile-menu nav li a {
  color: var(--clr-white);
  border-bottom: 1px solid var(--clr-border);
}
.mobile-menu nav a:hover,
.mobile-menu nav li 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 */
/* Completion banner CSS moved and redesigned above */

/* ============================================================
   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);
}

/* ============================================================
   LEADERBOARD PAGE (.lb-*)
   ============================================================ */
.leaderboard-page { padding-bottom: var(--space-20); }

/* Hero */
.lb-hero {
  position: relative;
  overflow: hidden;
  padding: var(--space-14) 0 var(--space-10);
  border-bottom: 1px solid var(--clr-border);
}
.lb-hero__inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-8);
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}
.lb-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-4);
  display: block;
}
.lb-hero__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.05;
  margin-bottom: var(--space-3);
  color: var(--clr-white);
}
.lb-hero__sub { font-size: var(--fs-lg); color: var(--clr-text-muted); }
.lb-hero__stats { display: flex; gap: var(--space-8); flex-shrink: 0; }
.lb-hero__stat-num {
  display: block;
  font-family: var(--font-display);
  font-size: var(--fs-4xl);
  font-weight: 800;
  color: var(--clr-primary);
  line-height: 1;
}
.lb-hero__stat-lbl {
  display: block;
  font-size: var(--fs-xs);
  color: var(--clr-text-faint);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-top: var(--space-1);
  font-weight: 700;
}
.lb-hero__glow {
  position: absolute;
  top: -100px; right: -100px;
  width: 500px; height: 500px;
  background: radial-gradient(ellipse, var(--clr-primary-glow) 0%, transparent 70%);
  pointer-events: none;
}

/* Body */
.lb-body { padding-top: var(--space-12); }

/* Three column grid */
.lb-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  margin-bottom: var(--space-16);
}
@media (max-width: 960px)  { .lb-grid { grid-template-columns: 1fr; } }
@media (min-width: 640px) and (max-width: 960px) { .lb-grid { grid-template-columns: repeat(2, 1fr); } }

/* Panel */
.lb-panel {
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
}
.lb-panel__head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-5) var(--space-4);
  border-bottom: 1px solid var(--clr-border);
  background: var(--clr-bg-2);
}
.lb-panel__icon { font-size: 1.8rem; line-height: 1; flex-shrink: 0; }
.lb-panel__title {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--clr-white);
  margin: 0;
}
.lb-panel__sub { font-size: var(--fs-xs); color: var(--clr-text-faint); margin-top: 2px; }
.lb-panel__list { padding: var(--space-2) 0; }

/* Row */
.lb-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--clr-border);
  transition: background var(--dur-fast);
  text-decoration: none;
}
.lb-row:last-child { border-bottom: none; }
.lb-row:hover { background: var(--clr-bg-2); }

.lb-row--top { background: linear-gradient(90deg, var(--clr-primary-glow) 0%, transparent 60%); }
.lb-row--top:hover { background: linear-gradient(90deg, rgba(212,137,26,.2) 0%, var(--clr-bg-2) 60%); }

.lb-row__rank {
  width: 32px;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--clr-text-faint);
  flex-shrink: 0;
}
.lb-row--top .lb-row__rank { font-size: 1.4rem; }

.lb-row__cover {
  width: 40px;
  height: 56px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--clr-bg-2);
}
.lb-row__cover img { width: 100%; height: 100%; object-fit: cover; }
.lb-row__cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.lb-row__info { flex: 1; min-width: 0; }
.lb-row__title {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--clr-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}
.lb-row__genre {
  font-size: var(--fs-xs);
  color: var(--clr-text-faint);
}

.lb-row__stat {
  flex-shrink: 0;
  text-align: right;
  font-size: var(--fs-sm);
  font-weight: 800;
  color: var(--clr-primary);
}
.lb-row__stat span {
  display: block;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--clr-text-faint);
}

.lb-empty {
  padding: var(--space-8) var(--space-4);
  text-align: center;
  color: var(--clr-text-faint);
  font-size: var(--fs-sm);
}

/* ── Challenge Results ──────────────────────────────────────── */
.lb-challenge-results {
  margin-bottom: var(--space-16);
}
.lb-challenge-results__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-5);
}
.lb-challenge-picker select {
  font-size: var(--fs-sm);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--clr-border);
  background: var(--clr-bg-card);
  color: var(--clr-text);
}

/* Winner cards: pinned at top, visually distinct from the score-ranked
   panel below so "official result" never reads as "current popularity". */
.lb-winners-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}
@media (min-width: 640px) { .lb-winners-row { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .lb-winners-row { grid-template-columns: repeat(3, 1fr); } }
.lb-winner-card {
  display: block;
  text-decoration: none;
  background: linear-gradient(160deg, var(--clr-primary-glow) 0%, var(--clr-bg-card) 65%);
  border: 1px solid var(--clr-primary);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  transition: transform var(--dur-fast), box-shadow var(--dur-fast);
}
.lb-winner-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.lb-winner-card__medal { font-size: 1.6rem; margin-bottom: var(--space-2); }
.lb-winner-card__rank {
  font-size: var(--fs-xs);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--clr-primary);
  margin-bottom: var(--space-2);
}
.lb-winner-card__title {
  font-family: var(--font-display);
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--clr-white);
  margin-bottom: var(--space-1);
}
.lb-winner-card__writer { font-size: var(--fs-xs); color: var(--clr-text-faint); margin-bottom: var(--space-2); }
.lb-winner-card__prize { font-size: var(--fs-sm); font-weight: 700; color: var(--clr-primary); }

/* "Also in the Running": deliberately unranked, unnumbered chips rather
   than a numbered list, so nobody's exact low rank is on public display. */
.lb-also-running {
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid var(--clr-border);
}
.lb-also-running__title {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--clr-text-muted);
  margin-bottom: var(--space-3);
}
.lb-also-running__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.lb-also-running__chip {
  display: inline-block;
  font-size: var(--fs-xs);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-full);
  background: var(--clr-bg-2);
  border: 1px solid var(--clr-border);
  color: var(--clr-text-muted);
  text-decoration: none;
  transition: color var(--dur-fast), border-color var(--dur-fast);
}
.lb-also-running__chip:hover { color: var(--clr-primary); border-color: var(--clr-primary); }

/* CTA */
.lb-cta {
  text-align: center;
  padding: var(--space-12) var(--space-4);
  background: var(--clr-bg-2);
  border-radius: var(--radius-xl);
  border: 1px solid var(--clr-border);
}
.lb-cta h2 { font-family: var(--font-display); font-size: clamp(var(--fs-xl), 2.5vw, var(--fs-3xl)); margin-bottom: var(--space-2); }
.lb-cta p  { color: var(--clr-text-muted); margin-bottom: var(--space-6); }

@media (max-width: 640px) {
  .lb-hero__inner { flex-direction: column; align-items: flex-start; }
  .lb-hero__stats { gap: var(--space-6); }
}

/* ============================================================
   COPY QUOTE POPUP (.quote-popup)
   ============================================================ */
.quote-popup {
  position: fixed;
  z-index: 9999;
  display: none;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 8px;
  background: #1a1c2e;
  color: #fff;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  font-size: var(--fs-xs);
  font-weight: 700;
  white-space: nowrap;
  pointer-events: all;
}
.quote-popup.visible {
  display: flex;
  animation: fadeUp .15s ease-out;
}
/* Arrow pointer pointing down */
.quote-popup::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #1a1c2e;
  border-bottom: none;
}
.quote-popup__btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-xs);
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: opacity var(--dur-fast);
  font-family: var(--font-body);
  line-height: 1;
}
.quote-popup__btn:hover { opacity: .85; }
.quote-popup__copy {
  background: var(--clr-primary);
  color: #1a0a00;
}
.quote-popup__tweet {
  background: #fff;
  color: #000;
  text-decoration: none;
}





/* ═══════════════════════════════════════════════════════════════
   THE READING ROOM — Homepage Design System v4
   Direction: warm-paper editorial magazine. Light-first. Asymmetric.
   Every section has a different shape — rhythm over repetition.
   All classes prefixed rr- to avoid touching inner-page styles.
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* Paper + ink, not app-dashboard dark/light */
  --rr-paper:        #faf6ee;
  --rr-paper-2:      #f3ecdc;
  --rr-paper-3:      #ece2cc;
  --rr-ink:          #211d18;
  --rr-ink-soft:     #4a443c;
  --rr-ink-faint:    #8a8174;
  --rr-line:         rgba(33,29,24,0.12);
  --rr-line-soft:    rgba(33,29,24,0.07);

  /* A single confident accent — clay/terracotta, not gold or purple */
  --rr-clay:         #b1502f;
  --rr-clay-dark:    #8e3e23;
  --rr-clay-tint:    rgba(177,80,47,0.1);

  /* Deep ink panel for the writer CTA — contrast moment */
  --rr-panel:        #211d18;
  --rr-panel-text:   #f3ecdc;

  --rr-font-display: 'Fraunces', Georgia, serif;
  --rr-font-ui:       'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --rr-radius:       3px; /* sharp, print-like corners, not app-rounded */
}

/* ── Section rhythm helpers ── */
.rr-section { padding-block: 3.5rem; }
.rr-section--tint { background: var(--rr-paper-2); }
@media (min-width: 1024px) { .rr-section { padding-block: 5rem; } }

.rr-section__head {
  display: flex;
  align-items: baseline;
  gap: 0.875rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}
.rr-folio {
  font-family: var(--rr-font-ui);
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--rr-ink-faint);
  border: 1px solid var(--rr-line);
  border-radius: 100px;
  padding: 2px 8px;
  flex-shrink: 0;
}
.rr-folio--light { color: rgba(243,236,220,0.6); border-color: rgba(243,236,220,0.25); }
.rr-section__title {
  font-family: var(--rr-font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 500;
  font-style: italic;
  color: var(--rr-ink);
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.rr-section__more {
  margin-left: auto;
  font-family: var(--rr-font-ui);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--rr-clay);
  text-decoration: none;
  white-space: nowrap;
}
.rr-section__more:hover { text-decoration: underline; }


/* ═══════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════ */
.rr-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8125rem 1.625rem;
  font-family: var(--rr-font-ui);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  border-radius: var(--rr-radius);
  text-decoration: none;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: transform 180ms cubic-bezier(0.16,1,0.3,1), box-shadow 180ms, background 180ms, border-color 180ms;
}
.rr-btn--ink {
  background: var(--rr-ink);
  color: var(--rr-paper);
}
.rr-btn--ink:hover {
  background: var(--rr-clay-dark);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(33,29,24,0.22);
}
.rr-btn--paper {
  background: var(--rr-paper);
  color: var(--rr-ink);
}
.rr-btn--paper:hover {
  background: #fff;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.18);
}



/* ═══════════════════════════════════════════════════════════════
   1. HERO — asymmetric split, search bar fully contained inside
   ═══════════════════════════════════════════════════════════════ */
.rr-hero {
  position: relative;
  background: var(--rr-paper);
  padding-top: 2rem;
  padding-bottom: 2.5rem;
  overflow: hidden;
}
@media (min-width: 1024px) {
  .rr-hero { padding-top: 3rem; padding-bottom: 3rem; }
}

.rr-hero__grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image: radial-gradient(circle at 1px 1px, rgba(33,29,24,0.06) 1px, transparent 0);
  background-size: 18px 18px;
  mask-image: linear-gradient(to bottom, black 0%, transparent 80%);
}

.rr-hero__grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
  margin-bottom: 1.75rem;
}
@media (min-width: 900px) {
  .rr-hero__grid {
    grid-template-columns: 1.15fr 0.85fr;
    align-items: center;
    gap: 3rem;
    margin-bottom: 2.25rem;
  }
}

.rr-hero__eyebrow {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.125rem;
  flex-wrap: wrap;
}
.rr-hero__eyebrow-label {
  font-family: var(--rr-font-ui);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--rr-ink-faint);
}
.rr-hero__genre {
  font-family: var(--rr-font-ui);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--rr-clay);
  text-decoration: none;
  border-bottom: 2px solid var(--rr-clay);
  padding-bottom: 1px;
}

.rr-hero__title {
  font-family: var(--rr-font-display);
  font-size: clamp(2.25rem, 5.5vw, 3.75rem);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.015em;
  color: var(--rr-ink);
  margin-bottom: 1rem;
  max-width: 18ch;
}
.rr-hero__title a { color: inherit; text-decoration: none; }
.rr-hero__title a:hover { color: var(--rr-clay-dark); }

.rr-hero__excerpt {
  font-family: var(--rr-font-ui);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--rr-ink-soft);
  max-width: 480px;
  margin-bottom: 1.5rem;
}

.rr-hero__byline {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}
.rr-hero__avatar { border-radius: 50%; flex-shrink: 0; }
.rr-hero__byline-text { display: flex; flex-direction: column; line-height: 1.3; }
.rr-hero__author { font-family: var(--rr-font-ui); font-size: 0.875rem; font-weight: 700; color: var(--rr-ink); }
.rr-hero__sub { font-family: var(--rr-font-ui); font-size: 0.75rem; color: var(--rr-ink-faint); }

.rr-hero__actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* Art panel */
.rr-hero__art { display: flex; justify-content: center; }
.rr-hero__frame {
  position: relative;
  width: 78%;
  max-width: 360px;
  aspect-ratio: 3/4;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 24px 48px -12px rgba(33,29,24,0.3), 0 0 0 1px rgba(33,29,24,0.06);
  background: var(--rr-paper-3);
}
.rr-hero__frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rr-hero__art-fallback { width: 100%; height: 100%; background: linear-gradient(160deg, var(--rr-paper-3), var(--rr-paper-2)); }

@media (max-width: 899px) {
  .rr-hero__art { order: -1; }
  .rr-hero__frame { width: 58%; max-width: 240px; }
}

/* Search bar — full width inside the hero container, always contained */
.rr-hero__search {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #fff;
  border: 1.5px solid var(--rr-ink);
  border-radius: var(--rr-radius);
  padding: 0.25rem 0.25rem 0.25rem 1.125rem;
  width: 100%;
  max-width: 720px;
  box-shadow: 0 8px 20px -6px rgba(33,29,24,0.12);
  position: relative;
  z-index: 1;
}
.rr-hero__search svg { color: var(--rr-ink-faint); flex-shrink: 0; }
.rr-hero__search input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--rr-font-ui);
  font-size: 0.9375rem;
  padding: 0.8125rem 0;
  color: var(--rr-ink);
}
.rr-hero__search input::placeholder { color: var(--rr-ink-faint); }
.rr-hero__search button {
  background: var(--rr-ink);
  color: var(--rr-paper);
  border: none;
  font-family: var(--rr-font-ui);
  font-size: 0.8125rem;
  font-weight: 700;
  padding: 0.75rem 1.25rem;
  border-radius: 2px;
  cursor: pointer;
  transition: background 150ms;
  white-space: nowrap;
  flex-shrink: 0;
}
.rr-hero__search button:hover { background: var(--rr-clay-dark); }

@media (max-width: 480px) {
  .rr-hero__search { padding-left: 0.875rem; }
  .rr-hero__search button { padding: 0.7rem 0.9rem; font-size: 0.75rem; }
}


/* ═══════════════════════════════════════════════════════════════
   3. LATEST STORIES — Netflix-style dense cover grid
   Mobile: cards run edge-to-edge (bleed past the container gutter)
   so covers read large and confident, not cramped.
   Desktop: 6 per row, tight gaps, cover-forward — no AI card
   chrome (no heavy borders, no big radius, no hover lift).
   ═══════════════════════════════════════════════════════════════ */
.rr-story-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  /* Bleed to the viewport edge on mobile, ignoring the container gutter */
  margin-inline: calc(-1 * var(--space-4));
  padding-inline: var(--space-4);
}
@media (min-width: 480px) {
  .rr-story-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 640px) {
  .rr-story-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.875rem;
    margin-inline: 0;
    padding-inline: 0;
  }
}
@media (min-width: 1024px) {
  .rr-story-grid { grid-template-columns: repeat(6, 1fr); gap: 0.75rem; }
}

/* Lighter card chrome for this grid specifically: true hairline border,
   small radius, no shadow — cover image does the talking, not the frame */
.rr-story-grid .story-card {
  background: transparent;
  border: 1px solid rgba(33,29,24,0.06);
  border-radius: 4px;
}
[data-theme="dark"] .rr-story-grid .story-card {
  border-color: rgba(240,234,216,0.08);
}
.rr-story-grid .story-card__info { padding: 0.5rem 0.125rem 0; }
.rr-story-grid .story-card__title { font-size: 0.8125rem; }
.rr-story-grid .story-card__genre { font-size: 0.625rem; margin-bottom: 0.125rem; }
.rr-story-grid .story-card__stats { font-size: 0.6875rem; margin-top: 0.25rem; }
/* ═══════════════════════════════════════════════════════════════
   4. JUST UPDATED — compact reading list (not cards)
   ═══════════════════════════════════════════════════════════════ */
.rr-updates-list {
  border-top: 1px solid var(--rr-line);
}
.rr-update-row { border-bottom: 1px solid var(--rr-line); }
.rr-update-row__link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 0;
  text-decoration: none;
  transition: padding-left 200ms cubic-bezier(0.16,1,0.3,1);
}
.rr-update-row__link:hover { padding-left: 0.5rem; }
.rr-update-row__cover {
  flex-shrink: 0;
  width: 36px;
  height: 50px;
  border-radius: 2px;
  overflow: hidden;
  background: var(--rr-paper-3);
}
.rr-update-row__cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rr-update-row__cover-fallback { width: 100%; height: 100%; background: var(--rr-paper-3); }
.rr-update-row__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}
.rr-update-row__story {
  font-family: var(--rr-font-ui);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--rr-clay);
}
.rr-update-row__ep {
  font-family: var(--rr-font-display);
  font-size: 1.0625rem;
  font-weight: 400;
  color: var(--rr-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rr-update-row__time {
  flex-shrink: 0;
  font-family: var(--rr-font-ui);
  font-size: 0.75rem;
  color: var(--rr-ink-faint);
  white-space: nowrap;
}

@media (max-width: 480px) {
  .rr-update-row__ep { font-size: 0.9375rem; }
  .rr-update-row__time { display: none; } /* prioritize title on tiny screens */
}


/* ═══════════════════════════════════════════════════════════════
   5. PULL QUOTE — typographic centerpiece
   ═══════════════════════════════════════════════════════════════ */
.rr-pullquote {
  background: var(--rr-paper);
  padding-block: 4rem;
  border-top: 1px solid var(--rr-line);
  border-bottom: 1px solid var(--rr-line);
}
.rr-pullquote__inner {
  max-width: 760px;
  text-align: center;
  position: relative;
}
.rr-pullquote__mark {
  font-family: var(--rr-font-display);
  font-size: 5rem;
  color: var(--rr-clay);
  opacity: 0.25;
  line-height: 1;
  display: block;
  margin-bottom: -1.5rem;
}
.rr-pullquote blockquote p {
  font-family: var(--rr-font-display);
  font-style: italic;
  font-size: clamp(1.5rem, 3.5vw, 2.25rem);
  font-weight: 400;
  line-height: 1.3;
  color: var(--rr-ink);
  letter-spacing: -0.01em;
}
.rr-pullquote cite {
  display: block;
  margin-top: 1.25rem;
  font-family: var(--rr-font-ui);
  font-style: normal;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--rr-ink-faint);
}
.rr-pullquote cite a { color: var(--rr-clay); text-decoration: none; }
.rr-pullquote cite a:hover { text-decoration: underline; }


/* ═══════════════════════════════════════════════════════════════
   6. GENRE INDEX — card-catalog row list, not pills
   ═══════════════════════════════════════════════════════════════ */
.rr-genre-index {
  display: grid;
  grid-template-columns: 1fr;
  border-top: 1px solid var(--rr-line);
}
@media (min-width: 700px) {
  .rr-genre-index { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1100px) {
  .rr-genre-index { grid-template-columns: repeat(3, 1fr); }
}

.rr-genre-index__row {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 1.125rem 0.25rem;
  border-bottom: 1px solid var(--rr-line);
  text-decoration: none;
  transition: background 150ms, padding-left 200ms cubic-bezier(0.16,1,0.3,1);
}
@media (min-width: 700px) {
  .rr-genre-index__row:nth-child(odd) { border-right: 1px solid var(--rr-line); padding-right: 1.25rem; }
}
.rr-genre-index__row:hover {
  background: var(--rr-paper-2);
  padding-left: 0.75rem;
}
.rr-genre-index__num {
  font-family: var(--rr-font-display);
  font-style: italic;
  font-size: 0.9375rem;
  color: var(--rr-clay);
  width: 28px;
  flex-shrink: 0;
}
.rr-genre-index__name {
  font-family: var(--rr-font-ui);
  font-size: 1rem;
  font-weight: 600;
  color: var(--rr-ink);
  flex: 1;
}
.rr-genre-index__count {
  font-family: var(--rr-font-ui);
  font-size: 0.75rem;
  color: var(--rr-ink-faint);
  white-space: nowrap;
}
.rr-genre-index__arrow {
  color: var(--rr-ink-faint);
  flex-shrink: 0;
  transition: transform 200ms;
}
.rr-genre-index__row:hover .rr-genre-index__arrow {
  transform: translateX(3px);
  color: var(--rr-clay);
}


/* ═══════════════════════════════════════════════════════════════
   7. MOST READ — numbered editorial ranking list
   ═══════════════════════════════════════════════════════════════ */
.rr-ranked-list {
  border-top: 1px solid var(--rr-line);
}
.rr-ranked-item { border-bottom: 1px solid var(--rr-line); }
.rr-ranked-item__link {
  display: flex;
  align-items: center;
  gap: 1.125rem;
  padding: 1.125rem 0;
  text-decoration: none;
  transition: padding-left 200ms cubic-bezier(0.16,1,0.3,1);
}
.rr-ranked-item__link:hover { padding-left: 0.5rem; }
.rr-ranked-item__rank {
  font-family: var(--rr-font-display);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 400;
  font-style: italic;
  color: var(--rr-paper-3);
  -webkit-text-stroke: 1.5px var(--rr-ink-faint);
  width: 48px;
  flex-shrink: 0;
  text-align: center;
  line-height: 1;
}
.rr-ranked-item__cover {
  flex-shrink: 0;
  width: 50px;
  aspect-ratio: 2/3;
  border-radius: 2px;
  overflow: hidden;
  background: var(--rr-paper-3);
}
.rr-ranked-item__cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rr-ranked-item__cover-fallback { width: 100%; height: 100%; background: var(--rr-paper-3); }
.rr-ranked-item__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.125rem; }
.rr-ranked-item__genre {
  font-family: var(--rr-font-ui);
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--rr-clay);
}
.rr-ranked-item__title {
  font-family: var(--rr-font-display);
  font-size: 1.0625rem;
  font-weight: 500;
  color: var(--rr-ink);
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rr-ranked-item__author {
  font-family: var(--rr-font-ui);
  font-size: 0.75rem;
  color: var(--rr-ink-faint);
}
.rr-ranked-item__reads {
  flex-shrink: 0;
  font-family: var(--rr-font-ui);
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--rr-ink);
  text-align: right;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.rr-ranked-item__reads small {
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--rr-ink-faint);
  text-transform: uppercase;
}

@media (max-width: 480px) {
  .rr-ranked-item__rank { width: 32px; font-size: 1.5rem; }
  .rr-ranked-item__author { display: none; }
}


/* ═══════════════════════════════════════════════════════════════
   8. WRITER CTA — ink panel, contrast moment in the page rhythm
   ═══════════════════════════════════════════════════════════════ */
.rr-writer {
  background: var(--rr-panel);
  padding-block: 4.5rem;
  position: relative;
  overflow: hidden;
}
.rr-writer__inner {
  max-width: 640px;
  position: relative;
  z-index: 1;
}
.rr-writer__heading {
  font-family: var(--rr-font-display);
  font-size: clamp(1.875rem, 4vw, 2.75rem);
  font-weight: 400;
  font-style: italic;
  line-height: 1.15;
  color: var(--rr-panel-text);
  margin: 0.875rem 0 1rem;
  letter-spacing: -0.01em;
}
.rr-writer__sub {
  font-family: var(--rr-font-ui);
  font-size: 1rem;
  line-height: 1.65;
  color: rgba(243,236,220,0.65);
  margin-bottom: 1.75rem;
  max-width: 480px;
}
.rr-writer__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
}
.rr-writer__link {
  font-family: var(--rr-font-ui);
  font-size: 0.875rem;
  font-weight: 600;
  color: rgba(243,236,220,0.7);
  text-decoration: none;
  border-bottom: 1px solid rgba(243,236,220,0.3);
  padding-bottom: 2px;
}
.rr-writer__link:hover { color: var(--rr-panel-text); border-color: rgba(243,236,220,0.6); }


/* ═══════════════════════════════════════════════════════════════
   9. WHATSAPP CHANNEL — follow banner
   ═══════════════════════════════════════════════════════════════ */
.rr-whatsapp {
  background: var(--rr-paper-2);
  padding-block: 3.5rem;
}
@media (min-width: 768px) { .rr-whatsapp { padding-block: 4.5rem; } }

.rr-whatsapp__inner {
  max-width: 920px;
  margin-inline: auto;
  background: var(--rr-paper);
  border: 1px solid var(--rr-line);
  border-radius: 6px;
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.25rem;
  text-decoration: none;
  transition: border-color 150ms;
}
.rr-whatsapp__inner:hover { border-color: #25D366; }
@media (min-width: 768px) {
  .rr-whatsapp__inner {
    flex-direction: row;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem 2.5rem;
  }
}

.rr-whatsapp__icon {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25D366;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rr-whatsapp__text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
  min-width: 0;
}
.rr-whatsapp__heading {
  font-family: var(--rr-font-display);
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  font-weight: 500;
  font-style: italic;
  color: var(--rr-ink);
  letter-spacing: -0.01em;
}
.rr-whatsapp__sub {
  font-family: var(--rr-font-ui);
  font-size: 0.875rem;
  color: var(--rr-ink-soft);
  line-height: 1.55;
  max-width: 440px;
}

.rr-whatsapp__cta {
  flex-shrink: 0;
  width: 100%;
  justify-content: center;
}
@media (min-width: 768px) { .rr-whatsapp__cta { width: auto; } }


/* ═══════════════════════════════════════════════════════════════
   TOUCH + MOBILE POLISH
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  .rr-hero__title { font-size: 2.1rem; }
  .rr-hero__excerpt { font-size: 0.9375rem; }
  .rr-writer { padding-block: 3rem; }
}

.rr-update-row__link, .rr-ranked-item__link, .rr-genre-index__row,
.rr-hero__search button {
  -webkit-tap-highlight-color: transparent;
}

@media (prefers-reduced-motion: reduce) {
  .rr-update-row__link,
  .rr-ranked-item__link,
  .rr-genre-index__row,
  .rr-genre-index__arrow,
  .rr-btn { transition: none; }
}

/* ── Continue Reading banner restyle for the homepage (Reading Room palette) ── */
.home .continue-reading-wrap-padding { padding-top: 2rem; }
.home .continue-reading {
  background: var(--rr-paper-2);
  border: 1px solid var(--rr-line);
  border-radius: var(--rr-radius);
  margin-block: 2rem 0;
}
.home .continue-reading:hover {
  background: var(--rr-paper-3);
  transform: translateY(-2px);
}
.home .continue-reading__label { color: var(--rr-clay); }
.home .continue-reading__title { font-family: var(--rr-font-display); color: var(--rr-ink); font-weight: 500; }
.home .continue-reading__episode { color: var(--rr-ink-soft); font-family: var(--rr-font-ui); }
.home .progress-bar-wrap { background: var(--rr-line); }
.home .progress-bar-fill { background: var(--rr-clay); }


/* ═══════════════════════════════════════════════════════════════
   AD BANNERS — in-page placements (homepage, sidebar, in-content)
   Reserves exact pixel dimensions to prevent layout shift.
   ═══════════════════════════════════════════════════════════════ */
.story-ad-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  margin-block: 2rem;
}
.story-ad-banner__label {
  font-family: var(--rr-font-ui, var(--font-body));
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--clr-text-faint);
}
.story-ad-banner__link {
  display: block;
  width: var(--ad-w);
  max-width: 100%;
  height: var(--ad-h);
}
.story-ad-banner__link img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 4px;
  display: block;
}

/* On narrow viewports, scale the reserved box proportionally
   instead of letting it overflow or get clipped */
@media (max-width: 480px) {
  .story-ad-banner__link {
    width: 100%;
    max-width: var(--ad-w);
    aspect-ratio: var(--ad-w) / var(--ad-h);
    height: auto;
  }
}


/* ═══════════════════════════════════════════════════════════════
   STICKY FOOTER AD ("sticker" ad) — dismissible anchor bar
   ═══════════════════════════════════════════════════════════════ */
.story-sticky-ad {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  background: var(--clr-bg-card, #fff);
  border-top: 1px solid var(--clr-border, rgba(0,0,0,0.1));
  padding: 0.5rem 2.5rem 0.5rem 0.75rem;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.08);
}
.story-sticky-ad__label {
  position: absolute;
  top: 4px;
  left: 6px;
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--clr-text-faint);
}
.story-sticky-ad__link {
  display: block;
  width: var(--ad-w);
  max-width: 100%;
  height: var(--ad-h);
  margin-top: 0.375rem;
}
.story-sticky-ad__link img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.story-sticky-ad__close {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--clr-bg, rgba(0,0,0,0.06));
  border: none;
  border-radius: 50%;
  color: var(--clr-text-muted);
  cursor: pointer;
  flex-shrink: 0;
}
.story-sticky-ad__close:hover { background: var(--clr-border, rgba(0,0,0,0.12)); color: var(--clr-text); }

@media (max-width: 480px) {
  .story-sticky-ad__link { width: 100%; max-width: var(--ad-w); aspect-ratio: var(--ad-w) / var(--ad-h); height: auto; }
}


/* ═══════════════════════════════════════════════════════════════
   QUOTE HIGHLIGHT & SHARE SYSTEM
   Mobile-first. Minimal toolbar, modal preview, quote landing page.
   ═══════════════════════════════════════════════════════════════ */

/* ── In-text highlight mark ── */
mark.quote-highlight {
  background: rgba(177,80,47,0.18);
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}
[data-theme="dark"] mark.quote-highlight {
  background: rgba(224,130,92,0.22);
}

/* ── Floating selection toolbar ── */
.quote-toolbar {
  position: absolute;
  z-index: 1000;
  display: flex;
  gap: 2px;
  background: var(--rr-ink, #211d18);
  border-radius: 8px;
  padding: 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  animation: quoteToolbarIn 140ms ease-out;
}
.quote-toolbar[hidden] {
  display: none;
}
@keyframes quoteToolbarIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.quote-toolbar__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 12px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: rgba(240,234,216,0.85);
  font-family: var(--rr-font-ui, var(--font-body));
  font-size: 0.625rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms;
}
.quote-toolbar__btn:hover,
.quote-toolbar__btn:focus-visible {
  background: rgba(255,255,255,0.12);
}
.quote-toolbar__btn--primary {
  color: #fff;
}
.quote-toolbar__btn--primary svg {
  color: var(--rr-clay, #e0825c);
}

/* ── Share modal ── */
.quote-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.quote-modal[hidden] {
  display: none;
}
@media (min-width: 640px) {
  .quote-modal { align-items: center; }
}
.quote-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
}
.quote-modal__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: var(--rr-paper, #faf6ee);
  border-radius: 16px 16px 0 0;
  padding: 1.5rem 1.25rem 1.75rem;
  animation: quoteModalIn 220ms cubic-bezier(0.16,1,0.3,1);
}
@media (min-width: 640px) {
  .quote-modal__panel { border-radius: 16px; padding: 2rem; }
}
@keyframes quoteModalIn {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
.quote-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(33,29,24,0.06);
  border: none;
  border-radius: 50%;
  color: var(--rr-ink, #211d18);
  cursor: pointer;
}
[data-theme="dark"] .quote-modal__close {
  background: rgba(240,234,216,0.1);
  color: var(--rr-ink, #f0ead8);
}

.quote-modal__preview {
  margin-bottom: 1rem;
  overflow-y: auto;
  min-height: 0; /* required for flex children to actually shrink and scroll */
  flex: 1 1 auto;
}
.quote-modal__status {
  min-height: 1.2em;
  flex-shrink: 0;
  font-family: var(--rr-font-ui, var(--font-body));
  font-size: 0.8125rem;
  color: var(--rr-ink-faint, #8a8174);
  text-align: center;
  margin-bottom: 0.75rem;
}

.quote-modal__actions { display: flex; flex-direction: column; gap: 0.625rem; flex-shrink: 0; }
.quote-modal__share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  width: 100%;
  padding: 0.875rem;
  border: none;
  border-radius: 10px;
  font-family: var(--rr-font-ui, var(--font-body));
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 150ms, transform 150ms;
}
.quote-modal__share-btn--whatsapp {
  background: #25D366;
  color: #fff;
}
.quote-modal__share-btn:hover { transform: translateY(-1px); }
.quote-modal__share-btn.is-disabled,
.quote-modal__share-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.quote-modal__secondary-actions { display: flex; gap: 0.625rem; }
.quote-modal__secondary-btn {
  flex: 1;
  padding: 0.75rem;
  background: rgba(33,29,24,0.06);
  border: none;
  border-radius: 10px;
  color: var(--rr-ink, #211d18);
  font-family: var(--rr-font-ui, var(--font-body));
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
}
[data-theme="dark"] .quote-modal__secondary-btn {
  background: rgba(240,234,216,0.08);
  color: var(--rr-ink, #f0ead8);
}
.quote-modal__secondary-btn.is-disabled,
.quote-modal__secondary-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Quote card preview (mirrors the generated share image) ── */
.quote-card {
  background: #faf6ee;
  border-radius: 2px;
  padding: 2.25rem 1.75rem 1.75rem;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(33,29,24,0.1);
  position: relative;
}
.quote-card__logo {
  position: absolute;
  bottom: 1.25rem;
  right: 1.75rem;
  font-family: var(--rr-font-ui, var(--font-body));
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #8a8174;
}
.quote-card__mark {
  font-family: var(--rr-font-display, Georgia, serif);
  font-size: 3rem;
  line-height: 1;
  color: #b1502f;
  opacity: 0.85;
  margin-bottom: 0.25rem;
}
.quote-card__text {
  margin: 0 0 1.5rem;
  font-family: var(--rr-font-display, Georgia, serif);
  font-size: clamp(1.25rem, 5.5vw, 1.625rem);
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -0.005em;
  color: #211d18;
  /* Cap visible length so a long selection never breaks the layout —
     it scrolls within the card instead of stretching the modal. */
  max-height: 9.5rem;
  overflow-y: auto;
}
blockquote.quote-card__text {
  margin-inline: 0; /* override the browser's default blockquote indent */
}
.quote-card__rule {
  width: 28px;
  height: 2px;
  background: #b1502f;
  margin-bottom: 0.875rem;
  flex-shrink: 0;
}
.quote-card__footer { display: flex; flex-direction: column; gap: 2px; margin-bottom: 1.5rem; }
.quote-card__story {
  font-family: var(--rr-font-ui, var(--font-body));
  font-size: 0.8125rem;
  font-weight: 700;
  color: #211d18;
}
.quote-card__episode {
  font-family: var(--rr-font-ui, var(--font-body));
  font-size: 0.75rem;
  color: #8a8174;
}
.quote-card__cta { display: none; } /* superseded by the bottom-right imprint mark */

/* ── Quote landing page (/quote/{slug}) ── */
.rr-quote-landing {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: center;
  background: var(--rr-paper, #faf6ee);
  padding-block: 3rem;
  overflow: hidden;
}
.rr-quote-landing__grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image: radial-gradient(circle at 1px 1px, rgba(33,29,24,0.06) 1px, transparent 0);
  background-size: 18px 18px;
}
.rr-quote-landing__inner {
  position: relative;
  z-index: 1;
  max-width: 640px;
  text-align: center;
}
.rr-quote-landing__mark {
  font-family: var(--rr-font-display, Georgia, serif);
  font-size: 4rem;
  color: var(--rr-clay, #b1502f);
  opacity: 0.3;
  line-height: 1;
  display: block;
  margin-bottom: -1rem;
}
.rr-quote-landing__text p {
  font-family: var(--rr-font-display, Georgia, serif);
  font-style: italic;
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  line-height: 1.35;
  color: var(--rr-ink, #211d18);
}
.rr-quote-landing__source {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin: 1.75rem 0 1.5rem;
}
.rr-quote-landing__cover { border-radius: 4px; object-fit: cover; }
.rr-quote-landing__source-text { display: flex; flex-direction: column; text-align: left; }
.rr-quote-landing__story { font-family: var(--rr-font-ui, var(--font-body)); font-weight: 700; font-size: 0.875rem; color: var(--rr-ink, #211d18); }
.rr-quote-landing__episode { font-family: var(--rr-font-ui, var(--font-body)); font-size: 0.75rem; color: var(--rr-ink-faint, #8a8174); }
.rr-quote-landing__actions { display: flex; flex-direction: column; align-items: center; gap: 0.875rem; margin-bottom: 1.5rem; }
.rr-quote-landing__story-link {
  font-family: var(--rr-font-ui, var(--font-body));
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--rr-ink-faint, #8a8174);
  text-decoration: none;
}
.rr-quote-landing__tagline {
  font-family: var(--rr-font-ui, var(--font-body));
  font-size: 0.75rem;
  color: var(--rr-ink-faint, #8a8174);
}

/* ── Mobile refinements ── */
@media (max-width: 479px) {
  .quote-toolbar__btn { padding: 6px 10px; }
  .quote-card { padding: 1.5rem 1.25rem; min-height: 220px; }
}

/* ── Episode Read Progress ─────────────────────────────────── */
.sp-ep-row.ep-row--read .episode-row__check {
    opacity: 1;
    color: var(--clr-success, #22c55e);
}
.sp-ep-row.ep-row--read .sp-ep-row__title {
    color: var(--clr-text-muted);
}
.sp-ep-row.ep-row--read .sp-ep-row__arrow {
    display: none;
}

/* ── Hype Button ────────────────────────────────────────────── */
.sp-hype-btn {
    font-size: 1rem;
    gap: 4px;
}
.sp-hype-btn[aria-pressed="true"] .sp-icon-btn__label {
    color: var(--clr-primary);
    font-weight: 700;
}

/* ── Share Image Button ─────────────────────────────────────── */
.share-btn--download {
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    color: var(--clr-text);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: var(--fs-xs);
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, color .15s;
    text-decoration: none;
}
.share-btn--download:hover {
    background: var(--clr-primary);
    color: #fff;
    border-color: var(--clr-primary);
}

/* ═══════════════════════════════════════════════════════════════════
   COMMUNITY BAR — Telegram / WhatsApp Channel / WhatsApp Group
═══════════════════════════════════════════════════════════════════ */

@keyframes ep-comm-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(37,211,102,.6); }
    50%       { box-shadow: 0 0 0 8px rgba(37,211,102,0); }
}

@keyframes ep-comm-shimmer {
    0%   { transform: translateX(-100%) skewX(-15deg); }
    100% { transform: translateX(220%) skewX(-15deg); }
}

@keyframes ep-comm-fadein {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Section shell ── */
.ep-community-bar {
    background: #0d0e1a;
    border-top: 1px solid rgba(255,255,255,.06);
    padding: 56px 0;
    overflow: hidden;
    position: relative;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .5s ease, transform .5s ease;
}

.ep-community-bar.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.ep-community-bar::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 70% 60% at 50% 110%, rgba(102,126,234,.13) 0%, transparent 70%);
    pointer-events: none;
}

.ep-community-bar--episode {
    margin: 48px 0 0;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,.08);
    padding: 40px 32px;
}

/* ── Inner layout ── */
.ep-community-bar__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 28px 40px;
    position: relative;
    z-index: 1;
}

/* ── Left text block ── */
.ep-community-bar__text {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    flex: 1 1 200px;
    min-width: 0;
}

.ep-community-bar__heading {
    margin: 0 0 4px;
    font-size: clamp(1.1rem, 2.5vw, 1.35rem);
    font-weight: 700;
    color: #fff;
    line-height: 1.25;
}

.ep-community-bar__sub {
    margin: 0;
    font-size: .9rem;
    color: rgba(255,255,255,.55);
    line-height: 1.55;
    max-width: 36ch;
}

/* ── Live-pulse dot ── */
.ep-community-bar__pulse-dot {
    flex-shrink: 0;
    margin-top: 5px;
    display: block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #25d366;
    animation: ep-comm-pulse 2s ease-in-out infinite;
}

/* ── Button row ── */
.ep-community-bar__buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

/* ── Base button ── */
.ep-comm-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: 50px;
    font-size: .88rem;
    font-weight: 600;
    text-decoration: none;
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.ep-comm-btn:hover {
    transform: translateY(-3px) scale(1.03);
    filter: brightness(1.1);
}

.ep-comm-btn:active {
    transform: translateY(0) scale(.97);
}

/* ── Shimmer sweep ── */
.ep-comm-btn__shimmer {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        105deg,
        transparent 40%,
        rgba(255,255,255,.22) 50%,
        transparent 60%
    );
    animation: ep-comm-shimmer 3s ease infinite;
}

.ep-comm-btn:nth-child(2) .ep-comm-btn__shimmer { animation-delay: -1s; }
.ep-comm-btn:nth-child(3) .ep-comm-btn__shimmer { animation-delay: -2s; }

/* ── Telegram button ── */
.ep-comm-btn--telegram {
    background: linear-gradient(135deg, #229ed9 0%, #1a7ec0 100%);
    color: #fff;
    box-shadow: 0 4px 18px rgba(34,158,217,.4);
}

/* ── WhatsApp channel button ── */
.ep-comm-btn--whatsapp {
    background: linear-gradient(135deg, #25d366 0%, #1aad52 100%);
    color: #fff;
    box-shadow: 0 4px 18px rgba(37,211,102,.4);
}

/* ── WhatsApp group button ── */
.ep-comm-btn--whatsapp-group {
    background: transparent;
    color: #25d366;
    border: 1.5px solid #25d366;
    box-shadow: 0 4px 14px rgba(37,211,102,.18);
}

.ep-comm-btn--whatsapp-group .ep-comm-btn__shimmer {
    background: linear-gradient(
        105deg,
        transparent 40%,
        rgba(37,211,102,.18) 50%,
        transparent 60%
    );
}

.ep-comm-btn--whatsapp-group:hover {
    background: rgba(37,211,102,.08);
}

.ep-comm-btn__icon {
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.ep-comm-btn__label {
    position: relative;
    z-index: 1;
    white-space: nowrap;
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
    .ep-community-bar {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .ep-comm-btn__shimmer { animation: none; }
    .ep-community-bar__pulse-dot { animation: none; }
}

/* ── Mobile ── */
@media (max-width: 680px) {
    .ep-community-bar {
        padding: 36px 0;
    }

    .ep-community-bar__inner {
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
    }

    .ep-community-bar__text {
        flex: none;
        align-items: flex-start;
        gap: 10px;
    }

    .ep-community-bar__heading {
        font-size: 1.1rem;
    }

    .ep-community-bar__sub {
        max-width: 100%;
        font-size: .85rem;
    }

    .ep-community-bar__buttons {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        width: 100%;
    }

    .ep-comm-btn {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
        font-size: .93rem;
        border-radius: 12px;
        white-space: normal;
        text-align: center;
    }

    .ep-community-bar--episode {
        padding: 24px 16px;
        margin: 28px 0 0;
        border-radius: 12px;
    }
}
