/* Modern blog system. Readability, contrast, whitespace, and limited navigation follow
   the user-provided IxDF, WCAG, UsabilityGeek, and navigation best-practice references. */
:root {
  color-scheme: light;
  --bg: #f8faf7;
  --surface: #ffffff;
  --surface-soft: #eef5ef;
  --surface-warm: #fff8ef;
  --ink: #101513;
  --muted: #3f4d45;
  --subtle: #58665e;
  --border: #d9e4dd;
  --border-strong: #bfd0c6;
  --green: #1f6b49;
  --green-dark: #164b35;
  --amber: #8f5614;
  --blue: #2563eb;
  --clay: #a34f37;
  --shadow: 0 22px 55px rgba(18, 35, 27, 0.11);
  --shadow-soft: 0 12px 32px rgba(18, 35, 27, 0.08);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --font-body: Inter, Lato, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: "Source Serif 4", "Fraunces", ui-serif, serif;
  --space: clamp(1rem, 2vw, 1.5rem);
  --max: 1180px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c1110;
  --surface: #121a17;
  --surface-soft: #19241f;
  --surface-warm: #211b14;
  --ink: #f5faf6;
  --muted: #bfcbc4;
  --subtle: #91a097;
  --border: #2a3932;
  --border-strong: #3c5147;
  --green: #62c88f;
  --green-dark: #94e6b4;
  --amber: #f3bf63;
  --blue: #8bb6ff;
  --clay: #ff9a82;
  --shadow: 0 22px 55px rgba(0, 0, 0, 0.38);
  --shadow-soft: 0 12px 32px rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 110px;
  overflow-x: clip;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 12% 0%, rgba(31, 107, 73, 0.08), transparent 28rem),
    linear-gradient(180deg, #fbfcf8 0%, var(--bg) 45%, #f2f6f2 100%);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

:root[data-theme="dark"] body {
  background:
    radial-gradient(circle at 15% 0%, rgba(98, 200, 143, 0.12), transparent 28rem),
    linear-gradient(180deg, #0b100e 0%, var(--bg) 48%, #101713 100%);
}

body.menu-open {
  overflow: hidden;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--green-dark);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.22em;
}

a:hover {
  color: var(--clay);
}

button,
input,
select,
textarea {
  font: inherit;
}

:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.75);
  outline-offset: 3px;
}

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

.skip-link {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: 1000;
  transform: translateY(-150%);
  background: var(--ink);
  color: white;
  padding: 0.7rem 1rem;
  border-radius: 999px;
}

.skip-link:focus {
  transform: translateY(0);
}

.reading-progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 120;
  height: 4px;
  transform-origin: left;
  transform: scaleX(var(--progress, 0));
  background: linear-gradient(90deg, var(--green), var(--amber));
  opacity: 0;
  transition: opacity 160ms ease;
}

.reading-progress.is-visible {
  opacity: 1;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  width: min(var(--max), calc(100% - 2rem));
  margin: 1rem auto 0;
  padding: 0.7rem;
  border: 1px solid rgba(217, 228, 221, 0.9);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

:root[data-theme="dark"] .site-header,
:root[data-theme="dark"] .mobile-menu,
:root[data-theme="dark"] .resources-menu-panel {
  background: rgba(18, 26, 23, 0.92);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-width: max-content;
  color: var(--ink);
  text-decoration: none;
}

.brand img,
.footer-logo-lockup img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 14px;
}

.brand strong,
.footer-logo-lockup strong {
  display: block;
  font-size: 1rem;
  line-height: 1.1;
}

.brand small,
.footer-logo-lockup small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.nav-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.25rem;
}

.nav-links a,
.resources-menu summary,
.mobile-menu a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.55rem 0.82rem;
  color: var(--muted);
  font-weight: 750;
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a[aria-current="page"],
.resources-menu summary:hover,
.resources-menu summary[aria-current="page"],
.mobile-menu a:hover,
.mobile-menu a[aria-current="page"] {
  background: var(--surface-soft);
  color: var(--ink);
}

.resources-menu {
  position: relative;
}

.resources-menu summary {
  list-style: none;
  cursor: pointer;
}

.resources-menu summary::-webkit-details-marker {
  display: none;
}

.resources-menu summary::after {
  content: "⌄";
  margin-left: 0.35rem;
  color: var(--subtle);
  font-size: 0.85rem;
}

.resources-menu-panel {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  z-index: 105;
  display: grid;
  gap: 0.25rem;
  min-width: 220px;
  padding: 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.resources-menu:not([open]) .resources-menu-panel {
  display: none;
}

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.15rem;
}

.header-search,
.search-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.compact-search {
  position: relative;
  width: 56px;
  justify-content: flex-end;
  transition: width 180ms ease;
}

.compact-search.is-expanded,
.compact-search:focus-within {
  width: min(360px, 38vw);
}

.header-search input,
.search-box input,
.newsletter input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fbfdfb;
  color: var(--ink);
  padding: 0.75rem 1rem;
}

:root[data-theme="dark"] .header-search input,
:root[data-theme="dark"] .search-box input,
:root[data-theme="dark"] .newsletter input {
  background: #0f1713;
  border-color: var(--border-strong);
}

.compact-search input,
.compact-search .search-submit {
  width: 0;
  min-width: 0;
  opacity: 0;
  pointer-events: none;
  padding-inline: 0;
  border-width: 0;
}

.compact-search.is-expanded input,
.compact-search:focus-within input {
  width: 100%;
  min-width: 170px;
  opacity: 1;
  pointer-events: auto;
  padding: 0.75rem 1rem;
  border-width: 1px;
}

.compact-search.is-expanded .search-submit,
.compact-search:focus-within .search-submit {
  width: auto;
  opacity: 1;
  pointer-events: auto;
  padding: 0.75rem 0.95rem;
}

.header-search button,
.newsletter button,
.btn,
.filter-panel button,
.menu-button,
.theme-toggle,
.mobile-theme-toggle,
.back-to-top {
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 850;
}

.header-search button,
.newsletter button,
.btn-primary {
  background: var(--green);
  color: white;
  box-shadow: 0 12px 24px rgba(31, 107, 73, 0.18);
}

.search-icon-button {
  width: 56px;
  min-width: 56px;
  min-height: 56px;
  padding: 0;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--ink);
  box-shadow: none;
  font-size: 1.32rem;
}

.header-search button:hover,
.newsletter button:hover,
.btn-primary:hover {
  background: var(--green-dark);
  color: white;
}

.search-icon-button:hover,
.search-icon-button:focus-visible,
.theme-toggle:hover,
.theme-toggle:focus-visible {
  border-color: var(--border-strong);
  background: #e7f3eb;
  color: var(--ink);
  transform: translateY(-1px);
}

.btn,
.text-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.78rem 1.05rem;
  text-decoration: none;
  max-width: 100%;
  text-align: center;
  white-space: normal;
  line-height: 1.18;
}

.btn-secondary {
  border: 1px solid var(--border-strong);
  background: white;
  color: var(--ink);
}

.menu-button {
  display: none;
}

.theme-toggle,
.mobile-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  min-height: 56px;
  padding: 0.7rem;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--ink);
  box-shadow: none;
}

.theme-toggle span {
  font-size: 1.32rem;
  line-height: 1;
}

.mobile-theme-toggle {
  width: 100%;
  color: var(--muted);
  font-weight: 850;
}

.mobile-menu {
  position: fixed;
  inset: auto 1rem 1rem;
  z-index: 160;
  display: grid;
  gap: 0.4rem;
  max-height: min(78vh, 620px);
  overflow: auto;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

:root[data-theme="dark"] .menu-button,
:root[data-theme="dark"] .theme-toggle,
:root[data-theme="dark"] .mobile-theme-toggle,
:root[data-theme="dark"] .btn-secondary,
:root[data-theme="dark"] .filter-panel button,
:root[data-theme="dark"] .filter-field select,
:root[data-theme="dark"] .feed-search input,
:root[data-theme="dark"] .frequency-options label,
:root[data-theme="dark"] .empty-state {
  background: var(--surface-soft);
  color: var(--ink);
}

.mobile-menu[hidden] {
  display: none !important;
}

.mobile-menu p {
  margin: 0.6rem 0 0.1rem;
  color: var(--subtle);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.page-shell {
  width: min(var(--max), calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 4.5rem) 0;
}

.hero,
.page-hero,
.newsletter-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.75fr);
  gap: clamp(1.2rem, 4vw, 3rem);
  align-items: center;
  margin-bottom: clamp(2rem, 5vw, 4rem);
}

.page-hero,
.newsletter-hero {
  padding: clamp(1.5rem, 4vw, 3rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.75);
  box-shadow: var(--shadow-soft);
}

.hero {
  min-height: 52vh;
}

.hero,
.hero-copy,
.hero-panel,
.hero-newsletter {
  min-width: 0;
}

.hero h1,
.page-hero h1,
.newsletter-hero h1,
.detail-header h1 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: clamp(2.6rem, 8vw, 6.8rem);
  line-height: 0.96;
  letter-spacing: -0.055em;
}

.page-hero h1,
.newsletter-hero h1 {
  font-size: clamp(2.2rem, 6vw, 4.8rem);
}

.detail-header h1 {
  font-size: clamp(2.35rem, 6.5vw, 5.2rem);
}

.hero p,
.page-hero p,
.newsletter-hero p,
.detail-header > p {
  max-width: 68ch;
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  overflow-wrap: anywhere;
}

.eyebrow {
  margin: 0 0 0.55rem;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero-actions,
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.hero-newsletter {
  margin-top: 1.25rem;
  max-width: 640px;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-soft);
}

.hero-newsletter > label,
.newsletter-signup-form > label {
  display: block;
  margin-bottom: 0.55rem;
  color: var(--ink);
  font-weight: 900;
}

.hero-panel,
.hero-brief-card,
.trust-strip,
.newsletter-cta,
.section-panel,
.start-here-panel,
.brief-at-glance,
.verification-panel,
.source-footnote-section,
.topic-primer {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.hero-panel {
  padding: clamp(1.25rem, 3vw, 2rem);
}

.hero-brief-card {
  display: grid;
  gap: 0.55rem;
  align-content: center;
  padding: clamp(1.15rem, 3vw, 1.8rem);
  background:
    radial-gradient(circle at 12% 18%, rgba(31, 107, 73, 0.1), transparent 12rem),
    var(--surface);
}

.hero-brief-card strong {
  display: block;
  max-width: 18ch;
  font-size: clamp(1.6rem, 3vw, 2.35rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.hero-brief-card p {
  margin: 0;
  color: var(--muted);
}

.hero-panel strong {
  display: block;
  margin-bottom: 0.75rem;
  font-size: 1.2rem;
}

.hero-panel ul,
.newsletter-cta ul,
.brief-at-glance ul,
.detail-section ul,
.prose-page ul {
  padding-left: 1.25rem;
}

.content-section {
  margin-top: clamp(2.5rem, 6vw, 5rem);
}

.section-panel {
  padding: clamp(1.1rem, 3vw, 2rem);
}

.latest-section {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), var(--surface));
}

.feed-section,
.best-of-section {
  background: linear-gradient(180deg, rgba(238, 245, 239, 0.72), rgba(255, 255, 255, 0.92));
}

.browse-section {
  background: linear-gradient(180deg, rgba(255, 248, 239, 0.86), rgba(255, 255, 255, 0.92));
}

.section-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1.1rem;
}

.section-header h2,
.content-section h2,
.article-main h2,
.prose-page h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.section-header p {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.latest-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.85fr);
  gap: 1rem;
}

.lead-card,
.post-card,
.secondary-card,
.topic-card,
.archive-card,
.related-card,
.feature-card,
.best-of-card,
.sample-digest-preview article,
.newsletter-signup-card,
.newsletter-value-grid article {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.lead-card {
  overflow: hidden;
}

.lead-card-copy,
.post-card-body,
.secondary-card,
.topic-card,
.archive-card,
.related-card,
.feature-card,
.best-of-card,
.sample-digest-preview article,
.newsletter-signup-card,
.newsletter-value-grid article {
  padding: clamp(1rem, 2.5vw, 1.45rem);
}

.lead-card-copy {
  padding: clamp(1.2rem, 3vw, 2rem);
}

.post-card {
  display: grid;
  overflow: hidden;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.best-of-carousel {
  position: relative;
}

.best-of-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(280px, 33%);
  grid-template-columns: none;
  gap: 1rem;
  overflow-x: auto;
  padding: 0.25rem 0.25rem 0.75rem;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}

.best-of-card {
  display: grid;
  min-width: 0;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  scroll-snap-align: start;
}

.best-of-card-body {
  padding: 1rem;
}

.best-of-card h3 {
  margin: 0.75rem 0 0.5rem;
  font-size: 1.25rem;
  line-height: 1.15;
}

.best-of-card h3 a {
  color: var(--ink);
  text-decoration: none;
}

.carousel-control {
  position: absolute;
  top: 44%;
  z-index: 2;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
  color: var(--ink);
  cursor: pointer;
  font-size: 1.7rem;
  font-weight: 900;
}

.carousel-prev {
  left: -0.6rem;
}

.carousel-next {
  right: -0.6rem;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.45rem;
}

.carousel-dots span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--border-strong);
}

.carousel-dots span.active {
  width: 22px;
  background: var(--green);
}

.secondary-stack {
  display: grid;
  gap: 1rem;
}

.post-card h3,
.secondary-card h3,
.lead-card h2,
.archive-card h2 {
  margin: 0.75rem 0 0.55rem;
  line-height: 1.12;
  letter-spacing: -0.025em;
}

.lead-card h2 {
  font-size: clamp(2rem, 5vw, 4rem);
}

.post-card h3,
.secondary-card h3 {
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.post-card h3 a,
.secondary-card h3 a,
.lead-card h2 a,
.archive-card h2 a {
  color: var(--ink);
  text-decoration: none;
}

.post-card p,
.secondary-card p,
.lead-card p,
.archive-card p,
.topic-card p,
.related-card p {
  color: var(--muted);
}

.meta-row,
.article-kicker-row,
.trust-note,
.hero-facts,
.card-topline,
.newsletter-benefit-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.topic-badge,
.verification-badge,
.meta-row span,
.trust-note span,
.hero-facts span,
.footer-trust-row span,
.newsletter-benefit-row span,
.term-chip-row a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--ink);
  padding: 0.32rem 0.62rem;
  font-size: 0.84rem;
  font-weight: 800;
}

.topic-badge {
  background: #e6f4ec;
  border-color: #b7dbc7;
  color: var(--green-dark);
  text-decoration: none;
}

.verification-badge {
  color: var(--green-dark);
}

.why-card,
.why-box {
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid #ead8b4;
  border-radius: var(--radius-sm);
  background: var(--surface-warm);
}

.why-card strong,
.why-box span {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--amber);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.date-ledger,
.detail-meta,
.verification-panel dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}

.date-ledger div,
.detail-meta div,
.verification-panel dl div {
  padding: 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

dt {
  color: var(--subtle);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

dd {
  margin: 0.15rem 0 0;
  font-weight: 750;
}

.filter-panel {
  display: grid;
  gap: 0.9rem;
  margin: 1rem 0 1.25rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.78);
}

.unified-filter-bar {
  grid-template-columns: minmax(160px, 0.7fr) minmax(150px, 0.6fr) minmax(180px, 1fr) auto;
  align-items: end;
}

.filter-field,
.feed-search {
  display: grid;
  gap: 0.35rem;
}

.filter-field span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 850;
}

.filter-field select,
.feed-search input {
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fbfdfb;
  color: var(--ink);
  padding: 0.72rem 0.95rem;
}

.feed-search {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
}

.feed-search-toggle {
  width: 48px;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
}

.feed-search input {
  width: 0;
  min-width: 0;
  opacity: 0;
  pointer-events: none;
  padding-inline: 0;
  border-width: 0;
  transition: opacity 160ms ease, width 160ms ease;
}

.feed-search.is-expanded input,
.feed-search:focus-within input {
  width: 100%;
  min-width: 220px;
  opacity: 1;
  pointer-events: auto;
  padding: 0.72rem 0.95rem;
  border-width: 1px;
}

.filter-panel .topic-filter-row + .topic-filter-row {
  border-top: 1px solid var(--border);
  padding-top: 0.8rem;
}

:root[data-theme="dark"] .page-hero,
:root[data-theme="dark"] .newsletter-hero,
:root[data-theme="dark"] .filter-panel,
:root[data-theme="dark"] .article-toc,
:root[data-theme="dark"] .hero-panel,
:root[data-theme="dark"] .trust-strip,
:root[data-theme="dark"] .section-panel,
:root[data-theme="dark"] .hero-newsletter,
:root[data-theme="dark"] .newsletter-cta,
:root[data-theme="dark"] .start-here-panel,
:root[data-theme="dark"] .brief-at-glance,
:root[data-theme="dark"] .verification-panel,
:root[data-theme="dark"] .source-footnote-section,
:root[data-theme="dark"] .topic-primer {
  background: rgba(18, 26, 23, 0.84);
}

.topic-filter-row {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.2rem;
}

.filter-panel button {
  min-width: max-content;
  padding: 0.65rem 0.95rem;
  border: 1px solid var(--border);
  background: white;
  color: var(--muted);
}

:root[data-theme="dark"] .filter-panel button.active,
:root[data-theme="dark"] .filter-panel button[aria-pressed="true"] {
  background: var(--ink);
  color: #0d1411;
}

.filter-panel button.active,
.filter-panel button[aria-pressed="true"] {
  background: var(--ink);
  color: white;
}

.load-more-button {
  display: flex;
  width: fit-content;
  margin: 1.2rem auto 0;
}

.load-more-button[hidden] {
  display: none;
}

.search-inline {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-weight: 750;
}

.search-inline input,
.search-box input {
  border-radius: var(--radius-sm);
}

.topic-grid,
.archive-grid,
.feature-grid,
.related-grid,
.trust-grid,
.newsletter-value-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.topic-card {
  color: inherit;
  text-decoration: none;
}

.topic-card strong,
.related-card strong {
  display: block;
  margin: 0.45rem 0;
  color: var(--ink);
  font-size: 1.2rem;
}

.start-here-panel,
.newsletter-cta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.9fr);
  gap: 1.5rem;
  align-items: center;
  padding: clamp(1.4rem, 4vw, 2.4rem);
}

.newsletter-link-card {
  display: grid;
  gap: 0.75rem;
  align-content: start;
}

.newsletter-row {
  display: flex;
  gap: 0.6rem;
}

.newsletter button {
  padding: 0.75rem 1.1rem;
}

.frequency-options {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 0.9rem 0 0;
  padding: 0;
  border: 0;
}

.frequency-options legend,
.privacy-note,
.form-message {
  width: 100%;
  color: var(--muted);
  font-size: 0.92rem;
}

.frequency-options label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: white;
  font-weight: 800;
}

.article-page {
  max-width: 1040px;
}

.article-main {
  display: grid;
  gap: 1.4rem;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.detail-header {
  display: grid;
  gap: 1rem;
  padding-bottom: 1rem;
}

.article-toc {
  position: sticky;
  top: 92px;
  z-index: 5;
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding: 0.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
}

.article-toc a {
  min-width: max-content;
  border-radius: 999px;
  padding: 0.45rem 0.72rem;
  color: var(--muted);
  font-weight: 800;
  text-decoration: none;
}

.article-toc a:hover {
  background: var(--surface-soft);
  color: var(--ink);
}

.brief-at-glance,
.verification-panel,
.detail-section,
.source-footnote-section {
  padding: clamp(1.1rem, 3vw, 1.75rem);
}

.detail-section {
  border-top: 1px solid var(--border);
}

.detail-section p,
.detail-section li,
.source-footnote-section p,
.prose-page p,
.prose-page li {
  max-width: 760px;
}

.glossary,
.source-list {
  display: grid;
  gap: 0.85rem;
}

.glossary > div,
.source-list li {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: white;
}

:root[data-theme="dark"] .glossary > div,
:root[data-theme="dark"] .source-list li,
:root[data-theme="dark"] .date-ledger div,
:root[data-theme="dark"] .detail-meta div,
:root[data-theme="dark"] .verification-panel dl div,
:root[data-theme="dark"] .why-card,
:root[data-theme="dark"] .why-box {
  background: var(--surface-soft);
}

.source-list {
  padding: 0;
  list-style: none;
}

.source-list a {
  display: block;
  font-weight: 850;
}

.source-list span,
.source-list strong {
  display: inline-block;
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.93rem;
}

.source-list strong {
  margin-left: 0.5rem;
  color: var(--green-dark);
}

.prose-page {
  max-width: 920px;
}

.prose-page section {
  margin-top: 2rem;
}

.newsletter-page .newsletter-hero {
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 0.8fr);
}

.newsletter-signup-card {
  background: var(--surface-warm);
}

.sample-digest-preview {
  margin-top: 2rem;
  display: grid;
  gap: 1rem;
}

.sample-digest-preview h2 {
  margin: 0;
}

.archive-card ol {
  margin: 1rem 0 0;
  padding-left: 1.25rem;
}

.archive-card li + li {
  margin-top: 0.5rem;
}

.archive-card li span {
  color: var(--green);
  font-weight: 850;
  margin-right: 0.35rem;
}

.empty-state {
  padding: 2rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: white;
}

.site-footer {
  width: min(var(--max), calc(100% - 2rem));
  margin: 3rem auto 1rem;
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(420px, 1.18fr);
  gap: 1.25rem;
  padding: clamp(1.2rem, 3vw, 2rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.footer-logo-lockup {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.footer-brand-block p {
  color: var(--muted);
}

.footer-trust-row {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: start;
  gap: 1rem;
}

.footer-links p {
  margin: 0.2rem 0;
  color: var(--subtle);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.footer-links a {
  display: block;
  min-height: 36px;
  color: var(--ink);
  font-weight: 750;
  text-decoration: none;
}

.back-to-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 130;
  width: 52px;
  height: 52px;
  background: var(--ink);
  color: white;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.back-to-top.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

@media (hover: hover) {
  .post-card,
  .lead-card,
  .secondary-card,
  .topic-card,
  .archive-card,
  .related-card {
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
  }

  .post-card:hover,
  .lead-card:hover,
  .secondary-card:hover,
  .topic-card:hover,
  .archive-card:hover,
  .related-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow);
  }

}

@media (max-width: 1040px) {
  .site-header {
    grid-template-columns: auto 1fr auto;
  }

  .nav-links,
  .header-actions {
    display: none;
  }

  .menu-button {
    position: fixed;
    right: 1rem;
    top: 1rem;
    z-index: 170;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border: 1px solid var(--border);
    background: white;
    box-shadow: var(--shadow-soft);
  }

  .menu-icon,
  .menu-icon span {
    display: block;
  }

  .menu-icon {
    width: 22px;
  }

  .menu-icon span {
    height: 2px;
    margin: 5px 0;
    border-radius: 99px;
    background: var(--ink);
  }

  .hero,
  .page-hero,
  .newsletter-hero,
  .latest-layout,
  .start-here-panel,
  .newsletter-cta,
  .site-footer {
    grid-template-columns: 1fr;
  }

  .unified-filter-bar,
  .footer-links {
    grid-template-columns: 1fr;
  }

  .topic-grid,
  .post-grid,
  .archive-grid,
  .feature-grid,
  .related-grid,
  .trust-grid,
  .newsletter-value-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .best-of-grid {
    grid-auto-columns: minmax(260px, 46%);
  }
}

@media (max-width: 720px) {
  body {
    font-size: 16.5px;
  }

  .site-header {
    width: calc(100vw - 1rem);
    margin-top: 0.5rem;
    border-radius: 22px;
  }

  .brand img {
    width: 42px;
    height: 42px;
  }

  .brand small {
    display: none;
  }

  .page-shell,
  .site-footer {
    width: calc(100vw - 1rem);
    max-width: var(--max);
    overflow-x: clip;
  }

  .hero {
    grid-template-columns: 1fr;
    width: 100%;
    max-width: 100%;
    min-height: auto;
    padding-top: 1rem;
  }

  .hero-copy,
  .hero-actions,
  .hero-newsletter {
    width: 100%;
    max-width: 100%;
  }

  .hero p {
    max-width: 100%;
  }

  .hero-brief-card {
    display: none;
  }

  .hero h1 {
    font-size: clamp(2.25rem, 12vw, 3.25rem);
  }

  .post-grid,
  .topic-grid,
  .archive-grid,
  .feature-grid,
  .related-grid,
  .trust-grid,
  .newsletter-value-grid,
  .date-ledger,
  .detail-meta,
  .verification-panel dl {
    grid-template-columns: 1fr;
  }

  .best-of-grid {
    grid-auto-columns: minmax(260px, 86%);
  }

  .carousel-control {
    top: 36%;
  }

  .section-header {
    align-items: start;
    flex-direction: column;
  }

  .newsletter-row,
  .hero-actions,
  .card-actions {
    flex-direction: column;
  }

  .btn,
  .newsletter button,
  .header-search button {
    width: 100%;
  }

  .feed-search {
    grid-template-columns: 1fr;
  }

  .feed-search-toggle {
    display: none;
  }

  .feed-search input {
    width: 100%;
    min-width: 0;
    opacity: 1;
    pointer-events: auto;
    padding: 0.75rem 1rem;
    border-width: 1px;
  }

  .article-toc {
    top: 76px;
    border-radius: var(--radius-sm);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
