/* =========================================================================
   Jornal da IA — editorial design system
   System fonts only (no web fonts / no CDNs — CSP self). Light-first with a
   tasteful prefers-color-scheme: dark variant. Accent green #10b981.
   ========================================================================= */

/* ---------- Design tokens ---------- */
:root {
  /* type */
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  /* brand */
  --accent: #10b981;
  --accent-strong: #059669;
  --accent-ink: #065f46;
  --accent-tint: #ecfdf5;
  --accent-tint-2: #d1fae5;

  /* surfaces — light */
  --bg: #ffffff;
  --bg-soft: #f7f8fa;
  --bg-sunk: #f1f3f5;
  --surface: #ffffff;
  --ink: #0b1220;
  --ink-2: #2b3444;
  --muted: #5b6573;
  --faint: #8a93a1;
  --line: #e6e9ee;
  --line-strong: #d4d9e0;

  --shadow-sm: 0 1px 2px rgba(11, 18, 32, .06), 0 1px 1px rgba(11, 18, 32, .04);
  --shadow-md: 0 6px 22px -10px rgba(11, 18, 32, .22), 0 2px 6px -2px rgba(11, 18, 32, .08);

  --radius: 12px;
  --radius-sm: 8px;
  --maxw: 1180px;
  --measure: 680px;

  --space: clamp(16px, 4vw, 28px);
  --header-h: 60px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0e16;
    --bg-soft: #0e1320;
    --bg-sunk: #11172499;
    --surface: #121826;
    --ink: #f3f5f8;
    --ink-2: #cdd4df;
    --muted: #97a1b0;
    --faint: #6c7686;
    --line: #20283a;
    --line-strong: #2c374d;
    --accent-tint: #0c2a20;
    --accent-tint-2: #103a2c;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 10px 30px -12px rgba(0, 0, 0, .6), 0 2px 8px -2px rgba(0, 0, 0, .5);
  }
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1, "liga" 1;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent-strong); }

h1, h2, h3, h4 { font-family: var(--serif); line-height: 1.18; letter-spacing: -0.012em; color: var(--ink); margin: 0 0 .4em; font-weight: 700; }

::selection { background: var(--accent-tint-2); color: var(--ink); }

:focus-visible {
  outline: 2.5px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

/* Skip link */
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px;
  transition: top .15s ease;
}
.skip-link:focus { top: 12px; }

/* ---------- Layout helpers ---------- */
.wrap, .article-wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--space); }
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--space); }

/* =========================================================================
   Masthead / site header
   ========================================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header > .wrap,
.site-header > .container,
.site-header .masthead {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: var(--header-h);
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--space);
}

/* Brand / logo lockup */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.28rem;
  letter-spacing: -0.02em;
  line-height: 1;
}
.brand:hover { color: var(--ink); }
.brand img, .brand svg { height: 30px; width: auto; display: block; }
.brand .brand-mark { height: 30px; width: 30px; }
/* If brand has a top accent rule, keep it minimal */

/* Primary category navigation */
.masthead-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.masthead-nav::-webkit-scrollbar { display: none; }
.masthead-nav a {
  position: relative;
  flex: 0 0 auto;
  padding: 8px 11px;
  font-size: .9rem;
  font-weight: 600;
  color: var(--ink-2);
  border-radius: 8px;
  white-space: nowrap;
  transition: color .15s ease, background-color .15s ease;
}
.masthead-nav a:hover { color: var(--ink); background: var(--bg-sunk); }
.masthead-nav a[aria-current="page"],
.masthead-nav a.is-active {
  color: var(--accent-strong);
}
.masthead-nav a[aria-current="page"]::after,
.masthead-nav a.is-active::after {
  content: "";
  position: absolute; left: 11px; right: 11px; bottom: 2px;
  height: 2px; border-radius: 2px; background: var(--accent);
}

/* Date stamp + search live at the masthead end */
.masthead-date {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  padding-left: 6px;
  border-left: 1px solid var(--line);
}

/* Mobile nav toggle (hidden on desktop) */
.nav-toggle {
  display: none;
  flex: 0 0 auto;
  margin-left: auto;
  width: 42px; height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  align-items: center; justify-content: center;
}
.nav-toggle svg { width: 20px; height: 20px; }
.nav-toggle:hover { background: var(--bg-sunk); }

/* =========================================================================
   Search form
   ========================================================================= */
.search-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.search-form input[type="search"], .search-form input[type="text"] {
  font: inherit;
  font-size: .92rem;
  width: 100%;
  max-width: 260px;
  padding: 9px 13px;
  color: var(--ink);
  background: var(--bg-soft);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.search-form input::placeholder { color: var(--faint); }
.search-form input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.search-form button {
  font: inherit; font-weight: 600; font-size: .9rem;
  padding: 9px 16px;
  color: #fff; background: var(--accent-strong);
  border: 1px solid transparent; border-radius: 999px;
  cursor: pointer;
  transition: background-color .15s ease, transform .08s ease;
}
.search-form button:hover { background: var(--accent-ink); }
.search-form button:active { transform: translateY(1px); }

/* In the masthead, search is compact; full-width on search pages */
.site-header .search-form { display: none; } /* surfaced on wide screens below */

/* =========================================================================
   HERO — the front-page lead
   ========================================================================= */
main { display: block; }

.hero {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(20px, 4vw, 48px);
  align-items: center;
  padding-block: clamp(26px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}
.hero .hero-cover,
.hero > a:first-child {
  order: 2;
}
.hero-cover {
  display: block;
  position: relative;
  aspect-ratio: 3 / 2;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-sunk);
  box-shadow: var(--shadow-md);
}
.hero-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2,.7,.3,1); }
.hero-cover:hover img { transform: scale(1.035); }

.hero-body { order: 1; min-width: 0; }
.hero .kicker { margin-bottom: 14px; }
.hero h1, .hero .hero-title {
  font-size: clamp(1.9rem, 4.6vw, 3.1rem);
  line-height: 1.06;
  letter-spacing: -0.022em;
  margin: 0 0 .35em;
}
.hero h1 a:hover { color: var(--accent-strong); }
.hero .dek {
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  color: var(--muted);
  font-family: var(--sans);
  max-width: 46ch;
  margin: 0 0 16px;
  line-height: 1.5;
}

/* =========================================================================
   Kicker — category label
   ========================================================================= */
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--sans);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent-strong);
}
.kicker::before {
  content: "";
  width: 16px; height: 2px; border-radius: 2px;
  background: var(--accent);
}
a.kicker:hover { color: var(--accent-ink); }

/* =========================================================================
   Card grid — multi-column "latest"
   ========================================================================= */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: clamp(18px, 2.4vw, 30px);
  padding-block: clamp(20px, 3vw, 32px);
}

.card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
}
.card + .card { /* divider feel handled by gap */ }

.card-cover {
  display: block;
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-sunk);
  margin-bottom: 13px;
  box-shadow: var(--shadow-sm);
}
.card-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s cubic-bezier(.2,.7,.3,1); }
.card:hover .card-cover img { transform: scale(1.04); }

.card .kicker { margin-bottom: 8px; }
.card h2, .card h3, .card .card-title {
  font-size: 1.18rem;
  line-height: 1.22;
  margin: 0 0 6px;
}
.card h3 a:hover, .card h2 a:hover { color: var(--accent-strong); }
.card .dek {
  font-family: var(--sans);
  font-size: .96rem;
  color: var(--muted);
  margin: 0 0 10px;
  line-height: 1.45;
}
.card .byline { margin-top: auto; }

/* =========================================================================
   Cover fallback — attractive green-tinted gradient, title legible
   ========================================================================= */
.cover-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 14px 16px;
  background:
    radial-gradient(120% 120% at 0% 0%, color-mix(in srgb, var(--accent) 32%, transparent) 0%, transparent 55%),
    linear-gradient(135deg, #0b3b30 0%, #0f5c45 42%, #10b981 130%);
  color: #eafff7;
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.18;
  font-size: 1.02rem;
  text-shadow: 0 1px 14px rgba(0, 0, 0, .35);
  overflow: hidden;
}
.cover-fallback::before {
  /* subtle "grain"/grid texture so it reads as designed, not flat */
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(transparent 95%, rgba(255,255,255,.06) 95%),
    linear-gradient(90deg, transparent 95%, rgba(255,255,255,.06) 95%);
  background-size: 22px 22px;
  opacity: .5;
  pointer-events: none;
}
.cover-fallback::after {
  content: "Jornal da IA";
  position: absolute;
  top: 12px; left: 16px;
  font-family: var(--mono);
  font-size: .62rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(234, 255, 247, .8);
  font-weight: 600;
}
.cover-fallback > * { position: relative; z-index: 1; }
.hero-cover .cover-fallback { font-size: clamp(1.2rem, 2.4vw, 1.8rem); padding: 22px 26px; }
.card-cover .cover-fallback { font-size: .98rem; }

/* =========================================================================
   Rails — category sections
   ========================================================================= */
.rail { padding-block: clamp(22px, 3.4vw, 40px); border-top: 1px solid var(--line); }
.rail:first-of-type { border-top: 0; }

.rail-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.rail-head h2, .rail-head .rail-title {
  font-size: clamp(1.25rem, 2.4vw, 1.7rem);
  margin: 0;
  letter-spacing: -0.018em;
}
.rail-head .rail-more, .rail-head a {
  font-family: var(--sans);
  font-size: .85rem;
  font-weight: 700;
  color: var(--accent-strong);
  white-space: nowrap;
}
.rail-head a:hover { color: var(--accent-ink); }
.rail-head a::after { content: " →"; }

/* =========================================================================
   Byline / meta
   ========================================================================= */
.byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-family: var(--sans);
  font-size: .8rem;
  color: var(--faint);
}
.byline > * + *::before {
  content: "·";
  margin-right: 10px;
  color: var(--line-strong);
}
.byline time, .byline .author { color: var(--muted); }
.byline .author { font-weight: 600; }

/* =========================================================================
   Article page
   ========================================================================= */
.article-wrap {
  max-width: var(--measure);
  padding-top: clamp(26px, 4vw, 46px);
  padding-bottom: clamp(40px, 6vw, 72px);
}
.article-wrap .kicker { margin-bottom: 16px; }
.article-wrap h1, .article-wrap .article-title {
  font-size: clamp(1.8rem, 4.4vw, 2.7rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 .35em;
}
.article-wrap .dek {
  font-family: var(--serif);
  font-size: clamp(1.12rem, 2vw, 1.32rem);
  font-weight: 400;
  font-style: italic;
  color: var(--ink-2);
  line-height: 1.45;
  margin: 0 0 20px;
}
.article-wrap .byline {
  font-size: .85rem;
  padding-bottom: 20px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.article-cover {
  position: relative;
  aspect-ratio: 3 / 2;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-sunk);
  margin: 8px 0 6px;
  box-shadow: var(--shadow-md);
}
.article-cover img { width: 100%; height: 100%; object-fit: cover; }
.article-cover figcaption,
.article-cover + .cover-caption {
  font-family: var(--sans);
  font-size: .78rem;
  color: var(--faint);
  margin-top: 8px;
}

/* Article body — generous reading measure */
.article-body { font-size: 1.16rem; line-height: 1.72; color: var(--ink-2); }
.article-body > * { margin-block: 0 1.15em; }
.article-body p { margin: 0 0 1.15em; }
.article-body p:first-of-type { font-size: 1.05em; }
.article-body p:first-of-type::first-letter {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 3.1em;
  line-height: .82;
  float: left;
  padding: 6px 12px 0 0;
  color: var(--accent-strong);
}
.article-body h2 {
  font-size: clamp(1.3rem, 2.6vw, 1.6rem);
  margin: 1.6em 0 .5em;
  letter-spacing: -0.016em;
  color: var(--ink);
}
.article-body ul, .article-body ol { margin: 0 0 1.2em; padding-left: 1.3em; }
.article-body li { margin: 0 0 .5em; padding-left: .2em; }
.article-body li::marker { color: var(--accent-strong); }
.article-body a { color: var(--accent-strong); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent); text-underline-offset: 2px; }
.article-body a:hover { text-decoration-color: var(--accent-strong); }

.article-body blockquote, .article-body .quote {
  margin: 1.5em 0;
  padding: 4px 0 4px 22px;
  border-left: 3px solid var(--accent);
  font-family: var(--serif);
  font-size: 1.22rem;
  font-style: italic;
  color: var(--ink);
  line-height: 1.5;
}
.article-body blockquote cite, .article-body .quote cite {
  display: block;
  margin-top: 10px;
  font-family: var(--sans);
  font-style: normal;
  font-size: .82rem;
  font-weight: 600;
  color: var(--muted);
}
.article-body blockquote cite::before, .article-body .quote cite::before { content: "— "; }

/* =========================================================================
   Prism box — "O NOSSO PRISMA" editorial callout
   ========================================================================= */
.prism-box {
  position: relative;
  margin: 30px 0;
  padding: 20px 22px 20px 24px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  background:
    linear-gradient(180deg, var(--accent-tint) 0%, color-mix(in srgb, var(--accent-tint) 40%, var(--surface)) 100%);
  box-shadow: var(--shadow-sm);
}
.prism-box::before {
  content: "O NOSSO PRISMA";
  display: inline-block;
  font-family: var(--sans);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin-bottom: 8px;
}
@media (prefers-color-scheme: dark) { .prism-box::before { color: var(--accent); } }
.prism-box p, .prism-box .prism-text {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.1rem;
  line-height: 1.55;
  color: var(--ink);
  font-style: italic;
}
.prism-box > p:not(:last-child) { margin-bottom: .6em; }

/* =========================================================================
   Sources
   ========================================================================= */
.sources {
  margin: 34px 0 6px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.sources h2, .sources h3, .sources .sources-title {
  font-family: var(--sans);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 12px;
}
.sources ul, .sources ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sources li { margin: 0; }
.sources a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: .95rem;
  font-weight: 600;
  color: var(--ink);
  padding: 8px 14px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
.sources a::before { content: "↗"; color: var(--accent-strong); font-weight: 700; }
.sources a:hover { color: var(--accent-strong); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); background: var(--accent-tint); }

/* =========================================================================
   Related
   ========================================================================= */
.related {
  margin-top: 44px;
  padding-top: 26px;
  border-top: 2px solid var(--line);
}
.related > h2, .related > h3, .related .related-title {
  font-family: var(--serif);
  font-size: 1.4rem;
  margin: 0 0 18px;
}
.related .card-grid { padding-block: 0; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
/* compact related cards */
.related .card h2, .related .card h3 { font-size: 1.04rem; }

/* =========================================================================
   Subscribe box
   ========================================================================= */
.subscribe-box {
  margin: 44px auto;
  padding: clamp(24px, 4vw, 38px);
  border-radius: var(--radius);
  background:
    radial-gradient(140% 120% at 100% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%),
    var(--ink);
  color: #f3f5f8;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.subscribe-box::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(transparent 96%, rgba(255,255,255,.04) 96%),
    linear-gradient(90deg, transparent 96%, rgba(255,255,255,.04) 96%);
  background-size: 26px 26px;
  opacity: .6; pointer-events: none;
}
.subscribe-box > * { position: relative; z-index: 1; }
.subscribe-box h2, .subscribe-box h3 {
  color: #fff;
  font-size: clamp(1.35rem, 2.6vw, 1.9rem);
  margin: 0 0 8px;
}
.subscribe-box .kicker { color: var(--accent); margin-bottom: 14px; }
.subscribe-box .kicker::before { background: var(--accent); }
.subscribe-box p { color: #c7cedb; max-width: 52ch; margin: 0 auto 20px; }
.subscribe-box form {
  display: flex;
  gap: 10px;
  max-width: 480px;
  margin: 0 auto;
  flex-wrap: wrap;
  justify-content: center;
}
.subscribe-box input[type="email"], .subscribe-box input[type="text"] {
  font: inherit; font-size: 1rem;
  flex: 1 1 240px;
  min-width: 0;
  padding: 13px 18px;
  color: var(--ink);
  background: #fff;
  border: 1px solid transparent;
  border-radius: 999px;
}
.subscribe-box input::placeholder { color: var(--faint); }
.subscribe-box input:focus {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 50%, transparent);
}
.subscribe-box button {
  font: inherit; font-weight: 700; font-size: 1rem;
  flex: 0 0 auto;
  padding: 13px 26px;
  color: #052e22;
  background: var(--accent);
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color .15s ease, transform .08s ease;
}
.subscribe-box button:hover { background: #34d399; }
.subscribe-box button:active { transform: translateY(1px); }
.subscribe-box button[disabled] { opacity: .6; cursor: progress; }
.subscribe-box .form-msg {
  margin: 14px auto 0;
  min-height: 1.2em;
  font-size: .92rem;
  font-weight: 600;
}
.subscribe-box .form-msg.is-ok { color: var(--accent); }
.subscribe-box .form-msg.is-err { color: #fca5a5; }
.subscribe-box .fineprint { font-size: .78rem; color: #8b94a5; margin-top: 12px; }

/* =========================================================================
   Pager
   ========================================================================= */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-block: clamp(28px, 4vw, 44px);
}
.pager a, .pager span, .pager .page {
  font-family: var(--sans);
  font-size: .92rem;
  font-weight: 700;
  padding: 9px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--ink);
  background: var(--surface);
  transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
.pager a:hover { border-color: var(--accent); color: var(--accent-strong); background: var(--accent-tint); }
.pager [aria-current="page"], .pager .is-current {
  background: var(--accent-strong); color: #fff; border-color: var(--accent-strong); cursor: default;
}
.pager [aria-disabled="true"], .pager .is-disabled { opacity: .45; pointer-events: none; }

/* =========================================================================
   Page section headers (category / search / list pages)
   ========================================================================= */
.page-head {
  padding-block: clamp(24px, 4vw, 44px) clamp(12px, 2vw, 20px);
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}
.page-head .kicker { margin-bottom: 12px; }
.page-head h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); margin: 0 0 .25em; }
.page-head p, .page-head .dek { color: var(--muted); font-family: var(--sans); max-width: 60ch; margin: 0; font-size: 1.05rem; }

/* The search page surfaces a big search form */
.search-page .search-form { max-width: 560px; margin: 18px 0 0; }
.search-page .search-form input { max-width: none; }

/* Empty / 404 states */
.empty-state, .notfound {
  text-align: center;
  padding-block: clamp(48px, 9vw, 110px);
  max-width: 540px;
  margin-inline: auto;
}
.empty-state h1, .notfound h1 { font-size: clamp(2.2rem, 7vw, 4rem); margin-bottom: .15em; }
.empty-state .code, .notfound .code {
  font-family: var(--mono); font-size: 4rem; font-weight: 700; color: var(--accent-strong); line-height: 1;
}
.empty-state p, .notfound p { color: var(--muted); font-size: 1.1rem; margin: 12px 0 24px; }

/* =========================================================================
   Footer
   ========================================================================= */
.site-footer {
  margin-top: clamp(40px, 7vw, 90px);
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--muted);
  font-size: .9rem;
}
.site-footer .wrap, .site-footer .container, .site-footer-inner {
  width: 100%; max-width: var(--maxw); margin-inline: auto; padding-block: clamp(34px, 5vw, 54px); padding-inline: var(--space);
}
.site-footer .footer-top {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: clamp(24px, 4vw, 48px);
  padding-bottom: 30px;
  border-bottom: 1px solid var(--line);
}
.site-footer .brand { font-size: 1.15rem; }
.site-footer .footer-about { max-width: 36ch; margin-top: 12px; line-height: 1.55; }
.site-footer h3, .site-footer .col-title {
  font-family: var(--sans);
  font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink); margin: 0 0 14px;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent-strong); }
.site-footer .footer-bottom {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  padding-top: 22px;
  font-size: .82rem; color: var(--faint);
}
.site-footer .footer-bottom .legal-links { display: flex; gap: 16px; flex-wrap: wrap; }

/* =========================================================================
   Utility / shared
   ========================================================================= */
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0; }
.tag-row a, .tag {
  font-family: var(--sans); font-size: .8rem; font-weight: 600;
  padding: 5px 12px; border-radius: 999px;
  background: var(--bg-sunk); color: var(--ink-2);
  border: 1px solid var(--line);
}
.tag-row a:hover { color: var(--accent-strong); border-color: var(--accent); }

.read-time { font-family: var(--mono); font-size: .72rem; letter-spacing: .04em; color: var(--faint); }

/* Animated entrance — subtle, reduced-motion safe */
@media (prefers-reduced-motion: no-preference) {
  .card, .rail, .hero-body { animation: jdia-rise .5s cubic-bezier(.2,.7,.3,1) both; }
  @keyframes jdia-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}

/* =========================================================================
   Responsive
   ========================================================================= */
@media (min-width: 900px) {
  .site-header .search-form { display: flex; } /* compact search in masthead */
  .site-header .search-form input { max-width: 180px; }
  .site-header .search-form button { padding: 9px 14px; }
}

@media (max-width: 880px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 18px;
    padding-block: 22px;
  }
  .hero .hero-cover, .hero > a:first-child { order: 0; }
  .hero-body { order: 1; }
  .hero h1, .hero .hero-title { font-size: clamp(1.7rem, 7vw, 2.4rem); }
  .site-footer .footer-top { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  .article-body { font-size: 1.08rem; }

  /* collapse nav into a toggled panel */
  .nav-toggle { display: inline-flex; }
  .masthead-date { display: none; }

  .masthead-nav {
    position: fixed;
    top: var(--header-h);
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    padding: 8px var(--space) 16px;
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .18s ease, transform .18s ease, visibility .18s;
  }
  .masthead-nav.is-open {
    transform: none;
    opacity: 1;
    visibility: visible;
  }
  .masthead-nav a {
    padding: 13px 8px;
    font-size: 1rem;
    border-radius: 8px;
    border-bottom: 1px solid var(--line);
  }
  .masthead-nav a:last-child { border-bottom: 0; }
  .masthead-nav a[aria-current="page"]::after,
  .masthead-nav a.is-active::after { display: none; }

  .article-body p:first-of-type::first-letter { font-size: 2.6em; }
  .site-footer .footer-top { grid-template-columns: 1fr; gap: 22px; }
}

@media (max-width: 460px) {
  .brand span.brand-text, .brand .wordmark { display: none; } /* mark only on very small screens, if markup supports */
  .subscribe-box form { flex-direction: column; }
  .subscribe-box button { width: 100%; }
}

/* No-JS fallback: if app.js can't open the menu, let nav be a horizontal scroller */
.no-js .nav-toggle { display: none; }
@media (max-width: 760px) {
  .no-js .masthead-nav {
    position: static; flex-direction: row; opacity: 1; visibility: visible; transform: none;
    box-shadow: none; border-bottom: 0; padding: 0; overflow-x: auto;
  }
  .no-js .masthead-nav a { border-bottom: 0; padding: 8px 11px; }
}

/* Print — readable article */
@media print {
  .site-header, .site-footer, .subscribe-box, .related, .nav-toggle, .search-form { display: none !important; }
  body { font-size: 12pt; color: #000; background: #fff; }
  .article-wrap { max-width: none; }
  a { color: #000; text-decoration: underline; }
}
