/* ============================================
   NOVA NEWS — Main Stylesheet
   ============================================ */

/* ---- Design Tokens ---- */
:root {
  --color-bg:      #000000;
  --color-fg:      #ffffff;
  --color-fg-90:   rgba(255,255,255,.9);
  --color-fg-70:   rgba(255,255,255,.7);
  --color-fg-50:   rgba(255,255,255,.5);
  --color-fg-30:   rgba(255,255,255,.3);
  --color-fg-12:   rgba(255,255,255,.12);
  --color-fg-08:   rgba(255,255,255,.08);

  --glass-bg:            rgba(255,255,255,.01);
  --glass-bg-active:     rgba(255,255,255,.16);
  --glass-shadow-inset:  inset 0 1px 1px rgba(255,255,255,.1);
  --glass-border-grad:   linear-gradient(180deg,
                            rgba(255,255,255,.45) 0%,
                            rgba(255,255,255,.15) 20%,
                            rgba(255,255,255,0) 40%,
                            rgba(255,255,255,0) 60%,
                            rgba(255,255,255,.15) 80%,
                            rgba(255,255,255,.45) 100%);
  --glass-border-width:  1.4px;

  --wash-purple: rgba(124,58,237,.55);
  --wash-pink:   rgba(219,39,119,.4);
  --wash-cyan:   rgba(6,182,212,.35);

  --font-display: 'Newsreader', Georgia, serif;
  --font-body:    'Public Sans', 'Segoe UI', system-ui, sans-serif;

  --radius-pill: 9999px;
  --radius-card: 20px;
  --radius-img:  12px;

  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 40px;
  --space-5: 48px;
  --space-6: 64px;

  --max-width: 1280px;
  --col-gap: 1.5rem;

  --shadow-card: 0 8px 32px rgba(0,0,0,.5);

  --ease-entrance: ease-out;
  --dur-hero: .8s;
  --dur-word: .6s;

  --nav-height: 80px;
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-weight: 300;
  color: var(--color-fg);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--color-fg-70); }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
input, textarea { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--color-fg); outline-offset: 2px; }

/* ---- Typography ---- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.02em;
}

.article-body p, .article-body li, .entry-content p, .entry-content li {
  font-weight: 300;
  color: var(--color-fg-90);
}

.article-body blockquote, .entry-content blockquote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.25;
  color: var(--color-fg);
  border-left: none;
  padding: var(--space-2) 0 var(--space-2) var(--space-3);
  border-left: 2px solid var(--color-fg-30);
  margin: var(--space-4) 0;
}

/* ---- Layout Utilities ---- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--col-gap); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--col-gap); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--col-gap); }

.mt-3 { margin-top: var(--space-4); }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap;
}
.sr-only.skip-link:focus {
  position: fixed; top: var(--space-2); left: var(--space-2);
  width: auto; height: auto; clip: auto; z-index: 999;
  background: var(--color-fg); color: var(--color-bg);
  padding: .6rem 1rem; border-radius: var(--radius-pill);
}

/* ============================================
   GLASS COMPONENT SYSTEM
   ============================================ */
.glass {
  background: var(--glass-bg);
  background-blend-mode: luminosity;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: var(--glass-shadow-inset);
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-pill);
}
.glass::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: var(--glass-border-width);
  background: var(--glass-border-grad);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.glass.pill  { border-radius: var(--radius-pill); }
.glass.card  { border-radius: var(--radius-card); overflow: visible; }
.glass.card::before { overflow: hidden; }

.glass-strong { background: var(--glass-bg-active); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-body); font-weight: 500; font-size: .875rem;
  padding: .6rem 1.1rem; border-radius: var(--radius-pill);
  white-space: nowrap; transition: opacity .2s ease, background .2s ease;
}
.btn-solid {
  background: var(--color-fg); color: var(--color-bg);
}
.btn-solid:hover { opacity: .85; color: var(--color-bg); }
.btn-glass {
  color: var(--color-fg);
}
.btn-glass:hover { color: var(--color-fg-90); }
.btn-ghost {
  background: none; padding: 0; color: var(--color-fg);
}
.btn-ghost:hover { color: var(--color-fg-70); }

/* ============================================
   HEADER / FLOATING NAV
   ============================================ */
.site-header {
  position: fixed;
  top: var(--space-2);
  left: 0; right: 0;
  z-index: 100;
  padding-inline: var(--space-2);
  transition: background .3s ease, backdrop-filter .3s ease, box-shadow .3s ease;
}
/* Transparent at the top of the page; once scrolled (toggled via JS),
   a solid blurred backdrop keeps page content from showing through the
   gaps between the individual glass nav pills. */
.site-header.is-scrolled {
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 4px 24px rgba(0,0,0,.3);
}

.nav-inner {
  max-width: var(--max-width);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

/* Desktop: double the header bar's height. --nav-height also drives the
   content-clearance padding-top on the hero/archive/single/page templates
   below (see calc(var(--nav-height) + ...) throughout this file), so
   doubling it here keeps everything below the header pushed down to
   match automatically. align-items: center above already centers every
   child (logo, nav pills, header actions) within the taller row. */
@media (min-width: 721px) {
  :root { --nav-height: 160px; }
  .nav-inner { min-height: var(--nav-height); }
}

.site-logo {
  display: flex; align-items: center; gap: 12px;
  flex-shrink: 0;
}
/* Uploaded custom logo (replaces the badge + text entirely) is a direct
   child of .site-logo, capped so an oversized upload can't break the nav. */
.site-logo > img { max-height: 44px; width: auto; display: block; }

.site-logo-badge {
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.site-logo-badge img { max-width: 28px; max-height: 28px; border-radius: 6px; }
.site-logo-badge .logo-mark {
  font-family: var(--font-display); font-style: italic;
  font-size: 15px; line-height: 1; letter-spacing: -0.02em;
  color: var(--color-fg);
}

.site-logo-text {
  font-family: var(--font-display); font-style: italic; font-weight: 400;
  /* Fluid, not a fixed desktop jump: holds near the old 19px through
     mobile/tablet, then scales up on wider desktop viewports, capping
     out at 26px so it doesn't overpower the 48px badge next to it. */
  font-size: clamp(18px, 1.8vw, 26px);
  line-height: 1; letter-spacing: -0.01em;
  color: var(--color-fg); white-space: nowrap;
}

/* Slow sheen sweep across the mark; a static solid color otherwise. */
@media (prefers-reduced-motion: no-preference) {
  .site-logo-badge .logo-mark {
    background: linear-gradient(100deg,
      rgba(255,255,255,.5) 0%,
      #fff 40%,
      #fff 55%,
      rgba(255,255,255,.5) 90%);
    background-size: 220% 100%;
    background-position: 200% 0;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: logoSheen 5s ease-in-out infinite;
  }
  @keyframes logoSheen {
    0%, 15%  { background-position: 200% 0; }
    65%, 100% { background-position: -120% 0; }
  }
}

.nav-capsule {
  display: flex; align-items: center; gap: 6px;
  padding: 6px;
  flex: 1 1 auto;
  max-width: fit-content;
  margin-inline: auto;
}

.primary-nav ul { display: flex; align-items: center; gap: 2px; }
.primary-nav a {
  display: block;
  padding: 8px 14px;
  font-size: 14px; font-weight: 500;
  color: var(--color-fg-90);
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
.primary-nav a:hover { color: var(--color-fg); background: var(--color-fg-08); }
.primary-nav .current-menu-item > a,
.primary-nav .current-menu-ancestor > a { color: var(--color-fg); background: var(--color-fg-08); }

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

.btn-search-icon {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-pill);
  color: var(--color-fg);
}

.menu-toggle {
  display: none;
  width: 40px; height: 40px;
  align-items: center; justify-content: center;
  border-radius: var(--radius-pill);
  color: var(--color-fg);
}

/* Search overlay */
.search-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.92);
  backdrop-filter: blur(12px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
}
.search-overlay.is-open { opacity: 1; visibility: visible; }
.search-overlay .search-form {
  width: min(640px, 90vw);
}
.search-overlay .search-field {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--color-fg-30);
  font-family: var(--font-display); font-style: italic;
  font-size: clamp(28px, 5vw, 42px);
  color: var(--color-fg);
  padding-bottom: var(--space-2);
}
.search-overlay .search-field::placeholder { color: var(--color-fg-50); }
.search-close {
  position: absolute; top: var(--space-3); right: var(--space-3);
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-pill);
  color: var(--color-fg);
}

/* ============================================
   ATMOSPHERIC WASH (section/page header backgrounds)
   ============================================ */
.wash {
  position: relative;
  isolation: isolate;
}
.wash::before {
  content: '';
  position: absolute; inset: 0; z-index: -1;
  /* --wash-1/2/3 let a specific page (e.g. a category archive) recolor the
     atmosphere to match its own accent; unset pages keep the default trio. */
  background:
    radial-gradient(ellipse 60% 45% at 15% 10%, var(--wash-1, var(--wash-purple)), transparent 60%),
    radial-gradient(ellipse 55% 50% at 85% 25%, var(--wash-2, var(--wash-pink)), transparent 60%),
    radial-gradient(ellipse 70% 60% at 50% 100%, var(--wash-3, var(--wash-cyan)), transparent 65%);
  opacity: .5;
  pointer-events: none;
}

/* ============================================
   HOME HERO
   ============================================ */
.hero-section {
  position: relative;
  min-height: 100vh;
  padding-top: calc(var(--nav-height) + var(--space-4));
  padding-bottom: var(--space-5);
  display: flex; flex-direction: column; justify-content: center;
}

.hero-eyebrow {
  font-size: 14px; color: var(--color-fg-70); margin-bottom: var(--space-2);
}

.hero-headline {
  font-family: var(--font-display); font-style: italic; font-weight: 400;
  color: var(--color-fg);
  font-size: clamp(40px, 6vw, 76px);
  line-height: .95;
  letter-spacing: -0.03em;
  max-width: 900px;
}
.hero-headline a { color: inherit; }
.hero-headline a:hover { color: var(--color-fg-70); }

.hero-sub {
  margin-top: var(--space-2);
  font-size: 15px; color: var(--color-fg-90); font-weight: 300;
  max-width: 560px; line-height: 1.5;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: var(--space-3);
  margin-top: var(--space-4);
  align-items: stretch;
}

.hero-featured { display: flex; flex-direction: column; }
.hero-featured .thumb-wrap {
  border-radius: var(--radius-card);
  overflow: hidden;
  aspect-ratio: 16/10;
}
.hero-featured .post-thumb { width: 100%; height: 100%; object-fit: cover; }
.hero-featured .post-meta-overlay { padding-top: var(--space-2); }

.hero-side { display: flex; flex-direction: column; gap: var(--space-2); }
.hero-side-story { display: flex; gap: var(--space-2); align-items: flex-start; }
.hero-side-story .side-thumb {
  width: 120px; height: 84px; object-fit: cover;
  border-radius: var(--radius-img); flex-shrink: 0;
}

.hero-stats { display: flex; gap: var(--space-2); margin-top: var(--space-3); flex-wrap: wrap; }
.hero-stat {
  width: 200px; padding: var(--space-2);
  display: flex; flex-direction: column; align-items: flex-start;
}
.hero-stat .stat-number {
  font-family: var(--font-display); font-style: italic; font-size: 34px;
  letter-spacing: -1px; line-height: 1; color: var(--color-fg);
  margin-top: var(--space-2);
}
.hero-stat .stat-label { font-size: 12px; color: var(--color-fg-70); margin-top: 6px; }

/* ============================================
   SECTION HEADERS
   ============================================ */
.section-header {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--space-2); margin-bottom: var(--space-3);
  padding: var(--space-3) 0;
}
.section-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  display: flex; align-items: center; gap: .5rem;
}
.section-title .accent-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--dot-accent, var(--color-fg)); display: inline-block;
}
.section-link {
  font-size: .85rem; color: var(--color-fg-70); white-space: nowrap;
}
.section-link:hover { color: var(--color-fg); }

/* ============================================
   POST CARD
   ============================================ */
.post-card {
  padding: 16px;
  display: flex; flex-direction: column;
}
.card-thumb-wrap {
  display: block; border-radius: var(--radius-img); overflow: hidden;
  aspect-ratio: 16/10;
}
.card-thumb { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.post-card:hover .card-thumb { transform: scale(1.04); }
.card-body { padding-top: var(--space-2); display: flex; flex-direction: column; flex: 1; }

.cat-badge {
  display: inline-flex; align-self: flex-start;
  font-size: 10px; letter-spacing: .5px; text-transform: uppercase;
  font-weight: 600;
  /* Set per-instance via inline --cat-accent/--cat-accent-bg (nova_cat_badge()
     in functions.php); falls back to the plain monochrome chip if unset. */
  color: var(--cat-accent, var(--color-fg-90));
  padding: 4px 12px;
  background: var(--cat-accent-bg, var(--color-fg-08));
  border-radius: var(--radius-pill);
  margin-bottom: 10px;
}
.cat-badge:hover { filter: brightness(1.15); }

.post-title { font-size: 1.15rem; line-height: 1.15; }
.post-title a:hover { color: var(--color-fg-70); }
.post-excerpt {
  font-size: .85rem; color: var(--color-fg-70); font-weight: 300;
  margin-top: 8px; line-height: 1.5;
}
.post-byline {
  font-size: .75rem; color: var(--color-fg-50); margin-top: auto; padding-top: 10px;
}
.post-byline a { color: var(--color-fg-70); }
.post-byline a:hover { color: var(--color-fg); }

/* Compact list-row variant (side stories, trending widget) */
.post-list-item { display: flex; gap: var(--space-2); align-items: flex-start; }
.list-thumb { width: 88px; height: 64px; object-fit: cover; border-radius: var(--radius-img); flex-shrink: 0; }

/* ============================================
   ARCHIVE / SEARCH
   ============================================ */
.archive-header {
  padding-top: calc(var(--nav-height) + var(--space-5));
  padding-bottom: var(--space-4);
}
.archive-cat-label {
  font-size: 14px; color: var(--page-accent, var(--color-fg-70)); margin-bottom: var(--space-2);
  font-family: var(--font-body);
}
.archive-title {
  font-size: clamp(40px, 6vw, 72px);
  max-width: 900px;
}
.archive-description {
  margin-top: var(--space-2); max-width: 640px;
  color: var(--color-fg-90); font-weight: 300; font-size: .95rem;
}

.archive-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-2); flex-wrap: wrap; margin-bottom: var(--space-4);
}
.filter-pills { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filter-pill {
  padding: 8px 18px; font-size: 13px; font-weight: 500;
  /* --pill-accent (set per-category, see archive.php/sidebar.php) tints even
     inactive pills, so the category cross-nav reads as a color-coded row. */
  color: var(--pill-accent, var(--color-fg-90));
  white-space: nowrap;
}
.filter-pill.is-active {
  background: var(--pill-accent-bg, var(--glass-bg-active));
  color: var(--pill-accent, var(--color-fg));
}

.sort-pills { display: flex; align-items: center; gap: 4px; padding: 6px; }
.sort-pill {
  padding: 6px 14px; font-size: 13px; font-weight: 500; border-radius: var(--radius-pill);
  color: var(--color-fg);
}
.sort-pill.is-active { background: var(--color-fg); color: var(--color-bg); }

.archive-layout {
  display: grid; grid-template-columns: 1fr 320px; gap: var(--space-4);
  align-items: start;
}
.archive-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-3);
}

/* Pagination */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; margin-top: var(--space-5); flex-wrap: wrap;
}
.pagination .page-numbers {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-pill);
  font-size: 14px; color: var(--color-fg);
  background: var(--glass-bg);
}
.pagination .page-numbers.current { background: var(--color-fg); color: var(--color-bg); }
.pagination .page-numbers.dots { background: none; }

/* ============================================
   SINGLE ARTICLE
   ============================================ */
.single-layout {
  padding-top: calc(var(--nav-height) + var(--space-5));
  display: grid; grid-template-columns: 1fr 320px; gap: var(--space-4);
  align-items: start;
}

.article-category { margin-bottom: var(--space-2); }
.article-title {
  font-size: clamp(2rem, 5vw, 3.4rem);
  max-width: 900px;
}
.article-deck {
  margin-top: var(--space-2); font-size: 1.05rem; color: var(--color-fg-90);
  font-weight: 300; max-width: 720px; line-height: 1.5;
}

.article-meta {
  display: flex; align-items: center; gap: var(--space-2);
  margin-top: var(--space-3); padding: var(--space-2) 0;
  border-top: 1px solid var(--color-fg-12);
  border-bottom: 1px solid var(--color-fg-12);
  flex-wrap: wrap;
}
.article-date { font-size: .78rem; color: var(--color-fg-50); }
.reading-time {
  display: flex; align-items: center; gap: 6px;
  font-size: .78rem; color: var(--color-fg-50); margin-left: auto;
}

.share-bar { display: flex; align-items: center; gap: 8px; margin-top: var(--space-2); flex-wrap: wrap; }
.share-label { font-size: .78rem; color: var(--color-fg-50); margin-right: 4px; }
.share-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; font-size: .78rem; color: var(--color-fg);
}

.article-hero-wrap { margin-top: var(--space-4); border-radius: var(--radius-card); overflow: hidden; }
.article-hero-wrap img { width: 100%; }
.article-hero-caption { font-size: .8rem; color: var(--color-fg-50); padding-top: 8px; }

.article-body { margin-top: var(--space-4); font-size: 1.05rem; line-height: 1.75; }
.article-body h2, .article-body h3 { margin-top: var(--space-4); margin-bottom: var(--space-2); font-size: 1.6rem; }
.article-body a { color: var(--color-fg); text-decoration: underline; text-underline-offset: 3px; }
.article-body ul, .article-body ol { list-style: disc; padding-left: 1.4em; margin: var(--space-2) 0; }
.article-body img { border-radius: var(--radius-img); margin: var(--space-3) 0; }

.article-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: var(--space-4); }
.tag {
  padding: 6px 14px; font-size: .78rem; color: var(--color-fg-90);
  background: var(--color-fg-08); border-radius: var(--radius-pill);
}
.tag:hover { color: var(--color-fg); }

.related-posts { margin-top: var(--space-6); }

/* Numeral / stat display (also used by 404) */
.numeral-display {
  font-family: var(--font-display); font-style: italic; font-weight: 400;
  color: var(--color-fg-12); line-height: 1;
}

/* ============================================
   SIDEBAR / WIDGETS
   ============================================ */
.sidebar { display: flex; flex-direction: column; gap: var(--space-3); }
.widget { padding: var(--space-3); }
.widget-title { font-size: 1.1rem; margin-bottom: var(--space-2); }

.trending-list { display: flex; flex-direction: column; gap: var(--space-2); }
.trending-item { display: flex; gap: 10px; align-items: flex-start; }
.trending-num {
  font-family: var(--font-display); font-style: italic; font-size: 1.4rem;
  color: var(--color-fg-30); flex-shrink: 0; width: 24px;
}

.newsletter-widget p { font-size: .82rem; color: var(--color-fg-70); font-weight: 300; margin-bottom: var(--space-2); }
.newsletter-form { display: flex; flex-direction: column; gap: 8px; }
.newsletter-form input[type="email"] {
  padding: 10px 16px; border-radius: var(--radius-pill);
  background: var(--color-fg-08); border: 1px solid var(--color-fg-12);
  font-size: .85rem;
}
.newsletter-form input[type="email"]::placeholder { color: var(--color-fg-50); }
.newsletter-form button {
  padding: 10px 16px; border-radius: var(--radius-pill);
  background: var(--color-fg); color: var(--color-bg);
  font-size: .85rem; font-weight: 500; text-align: center;
}
.newsletter-form button:hover { opacity: .85; }

.promo-box {
  padding: var(--space-4) var(--space-2);
  text-align: center; font-size: .75rem; color: var(--color-fg-30);
  border: 1px dashed var(--color-fg-12); border-radius: var(--radius-card);
}

.category-list li { border-bottom: 1px solid var(--color-fg-08); }
.category-list a {
  display: flex; justify-content: space-between; padding: .5rem 0;
  font-size: .875rem; color: var(--cat-accent, var(--color-fg-90));
}
.category-list a:hover { filter: brightness(1.15); }
.category-list .count { color: var(--color-fg-50); font-size: .78rem; }
.category-list a.is-active { font-weight: 600; }

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  padding-block: var(--space-6) var(--space-3);
  position: relative; overflow: hidden;
}
.footer-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--space-4); flex-wrap: wrap;
}
.footer-brand { display: flex; align-items: center; gap: var(--space-2); }
.footer-brand .tagline { font-size: 13px; color: var(--color-fg-70); font-weight: 300; line-height: 1.4; }

.footer-columns { display: flex; gap: var(--space-6); flex-wrap: wrap; }
.footer-col-label {
  font-size: 11px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--color-fg-50); margin-bottom: 4px;
}
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-col a, .footer-col span { font-size: 14px; color: var(--color-fg-90); }
.footer-col a:hover { color: var(--color-fg); }
.footer-col h4 { font-family: var(--font-body); font-style: normal; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--color-fg-50); margin-bottom: 4px; }
.footer-col ul { display: flex; flex-direction: column; gap: 10px; }

.footer-socials { display: flex; gap: 10px; margin-top: var(--space-2); }
.social-icon {
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--color-fg-08); color: var(--color-fg);
}
.social-icon:hover { background: var(--color-fg-12); }

.footer-watermark {
  font-family: var(--font-display); font-style: italic; color: var(--color-fg);
  font-size: clamp(72px, 14vw, 220px); line-height: .8; letter-spacing: -6px;
  text-align: center; margin-top: var(--space-6); opacity: .9; user-select: none;
}

.footer-bottom {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-2); flex-wrap: wrap;
  margin-top: var(--space-5); padding-top: var(--space-3);
  border-top: 1px solid var(--color-fg-12);
  font-size: 12px; color: var(--color-fg-50); font-weight: 300;
}
.footer-bottom a { color: var(--color-fg-70); }
.footer-bottom .footer-legal { display: flex; gap: var(--space-3); }

.scroll-top {
  position: fixed; bottom: var(--space-3); right: var(--space-3); z-index: 90;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  color: var(--color-fg);
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
}
.scroll-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }

/* ============================================
   COMMENTS
   ============================================ */
.comments-area {
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-fg-12);
}
.comments-title { font-size: 1.6rem; margin-bottom: var(--space-3); }
.no-comments { color: var(--color-fg-50); padding: var(--space-2) 0; }

/* Comment list */
.comment-list, .comment-list .children {
  list-style: none;
  display: flex; flex-direction: column; gap: var(--space-3);
}
.comment-list .children {
  margin-top: var(--space-3);
  padding-left: var(--space-4);
  border-left: 1px solid var(--color-fg-12);
}
.comment-body { padding: var(--space-3); }
.comment-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.comment-author.vcard { display: flex; align-items: center; gap: 10px; }
.comment-author .avatar { width: 40px; height: 40px; border-radius: 50%; display: block; }
.comment-author .fn { font-style: normal; font-weight: 500; font-size: .9rem; color: var(--color-fg); }
.comment-metadata { font-size: .75rem; color: var(--color-fg-50); }
.comment-metadata a { color: inherit; }
.comment-metadata a:hover { color: var(--color-fg-90); }
.comment-content p { font-size: .9rem; color: var(--color-fg-90); font-weight: 300; line-height: 1.6; margin-top: 6px; }
.comment-awaiting-moderation { display: block; margin-top: 8px; font-size: .78rem; font-style: italic; color: var(--color-fg-50); }
.comment .reply { margin-top: 10px; }
.comment-reply-link {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 14px; font-size: .75rem; font-weight: 500;
  border-radius: var(--radius-pill); background: var(--color-fg-08); color: var(--color-fg);
}
.comment-reply-link:hover { background: var(--color-fg-12); color: var(--color-fg); }

.comment-navigation { display: flex; justify-content: space-between; margin-top: var(--space-3); font-size: .85rem; color: var(--color-fg-70); }

/* Reply form */
.comment-respond { margin-top: var(--space-5); padding: var(--space-4); }
.comment-reply-title { font-size: 1.8rem; display: flex; align-items: baseline; gap: var(--space-2); flex-wrap: wrap; }
.comment-reply-title small { font-family: var(--font-body); font-style: normal; font-size: .8rem; }
.comment-reply-title small a { color: var(--color-fg-50); text-decoration: underline; }
.comment-notes, .logged-in-as { font-size: .85rem; color: var(--color-fg-50); font-weight: 300; margin-top: 8px; margin-bottom: var(--space-3); }
.logged-in-as a { color: var(--color-fg-70); }

.comment-form p { margin-bottom: var(--space-2); }
.comment-form label {
  display: block;
  order: -1;
  font-size: .8rem; font-weight: 500; color: var(--color-fg-70);
  margin-bottom: 6px;
}
.comment-form p.comment-form-comment,
.comment-form p.comment-form-author,
.comment-form p.comment-form-email,
.comment-form p.comment-form-url {
  display: flex; flex-direction: column;
}
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  background: var(--color-fg-08);
  border: 1px solid var(--color-fg-12);
  border-radius: var(--radius-img);
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: .9rem;
  color: var(--color-fg);
  resize: vertical;
}
.comment-form input[type="text"]::placeholder,
.comment-form input[type="email"]::placeholder,
.comment-form input[type="url"]::placeholder,
.comment-form textarea::placeholder { color: var(--color-fg-50); }
.comment-form input[type="text"]:focus,
.comment-form input[type="email"]:focus,
.comment-form input[type="url"]:focus,
.comment-form textarea:focus {
  outline: none; border-color: var(--color-fg-30); background: var(--color-fg-12);
}
.comment-form textarea { min-height: 160px; }

.comment-form-cookies-consent { display: flex; align-items: center; gap: 8px; }
.comment-form-cookies-consent label { order: 0; margin: 0; font-size: .8rem; color: var(--color-fg-70); font-weight: 300; }
.comment-form-cookies-consent input[type="checkbox"] {
  width: 16px; height: 16px; accent-color: #fff; cursor: pointer;
}

.comment-form .form-submit { margin-top: var(--space-2); margin-bottom: 0; }
.comment-form .form-submit input[type="submit"] { border: none; cursor: pointer; }

/* ============================================
   PAGE / 404
   ============================================ */
.page-content { padding-top: calc(var(--nav-height) + var(--space-5)); }

/* ============================================
   BOOK LIBRARY
   Typography (font-family/size/line-height/link color) for running text
   is intentionally NOT set here — .book-page content renders inside the
   existing .article-body wrapper and inherits its rules (see ARTICLE
   section above). Only structural/layout classes are styled below.
   ============================================ */
.book-title { font-size: clamp(2rem, 5vw, 3.4rem); }
.book-authors, .book-hero-info .book-authors {
  margin-top: var(--space-1); font-size: 1rem; color: var(--color-fg-70);
  font-weight: 300; font-style: normal; font-family: var(--font-body);
}
.book-authors a { color: var(--color-fg-90); }
.book-authors a:hover { color: var(--color-fg); }

.book-categories { display: flex; flex-wrap: wrap; gap: 8px; margin-top: var(--space-2); }

/* Book root hero: poster + info side by side, stacking on mobile. */
.book-hero {
  display: flex; gap: var(--space-4); align-items: flex-start;
  margin-bottom: var(--space-4);
}
.book-poster-wrap {
  flex-shrink: 0; width: 240px; padding: 8px;
}
.book-poster { width: 100%; aspect-ratio: 400 / 560; object-fit: cover; border-radius: calc(var(--radius-card) - 8px); }
.book-hero-info { flex: 1; min-width: 0; }

/* Placeholder cover shown on cards/hero until a poster image is set. */
.book-poster-placeholder, .author-avatar-placeholder {
  display: flex; align-items: center; justify-content: center;
  background: var(--color-fg-08); color: var(--color-fg-50);
  text-align: center;
}
.book-poster-placeholder-title {
  font-family: var(--font-display); font-style: italic; font-size: 1.1rem;
  padding: var(--space-2); line-height: 1.15;
}

/* Shelf-style grid for book covers (library index, category archive,
   "Books by this author") — flush-to-edge portrait cover art rather
   than the padded 16:10 card used for news post grids. */
.book-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: var(--space-3);
}
.book-grid .post-card { padding: 0; overflow: hidden; }
.book-grid .card-thumb-wrap, .book-grid .book-poster-placeholder { aspect-ratio: 400 / 560; }
.book-grid .card-body { padding: var(--space-2); }

/* Authors */
.author-hero {
  display: flex; align-items: center; gap: var(--space-3);
  margin-bottom: var(--space-4); flex-wrap: wrap;
}
.author-avatar-lg {
  width: 140px; height: 140px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
  font-size: 3rem;
}
.author-hero-info h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }

.author-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--space-3); }
.author-card {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: var(--space-3) var(--space-2); gap: 4px;
}
.author-card-avatar { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; font-size: 2rem; }
.author-card-name { font-size: 1rem; color: var(--color-fg); margin-top: 6px; }
.author-card:hover .author-card-name { color: var(--color-fg-70); }
.author-card-count { font-size: .75rem; color: var(--color-fg-50); }

/* Chapter/front/back hero: same scale/component as the book root's
   .book-hero (big poster + info column) rather than a compact strip —
   the book's cover art, book name/author, Part/Chapter badges, and this
   page's own title (now shown once here; the duplicate embedded heading
   is stripped from the_content(), see nova_book_strip_embedded_structure()
   in inc/book-library.php), plus the prev/Contents/next buttons. */
.chapter-hero-book { font-size: .85rem; font-weight: 500; color: var(--color-fg-90); }
.chapter-hero-book:hover { color: var(--color-fg); }
.chapter-hero-authors { font-size: .8rem; color: var(--color-fg-50); margin-left: 4px; }
.chapter-hero-authors a { color: var(--color-fg-70); }
.chapter-hero-authors a:hover { color: var(--color-fg); }
.chapter-hero-meta { display: flex; gap: 8px; margin-top: 10px; }
.chapter-hero-badge {
  font-size: .68rem; letter-spacing: .5px; text-transform: uppercase; font-weight: 600;
  padding: 3px 10px; border-radius: var(--radius-pill);
  background: var(--color-fg-08); color: var(--color-fg-70);
}
/* Reuses .chapter-hero-thumb-wrap/.chapter-hero-thumb for the smaller
   Table of Contents page header (see .book-toc-header-inner below);
   the chapter/front/back hero itself now uses the bigger
   .book-poster-wrap/.book-poster from the book root hero instead. */
.chapter-hero-thumb-wrap { flex-shrink: 0; border-radius: var(--radius-img); overflow: hidden; }
.chapter-hero-thumb { width: 56px; height: 78px; object-fit: cover; display: block; }

@media (max-width: 720px) {
  .book-hero { flex-direction: column; align-items: center; text-align: center; }
  .book-poster-wrap { width: 200px; }
  .author-hero { flex-direction: column; text-align: center; }
  .chapter-nav { justify-content: center; }
}

.book-toc-group { margin-top: var(--space-4); }
.book-toc-group-title {
  font-size: .75rem; letter-spacing: .8px; text-transform: uppercase;
  color: var(--color-fg-50); font-family: var(--font-body); font-style: normal;
  margin-bottom: var(--space-2);
}
.book-toc-part-title { font-size: 1.15rem; margin: var(--space-3) 0 var(--space-1); }

.toc-list {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px var(--space-3);
}
.toc-list li { border-bottom: 1px solid var(--color-fg-08); padding: 6px 0; }
.toc-list a { font-size: .9rem; color: var(--color-fg-90); display: flex; gap: 8px; align-items: baseline; }
.toc-list a:hover { color: var(--color-fg); }
.toc-list-num {
  font-family: var(--font-display); font-style: italic; font-size: .95rem;
  color: var(--color-fg-30); flex-shrink: 0; min-width: 1.4em;
}
.toc-list-title { min-width: 0; }

/* Dedicated Table of Contents page — a slimmer book-context header than
   the book root's full poster hero, and a wider single-column reading
   width for the numbered chapter groups below it. */
.book-toc-header-inner { display: flex; align-items: center; gap: var(--space-3); }
.book-toc-header-inner .chapter-hero-thumb { width: 64px; height: 90px; }
.book-toc-header-inner .chapter-hero-book { display: block; font-size: .9rem; }
.book-toc-header-inner .book-authors { margin-top: 4px; font-size: .9rem; }
.book-toc-header-inner .archive-title { margin-top: 4px; }
.toc-list--numbered { display: flex; flex-direction: column; gap: 0; }

/* Prev/Contents/Next as real buttons (.btn.glass.pill / .btn.btn-solid,
   set in the markup) rather than plain text links. --top now renders
   nested inside the chapter hero's info column (see .chapter-hero-large
   below) instead of as its own bordered bar above the content, so it
   only needs top spacing; --bottom stays a separate bar after the
   reading content, same as before. */
.chapter-nav {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
}
.chapter-nav--top { margin-top: var(--space-3); }
.chapter-nav--bottom { border-top: 1px solid var(--color-fg-12); margin-top: var(--space-4); padding-top: var(--space-3); }
.chapter-nav__prev.is-disabled, .chapter-nav__next.is-disabled { display: none; }

/* Higher-specificity duplicates so these win over the generic
   .article-body h2/h3/p rules (ARTICLE section above) when nested inside
   the_content(), while still working standalone (e.g. a Part's heading,
   output directly by single-book_page.php, not via the_content()). */
.chapter-heading, .article-body .chapter-heading {
  margin-top: var(--space-4); font-size: clamp(1.8rem, 4vw, 2.6rem);
}
.chapter-subtitle, .article-body .chapter-subtitle {
  font-size: 1.1rem; color: var(--color-fg-70);
  font-family: var(--font-body); font-style: normal; margin-top: 4px;
}
p.poem, .article-body p.poem {
  font-family: var(--font-display); font-style: italic;
  padding-left: var(--space-3); margin: var(--space-2) 0;
  color: var(--color-fg-90);
}

@media (max-width: 720px) {
  .toc-list { grid-template-columns: 1fr; }
}

/* ============================================
   ENTRANCE ANIMATIONS (progressive enhancement)
   ============================================ */
@media (prefers-reduced-motion: no-preference) {
  [data-animate] { opacity: 0; }
  [data-animate].is-inview {
    animation: heroIn var(--dur-hero) var(--ease-entrance) forwards;
  }
  [data-animate-word] { opacity: 0; }
  [data-animate-word].is-inview {
    animation: wordIn var(--dur-word) var(--ease-entrance) forwards;
  }
}

@keyframes heroIn {
  from { filter: blur(10px); opacity: 0; transform: translateY(20px); }
  to   { filter: blur(0);    opacity: 1; transform: translateY(0); }
}
@keyframes wordIn {
  0%   { filter: blur(10px); opacity: 0;  transform: translateY(50px); }
  50%  { filter: blur(5px);  opacity: .5; transform: translateY(-5px); }
  100% { filter: blur(0);    opacity: 1;  transform: translateY(0); }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .archive-layout, .single-layout { grid-template-columns: 1fr; }
  .archive-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-columns { gap: var(--space-4); }
}

@media (max-width: 720px) {
  .nav-capsule .primary-nav { display: none; }
  .menu-toggle { display: flex; }
  .archive-grid { grid-template-columns: 1fr; }
  .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr; }
  .archive-toolbar { flex-direction: column; align-items: flex-start; }
  .article-meta { flex-direction: column; align-items: flex-start; }
  .reading-time { margin-left: 0; }
  .footer-top { flex-direction: column; }
}

@media (max-width: 420px) {
  .site-header .site-logo-text { display: none; }
}

/* Mobile nav panel (JS-toggled) */
.mobile-nav-panel {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(0,0,0,.97);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: var(--space-2);
  opacity: 0; visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
}
.mobile-nav-panel.is-open { opacity: 1; visibility: visible; }
.mobile-nav-panel a {
  font-family: var(--font-display); font-style: italic; font-size: 2rem; color: var(--color-fg);
}
.mobile-nav-close {
  position: absolute; top: var(--space-3); right: var(--space-3);
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  color: var(--color-fg);
}
