/* ============================================================
   The Storyteller's Journal — Blog CSS
   Combines essential rules from designs/blog-designs/shared.css
   and design2.css, adapted for server-rendered templates.
   Loaded async (non-render-blocking) via media="print" trick.
   ============================================================ */

:root {
  --page-max-width: min(100%, 1160px);
  --page-read-width: min(100%, 900px);
  --surface-base:#ffffff;
  --surface-card: rgba(255,255,255,0.78);
  --surface-overlay-soft: rgba(255,255,255,0.72);
  --surface-overlay-strong: rgba(255,255,255,0.92);
  --accent-600:#0d9488; --accent-500:#0BB79A; --accent-400:#2dd4bf;
  --accent-300:#6ee7b7; --accent-200:#a7f3d0; --accent-100:#d1fae5; --accent-50:#f0fdfa;
  --accent-500-rgb:11,183,154; --accent-400-rgb:45,212,191;
  --accent-500-alpha-18: rgba(11,183,154,0.18);
  --accent-500-alpha-35: rgba(11,183,154,0.35);
  --accent-400-alpha-15: rgba(45,212,191,0.15);
  --text-primary:#1f2933; --text-secondary:#52606d;
  --text-muted: rgba(82,96,109,0.68);
  --border-subtle: rgba(120,117,108,0.14);
  --border-strong: rgba(120,117,108,0.22);
  --border-divider: rgba(15,23,42,0.08);
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.02), 0 1px 2px rgba(0,0,0,0.03);
  --shadow-md: 0 4px 8px -2px rgba(0,0,0,0.05), 0 2px 4px -2px rgba(0,0,0,0.03);
  --shadow-lg: 0 12px 24px -6px rgba(0,0,0,0.08), 0 4px 8px -4px rgba(0,0,0,0.04);
  --radius-2xl:24px; --radius-xl:20px; --radius-lg:16px;
  --radius-md:8px; --radius-sm:6px; --radius-xs:4px; --radius-pill:9999px;
  --font-base:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
  --font-head:'Poppins','Inter',-apple-system,sans-serif;
  --font-serif:'Source Serif Pro','Georgia','Times New Roman',serif;
  --gradient-brand: linear-gradient(135deg, var(--accent-500), var(--accent-400));
  --gradient-body: linear-gradient(180deg,#f8f4ec 0%,#fcfbf8 45%,#f0ede5 100%);
}

html[data-theme="dark"] {
  --surface-base:#020617; --surface-950:#0b1121; --surface-900:#0f172a; --surface-850:#111c31;
  --surface-card: rgba(17,24,39,0.72);
  --surface-card-strong: rgba(17,24,39,0.92);
  --surface-overlay-strong: rgba(30,41,59,0.88);
  --surface-overlay-soft: rgba(30,41,59,0.62);
  --text-primary:#f8fafc; --text-secondary: rgba(203,213,225,0.85);
  --text-muted: rgba(148,163,184,0.72);
  --border-subtle: rgba(71,85,105,0.42);
  --border-strong: rgba(203,213,225,0.42);
  --border-divider: rgba(148,163,184,0.16);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.2), 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.25), 0 2px 6px rgba(0,0,0,0.2);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.3), 0 4px 12px rgba(0,0,0,0.2);
  --gradient-body: linear-gradient(180deg,#020617 0%,#0b1220 55%,#111c31 100%);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin:0; padding:0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-base);
  color: var(--text-primary);
  background: var(--gradient-body);
  background-attachment: fixed;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.4s ease, color 0.3s ease;
  /* Flex layout so the footer sticks to the bottom on short pages */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
h1,h2,h3,h4,h5 { font-family: var(--font-head); margin:0; line-height:1.2; font-weight:700; }
/* Cormorant Garamond sets digits as old-style figures by default — numerals
   like 1/2/0 sit at x-height with no full-height stem, so numbered headings
   ("1. The System Administrator") look like they start with a tiny subscript.
   Force lining figures wherever the display face is used. */
.nd-brand__name, .sj-list__title, .sj-empty h1, .sj-empty h2, .sj-title,
.sj-body h2, .sj-body h3, .sj-body blockquote,
.sj-body > p:first-child::first-letter, .sj-authorcard__name,
.sj-more__title, .sj-morecard h3, .sj-cta__title {
  font-variant-numeric: lining-nums;
}
p { margin:0; }
a { color: var(--accent-600); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--accent-500); }
img { max-width:100%; display:block; }
button { font-family: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent-500-alpha-35); outline-offset: 2px; border-radius: 4px; }

/* Header */
.nd-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--surface-overlay-strong);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
}
.nd-header__inner {
  max-width: var(--page-max-width); margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.nd-nav { display: flex; gap: clamp(1rem, 2vw, 1.75rem); align-items: center; }
.nd-nav a { color: var(--text-secondary); font-weight: 600; font-size: 0.92rem; letter-spacing: 0.02em; position: relative; }
.nd-nav a.is-active { color: var(--accent-600); }
.nd-nav a.is-active::after {
  content:''; position:absolute; left:0; right:0; bottom:-6px; height:2px;
  background: var(--gradient-brand); border-radius: 2px;
}
/* Persistent bridge to the product — visually distinct from category links
   so it reads as a cross-site navigation, not another journal section. */
.nd-nav__product-link {
  margin-left: 0.5rem; padding-left: 1rem;
  border-left: 1px solid var(--border-subtle);
  color: var(--accent-600) !important; font-weight: 700;
}
html[data-theme="dark"] .nd-nav__product-link { color: var(--accent-400) !important; }
.nd-nav__product-link:hover { color: var(--accent-500) !important; }
.nd-header__actions { display:flex; align-items:center; gap:0.6rem; }
.sj-auth-links { display:flex; align-items:center; gap:0.75rem; }
.sj-auth-link { font-size: 0.88rem; font-weight: 600; color: var(--text-secondary); text-decoration: none; transition: color 0.2s; }
.sj-auth-link:hover { color: var(--accent-600); }
.sj-auth-link--out { display: inline-flex; }
.sj-auth-link--in { display: none; }

/* User chip — avatar + name shown when logged in */
.sj-user-chip { display:flex; align-items:center; gap:0.5rem; text-decoration:none; color:var(--text-primary); }
.sj-user-chip:hover { color: var(--accent-600); }
.sj-user-chip__avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.sj-user-chip__avatar-placeholder {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--gradient-brand); color: #fff;
  display: grid; place-items: center; font-size: 0.8rem; font-weight: 700;
  font-family: var(--font-head);
}

/* Logo — same as the main SPA header. The brand lockup is a div containing
   a logo link (→ journal home), a "NovelDay" eyebrow (→ product home), and
   the journal name (→ journal home). The eyebrow makes NovelDay attribution
   persistent and prominent for cold SEO readers. */
.nd-brand { display:flex; align-items:center; gap:0.5rem; text-decoration: none; color: var(--text-primary); }
.nd-brand__logo-link { display:flex; align-items:center; flex-shrink: 0; }
.nd-brand__logo { width: 32px; height: 32px; border-radius: 8px; object-fit: cover; }
.nd-brand__text { display:flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.nd-brand__eyebrow {
  font-family: var(--font-head); font-weight: 700; font-size: 0.68rem;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent-600); text-decoration: none; transition: color 0.2s;
}
html[data-theme="dark"] .nd-brand__eyebrow { color: var(--accent-400); }
.nd-brand__eyebrow:hover { color: var(--accent-500); }
.nd-brand__name { font-family: 'Cormorant Garamond', var(--font-serif); font-weight: 600; font-size: 1.15rem; text-decoration: none; color: var(--text-primary); transition: color 0.2s; }
.nd-brand__name:hover { color: var(--accent-600); }
.nd-icon-btn {
  width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--surface-card); color: var(--text-primary);
  display: grid; place-items: center; font-size: 1rem;
  transition: all 0.2s ease; text-decoration: none;
  cursor: pointer; flex-shrink: 0; overflow: hidden;
}
.nd-icon-btn:hover { border-color: var(--accent-400); color: var(--accent-600); }

/* Theme toggle — sun icon in light mode, moon icon in dark mode */
.nd-theme-toggle { padding: 0; }
.nd-theme-toggle .nd-icon-sun,
.nd-theme-toggle .nd-icon-moon { display: none; }
html[data-theme="light"] .nd-theme-toggle .nd-icon-sun,
html:not([data-theme]) .nd-theme-toggle .nd-icon-sun { display: block; }
html[data-theme="dark"] .nd-theme-toggle .nd-icon-moon { display: block; }

/* Mobile menu toggle — hidden on desktop, shown at ≤860px where the
   nav is hidden by default. Clicking toggles .is-menu-open on the header,
   which shows the nav as a dropdown panel. */
.nd-menu-toggle { display: none; padding: 0; }
.nd-menu-toggle .nd-icon-close { display: none; }
.nd-header.is-menu-open .nd-menu-toggle .nd-icon-menu { display: none; }
.nd-header.is-menu-open .nd-menu-toggle .nd-icon-close { display: block; }

/* Masthead */
.sj-masthead { border-bottom: 1px solid var(--border-subtle); background: var(--surface-overlay-soft); }
.sj-masthead__inner {
  display:flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: 0.55rem 1.5rem; font-family: var(--font-serif); font-style: italic;
  font-size: 0.82rem; color: var(--text-muted);
}
.sj-masthead__vol { font-weight: 600; color: var(--text-secondary); }

/* Container */
.nd-container { max-width: var(--page-max-width); margin: 0 auto; padding: 0 1.5rem; }

/* Reading progress bar */
.nd-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: var(--gradient-brand); z-index: 100;
  transition: width 0.1s linear;
}

/* Breadcrumbs */
.nd-crumbs { display:flex; flex-wrap:wrap; align-items:center; gap:0.4rem; font-size:0.82rem; color: var(--text-muted); }
.nd-crumbs a { color: var(--text-muted); }
.nd-crumbs a:hover { color: var(--accent-600); }
.nd-crumbs span.sep { opacity: 0.5; }
.nd-crumbs .current { color: var(--text-secondary); font-weight: 600; }

/* Buttons */
.nd-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.7rem 1.4rem; border-radius: var(--radius-md);
  font-weight: 700; font-size: 0.92rem; letter-spacing: 0.01em;
  border: 1px solid transparent; transition: all 0.2s ease; text-decoration: none;
}
.nd-btn--primary {
  background: var(--gradient-brand); color: #fff;
  box-shadow: 0 10px 24px -8px rgba(var(--accent-500-rgb),0.5);
}
.nd-btn--primary:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -8px rgba(var(--accent-500-rgb),0.6); color:#fff; }
.nd-btn--ghost { background: var(--surface-card); color: var(--text-primary); border-color: var(--border-subtle); }
.nd-btn--ghost:hover { border-color: var(--accent-400); color: var(--accent-600); }

/* ── List page ────────────────────────────────────────────────────── */
.sj-list { padding: 2.5rem 0 1rem; }
.sj-list__head { text-align: center; margin-bottom: 3rem; }
.sj-list__title {
  font-family: 'Cormorant Garamond', var(--font-serif); font-weight: 600;
  font-size: clamp(2rem, 5vw, 3rem); line-height: 1.1; margin-bottom: 0.75rem;
}
.sj-list__sub {
  font-family: var(--font-serif); font-size: 1.1rem;
  color: var(--text-secondary); max-width: 52ch; margin: 0 auto;
}
.sj-list__grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem; margin-bottom: 3rem;
  align-items: start;
}
.sj-empty { text-align: center; padding: 4rem 1rem; }
.sj-empty h1, .sj-empty h2 { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 2rem; margin-bottom: 1rem; }
.sj-empty p { color: var(--text-secondary); margin-bottom: 1.5rem; }
.sj-empty--404 { min-height: 50vh; display: flex; flex-direction: column; align-items: center; justify-content: center; margin-top: auto; }

/* Pagination */
.sj-pagination {
  display: flex; justify-content: center; align-items: center; gap: 1.5rem;
  padding: 2rem 0; flex-wrap: wrap;
}
.sj-pagination__info { font-family: var(--font-serif); color: var(--text-muted); font-size: 0.9rem; }

/* ── Article detail ───────────────────────────────────────────────── */
/* Article container matches the header width (1160px). Text body is
   centered at a readable measure. Images fill the full article width. */
.sj-article { max-width: var(--page-max-width); margin: 0 auto; padding: 2.5rem 1.5rem 1rem; }
.sj-article__head { text-align: center; max-width: var(--page-read-width); margin: 0 auto; }
.sj-kicker {
  font-family: var(--font-head); font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.18em; color: var(--accent-600);
  margin: 1.25rem 0 0.85rem;
}
html[data-theme="dark"] .sj-kicker { color: var(--accent-400); }
.sj-title {
  font-family: 'Cormorant Garamond', var(--font-serif); font-weight: 600;
  font-size: clamp(2.4rem, 6vw, 3.8rem); line-height: 1.08; letter-spacing: -0.01em;
  margin-bottom: 1rem;
}
.sj-sub {
  font-family: var(--font-serif); font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--text-secondary); line-height: 1.5; max-width: 52ch; margin: 0 auto 1.5rem;
}
.sj-byline {
  font-family: var(--font-serif); font-size: 0.92rem; color: var(--text-muted);
  display: inline-flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; justify-content: center;
}
.sj-byline a { color: var(--text-secondary); font-weight: 600; }
.sj-dot { opacity: 0.5; }

/* Edit-post link — shown only to the post author (client-side check).
   Small, subtle, serif-italic to match the byline area, not a big button. */
.sj-edit-btn {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-family: var(--font-serif); font-style: italic;
  font-size: 0.85rem; color: var(--text-muted);
  text-decoration: none; margin-top: 0.5rem;
  transition: color 0.2s;
}
.sj-edit-btn:hover { color: var(--accent-600); }
.sj-edit-btn svg { width: 13px; height: 13px; opacity: 0.7; }

/* Cover image — centered with a max-height so portrait images don't
   become comically tall. Landscape images fill the article width; portrait
   images are constrained to 500px tall and centered. */
.sj-ornament { margin: 2.5rem 0; text-align: center; }
.sj-ornament__img {
  max-width: 100%;
  max-height: 500px;
  width: auto;
  height: auto;
  margin: 0 auto;
  display: block;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

/* Article body — centered at a readable measure (~900px) */
.sj-body { font-family: var(--font-serif); font-size: 1.18rem; line-height: 1.8; color: var(--text-primary); max-width: var(--page-read-width); margin: 0 auto; }
.sj-body > p { margin-bottom: 1.4rem; }
/* Empty paragraphs (Quill produces <p><br></p> for blank lines) — reduce
   margin so they don't look like double line breaks. The :has() selector
   targets the <p> containing only a <br>, not the <br> itself (the old
   selector '.sj-body > p > br:only-child' set margin on the <br>, which
   had no effect on the <p>'s spacing). */
.sj-body > p:empty, .sj-body > p:has(br:only-child) { margin: 0; }
.sj-body > p:first-child::first-letter {
  font-family: 'Cormorant Garamond', serif; font-weight: 700;
  font-size: 4.2rem; line-height: 0.8; float: left;
  padding: 0.3rem 0.7rem 0 0; color: var(--accent-600);
}
html[data-theme="dark"] .sj-body > p:first-child::first-letter { color: var(--accent-400); }
.sj-body h2 {
  font-family: 'Cormorant Garamond', var(--font-serif); font-weight: 600;
  font-size: 1.7rem; margin: 2.25rem 0 1rem; letter-spacing: -0.01em; text-align: center;
}
.sj-body h2::before { content: '❦'; display: block; font-size: 1rem; color: var(--accent-500); margin-bottom: 0.5rem; opacity: 0.7; }
.sj-body h2::after { content: '❦'; display: block; font-size: 1rem; color: var(--accent-500); margin: 1rem 0 0; opacity: 0.7; }
.sj-body h3 { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 1.4rem; margin: 1.75rem 0 0.75rem; }
.sj-body em { font-style: italic; }
.sj-body strong { font-weight: 600; }
.sj-body blockquote {
  margin: 2rem 0; padding: 1.5rem 2rem; text-align: center;
  font-family: 'Cormorant Garamond', serif; font-style: italic;
  font-size: 1.5rem; line-height: 1.4; color: var(--text-primary);
  border-top: 1px solid var(--border-subtle); border-bottom: 1px solid var(--border-subtle);
}
/* Inline images — fill the text column width */
.sj-body img { border-radius: var(--radius-md); margin: 2rem auto; box-shadow: var(--shadow-md); max-width: 100%; }
.sj-body figure { margin: 2rem 0; }
.sj-body figure img { width: 100%; }
/* Medium-sized portrait images — constrains width to 500px for vertical
   images that are too large at full column width (~900px). Height flows
   naturally with the aspect ratio. Used by the "Shrink (portrait)" toolbar
   button, which wraps the image in <figure class="novel-cover">. */
.sj-body figure.novel-cover { margin: 2rem auto; text-align: center; }
.sj-body figure.novel-cover img { width: 100%; max-width: 500px; border-radius: var(--radius-md); box-shadow: var(--shadow-md); }
/* Medium-sized landscape images — constrains height to 400px for horizontal
   images that fill the column width but shouldn't take up too much vertical
   space. Width flows up to 100% of the column. Used by the "Shrink (landscape)"
   toolbar button, which wraps the image in <figure class="novel-cover-landscape">. */
.sj-body figure.novel-cover-landscape { margin: 2rem auto; text-align: center; }
.sj-body figure.novel-cover-landscape img { width: auto; max-width: 100%; max-height: 400px; border-radius: var(--radius-md); box-shadow: var(--shadow-md); }
.sj-body hr { border: none; height: 24px; margin: 2.5rem 0; text-align: center; background: none; position: relative; }
.sj-body hr::before { content: '✦  ✦  ✦'; letter-spacing: 0.6em; color: var(--accent-500); opacity: 0.6; font-size: 0.9rem; }
.sj-body ul, .sj-body ol { margin: 1rem 0 1.4rem 2rem; }
.sj-body li { margin-bottom: 0.5rem; }
.sj-body a { color: var(--accent-600); text-decoration: underline; text-decoration-color: var(--accent-400); text-underline-offset: 2px; }
.sj-body figcaption { text-align: center; font-family: var(--font-serif); font-style: italic; font-size: 0.85rem; color: var(--text-muted); margin-top: 0.75rem; }
/* Broken images — hidden by blog.js when an <img> fails to load (404, network
   error, CORS, etc.). The .img-failed class is added by the JS error handler;
   this CSS is a fallback in case JS hasn't loaded yet or is blocked. Without
   this, readers see an ugly broken-image icon. */
img.img-failed { display: none !important; }
/* When a body figure's image fails, hide the whole figure so no empty box
   remains. Scoped to .sj-body so it can't affect figures elsewhere. */
.sj-body figure:has(> img.img-failed) { display: none; }
/* Cover image on detail pages */
.sj-ornament:has(> img.img-failed) { display: none; }
/* When a post card's cover image fails, hide the cover container. */
.sj-morecard__cover:has(> img.img-failed) { display: none; }

/* Foot: tags + share — centered at the readable measure */
.sj-foot {
  display:flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
  margin: 3rem auto 0; padding-top: 1.5rem; border-top: 1px solid var(--border-divider);
  max-width: var(--page-read-width);
}
.sj-tags { display:flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.sj-tags__label { font-family: var(--font-serif); font-style: italic; color: var(--text-muted); font-size: 0.9rem; margin-right: 0.25rem; }
.sj-tag {
  font-family: var(--font-base); font-size: 0.78rem; font-weight: 600;
  padding: 0.3rem 0.8rem; border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle); color: var(--text-secondary); background: var(--surface-card);
}
.sj-tag:hover { border-color: var(--accent-400); color: var(--accent-600); }
.sj-share { display:flex; gap: 0.4rem; }

/* Author card — matches the article body width (900px) so it aligns
   with the body text, foot, and CTA above/below it. All post-article
   elements share the same width to form a cohesive zone.
   width:100% is needed because body is display:flex;flex-direction:column —
   in a flex column, children with margin:auto shrink to content size
   instead of stretching to max-width. */
.sj-authorcard {
  width: 100%; display:flex; gap: 1.5rem; align-items: center; flex-wrap: wrap;
  margin: 3rem auto; padding: 1.75rem; max-width: var(--page-read-width);
  background: var(--surface-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl); box-shadow: var(--shadow-sm);
}
.sj-authorcard__avatar-placeholder {
  width: 80px; height: 80px; border-radius: 50%;
  background: var(--gradient-brand); color: #fff;
  display: grid; place-items: center; font-size: 2rem; font-weight: 700;
  font-family: var(--font-head);
}
/* Info group (name + role) — takes available space, actions go right.
   Supports two HTML structures:
   - New: .sj-authorcard__info (name+role) + .sj-authorcard__actions (siblings of card)
   - Old: .sj-authorcard__body (name+role+actions all inside one div) */
.sj-authorcard__info { flex: 1; min-width: 200px; }
/* Old structure: .sj-authorcard__body uses grid to place name (top-left),
   role (bottom-left), actions (right, spanning both rows). This puts
   actions on the same vertical level as name/role, not below them. */
.sj-authorcard__body {
  flex: 1; min-width: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 1.5rem;
}
.sj-authorcard__body .sj-authorcard__name { grid-column: 1; grid-row: 1; }
.sj-authorcard__body .sj-authorcard__role { grid-column: 1; grid-row: 2; }
.sj-authorcard__body .sj-authorcard__actions { grid-column: 2; grid-row: 1 / span 2; }

.sj-authorcard__name { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 1.4rem; }
.sj-authorcard__role { color: var(--text-muted); font-size: 0.85rem; }
/* Actions — aligned to the right edge of the card, on the same
   vertical level as the name/role. flex-shrink:0 prevents them
   from being squeezed when the name is long. */
.sj-authorcard__actions { display:flex; gap: 0.6rem; flex-wrap: wrap; flex-shrink: 0; }
.ed-avatar { border-radius: 50%; }
.ed-avatar--lg { width: 80px; height: 80px; object-fit: cover; }

/* More from this issue — horizontal rail */
.sj-more { padding-top: 1rem; padding-bottom: 3rem; }
.sj-more__title { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 1.8rem; margin-bottom: 1.5rem; text-align: center; }
.sj-more__rail {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr);
  gap: 1.25rem; overflow-x: auto; padding-bottom: 1rem; scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}
/* ── Post cards ────────────────────────────────────────────────────
   Each card has a visible boundary (background, border, radius, shadow)
   so entries are clearly distinguishable in the grid — especially on
   mobile where text-only cards would otherwise blend into an
   undifferentiated wall of text. */
.sj-morecard {
  scroll-snap-align: start;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.sj-morecard:hover {
  border-color: var(--accent-400);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.sj-morecard__link { text-decoration: none; color: inherit; display: flex; flex-direction: column; height: 100%; }

/* Cover image — flush with card top/sides (no border-radius), so the
   image bleeds to the card edges. The body below gets padding. */
.sj-morecard__cover { aspect-ratio: 4/3; overflow: hidden; }
.sj-morecard__cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Card body — padded content area below the image (or the whole card
   for text-only cards). */
.sj-morecard__body { padding: 1.25rem 1.25rem 1.5rem; }

/* Text-only card — no image, so the body padding wraps all content.
   Slightly larger title since there's no image to anchor the card. */
.sj-morecard--text-only .sj-morecard__kicker { margin-top: 0; }
.sj-morecard--text-only h3 { font-size: 1.3rem; line-height: 1.2; }

.sj-morecard__kicker { font-family: var(--font-head); font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent-600); margin-bottom: 0.3rem; }
html[data-theme="dark"] .sj-morecard__kicker { color: var(--accent-400); }
.sj-morecard h3 { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 1.2rem; line-height: 1.25; margin-bottom: 0.4rem; }
.sj-morecard h3 a { color: var(--text-primary); }
.sj-morecard h3 a:hover { color: var(--accent-600); }
.sj-morecard__subtitle { font-family: var(--font-serif); font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 0.4rem; line-height: 1.4; }
.sj-morecard__meta { font-family: var(--font-serif); font-style: italic; font-size: 0.82rem; color: var(--text-muted); }

/* Product CTA — bridges journal readers to the NovelDay platform.
   Shown after the article body + author card on detail pages. Uses the
   same accent gradient as the subscribe band for visual coherence.
   width:100% is needed because body is display:flex;flex-direction:column —
   in a flex column, children with margin:auto shrink to content size
   instead of stretching to max-width. */
.sj-cta {
  width: 100%; margin: 3rem auto; padding: 2.5rem 1.5rem; max-width: var(--page-read-width);
  background: linear-gradient(135deg, var(--accent-500-alpha-18), var(--accent-400-alpha-15));
  border: 1px solid var(--accent-500-alpha-35);
  border-radius: var(--radius-xl);
  text-align: center;
}
.sj-cta__inner { display:flex; flex-direction: column; align-items: center; gap: 1.5rem; }
.sj-cta__copy { max-width: 52ch; }
.sj-cta__title { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: 0.5rem; line-height: 1.15; }
.sj-cta__sub { font-family: var(--font-serif); font-style: italic; color: var(--text-secondary); font-size: 1.05rem; }
.sj-cta__actions { display:flex; gap: 0.75rem; flex-wrap: wrap; justify-content: center; }

/* Footer — margin-top:auto pushes it to the bottom on short pages
   (body is display:flex; flex-direction:column). Previously the
   subscribe band held this role; now the footer does it directly. */
.nd-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-subtle);
  background: var(--surface-overlay-soft);
  backdrop-filter: blur(10px);
}
.nd-footer__inner {
  max-width: var(--page-max-width); margin: 0 auto;
  padding: 3rem 1.5rem 2rem;
  display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 3rem;
}
.nd-footer__brand { max-width: 320px; }
.nd-footer__tagline { color: var(--text-muted); font-size: 0.9rem; margin-top: 0.75rem; line-height: 1.6; }
.nd-footer h4 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); margin-bottom: 0.85rem; }
.nd-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.55rem; }
.nd-footer a { color: var(--text-secondary); font-size: 0.9rem; }
.nd-footer a:hover { color: var(--accent-600); }
.nd-footer__bottom {
  max-width: var(--page-max-width); margin: 0 auto;
  padding: 1.25rem 1.5rem; border-top: 1px solid var(--border-divider);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem;
  color: var(--text-muted); font-size: 0.82rem;
}

/* Responsive */
@media (max-width: 860px) {
  /* Show the hamburger menu toggle button on mobile */
  .nd-menu-toggle { display: grid; }
  /* Nav: hidden by default, shown as a dropdown panel when the header
     has .is-menu-open (toggled by the hamburger button). The panel
     drops down below the header bar, full-width, with a backdrop. */
  .nd-nav { display: none; }
  .nd-header.is-menu-open .nd-nav {
    display: flex; flex-direction: column;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--surface-overlay-strong);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0.75rem 1.5rem 1.25rem; gap: 0;
    z-index: 49;
    box-shadow: var(--shadow-lg);
  }
  .nd-header.is-menu-open .nd-nav a {
    padding: 0.7rem 0; border-bottom: 1px solid var(--border-divider);
    font-size: 1rem;
  }
  .nd-header.is-menu-open .nd-nav a:last-child { border-bottom: none; }
  /* "Discover novels →" link: in the dropdown, remove the left border
     divider (used on desktop to separate it from category links) and
     add a top margin instead so it reads as a separate section. */
  .nd-header.is-menu-open .nd-nav__product-link {
    margin-left: 0; padding-left: 0; border-left: none;
    margin-top: 0.5rem; font-size: 1rem;
  }
  .sj-article { padding: 1.5rem 1.25rem 1rem; }
  .sj-body { font-size: 1.1rem; }
  .sj-list__grid { grid-template-columns: 1fr; gap: 1.25rem; }
  .nd-footer__inner { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .nd-footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .sj-foot { flex-direction: column; align-items: flex-start; }
  /* Author card: stack vertically on mobile, center-aligned.
     1.25rem side padding matches .sj-article so the card's content
     aligns with the body text. !important overrides .nd-container. */
  .sj-authorcard { flex-direction: column; text-align: center; align-items: center; padding: 1.75rem 1.25rem !important; }
  .sj-authorcard__info { text-align: center; }
  /* Old structure: reset grid to stacked layout on mobile */
  .sj-authorcard__body { display: flex; flex-direction: column; text-align: center; }
  .sj-authorcard__actions { justify-content: center; }
  /* CTA: full-width on mobile (no side margin), 1.25rem side padding
     matches .sj-article so the CTA's inner text aligns with the body. */
  .sj-cta { margin: 2rem 0; padding: 1.75rem 1.25rem; border-radius: 0; }
  .nd-footer__inner { grid-template-columns: 1fr; }
  .nd-header__inner { padding: 0.6rem 1rem; gap: 0.5rem; }
  .nd-container { padding: 0 1rem; }
  /* Brand: truncate the long "The Storyteller's Journal" text so it
     doesn't wrap or eat all the header width. The "NovelDay" eyebrow
     above it stays visible — it's the persistent product attribution. */
  .nd-brand__name {
    font-size: 0.95rem; white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis; max-width: 100px;
  }
  .nd-brand__eyebrow { font-size: 0.68rem; }
  /* Mobile header: hide "My Posts" and "Write" auth links to save space
     (they're accessible from the profile page). The user chip is
     avatar-only. The hamburger menu provides access to the
     nav (categories + Discover novels). */
  .sj-auth-link--in[href="/my-blog-posts"],
  .sj-auth-link--in[href="/blog/create"] { display: none !important; }
  .sj-auth-links { gap: 0; }
  .nd-header__actions { gap: 0.35rem; }
  .sj-auth-link { font-size: 0.82rem; }
  .nd-icon-btn { width: 34px; height: 34px; flex-shrink: 0; }
  .nd-icon-btn svg { width: 14px; height: 14px; }
  .sj-user-chip__avatar { width: 28px; height: 28px; flex-shrink: 0; }
  .sj-user-chip__avatar-placeholder { width: 28px; height: 28px; flex-shrink: 0; }
  /* Article title: clamp() bottom value of 2.4rem is too large for mobile
     (38.4px = 4 lines for a long title). Reduce to 1.75rem (28px). */
  .sj-title { font-size: 1.75rem; line-height: 1.15; }
  /* Body h2: 1.7rem (27.2px) is too large for mobile (3 lines). Reduce
     to 1.3rem (20.8px). Also reduce the decorative flourish margins. */
  .sj-body h2 { font-size: 1.3rem; margin: 1.75rem 0 0.75rem; }
  .sj-body h2::before { margin-bottom: 0.35rem; }
  .sj-body h2::after { margin: 0.75rem 0 0; }
  .sj-body h3 { font-size: 1.15rem; }
  /* Masthead: on mobile the two spans wrap to separate lines. Center
     them and reduce the gap so it looks intentional, not like a broken
     space-between layout. */
  .sj-masthead__inner { justify-content: center; gap: 0.25rem; }
  /* Breadcrumbs: the article title in the breadcrumb trail wraps to a
     second line. Truncate it with ellipsis instead. */
  .nd-crumbs { font-size: 0.75rem; }
  .nd-crumbs > *:last-child {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    max-width: 200px;
  }
}
