/* ============================================================
   MERIDIAN v1.1 — Minimalist Ghost Theme
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;0,600;1,400;1,500&family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500&display=swap');

/* ── VARIABLES ───────────────────────────────────────────── */
:root {
  --color-bg:       #fafaf8;
  --color-text:     #1a1a18;
  --color-muted:    #6b6b65;
  --color-border:   #e8e8e4;
  --color-tag-bg:   #f0f0ec;
  --color-hover:    #f5f5f2;
  --color-accent:   var(--ghost-accent-color, #1a1a18);

  --font-serif: 'Lora', Georgia, serif;
  --font-sans:  'DM Sans', -apple-system, sans-serif;

  --max-width:      680px;
  --max-width-wide: 1100px;

  --nav-height: 60px;

  --sp-1:  8px;
  --sp-2:  16px;
  --sp-3:  24px;
  --sp-4:  32px;
  --sp-6:  48px;
  --sp-8:  64px;
  --sp-10: 80px;
  --sp-12: 96px;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  --transition: 0.16s ease;
}

/* ── RESET ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 18px; -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }
body { background: var(--color-bg); color: var(--color-text); font-family: var(--font-sans); line-height: 1.6; min-height: 100vh; }
img { max-width: 100%; display: block; }
a  { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }

/* ── LAYOUT ──────────────────────────────────────────────── */
.site-wrapper { display: flex; flex-direction: column; min-height: 100vh; }

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--sp-3);
}

/* ── HEADER ──────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250,250,248,0.93); /* fallback */
  background: color-mix(in srgb, var(--color-bg) 93%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  height: var(--nav-height);
  padding: 0 var(--sp-3);
  max-width: var(--max-width-wide);
  margin: 0 auto;
}

/* Brand: logo + name on the LEFT */
.site-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  color: var(--color-text);
}

.site-logo-img {
  height: 32px;
  width: auto;
  border-radius: var(--radius-sm);
  object-fit: contain;
}

.site-logo-placeholder {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--color-text);
  color: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 600;
  flex-shrink: 0;
}

.site-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

/* Nav links + CTA on the RIGHT */
.header-right {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-link {
  font-size: 0.82rem;
  color: var(--color-muted);
  padding: 6px 11px;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
}
.nav-link:hover { color: var(--color-text); background: var(--color-hover); }

.nav-divider {
  width: 1px;
  height: 18px;
  background: var(--color-border);
  margin: 0 6px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 500;
  transition: all var(--transition);
  white-space: nowrap;
  border: none;
  cursor: pointer;
}

.btn-primary  { background: var(--color-accent); color: var(--color-bg); }
.btn-primary:hover  { opacity: 0.82; }
.btn-outline  { border: 1.5px solid var(--color-border); color: var(--color-text); background: none; }
.btn-outline:hover  { border-color: var(--color-text); background: var(--color-hover); }

/* Mobile menu toggle — hidden on desktop */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.mobile-menu-toggle:hover { background: var(--color-hover); }
.mobile-menu-toggle span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--color-text);
  border-radius: 2px;
  transition: all var(--transition);
}

/* Mobile nav drawer */
.mobile-nav {
  border-top: 1px solid var(--color-border);
  padding: var(--sp-2) var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mobile-nav[hidden] { display: none; }

.mobile-nav-link {
  font-size: 0.92rem;
  color: var(--color-muted);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.mobile-nav-link:hover { color: var(--color-text); background: var(--color-hover); }

.mobile-nav-cta { margin-top: var(--sp-1); width: 100%; }

/* ── HERO ────────────────────────────────────────────────── */
.site-hero {
  padding: var(--sp-10) var(--sp-3) var(--sp-8);
  text-align: center;
  border-bottom: 1px solid var(--color-border);
}

.hero-icon {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-lg);
  object-fit: cover;
  margin: 0 auto var(--sp-3);
  border: 2px solid var(--color-border);
}

.hero-icon--logo { border-radius: var(--radius-md); }

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.18;
  margin-bottom: var(--sp-2);
}

.hero-description {
  font-size: 1rem;
  color: var(--color-muted);
  max-width: 440px;
  margin: 0 auto var(--sp-4);
  line-height: 1.72;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

.hero-actions .btn { padding: 11px 24px; font-size: 0.9rem; }

/* ── TAG FILTER TABS ─────────────────────────────────────── */
.tag-filter-wrap {
  border-bottom: 1px solid var(--color-border);
}

.tag-filter-bar {
  display: flex;
  align-items: center;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--sp-3);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.tag-filter-bar::-webkit-scrollbar { display: none; }

.filter-tab {
  padding: 14px 14px 13px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--color-muted);
  border: none;
  background: none;
  font-family: var(--font-sans);
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--transition);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  flex-shrink: 0;
}
.filter-tab:hover { color: var(--color-text); }
.filter-tab.active { color: var(--color-text); border-bottom-color: var(--color-accent); }
.filter-tab[aria-selected="true"] { color: var(--color-text); border-bottom-color: var(--color-accent); }

/* ── POST FEED — LIST ────────────────────────────────────── */
.post-feed { flex: 1; }
.post-feed .container { padding-top: var(--sp-2); padding-bottom: var(--sp-8); }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.post-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--sp-3);
  align-items: center;
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--color-border);
  animation: fadeUp 0.22s ease both;
}
.post-card:last-of-type { border-bottom: none; }

.post-card-link { display: contents; }

.post-card-body { min-width: 0; }

.post-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.post-card-tag {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted);
  background: var(--color-tag-bg);
  padding: 3px 8px;
  border-radius: 4px;
  transition: background var(--transition);
}
.post-card-tag:hover { background: var(--color-border); }

.post-card-date { font-size: 0.78rem; color: var(--color-muted); }

.post-card-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
  transition: color var(--transition);
}

.post-card:hover .post-card-title { color: var(--color-muted); }

.post-card-excerpt {
  font-size: 0.87rem;
  color: var(--color-muted);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-footer {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  margin-top: 10px;
}

.post-card-read-time { font-size: 0.75rem; color: var(--color-muted); }

.post-card-thumb {
  width: 160px;
  height: 108px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--color-hover);
}

/* ── POST FEED — GRID ────────────────────────────────────── */
.feed-grid .container { display: block; }

.feed-grid .post-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0;
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
  margin-bottom: var(--sp-3);
}

.feed-grid .post-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.08); transform: translateY(-2px); }

.feed-grid .post-card-thumb {
  width: 100%;
  height: 200px;
  border-radius: 0;
}

.feed-grid .post-card-body { padding: var(--sp-3); }

/* ── LOAD MORE / INFINITE SCROLL ─────────────────────────── */
#load-more-sentinel { height: 1px; }

.load-more-spinner {
  display: none;
  text-align: center;
  padding: var(--sp-4) 0;
  color: var(--color-muted);
  font-size: 0.85rem;
}
.load-more-spinner.visible { display: block; }

.load-more-btn {
  display: block;
  margin: var(--sp-4) auto 0;
  padding: 10px 28px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-muted);
  transition: all var(--transition);
}
.load-more-btn:hover { border-color: var(--color-text); color: var(--color-text); background: var(--color-hover); }

/* ── PAGINATION (fallback when infinite scroll off) ──────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) 0;
  border-top: 1px solid var(--color-border);
  margin-top: var(--sp-3);
}

/* Hide pagination when infinite scroll is active — JS uses it only for the next URL */
#post-feed[data-infinite="true"] .pagination {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

.pagination a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--color-muted);
  padding: 8px 16px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.pagination a:hover { color: var(--color-text); border-color: var(--color-text); }
.pagination-info { font-size: 0.8rem; color: var(--color-muted); }

/* ── SUBSCRIBE BOX ───────────────────────────────────────── */
.subscribe-section { padding: var(--sp-6) 0; }

.subscribe-box {
  background: var(--color-text);
  color: var(--color-bg);
  border-radius: var(--radius-lg);
  padding: var(--sp-6) var(--sp-4);
  text-align: center;
}

.subscribe-box h3 {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 500;
  margin-bottom: var(--sp-1);
}

.subscribe-box p { font-size: 0.88rem; opacity: 0.6; margin-bottom: var(--sp-3); }

.subscribe-form {
  display: flex;
  gap: var(--sp-1);
  max-width: 400px;
  margin: 0 auto;
}

.subscribe-input {
  flex: 1;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: none;
  background: rgba(255,255,255,0.12);
  color: white;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  outline: none;
  transition: background var(--transition);
}
.subscribe-input::placeholder { opacity: 0.5; color: white; }
.subscribe-input:focus { background: rgba(255,255,255,0.18); }

.subscribe-btn {
  padding: 10px 20px;
  background: white;
  color: var(--color-text);
  border-radius: var(--radius-sm);
  font-size: 0.83rem;
  font-weight: 500;
  transition: opacity var(--transition);
  white-space: nowrap;
}
.subscribe-btn:hover { opacity: 0.85; }

/* ── ARTICLE HEADER ──────────────────────────────────────── */
.article-header {
  padding: var(--sp-10) 0 var(--sp-6);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--sp-6);
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1);
  margin-bottom: var(--sp-2);
}

.article-tag {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted);
  background: var(--color-tag-bg);
  padding: 4px 10px;
  border-radius: 4px;
  transition: background var(--transition);
}
.article-tag:hover { background: var(--color-border); }

.article-title {
  font-family: var(--font-serif);
  font-size: clamp(1.7rem, 4vw, 2.7rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin-bottom: var(--sp-2);
}

.article-excerpt {
  font-size: 1.05rem;
  color: var(--color-muted);
  line-height: 1.72;
  font-style: italic;
  margin-bottom: var(--sp-3);
}

.article-byline { display: flex; align-items: center; gap: var(--sp-2); }

.author-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--color-border);
  flex-shrink: 0;
}

.author-name { font-size: 0.88rem; font-weight: 500; }
.article-meta { font-size: 0.8rem; color: var(--color-muted); }

/* ── ARTICLE BODY ────────────────────────────────────────── */
.article-hero-image {
  width: 100%;
  height: auto;
  max-height: 500px;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin-bottom: var(--sp-6);
}

.article-content {
  font-family: var(--font-serif);
  font-size: 1.08rem;
  line-height: 1.82;
  color: #2a2a26;
}

.article-content p { margin-bottom: 1.5em; }

.article-content h2 {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.28;
  margin: 2.5em 0 0.75em;
  color: var(--color-text);
}

.article-content h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 2em 0 0.6em;
  color: var(--color-text);
}

.article-content a {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--color-muted);
  transition: text-decoration-color var(--transition);
}
.article-content a:hover { text-decoration-color: var(--color-text); }

.article-content blockquote {
  border-left: 3px solid var(--color-accent);
  padding-left: var(--sp-3);
  margin: 2em 0;
  font-style: italic;
  color: var(--color-muted);
}

.article-content ul, .article-content ol {
  margin-bottom: 1.5em;
  padding-left: 1.5em;
}
.article-content li { margin-bottom: 0.4em; }

.article-content figure { margin: 2.5em 0; }
.article-content figure img { width: 100%; border-radius: var(--radius-sm); }

.article-content figcaption {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--color-muted);
  text-align: center;
  margin-top: 10px;
}

.article-content hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 3em 0;
}

.article-content code {
  font-size: 0.84em;
  background: var(--color-tag-bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'SF Mono', Consolas, 'Courier New', monospace;
}

.article-content pre {
  background: #f4f4f0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--sp-3);
  overflow-x: auto;
  margin: 2em 0;
}
.article-content pre code { background: none; padding: 0; font-size: 0.86rem; line-height: 1.7; }

/* ── ARTICLE FOOTER ──────────────────────────────────────── */
.article-footer {
  border-top: 1px solid var(--color-border);
  padding-top: var(--sp-4);
  margin-top: var(--sp-10);
}

.article-share {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-bottom: var(--sp-4);
}

.share-label { font-size: 0.8rem; font-weight: 500; color: var(--color-muted); }

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
  transition: all var(--transition);
  color: var(--color-text);
}
.share-btn:hover { border-color: var(--color-text); background: var(--color-hover); }

.author-card {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
  padding: var(--sp-3);
  background: var(--color-hover);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: var(--sp-4);
}

.author-card-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-border);
  flex-shrink: 0;
}

.author-card-name { font-size: 0.9rem; font-weight: 500; margin-bottom: 4px; }
.author-card-bio  { font-size: 0.83rem; color: var(--color-muted); line-height: 1.65; }

/* ── RELATED POSTS ───────────────────────────────────────── */
.related-posts { margin-top: var(--sp-10); border-top: 1px solid var(--color-border); padding-top: var(--sp-4); }
.related-title {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: var(--sp-3);
}

/* ── TAXONOMY PAGES ──────────────────────────────────────── */
.taxonomy-header {
  padding: var(--sp-10) 0 var(--sp-6);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--sp-4);
}

.taxonomy-label {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: var(--sp-1);
}

.taxonomy-title {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: var(--sp-1);
}

.taxonomy-description { font-size: 0.95rem; color: var(--color-muted); }

/* ── READING PROGRESS ────────────────────────────────────── */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background: var(--color-accent);
  z-index: 1000;
  transition: width 0.08s linear;
  pointer-events: none;
}

/* ── ERROR PAGE ──────────────────────────────────────────── */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--sp-12) var(--sp-3);
  flex: 1;
}

.error-code {
  font-family: var(--font-serif);
  font-size: 5rem;
  font-weight: 500;
  color: var(--color-border);
  line-height: 1;
  margin-bottom: var(--sp-2);
}

.error-title { font-family: var(--font-serif); font-size: 1.6rem; font-weight: 500; margin-bottom: var(--sp-1); }
.error-description { font-size: 0.93rem; color: var(--color-muted); margin-bottom: var(--sp-4); }

/* ── FOOTER ──────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: var(--sp-4) var(--sp-3);
  margin-top: auto;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  flex-wrap: wrap;
  max-width: var(--max-width-wide);
  margin: 0 auto;
}

.footer-brand { font-family: var(--font-serif); font-size: 0.9rem; }

.footer-nav { display: flex; gap: var(--sp-3); flex-wrap: wrap; }
.footer-nav a {
  font-size: 0.8rem;
  color: var(--color-muted);
  transition: color var(--transition);
}
.footer-nav a:hover { color: var(--color-text); }

.footer-copy { font-size: 0.76rem; color: var(--color-muted); }

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

/* ── RESPONSIVE ──────────────────────────────────────────── */

/* Tablet */
@media (max-width: 860px) {
  .feed-grid .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-3);
  }
  .feed-grid .post-card { margin-bottom: 0; }
}

/* Mobile */
@media (max-width: 640px) {
  :root { --nav-height: 54px; }
  html { font-size: 18px; }

  /* Nav: hide desktop nav, show hamburger */
  .header-nav, .nav-divider { display: none; }
  .mobile-menu-toggle { display: flex; }

  /* Hide the subscribe btn in header on mobile (it's in the mobile drawer) */
  .header-right .btn { display: none; }

  /* Hero */
  .site-hero { padding: 56px var(--sp-4) 56px; }
  .hero-icon { width: 64px; height: 64px; margin-bottom: var(--sp-3); }

  /* Post card: stack on mobile */
  .post-card {
    grid-template-columns: 1fr;
  }
  .post-card-thumb {
    width: 100%;
    height: 200px;
    order: -1;
  }

  /* Grid feed: single column */
  .feed-grid .container {
    display: block;
  }
  .feed-grid .post-card { margin-bottom: var(--sp-3); }

  /* Subscribe form: stack */
  .subscribe-form { flex-direction: column; }

  /* Footer: stack */
  .footer-inner { flex-direction: column; align-items: flex-start; gap: var(--sp-2); }

  /* Article */
  .article-title { font-size: 1.95rem; }
  .article-hero-image { border-radius: var(--radius-sm); }

  /* Author card: stack */
  .author-card { flex-direction: column; }

  /* Article share: wrap */
  .article-share { gap: var(--sp-1); }

  /* Typography scale boost on mobile */
  .post-card-title { font-size: 1.25rem; }
  .post-card-excerpt { font-size: 1rem; }
  .post-card-date { font-size: 0.88rem; }
  .post-card-read-time { font-size: 0.88rem; }
  .post-card-tag { font-size: 0.78rem; }

  .hero-description { font-size: 1.15rem; line-height: 1.6; }
  .hero-title { font-size: clamp(2.1rem, 7vw, 2.8rem); }

  .article-title { font-size: 2.1rem; }
  .article-header { padding: var(--sp-6) 0 var(--sp-4); }
  .article-header .container,
  .article-content.container { padding: 0 var(--sp-3); }
  .article-content { font-size: 1.1rem; }
  .article-content h2 { font-size: 1.55rem; }
  .article-content h3 { font-size: 1.3rem; }
  .article-meta { font-size: 0.88rem; }

  .nav-link { font-size: 1rem; }
  .site-title { font-size: 1.05rem; }

  .pat-title { font-size: 1.1rem; }
  .pat-abstract { font-size: 0.92rem; }
  .pat-id { font-size: 0.78rem; }

  .sidebar-section-title { font-size: 0.75rem; }
  .most-read-title { font-size: 0.9rem; }
}

/* Very small */
@media (max-width: 380px) {
  .site-title { font-size: 0.9rem; }
}


/* ============================================================
   TEMPLATE: TABLE OF CONTENTS (post-toc)
   ============================================================ */

.toc-layout { }

.toc-wrapper {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 0;
  max-width: 1060px;
  margin: 0 auto;
  padding: var(--sp-6) var(--sp-3);
  align-items: start;
}

/* Sticky TOC sidebar */
.toc-sidebar {
  position: sticky;
  top: calc(var(--nav-height) + var(--sp-4));
  padding-right: var(--sp-4);
  border-right: 1px solid var(--color-border);
  max-height: calc(100vh - var(--nav-height) - var(--sp-8));
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}

.toc-sticky { padding-bottom: var(--sp-4); }

.toc-heading {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: var(--sp-2);
}

.toc-nav { display: flex; flex-direction: column; gap: 2px; }

.toc-link {
  display: block;
  font-size: 0.82rem;
  color: var(--color-muted);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  border-left: 2px solid transparent;
  line-height: 1.4;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.toc-link:hover {
  color: var(--color-text);
  background: var(--color-hover);
}

.toc-link.active {
  color: var(--color-text);
  border-left-color: var(--color-accent);
  font-weight: 500;
}

.toc-link--h3 { padding-left: 22px; font-size: 0.78rem; }

/* Article body column */
.toc-body {
  padding-left: var(--sp-6);
  min-width: 0;
}

.toc-body .article-content { max-width: var(--max-width); }
.toc-body .subscribe-box   { max-width: var(--max-width); }
.toc-body .article-footer  { max-width: var(--max-width); }
.toc-body .author-card     { max-width: var(--max-width); }

/* TOC responsive */
@media (max-width: 860px) {
  .toc-wrapper {
    grid-template-columns: 1fr;
    padding: var(--sp-4) var(--sp-3);
  }

  .toc-sidebar {
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
    padding-right: 0;
    padding-bottom: var(--sp-4);
    margin-bottom: var(--sp-4);
    max-height: none;
    overflow: visible;
  }

  /* Collapse to horizontal scroll strip on mobile */
  .toc-nav {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: var(--sp-1);
    padding-bottom: var(--sp-1);
  }

  .toc-link {
    white-space: nowrap;
    border-left: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    padding: 6px 10px;
  }

  .toc-link.active { border-left-color: transparent; border-bottom-color: var(--color-accent); }
  .toc-link--h3 { padding-left: 10px; }

  .toc-body { padding-left: 0; }
}


/* ============================================================
   TEMPLATE: FULL WIDTH (post-fullwidth)
   ============================================================ */

/* Full-bleed hero */
.fw-hero {
  position: relative;
  width: 100%;
  height: 92vh;
  min-height: 480px;
  max-height: 800px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

.fw-hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.fw-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.04) 0%,
    rgba(0,0,0,0.1)  40%,
    rgba(0,0,0,0.72) 100%
  );
}

.fw-hero-content {
  position: relative;
  z-index: 2;
  padding: var(--sp-10) var(--sp-6) var(--sp-8);
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
}

.fw-tags { margin-bottom: var(--sp-2); }

.article-tag--light {
  background: rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.9);
  backdrop-filter: blur(4px);
}
.article-tag--light:hover { background: rgba(255,255,255,0.28); }

.fw-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: white;
  margin-bottom: var(--sp-2);
  text-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.fw-excerpt {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.8);
  line-height: 1.65;
  margin-bottom: var(--sp-3);
  max-width: 600px;
  font-style: italic;
}

.fw-byline {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.fw-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.5);
  flex-shrink: 0;
}

.fw-meta {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.75);
}

/* Wide body column */
.fw-body {
  max-width: 760px;
  margin: 0 auto;
  padding: var(--sp-8) var(--sp-3);
}

.fw-body .article-content { font-size: 1.1rem; }

/* Full width responsive */
@media (max-width: 640px) {
  .fw-hero { height: 72vh; min-height: 360px; }
  .fw-hero-content { padding: var(--sp-6) var(--sp-3) var(--sp-6); }
  .fw-title { font-size: 1.9rem; }
  .fw-excerpt { font-size: 0.95rem; }
}


/* ============================================================
   TEMPLATE: WITH SIDEBAR (post-sidebar)
   ============================================================ */

.sidebar-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: var(--sp-8);
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--sp-4) var(--sp-3) var(--sp-10);
  align-items: start;
}

/* Main body */
.sidebar-body { min-width: 0; }

/* Sticky sidebar */
.sidebar {
  position: sticky;
  top: calc(var(--nav-height) + var(--sp-4));
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  max-height: calc(100vh - var(--nav-height) - var(--sp-8));
  overflow-y: auto;
  scrollbar-width: none;
  padding-bottom: var(--sp-4);
}
.sidebar::-webkit-scrollbar { display: none; }

/* Widget card */
.sidebar-widget {
  background: var(--color-hover);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--sp-3);
}

.sidebar-widget-title {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: var(--sp-2);
}

/* Subscribe widget */
.sidebar-subscribe-desc {
  font-size: 0.83rem;
  color: var(--color-muted);
  line-height: 1.55;
  margin-bottom: var(--sp-2);
}

.sidebar-subscribe-form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.sidebar-input {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.84rem;
  background: var(--color-bg);
  color: var(--color-text);
  outline: none;
  transition: border-color var(--transition);
}
.sidebar-input:focus { border-color: var(--color-text); }
.sidebar-input::placeholder { color: var(--color-muted); }

.sidebar-sub-btn { width: 100%; justify-content: center; }

/* Tags widget */
.sidebar-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sidebar-tag {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-muted);
  background: var(--color-bg);
  border: 1.5px solid var(--color-border);
  padding: 4px 10px;
  border-radius: 4px;
  transition: all var(--transition);
}
.sidebar-tag:hover { border-color: var(--color-text); color: var(--color-text); }

/* Related posts widget */
.sidebar-related {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.sidebar-related-item {
  border-bottom: 1px solid var(--color-border);
}
.sidebar-related-item:last-child { border-bottom: none; }

.sidebar-related-link {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 0;
  transition: opacity var(--transition);
}
.sidebar-related-link:hover { opacity: 0.65; }

.sidebar-related-title {
  font-size: 0.85rem;
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: 1.35;
  color: var(--color-text);
}

.sidebar-related-meta {
  font-size: 0.75rem;
  color: var(--color-muted);
}

/* Progress widget */
.sidebar-progress-track {
  height: 4px;
  background: var(--color-border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 8px;
}

.sidebar-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--color-accent);
  border-radius: 2px;
  transition: width 0.15s ease;
}

.sidebar-progress-label {
  font-size: 0.75rem;
  color: var(--color-muted);
}

/* Sidebar responsive */
@media (max-width: 900px) {
  .sidebar-layout {
    grid-template-columns: 1fr;
    gap: var(--sp-6);
  }

  .sidebar {
    position: static;
    max-height: none;
    overflow: visible;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-3);
  }

  .sidebar-progress-widget { display: none; }
}

@media (max-width: 560px) {
  .sidebar { grid-template-columns: 1fr; }
}

/* ============================================================
   DARK MODE
   ============================================================

   Three layers:
   1. System preference  — auto via prefers-color-scheme
   2. Manual toggle      — [data-theme="dark"] / [data-theme="light"] on <html>
   3. Ghost Admin setting — @custom.color_scheme drives the initial class

   Priority: manual > system > default (light)
   ============================================================ */

/* Dark colour tokens */
:root[data-theme="dark"],
:root.dark-mode {
  --color-bg:     #141412;
  --color-text:   #e8e6e0;
  --color-muted:  #8a8a82;
  --color-border: #2a2a26;
  --color-tag-bg: #1e1e1a;
  --color-hover:  #1c1c18;
  --color-accent: var(--ghost-accent-color, #e8e6e0);
}

/* System auto-dark (when no manual override) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-bg:     #141412;
    --color-text:   #e8e6e0;
    --color-muted:  #8a8a82;
    --color-border: #2a2a26;
    --color-tag-bg: #1e1e1a;
    --color-hover:  #1c1c18;
    --color-accent: var(--ghost-accent-color, #e8e6e0);
  }
}

/* ── Dark-specific overrides ────────────────────────────────
   Anything that can't be covered by variable swaps alone     */

/* Nav backdrop */
:root[data-theme="dark"] .site-header,
:root.dark-mode .site-header {
  background: rgba(20,20,18,0.93);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .site-header {
    background: rgba(20,20,18,0.93);
  }
}

/* Article body text — slightly warmer in dark */
:root[data-theme="dark"] .article-content,
:root.dark-mode .article-content {
  color: #d4d0c8;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .article-content {
    color: #d4d0c8;
  }
}

/* Code blocks */
:root[data-theme="dark"] .article-content code,
:root.dark-mode .article-content code {
  background: #1e1e1a;
}

:root[data-theme="dark"] .article-content pre,
:root.dark-mode .article-content pre {
  background: #1a1a16;
  border-color: #2a2a26;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .article-content code { background: #1e1e1a; }
  :root:not([data-theme="light"]) .article-content pre  { background: #1a1a16; border-color: #2a2a26; }
}

/* Subscribe box — invert in dark (light box on dark bg) */
:root[data-theme="dark"] .subscribe-box,
:root.dark-mode .subscribe-box {
  background: #e8e6e0;
  color: #141412;
}

:root[data-theme="dark"] .subscribe-box .subscribe-input,
:root.dark-mode .subscribe-box .subscribe-input {
  background: rgba(0,0,0,0.1);
  color: #141412;
}

:root[data-theme="dark"] .subscribe-box .subscribe-input::placeholder,
:root.dark-mode .subscribe-box .subscribe-input::placeholder {
  color: rgba(20,20,18,0.45);
}

:root[data-theme="dark"] .subscribe-box .subscribe-btn,
:root.dark-mode .subscribe-box .subscribe-btn {
  background: #141412;
  color: #e8e6e0;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .subscribe-box {
    background: #e8e6e0;
    color: #141412;
  }
  :root:not([data-theme="light"]) .subscribe-box .subscribe-input {
    background: rgba(0,0,0,0.1);
    color: #141412;
  }
  :root:not([data-theme="light"]) .subscribe-box .subscribe-input::placeholder {
    color: rgba(20,20,18,0.45);
  }
  :root:not([data-theme="light"]) .subscribe-box .subscribe-btn {
    background: #141412;
    color: #e8e6e0;
  }
}

/* Sidebar subscribe widget in dark */
:root[data-theme="dark"] .sidebar-widget,
:root.dark-mode .sidebar-widget,
:root[data-theme="dark"] .sw {
  background: #1a1a16;
  border-color: #2a2a26;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sidebar-widget { background: #1a1a16; border-color: #2a2a26; }
}

/* Full-width hero overlay — slightly deeper in dark */
:root[data-theme="dark"] .fw-hero-overlay,
:root.dark-mode .fw-hero-overlay {
  background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.18) 40%, rgba(0,0,0,0.82) 100%);
}

/* ── Dark mode toggle button ──────────────────────────────── */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--color-border);
  color: var(--color-muted);
  background: none;
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}

.theme-toggle:hover {
  color: var(--color-text);
  border-color: var(--color-text);
  background: var(--color-hover);
}

.theme-toggle svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Show sun icon in dark mode, moon in light */
.theme-toggle .icon-moon { display: block; }
.theme-toggle .icon-sun  { display: none; }

:root[data-theme="dark"] .theme-toggle .icon-moon,
:root.dark-mode .theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun,
:root.dark-mode .theme-toggle .icon-sun  { display: block; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .icon-sun  { display: block; }
}

/* Smooth colour transitions when toggling */
html {
  transition:
    background-color 0.25s ease,
    color 0.25s ease;
}

/* ============================================================
   FEATURED ARTICLE HEROES
   ============================================================ */

/* ── Shared chrome ───────────────────────────────────────── */
.featured-hero {
  border-bottom: 1px solid var(--color-border);
}

.fh-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.fh-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted);
  background: var(--color-tag-bg);
  padding: 3px 8px;
  border-radius: 4px;
}

.fh-label--light {
  background: rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.85);
  backdrop-filter: blur(4px);
}

.fh-tag {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.fh-tag--light { color: rgba(255,255,255,0.75); }

.fh-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

.fh-meta--light { color: rgba(255,255,255,0.8); }

.fh-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--color-border);
  flex-shrink: 0;
}

.fh-byline { font-size: 0.8rem; color: var(--color-muted); }
.fh-byline--light { color: rgba(255,255,255,0.75); }


/* ── SINGLE featured article ─────────────────────────────── */
.featured-hero--single {
  padding: var(--sp-6) 0;
}

.featured-hero--single .featured-hero-link {
  display: block;
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 0 var(--sp-3);
  transition: opacity var(--transition);
}

.featured-hero--single .featured-hero-link:hover { opacity: 0.8; }

.fh-single-inner {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: var(--sp-6);
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-hover);
}

.fh-single-body {
  padding: var(--sp-6);
}

.fh-single-title {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.22;
  color: var(--color-text);
  margin-bottom: 14px;
}

.fh-single-excerpt {
  font-size: 1rem;
  color: var(--color-muted);
  line-height: 1.72;
}

.fh-single-image-wrap {
  height: 100%;
  min-height: 320px;
}

.fh-single-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}


/* ── TWO featured articles ───────────────────────────────── */
.featured-hero--two {
  display: grid;
  grid-template-columns: 1fr 340px;
  min-height: 460px;
}

/* Primary card (left, image background) */
.fh-primary {
  position: relative;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  transition: opacity var(--transition);
  min-height: 460px;
}

.fh-primary:hover { opacity: 0.88; }

.fh-primary-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.fh-primary-no-image {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--color-text) 0%, color-mix(in srgb, var(--color-text) 70%, transparent) 100%);
}

.fh-primary-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.02) 0%,
    rgba(0,0,0,0.12) 40%,
    rgba(0,0,0,0.72) 100%
  );
}

.fh-primary-content {
  position: relative;
  z-index: 2;
  padding: var(--sp-6);
}

.fh-primary-title {
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: white;
  margin-bottom: 10px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.fh-primary-excerpt {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.78);
  line-height: 1.65;
  font-style: italic;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Wide variant for three-layout top card */
.fh-primary--wide {
  min-height: 380px;
  grid-column: 1 / -1;
}

/* Secondary card (right, or bottom row) */
.fh-secondary {
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--color-border);
  transition: background var(--transition);
  overflow: hidden;
}

.fh-secondary:hover { background: var(--color-hover); }

.fh-secondary-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  flex-shrink: 0;
}

.fh-secondary-body {
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  flex: 1;
}

.fh-secondary-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.3;
  color: var(--color-text);
  margin-bottom: 8px;
  margin-top: 6px;
}

.fh-secondary-excerpt {
  font-size: 0.85rem;
  color: var(--color-muted);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 10px;
}

.fh-secondary-meta {
  font-size: 0.75rem;
  color: var(--color-muted);
  margin-top: auto;
}


/* ── THREE featured articles ─────────────────────────────── */
.featured-hero--three {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 380px auto;
}

/* Wide top card spans both columns */
.featured-hero--three .fh-primary--wide {
  grid-column: 1 / -1;
}

/* Two secondary cards sit in the bottom row */
.featured-hero--three .fh-secondary--card {
  border-left: none;
  border-top: 1px solid var(--color-border);
}

.featured-hero--three .fh-secondary--card:last-child {
  border-left: 1px solid var(--color-border);
}

.featured-hero--three .fh-secondary--card .fh-secondary-image {
  height: 160px;
}


/* ── Fallback: no featured posts message ─────────────────── */
.fh-empty {
  padding: var(--sp-8) var(--sp-3);
  text-align: center;
  color: var(--color-muted);
  font-size: 0.9rem;
  border-bottom: 1px solid var(--color-border);
}

.fh-empty a {
  text-decoration: underline;
  text-underline-offset: 3px;
}


/* ── Dark mode adjustments for featured heroes ───────────── */
:root[data-theme="dark"] .fh-single-inner,
:root.dark-mode .fh-single-inner {
  background: var(--color-hover);
  border-color: var(--color-border);
}

:root[data-theme="dark"] .fh-primary-overlay,
:root.dark-mode .fh-primary-overlay {
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.08) 0%,
    rgba(0,0,0,0.2) 40%,
    rgba(0,0,0,0.82) 100%
  );
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .fh-single-inner {
    background: var(--color-hover);
    border-color: var(--color-border);
  }
  :root:not([data-theme="light"]) .fh-primary-overlay {
    background: linear-gradient(to bottom, rgba(0,0,0,0.08) 0%, rgba(0,0,0,0.2) 40%, rgba(0,0,0,0.82) 100%);
  }
}


/* ── Responsive: featured heroes ─────────────────────────── */
@media (max-width: 860px) {
  /* Single: stack image below text */
  .fh-single-inner {
    grid-template-columns: 1fr;
  }
  .fh-single-image-wrap {
    min-height: 240px;
    order: -1;
  }
  .fh-single-body { padding: var(--sp-4); }

  /* Two: stack vertically */
  .featured-hero--two {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .fh-primary { min-height: 340px; }
  .fh-secondary { border-left: none; border-top: 1px solid var(--color-border); }

  /* Three: stack primary then 2-col secondaries */
  .featured-hero--three {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
  }
  .featured-hero--three .fh-primary--wide { min-height: 300px; }
}

@media (max-width: 560px) {
  .fh-primary { min-height: 280px; }
  .fh-primary-title { font-size: 1.4rem; }

  /* Three: all stack */
  .featured-hero--three {
    grid-template-columns: 1fr;
  }
  .featured-hero--three .fh-secondary--card:last-child {
    border-left: none;
    border-top: 1px solid var(--color-border);
  }

  .fh-single-body { padding: var(--sp-3); }
}

/* ============================================================
   INLINE SUBSCRIBE STRIP
   ============================================================ */

.inline-subscribe {
  border-bottom: 1px solid var(--color-border);
  background: var(--color-hover);
}

.inline-subscribe-inner {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 16px var(--sp-3);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.inline-subscribe-text {
  font-size: 0.85rem;
  color: var(--color-muted);
  line-height: 1.45;
  flex: 1;
  min-width: 180px;
}

.inline-subscribe-text strong {
  color: var(--color-text);
  font-weight: 500;
}

.inline-subscribe-form {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.inline-subscribe-input {
  padding: 8px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  background: var(--color-bg);
  color: var(--color-text);
  width: 220px;
  outline: none;
  transition: border-color var(--transition);
}

.inline-subscribe-input:focus { border-color: var(--color-text); }
.inline-subscribe-input::placeholder { color: var(--color-muted); }

.inline-subscribe-btn {
  padding: 8px 18px;
  background: var(--color-text);
  color: var(--color-bg);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity var(--transition);
}

.inline-subscribe-btn:hover { opacity: 0.8; }

.inline-subscribe-btn.success {
  background: #3a7d44;
  color: white;
}

@media (max-width: 640px) {
  .inline-subscribe-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .inline-subscribe-form { flex-direction: column; }
  .inline-subscribe-input { width: 100%; }
}


/* ============================================================
   TAG SECTIONS  (dedicated card rows per tag)
   ============================================================ */

#tag-sections-root {
  border-bottom: 1px solid var(--color-border);
}

.tag-section {
  padding: var(--sp-6) 0;
  border-bottom: 1px solid var(--color-border);
}

.tag-section:last-child { border-bottom: none; }

.tag-section-header {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 0 var(--sp-3);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--sp-3);
}

.tag-section-title {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.tag-section-more {
  font-size: 0.78rem;
  color: var(--color-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--transition);
}

.tag-section-more:hover { color: var(--color-text); }

.tag-section-cards {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 0 var(--sp-3);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-3);
}

/* Individual tag section card */
.ts-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-bg);
  transition: box-shadow var(--transition), transform var(--transition);
}

.ts-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.07);
  transform: translateY(-2px);
}

.ts-card-image {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.ts-card-image-placeholder {
  width: 100%;
  height: 160px;
  background: var(--color-tag-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}

.ts-card-body {
  padding: var(--sp-2) var(--sp-2) var(--sp-2);
  display: flex;
  flex-direction: column;
  flex: 1;
}

.ts-card-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--color-text);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ts-card-excerpt {
  font-size: 0.8rem;
  color: var(--color-muted);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 10px;
}

.ts-card-meta {
  font-size: 0.72rem;
  color: var(--color-muted);
  margin-top: auto;
}

/* Loading skeleton */
.ts-card--skeleton .ts-card-image-placeholder {
  animation: skeleton-pulse 1.4s ease-in-out infinite;
}

.ts-card--skeleton .ts-skel-line {
  height: 12px;
  border-radius: 4px;
  background: var(--color-tag-bg);
  margin-bottom: 8px;
  animation: skeleton-pulse 1.4s ease-in-out infinite;
}

.ts-card--skeleton .ts-skel-line:nth-child(2) { width: 80%; animation-delay: 0.1s; }
.ts-card--skeleton .ts-skel-line:nth-child(3) { width: 60%; animation-delay: 0.2s; }

@keyframes skeleton-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@media (max-width: 800px) {
  .tag-section-cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .tag-section-cards { grid-template-columns: 1fr; }
}


/* ============================================================
   HOME SIDEBAR LAYOUT
   ============================================================ */

.home-with-sidebar {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 0;
  max-width: 1100px;
  margin: 0 auto;
  align-items: start;
}

/* Feed column — matches standard post-feed but without the outer container centering */
.home-feed-col {
  min-width: 0;
  border-right: 1px solid var(--color-border);
}

.home-feed-col .tag-filter-wrap--sidebar {
  border-bottom: 1px solid var(--color-border);
}

.home-feed-col .post-feed { max-width: 100%; }

/* Sidebar container */
.home-sidebar {
  position: sticky;
  top: calc(var(--nav-height) + var(--sp-2));
  padding: var(--sp-4) var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  max-height: calc(100vh - var(--nav-height) - var(--sp-4));
  overflow-y: auto;
  scrollbar-width: none;
}

.home-sidebar::-webkit-scrollbar { display: none; }

/* Sidebar widget card */
.hs-widget {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.hs-widget-title {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-border);
}

/* Most Read list */
.hs-most-read {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.hs-most-read-item {
  border-bottom: 1px solid var(--color-border);
}

.hs-most-read-item:last-child { border-bottom: none; }

.hs-most-read-link {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 0;
  transition: opacity var(--transition);
}

.hs-most-read-link:hover { opacity: 0.65; }

.hs-most-read-num {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-border);
  line-height: 1;
  min-width: 20px;
  padding-top: 1px;
  flex-shrink: 0;
  transition: color var(--transition);
}

.hs-most-read-link:hover .hs-most-read-num {
  color: var(--color-text);
}

.hs-most-read-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.hs-most-read-title {
  font-size: 0.78rem;
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: 1.35;
  color: var(--color-text);
}

.hs-most-read-meta {
  font-size: 0.68rem;
  color: var(--color-muted);
}

.hs-tag {
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Sidebar subscribe widget */
.hs-widget--subscribe {
  background: var(--color-text);
  color: var(--color-bg);
  border-radius: var(--radius-md);
  padding: var(--sp-2) var(--sp-2);
}

.hs-subscribe-title {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 5px;
  color: var(--color-bg);
}

.hs-subscribe-desc {
  font-size: 0.78rem;
  opacity: 0.65;
  margin-bottom: 12px;
  line-height: 1.5;
}

.hs-subscribe-form {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.hs-subscribe-input {
  padding: 8px 12px;
  border: 1.5px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  background: rgba(255,255,255,0.1);
  color: var(--color-bg);
  outline: none;
  transition: border-color var(--transition);
}

.hs-subscribe-input::placeholder { color: rgba(255,255,255,0.4); }
.hs-subscribe-input:focus { border-color: rgba(255,255,255,0.5); }

.hs-subscribe-btn {
  background: var(--color-bg) !important;
  color: var(--color-text) !important;
  width: 100%;
  justify-content: center;
}

/* Browse topics widget */
.hs-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hs-tag-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--color-muted);
  background: var(--color-hover);
  border: 1.5px solid var(--color-border);
  padding: 4px 10px;
  border-radius: 20px;
  transition: all var(--transition);
}

.hs-tag-pill:hover {
  border-color: var(--color-text);
  color: var(--color-text);
  background: var(--color-bg);
}

.hs-tag-count {
  font-size: 0.67rem;
  opacity: 0.55;
}

/* Container override for sidebar layout */
.container--sidebar {
  max-width: 100%;
  padding: 0 var(--sp-3);
}

/* Sidebar responsive */
@media (max-width: 900px) {
  .home-with-sidebar {
    grid-template-columns: 1fr;
  }

  .home-feed-col {
    border-right: none;
  }

  .home-sidebar {
    position: static;
    max-height: none;
    overflow: visible;
    border-top: 1px solid var(--color-border);
    padding: var(--sp-4) var(--sp-3);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-4);
  }

  /* On mobile, hide the most read numeric decorations */
  .hs-most-read-num { font-size: 1rem; }
}

@media (max-width: 560px) {
  .home-sidebar { grid-template-columns: 1fr; }
}

/* ============================================================
   THEME ADMIN v2 — Custom Settings CSS
   ============================================================ */

/* ── Custom colour tokens (set via Ghost Admin colour pickers) ── */
:root {
  --color-accent:  var(--color-accent-custom, var(--ghost-accent-color, #1a1a18));
  --color-bg:      var(--color-bg-custom, #fafaf8);
}

:root[data-theme="dark"] {
  --color-bg: var(--color-dark-bg-custom, #141412);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-bg: var(--color-dark-bg-custom, #141412);
  }
}

/* ── Typography font overrides ─────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500&family=Playfair+Display:ital,wght@0,400;0,500;1,400&display=swap');

html.font-body-inter    { --font-sans: 'Inter', -apple-system, sans-serif; }
html.font-body-system   { --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
html.font-body-georgia  { --font-sans: Georgia, 'Times New Roman', serif; }

html.font-heading-sans      { --font-serif: var(--font-sans); }
html.font-heading-playfair  { --font-serif: 'Playfair Display', Georgia, serif; }
html.font-heading-system    { --font-serif: Georgia, 'Times New Roman', serif; }

/* ── Article width overrides ───────────────────────────────── */
html.article-narrow .container,
html.article-narrow .article-content { max-width: 620px; }

html.article-wide .container,
html.article-wide .article-content { max-width: 760px; }

/* ── Article font size overrides ───────────────────────────── */
html.article-font-small .article-content { font-size: 0.95rem; }
html.article-font-large .article-content { font-size: 1.1rem; }

/* ── Link style overrides ──────────────────────────────────── */
html.links-no-underline .article-content a {
  text-decoration: none;
  border-bottom: none;
}

html.links-highlight .article-content a {
  background: color-mix(in srgb, var(--color-accent) 12%, transparent);
  text-decoration: none;
  padding: 0 2px;
  border-radius: 2px;
  border-bottom: none;
}

html.links-highlight .article-content a:hover {
  background: color-mix(in srgb, var(--color-accent) 22%, transparent);
}

/* ── Non-sticky nav ─────────────────────────────────────────── */
html.nav-not-sticky .site-header { position: relative; }
html.nav-not-sticky .reading-progress { position: fixed; top: 0; }


/* ── RELATED POSTS ─────────────────────────────────────────── */
.related-posts {
  margin-top: var(--sp-6);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--color-border);
}

.related-posts-title {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: var(--sp-3);
}

.related-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--sp-2);
}

.related-post-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-bg);
  transition: box-shadow var(--transition), transform var(--transition);
}

.related-post-card:hover {
  box-shadow: 0 4px 18px rgba(0,0,0,0.07);
  transform: translateY(-2px);
}

.related-post-image {
  width: 100%;
  height: 120px;
  object-fit: cover;
}

.related-post-body {
  padding: var(--sp-2);
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}

.related-post-title {
  font-family: var(--font-serif);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--color-text);
}

.related-post-meta {
  font-size: 0.72rem;
  color: var(--color-muted);
}

@media (max-width: 560px) {
  .related-posts-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 400px) {
  .related-posts-grid { grid-template-columns: 1fr; }
}


/* ── POST NAVIGATION ───────────────────────────────────────── */
.post-navigation {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-2);
  margin-top: var(--sp-4);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--color-border);
}

.post-nav-link {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: var(--sp-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  transition: background var(--transition), border-color var(--transition);
}

.post-nav-link:hover {
  background: var(--color-hover);
  border-color: color-mix(in srgb, var(--color-border) 60%, var(--color-text));
}

.post-nav-next { text-align: right; }

.post-nav-dir {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.post-nav-title {
  font-family: var(--font-serif);
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--color-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 480px) {
  .post-navigation { grid-template-columns: 1fr; }
  .post-nav-next { text-align: left; }
}


/* ── SOCIAL LINKS IN FOOTER ────────────────────────────────── */
.footer-brand-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-tagline {
  font-size: 0.8rem;
  color: var(--color-muted);
  line-height: 1.5;
  max-width: 240px;
}

.footer-social {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.footer-social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  color: var(--color-muted);
  border: 1.5px solid var(--color-border);
  transition: all var(--transition);
}

.footer-social-link:hover {
  color: var(--color-text);
  border-color: var(--color-text);
  background: var(--color-hover);
}


/* ── FOOTER SUBSCRIBE ──────────────────────────────────────── */
.footer-subscribe {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.footer-subscribe-form {
  display: flex;
  gap: 6px;
}

.footer-subscribe-input {
  flex: 1;
  padding: 8px 12px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  background: var(--color-bg);
  color: var(--color-text);
  outline: none;
  transition: border-color var(--transition);
  min-width: 0;
}

.footer-subscribe-input:focus { border-color: var(--color-text); }
.footer-subscribe-input::placeholder { color: var(--color-muted); }

.footer-subscribe-btn {
  padding: 8px 16px;
  background: var(--color-text);
  color: var(--color-bg);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity var(--transition);
}

.footer-subscribe-btn:hover { opacity: 0.8; }


/* ── FOOTER LAYOUT RESPONSIVE UPDATE ──────────────────────── */
/* Override existing footer-inner for new 4-cell layout */
.site-footer .footer-inner {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  grid-template-areas: "brand nav subscribe copy";
  align-items: center;
  gap: var(--sp-4);
}

.site-footer .footer-brand-wrap  { grid-area: brand; }
.site-footer .footer-nav          { grid-area: nav; }
.site-footer .footer-subscribe    { grid-area: subscribe; }
.site-footer .footer-copy         { grid-area: copy; justify-self: end; }

@media (max-width: 860px) {
  .site-footer .footer-inner {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "brand nav"
      "subscribe copy";
    gap: var(--sp-3);
  }
  .site-footer .footer-copy { justify-self: start; }
}

@media (max-width: 560px) {
  .site-footer .footer-inner {
    grid-template-columns: 1fr;
    grid-template-areas:
      "brand"
      "nav"
      "subscribe"
      "copy";
  }
  .footer-subscribe-form { flex-direction: column; }
  .footer-subscribe-input { width: 100%; }
}


/* ── HERO BACKGROUND IMAGE (Subscribe hero) ─────────────────── */
.site-hero--with-bg {
  position: relative;
  color: white;
  overflow: hidden;
}

.site-hero--with-bg .hero-bg-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
}

.site-hero--with-bg .hero-bg-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0.65) 100%);
  z-index: 1;
}

.site-hero--with-bg .hero-title,
.site-hero--with-bg .hero-description {
  color: white;
  position: relative;
  z-index: 2;
}

.site-hero--with-bg .hero-actions {
  position: relative;
  z-index: 2;
}

.site-hero--with-bg .hero-icon,
.site-hero--with-bg .hero-icon--logo {
  position: relative;
  z-index: 2;
}

.site-hero--with-bg .btn-primary {
  background: white;
  color: #1a1a18;
}


/* ── COMPREHENSIVE RESPONSIVE AUDIT & FIXES ─────────────────── */

/* 1. Feed grid on small screens */
@media (max-width: 640px) {
  .feed-grid .post-card {
    grid-template-columns: 1fr;
  }

  .feed-grid .post-card-thumb {
    width: 100%;
    height: 180px;
    order: -1;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  }
}

/* 2. Tag section card count — 2-col on medium */
@media (max-width: 680px) {
  .tag-section-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 420px) {
  .tag-section-cards { grid-template-columns: 1fr; }
}

/* 3. Article templates responsive completeness */

/* TOC mobile already handled — ensure body padding */
@media (max-width: 640px) {
  .toc-body { padding-left: 0; }
  .toc-outer { padding: var(--sp-3) var(--sp-2); }
}

/* Fullwidth template image on tiny screens */
@media (max-width: 420px) {
  .fw-hero { height: 60vh; min-height: 280px; }
  .fw-hero-content { padding: var(--sp-4) var(--sp-2) var(--sp-5); }
}

/* Sidebar template on small screens */
@media (max-width: 640px) {
  .sidebar-layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--sp-3);
    position: static;
    max-height: none;
  }
}

/* 4. Hero background image on mobile — less height */
@media (max-width: 640px) {
  .site-hero--with-bg { min-height: 340px; }
}

/* 5. Inline subscribe on extra small */
@media (max-width: 380px) {
  .inline-subscribe-form { flex-direction: column; }
  .inline-subscribe-input { width: 100%; }
}

/* 6. Author card on small */
@media (max-width: 480px) {
  .author-card { flex-direction: column; gap: var(--sp-2); }
  .author-card-avatar { width: 40px; height: 40px; }
}

/* 7. Share buttons on small */
@media (max-width: 480px) {
  .article-share { flex-wrap: wrap; }
  .share-btn { font-size: 0.75rem; padding: 5px 10px; }
}

/* 8. Featured hero cards on very small */
@media (max-width: 400px) {
  .fh-primary { min-height: 240px; }
  .fh-primary-title { font-size: 1.25rem; }
  .fh-single-body { padding: var(--sp-2) var(--sp-2); }
  .fh-secondary-body { padding: var(--sp-2); }
}

/* 9. Post navigation on mobile already handled — just ensure wrapping */
@media (max-width: 380px) {
  .post-nav-link { padding: var(--sp-1) var(--sp-1); }
  .post-nav-title { font-size: 0.82rem; }
}

/* 10. Home sidebar responsive — make most-read horizontal on tablet */
@media (max-width: 900px) and (min-width: 561px) {
  .home-sidebar {
    grid-template-columns: 1fr 1fr;
  }
}

/* 11. Filter tabs — ensure they don't overflow */
.tag-filter-bar {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.tag-filter-bar::-webkit-scrollbar { display: none; }


/* ── DARK MODE — new elements ──────────────────────────────── */
:root[data-theme="dark"] .footer-subscribe-input,
:root.dark-mode .footer-subscribe-input {
  background: var(--color-hover);
}

:root[data-theme="dark"] .related-post-card,
:root.dark-mode .related-post-card {
  background: var(--color-hover);
}

:root[data-theme="dark"] .post-nav-link,
:root.dark-mode .post-nav-link {
  background: var(--color-hover);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .footer-subscribe-input { background: var(--color-hover); }
  :root:not([data-theme="light"]) .related-post-card { background: var(--color-hover); }
  :root:not([data-theme="light"]) .post-nav-link { background: var(--color-hover); }
}

/* ============================================================
   WIRING PASS — previously defined-but-unwired settings
   ============================================================ */

/* ── Centered navigation layout ─────────────────────────── */
.site-header.nav-centered .header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.site-header.nav-centered .header-nav--left {
  display: flex;
  gap: var(--sp-1);
  justify-content: flex-start;
}

.site-header.nav-centered .site-brand--center {
  justify-content: center;
}

.site-header.nav-centered .header-right {
  justify-content: flex-end;
}

/* Hide main site-brand on centered layout (it's already in the grid) */
.site-header.nav-centered .site-brand { display: none; }
.site-header.nav-centered .site-brand--center { display: flex; }

@media (max-width: 640px) {
  .site-header.nav-centered .header-inner {
    grid-template-columns: 1fr auto;
  }
  .site-header.nav-centered .header-nav--left { display: none; }
}


/* ── Search button in nav ───────────────────────────────── */
.nav-search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--color-border);
  background: none;
  color: var(--color-muted);
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}

.nav-search-btn:hover {
  color: var(--color-text);
  border-color: var(--color-text);
  background: var(--color-hover);
}


/* ── Search overlay ─────────────────────────────────────── */
.search-overlay {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  padding: var(--sp-2) var(--sp-3);
}

.search-overlay[hidden] { display: none; }

.search-inner {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  max-width: var(--max-width-wide);
  margin: 0 auto;
}

.search-input {
  flex: 1;
  padding: 10px 16px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 1rem;
  background: var(--color-bg);
  color: var(--color-text);
  outline: none;
  transition: border-color var(--transition);
}

.search-input:focus { border-color: var(--color-text); }
.search-input::placeholder { color: var(--color-muted); }

.search-close {
  width: 34px;
  height: 34px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: none;
  color: var(--color-muted);
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}

.search-close:hover {
  color: var(--color-text);
  border-color: var(--color-text);
}

.search-results {
  max-width: var(--max-width-wide);
  margin: var(--sp-2) auto 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 10px var(--sp-2);
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  text-decoration: none;
}

.search-result-item:hover { background: var(--color-hover); }

.search-result-title {
  font-size: 0.9rem;
  font-family: var(--font-serif);
  font-weight: 500;
  color: var(--color-text);
}

.search-result-tag {
  font-size: 0.7rem;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.search-empty {
  font-size: 0.86rem;
  color: var(--color-muted);
  padding: var(--sp-2);
  text-align: center;
}


/* ── Hero background image ──────────────────────────────── */
/* (CSS rules already added in v2 block above — this ensures min-height) */
.site-hero--with-bg {
  min-height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-10) var(--sp-3);
}

.site-hero--with-bg .container {
  position: relative;
  z-index: 2;
}

.site-hero--with-bg .hero-title,
.site-hero--with-bg .hero-description {
  text-shadow: 0 1px 8px rgba(0,0,0,0.25);
}

@media (max-width: 640px) {
  .site-hero--with-bg { min-height: 300px; padding: var(--sp-8) var(--sp-4) var(--sp-10); }
  .site-hero--with-bg .container { padding-left: var(--sp-3); padding-right: var(--sp-3); }
  .site-hero--with-bg .hero-title { font-size: 2rem; }
  .site-hero--with-bg .hero-description { font-size: 1rem; }
  .site-hero--with-bg .article-meta { font-size: 0.88rem; padding-left: var(--sp-3); }
}


/* ── Tag section grid adapts to card count ──────────────── */
/* 2-col override */
#tag-sections-root[data-count="2"] .tag-section-cards {
  grid-template-columns: repeat(2, 1fr);
}

/* 4-col on wide screens */
#tag-sections-root[data-count="4"] .tag-section-cards {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 860px) {
  #tag-sections-root[data-count="4"] .tag-section-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  #tag-sections-root[data-count="2"] .tag-section-cards,
  #tag-sections-root[data-count="4"] .tag-section-cards {
    grid-template-columns: 1fr;
  }
}


/* ============================================================
   COMPREHENSIVE RESPONSIVE PASS
   All breakpoints: 1024 / 860 / 640 / 480 / 380
   ============================================================ */

/* ── 1024px — wide desktop edge cases ───────────────────── */
@media (max-width: 1024px) {
  /* Sidebar layout — tighten up */
  .home-with-sidebar { max-width: 100%; }

  /* Tag section wide cards */
  .tag-section-cards { gap: var(--sp-2); }

  /* Featured hero 3 — reduce top card height */
  .featured-hero--three .fh-primary--wide { min-height: 320px; }
}


/* ── 860px — tablet landscape ───────────────────────────── */
@media (max-width: 860px) {

  /* Post article — narrower container padding */
  .article-header .container,
  .article-content.container { padding: 0 var(--sp-3); }

  /* TOC: collapse sidebar into sticky top strip */
  .toc-outer {
    grid-template-columns: 1fr;
    padding: var(--sp-3) var(--sp-3) var(--sp-6);
  }

  .toc-sidebar {
    position: sticky;
    top: calc(var(--nav-height) + 4px);
    z-index: 10;
    background: var(--color-bg);
    border-right: none;
    border-bottom: 1px solid var(--color-border);
    padding: var(--sp-2) 0;
    overflow-x: auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--sp-2);
    padding-right: var(--sp-3);
    scrollbar-width: none;
  }

  .toc-sidebar::-webkit-scrollbar { display: none; }

  .toc-sidebar .toc-header {
    font-size: 0.62rem;
    white-space: nowrap;
    flex-shrink: 0;
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
    border-right: 1px solid var(--color-border);
    padding-right: var(--sp-2);
  }

  .toc-sidebar .toc-links {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 2px;
  }

  .toc-sidebar .toc-link {
    border-left: none;
    border-bottom: 2px solid transparent;
    padding: 4px 10px;
    white-space: nowrap;
    font-size: 0.78rem;
  }

  .toc-sidebar .toc-link.active {
    border-bottom-color: var(--color-accent);
    border-left: none;
    background: none;
  }

  .toc-sidebar .toc-link--h3 {
    padding-left: 10px;
    font-size: 0.75rem;
  }

  .toc-body { padding-left: 0; margin-top: var(--sp-4); }

  /* Sidebar post template — stack */
  .sidebar-layout {
    grid-template-columns: 1fr;
    max-width: 680px;
  }

  .sidebar {
    position: static;
    max-height: none;
    overflow: visible;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-3);
    border-top: 1px solid var(--color-border);
    padding-top: var(--sp-4);
  }
}


/* ── 640px — tablet portrait / large phone ──────────────── */
@media (max-width: 640px) {

  /* Root font size */
  html { font-size: 18px; }

  /* Nav: already hides desktop links, show hamburger */
  .header-nav { display: none; }
  .mobile-menu-toggle { display: flex; }
  .nav-divider { display: none; }
  /* Hide subscribe btn in nav on mobile (in drawer) */
  .header-right > .btn { display: none; }

  /* Hero */
  .site-hero { padding: 64px var(--sp-4) 64px; }
  .hero-title { font-size: 1.6rem; }
  .hero-logo { width: 52px; height: 52px; }

  /* Featured heroes: stack */
  .featured-hero--two,
  .featured-hero--three {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }
  .featured-hero--three .fh-primary--wide { grid-column: 1; }
  .fh-primary { min-height: 300px; }
  .fh-secondary { border-left: none; border-top: 1px solid var(--color-border); }
  .featured-hero--three .fh-secondary--card:last-child { border-left: none; }

  /* Single featured — stack */
  .fh-single-inner { grid-template-columns: 1fr; }
  .fh-single-image-wrap, .fh-single-img-placeholder { width: 100%; min-height: 200px; order: -1; }

  /* Inline subscribe */
  .inline-subscribe-inner { flex-direction: column; gap: 10px; }
  .inline-subscribe-form { flex-direction: column; }
  .inline-subscribe-input { width: 100%; }

  /* Post article */
  .article-title { font-size: 1.6rem; }
  .article-hero-image { border-radius: var(--radius-sm); }

  /* Share buttons */
  .article-share { flex-wrap: wrap; gap: 6px; }
  .share-btn { font-size: 0.75rem; padding: 5px 10px; }

  /* Author card */
  .author-card { flex-direction: column; gap: var(--sp-2); }

  /* Post navigation */
  .post-navigation { grid-template-columns: 1fr; }
  .post-nav-next { text-align: left; }

  /* Related posts */
  .related-posts-grid { grid-template-columns: 1fr 1fr; }

  /* Subscribe box */
  .subscribe-form { flex-direction: column; gap: 8px; }
  .subscribe-input { width: 100%; }

  /* TOC template — full single column */
  .toc-outer { padding: var(--sp-2); }

  /* Sidebar post template */
  .sidebar { grid-template-columns: 1fr; }
  .sidebar-progress-widget { display: none; }

  /* Footer */
  .site-footer .footer-inner {
    grid-template-columns: 1fr;
    grid-template-areas: "brand" "nav" "subscribe" "copy";
  }
  .footer-subscribe-form { flex-direction: column; }
  .footer-subscribe-input { width: 100%; }

  /* Home sidebar — stacks already via existing rule; clean up widgets */
  .home-sidebar { padding: var(--sp-3); }

  /* Tag sections */
  .tag-section-cards { grid-template-columns: 1fr 1fr; gap: 12px; }
  .ts-card-image { height: 120px; }
  .ts-card-image-placeholder { height: 120px; }
}


/* ── 480px — phone ──────────────────────────────────────── */
@media (max-width: 480px) {

  html { font-size: 16px; }

  /* Hero */
  .hero-title { font-size: 1.45rem; }
  .hero-description { font-size: 0.9rem; }
  .site-hero { padding: 56px var(--sp-3) 56px; }

  /* Featured primary */
  .fh-primary { min-height: 260px; }
  .fh-primary-title { font-size: 1.25rem; }
  .fh-primary-excerpt { display: none; }

  /* Tag sections */
  .tag-section-cards { grid-template-columns: 1fr; }
  .tag-section { padding: var(--sp-3) 0; }

  /* Related posts */
  .related-posts-grid { grid-template-columns: 1fr; }

  /* Post nav */
  .post-nav-link { padding: var(--sp-1); }
  .post-nav-title { font-size: 0.82rem; }

  /* Inline subscribe */
  .inline-sub-inner { flex-direction: column; }

  /* Article */
  .article-title { font-size: 1.4rem; }
  .article-byline { flex-wrap: wrap; gap: var(--sp-1); }
}


/* ── 380px — small phone ─────────────────────────────────── */
@media (max-width: 380px) {

  html { font-size: 15px; }

  .hero-title { font-size: 1.3rem; }
  .article-title { font-size: 1.25rem; }

  .fh-primary { min-height: 220px; }
  .fh-primary-title { font-size: 1.1rem; }

  /* Sidebar widget subscribe */
  .hs-widget--subscribe { padding: var(--sp-2); }

  /* Search input */
  .search-input { font-size: 0.9rem; }
}


/* ── Dark mode — new elements ───────────────────────────── */
:root[data-theme="dark"] .search-overlay,
:root.dark-mode .search-overlay {
  background: #1a1a16;
  border-color: var(--color-border);
}

:root[data-theme="dark"] .search-input,
:root.dark-mode .search-input {
  background: var(--color-hover);
  border-color: var(--color-border);
}

:root[data-theme="dark"] .toc-sidebar,
:root.dark-mode .toc-sidebar {
  background: #141412;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .search-overlay { background: #1a1a16; }
  :root:not([data-theme="light"]) .search-input { background: var(--color-hover); }
  :root:not([data-theme="light"]) .toc-sidebar { background: #141412; }
}

/* ============================================================
   GHOST KOENIG EDITOR — Required card width classes
   ============================================================ */

.gh-content .kg-width-wide {
  position: relative;
  width: 85vw;
  min-width: 100%;
  margin: var(--sp-4) calc(50% - 42.5vw);
}

.gh-content .kg-width-full {
  position: relative;
  width: 100vw;
  min-width: 100%;
  margin: var(--sp-4) calc(50% - 50vw);
}

/* Koenig card base styles */
.gh-content .kg-card { margin: var(--sp-4) 0; }
.gh-content .kg-image { max-width: 100%; height: auto; border-radius: var(--radius-sm); }
.gh-content .kg-image-card { margin: var(--sp-4) 0; }
.gh-content .kg-image-card figcaption {
  text-align: center;
  font-size: 0.8rem;
  color: var(--color-muted);
  margin-top: 8px;
}

.gh-content .kg-gallery-card { margin: var(--sp-4) 0; }
.gh-content .kg-gallery-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.gh-content .kg-gallery-row {
  display: flex;
  gap: 4px;
}
.gh-content .kg-gallery-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: var(--radius-sm);
}

.gh-content .kg-bookmark-card { margin: var(--sp-4) 0; }
.gh-content .kg-bookmark-container {
  display: flex;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  text-decoration: none;
  background: var(--color-bg);
  transition: box-shadow var(--transition);
}
.gh-content .kg-bookmark-container:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.08); }
.gh-content .kg-bookmark-content { padding: 20px; flex: 1; min-width: 0; }
.gh-content .kg-bookmark-title { font-weight: 500; color: var(--color-text); margin-bottom: 4px; }
.gh-content .kg-bookmark-description { font-size: 0.85rem; color: var(--color-muted); margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gh-content .kg-bookmark-metadata { display: flex; align-items: center; gap: 8px; }
.gh-content .kg-bookmark-icon { width: 16px; height: 16px; }
.gh-content .kg-bookmark-publisher { font-size: 0.75rem; color: var(--color-muted); }
.gh-content .kg-bookmark-thumbnail { width: 160px; flex-shrink: 0; }
.gh-content .kg-bookmark-thumbnail img { width: 100%; height: 100%; object-fit: cover; display: block; }

.gh-content .kg-callout-card {
  display: flex;
  gap: 16px;
  padding: 20px;
  border-radius: var(--radius-md);
  background: var(--color-hover);
  border-left: 3px solid var(--color-accent, #1a1a18);
  margin: var(--sp-4) 0;
}
.gh-content .kg-callout-emoji { font-size: 1.4rem; flex-shrink: 0; }
.gh-content .kg-callout-text { font-size: 0.95rem; line-height: 1.7; }

.gh-content .kg-toggle-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin: var(--sp-4) 0;
  overflow: hidden;
}
.gh-content .kg-toggle-heading { padding: 16px 20px; font-weight: 500; cursor: pointer; }
.gh-content .kg-toggle-content { padding: 0 20px 16px; font-size: 0.95rem; line-height: 1.7; }

.gh-content .kg-video-card { margin: var(--sp-4) 0; }
.gh-content .kg-video-card video { width: 100%; border-radius: var(--radius-sm); }

.gh-content .kg-audio-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin: var(--sp-4) 0;
}

.gh-content .kg-product-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin: var(--sp-4) 0;
}

.gh-content .kg-hr { border: none; border-top: 1px solid var(--color-border); margin: var(--sp-6) 0; }

/* Responsive Koenig */
@media (max-width: 640px) {
  .gh-content .kg-width-wide,
  .gh-content .kg-width-full {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
  }
  .gh-content .kg-bookmark-thumbnail { display: none; }
}

/* ═══════════════════════════════════════════════════════════
   PATENTS PAGE TEMPLATE
   ═══════════════════════════════════════════════════════════ */

.patents-main {
  padding-bottom: var(--sp-12);
}

/* ── Hero stat bar ── */
.pat-hero {
  border-bottom: 1px solid var(--color-border);
  padding: var(--sp-8) 0 var(--sp-6);
}

.pat-hero-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-6);
  flex-wrap: wrap;
}

.pat-hero-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--sp-1);
}

.pat-hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0;
}

.pat-stats {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  flex-shrink: 0;
}

.pat-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.pat-stat-num {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 500;
  line-height: 1;
  color: var(--color-text);
  letter-spacing: -0.04em;
}

.pat-stat-label {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--color-muted);
  white-space: nowrap;
}

.pat-stat-divider {
  width: 1px;
  height: 40px;
  background: var(--color-border);
}

/* ── Filter tabs ── */
.pat-filter-wrap {
  padding: var(--sp-4) 0;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--sp-6);
}

.pat-filters {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
}

.pat-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1.5px solid var(--color-border);
  border-radius: 100px;
  background: transparent;
  color: var(--color-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.pat-filter:hover {
  border-color: var(--color-text);
  color: var(--color-text);
}

.pat-filter.active {
  background: var(--color-text);
  border-color: var(--color-text);
  color: var(--color-bg);
}

.pat-filter-count {
  font-size: 0.7rem;
  opacity: 0.6;
}

.pat-filter.active .pat-filter-count {
  opacity: 0.7;
}

/* ── Patent card grid ── */
.pat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--sp-4);
}

.pat-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  transition: border-color var(--transition), box-shadow var(--transition);
  animation: fadeUp 0.3s ease both;
}

.pat-card:hover {
  border-color: var(--color-muted);
  box-shadow: 0 4px 24px rgba(0,0,0,0.07);
}

.pat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pat-id {
  font-family: 'Courier New', monospace;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--color-muted);
  background: var(--color-hover);
  padding: 3px 8px;
  border-radius: 4px;
}

.pat-year {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-accent);
  letter-spacing: 0.04em;
}

.pat-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--color-text);
  margin: 4px 0 0;
  flex: 1;
}

.pat-abstract {
  font-size: 0.82rem;
  color: var(--color-muted);
  line-height: 1.6;
  margin: 0;
}

.pat-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: var(--sp-2);
  border-top: 1px solid var(--color-border);
}

.pat-owner {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
}

.pat-owner--quest {
  background: rgba(74, 154, 217, 0.12);
  color: #4a9ad9;
}

.pat-owner--edjx {
  background: rgba(100, 180, 130, 0.12);
  color: #44a066;
}

:root[data-theme="dark"] .pat-owner--quest {
  background: rgba(74, 154, 217, 0.18);
  color: #6ab4e8;
}

:root[data-theme="dark"] .pat-owner--edjx {
  background: rgba(100, 180, 130, 0.18);
  color: #66c488;
}

.pat-dates {
  font-size: 0.72rem;
  color: var(--color-muted);
  margin-left: auto;
}

.pat-pdf {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-muted);
  text-decoration: none;
  transition: color var(--transition);
  letter-spacing: 0.01em;
}

.pat-pdf:hover {
  color: var(--color-text);
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .pat-hero-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .pat-stats {
    gap: var(--sp-3);
  }

  .pat-stat-num {
    font-size: 1.5rem;
  }

  .pat-grid {
    grid-template-columns: 1fr;
  }
}


/* ── Hide Ghost portal floating trigger button ───────────── */
/* Ghost injects a floating "Subscribe Now" / "Sign in" button via portal.js.
   We have our own subscribe CTAs so this is redundant. */
.gh-portal-triggerbtn,
iframe.gh-portal-triggerbtn-iframe {
  display: none !important;
}

/* ── Most Read skeleton loading state ───────────────────── */
.hs-skeleton { opacity: 0.5; pointer-events: none; }
.hs-skel-line {
  display: block;
  height: 0.8em;
  background: var(--color-border);
  border-radius: 4px;
  margin-bottom: 4px;
  animation: shimmer 1.4s ease infinite;
}
@keyframes shimmer {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.9; }
}
