@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Newsreader:opsz,wght@6..72,500;6..72,600;6..72,700&display=swap');

/* Times New Roman, clean, minimal */
:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, 'Noto Sans', 'Liberation Sans', system-ui, sans-serif;
  --font-serif: 'Newsreader', 'Georgia', 'Times New Roman', serif;
  --fg: #141414;
  --muted: #4a4a4a; /* WCAG AA on white */
  --link: #0b5b66;  /* AA-compliant link on light */
  --border: #e5e5e5;
  --bg: #ffffff;
  --brand-bg: #0d1117;  /* sticky header background (dark, like WPDS masthead) */
  --brand-ink: #e6edf3; /* header foreground */
  --surface: #fcfcfc;   /* light card/note surface */
  --blockquote-bg: #f5f9fb;
  --max: min(68ch, 60rem); /* target ~65–75 characters per line, clamp for larger headings */
  --article-width: min(90vw, 45rem);
  /* Fluid type scale */
  --fs-meta: clamp(12px, 0.78rem + 0.2vw, 14px);
  --fs-small: clamp(14px, 0.85rem + 0.25vw, 15.5px);
  --fs-body: clamp(16px, 1rem + 0.3vw, 18px);
  --fs-h3: clamp(17px, 1.02rem + 0.6vw, 20px);
  --fs-h2: clamp(20px, 1.15rem + 0.8vw, 24px);
  --fs-title-sm: clamp(16px, 1rem + 0.6vw, 18px);
  --fs-title-md: clamp(18px, 1.1rem + 0.8vw, 22px);
  --fs-title-lg: clamp(30px, 1.8rem + 1.4vw, 40px);
  --fs-lead: clamp(34px, 2.2rem + 1.8vw, 48px);
}
/* Dark theme variables */
[data-theme="dark"] {
  --bg: #0d1117;
  --fg: #e6edf3;
  --muted: #9db1c9;
  --link: #7aa2f7;      /* accessible link on dark */
  --border: #263241;
  --brand-bg: #0d1117;  /* keep masthead dark in both themes */
  --brand-ink: #e6edf3;
  --surface: #0f141b;   /* dark card/note surface */
  --blockquote-bg: #0f1823;
}
@media (max-width: 1024px) {
  :root {
    --fs-body: 17px;
    --lh-body: 1.6;
    --fs-h1: 40px;
    --lh-h1: 1.22;
    --fs-dek: 16px;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--fg); }
body { font-family: var(--font-sans); font-size: var(--fs-body); line-height: 1.7; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

html[data-typography-variant="withoutBold"] strong,
html[data-typography-variant="withoutBold"] b {
  font-weight: inherit;
}

h1, h2, h3, h4,
.lead-title,
.section-head,
.section-head a,
.side-heading,
.side-heading a,
.kicker,
.cat-title,
.mini-title,
.side-title {
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.lead-title { font-weight: 700; }
.kicker { font-weight: 600; }
.section-head a { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.9rem; font-weight: 600; }

p, li, .meta, .lead-dek, .cat-dek, .mini-dek, .result-dek, .newsletter-cta__subhead, .newsletter-cta__social {
  font-family: var(--font-sans);
}
.container { max-width: 1100px; margin: 0 auto; padding: 0 22px; }
.site-header { border-bottom: 1px solid #161b22; background: var(--brand-bg); position: sticky; top: 0; z-index: 10; }
.site-header .container { max-width: 1100px; }
.site-header .head { display: flex; flex-direction: column; padding: 8px 0; gap: 6px; }
.topbar { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--brand-ink);
}
.brand-logo {
  display: block;
  height: 42px;
  width: auto;
}
.site-header .topbar {
  justify-content: center;
  gap: 16px;
}
.site-header .actions {
  position: absolute;
  right: 22px;
  top: 8px;
  display: flex;
  gap: 8px;
}
.site-header .head { position: relative; }
.nav { display: flex; gap: 8px; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
.icon-btn { background: transparent; border: 0; padding: 6px; line-height: 1; border-radius: 6px; color: var(--brand-ink); opacity: .75; cursor: pointer; }
.icon-btn:hover, .icon-btn:focus-visible { opacity: 1; background: color-mix(in oklab, var(--brand-bg), white 8%); }
.nav .header-link {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  text-align: center;
  white-space: nowrap;
  line-height: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  cursor: pointer;
  opacity: .45;
  background-repeat: no-repeat;
  background-position: bottom;
  letter-spacing: .25px;
  text-decoration: none;
  transition: opacity .15s ease;
  background-image: linear-gradient(var(--link), var(--link));
  background-size: 0% 2px;
}
.nav .header-link:hover,
.nav .header-link.active,
.nav .header-link[aria-current="page"] { opacity: 1; background-size: 100% 2px; }
.nav .header-link.admin { border: 1px solid rgba(0,188,212,0.35); border-radius: 4px; line-height: 38px; height: 38px; }
.nav .header-link.admin:hover { background-color: rgba(0,188,212,0.08); }
.nav .header-link.cta {
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #0b5b66, #1492a2);
  color: #fff;
  padding: 0 14px;
  line-height: 36px;
  height: 36px;
  font-weight: 600;
  opacity: 1;
  box-shadow: 0 8px 18px rgba(10, 90, 106, 0.22);
}
.nav .header-link.cta:hover,
.nav .header-link.cta:focus-visible {
  opacity: 1;
  background: linear-gradient(135deg, #1492a2, #0b5b66);
  box-shadow: 0 10px 22px rgba(10, 90, 106, 0.28);
}
.section-title { margin: 26px 0 10px; font-size: clamp(1.25rem, 1.06rem + 0.8vw, 1.7rem); }
.muted { color: var(--muted); }
.home-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 28px; align-items: start; margin-top: 10px; }
.main-col { min-width: 0; }
.side-col { min-width: 0; }
.side-heading {
  margin: 0 0 6px;
  font-size: clamp(1.05rem, 0.95rem + 0.6vw, 1.35rem);
  font-weight: 600;
  color: var(--fg);
  letter-spacing: 0.02em;
  padding-left: 14px;
}
.side-heading a {
  color: inherit;
  text-decoration: none;
}
.side-heading a:hover,
.side-heading a:focus-visible {
  color: var(--link);
}

.side-card:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.side-card:hover .side-title { color: var(--link); }
.side-title { font-size: var(--fs-title-sm); margin: 0 0 2px; line-height: 1.3; }
.side-title {
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.3;
  font-size: var(--fs-title-sm);
  color: var(--fg);
  transition: color .6s ease;
}
.side-media { display: block; margin-bottom: 8px; }
.side-thumb { width: 100%; aspect-ratio: 16 / 9; height: auto; object-fit: cover; border: 1px solid var(--border); display: block; }
.teaser { padding: 22px 0; border-bottom: 1px solid var(--border); }
.teaser .title { margin: 0 0 8px; font-size: var(--fs-title-lg); line-height: 1.25; }
.teaser .title a { color: var(--fg); text-decoration: none; text-underline-offset: 4px; }
.teaser .title a:hover { text-decoration: underline; }
.dek { color: var(--muted); margin: 0 0 10px; font-style: italic; }
.meta { color: var(--muted); font-size: var(--fs-meta); margin-bottom: 10px; letter-spacing: 0.2px; }
.kicker { font-size: var(--fs-meta); text-transform: uppercase; color: var(--muted); letter-spacing: 0.14em; margin: 2px 0 6px; }
.kicker a { color: var(--link); text-decoration: none; }
.kicker a:hover { text-decoration: underline; }
.bullets { margin: 10px 0 8px 18px; }
.bullets li { font-size: var(--fs-small); font-weight: 400; line-height: 1.65; margin-bottom: 6px; }
.post .title {
  font-size: var(--fs-lead);
  margin: 18px auto 10px;
  line-height: 1.15;
  max-width: var(--article-width);
  width: min(100%, var(--article-width));
  text-align: left;
}
.hero { margin: 8px auto 10px; position: relative; aspect-ratio: 21 / 9; overflow: hidden; border: 1px solid var(--border); max-width: var(--article-width); width: min(100%, var(--article-width)); }
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--fp-x, 50%) var(--fp-y, 50%); border: 0; display: block; }
.post .dek {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
  font-weight: 500;
  font-style: normal;
  margin: 0 auto 12px;
  max-width: var(--article-width);
  width: min(100%, var(--article-width));
  text-align: left;
}
.post .meta {
  max-width: var(--article-width);
  width: min(100%, var(--article-width));
  margin: 0 auto 12px;
  text-align: left;
}
.body { margin: 14px auto 0; max-width: var(--article-width); width: min(100%, var(--article-width)); }
.body > * { max-width: var(--article-width); width: min(100%, var(--article-width)); margin-left: auto; margin-right: auto; }
.body p { orphans: 3; widows: 3; }
.body h2, .body h3 {
  font-family: var(--font-serif);
  font-weight: 700;
  letter-spacing: 0.18em;
  line-height: 1;
  color: var(--muted);
  text-transform: uppercase;
  margin: 20px 0 4px;
  display: inline-block;
}
.body h2 { font-size: clamp(0.82rem, 0.72rem + 0.35vw, 0.95rem); }
.body h3 { font-size: clamp(0.78rem, 0.7rem + 0.3vw, 0.9rem); }
.body h2::after,
.body h3::after {
  content: ':';
  margin-left: 4px;
}
.body > h2:first-child,
.body > h3:first-child { margin-top: 0; }
.body h2 + p,
.body h3 + p { margin-top: 0.35em; }
.body blockquote { margin: 12px 0; padding: 8px 14px; border-left: 3px solid var(--link); color: var(--fg); background: var(--blockquote-bg); }
.body blockquote p { margin: 0; font-style: italic; }
.body ul,
.body ol {
  margin: 12px 0 18px 20px;
  padding: 0;
  display: grid;
  gap: clamp(8px, 1.2vw, 14px);
  list-style-position: outside;
}
.body ul li,
.body ol li {
  margin: 0;
  padding: 0;
  line-height: 1.65;
  color: var(--fg);
}
.body ul li::marker {
  font-size: 1.3em;
}
.body ol li::marker {
  font-size: 1.2em;
}
.body ul li > * + *,
.body ol li > * + * { margin-top: 4px; }
.body ul li ul,
.body ul li ol,
.body ol li ul,
.body ol li ol {
  margin: 10px 0 0 18px;
  gap: clamp(6px, 1vw, 10px);
}
.body ul + p,
.body ol + p { margin-top: 18px; }
@supports (-webkit-touch-callout: none) {
  .body ul,
  .body ol { gap: 12px; }
  .body ul li ul,
  .body ul li ol,
  .body ol li ul,
  .body ol li ol { gap: 10px; }
}
.body .pullquote, blockquote.pullquote {
  border: none;
  background: transparent;
  color: var(--link);
  font-style: normal;
  font-weight: 600;
  font-size: 24px;
  line-height: 1.35;
  padding: 0 8px;
  margin: 16px auto;
  text-align: center;
  max-width: 60ch;
}
/* Inline entity tags */
.entity-link { background: rgba(0,188,212,0.12); border-bottom: 1px dashed rgba(0,188,212,0.6); color: inherit; padding: 0 2px; border-radius: 2px; text-decoration: none; cursor: help; }
.entity-link:hover { background: rgba(0,188,212,0.18); }
/* Remove decorative quotation marks to avoid double quotes when text includes its own */
blockquote.pullquote::before,
.body .pullquote::before,
blockquote.pullquote::after,
.body .pullquote::after { content: none; }
.body .stat, .body .note {
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 10px 12px;
  margin: 12px 0;
}

.newsletter-cta {
  margin: 28px auto;
  padding: 24px 26px;
  border: 1px solid color-mix(in oklab, var(--link) 25%, var(--border));
  border-radius: 16px;
  background: linear-gradient(135deg, color-mix(in oklab, var(--link) 15%, white), color-mix(in oklab, var(--link) 8%, var(--surface)));
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: min(100%, calc(var(--article-width) + 80px));
  width: min(100%, calc(var(--article-width) + 80px));
  position: relative;
  box-shadow: 0 24px 48px rgba(12, 37, 69, 0.12);
}
.newsletter-cta__copy {
  display: grid;
  gap: 10px;
}
.newsletter-cta__headline {
  font-size: clamp(1.05rem, 0.98rem + 0.35vw, 1.3rem);
  margin: 0;
  color: var(--fg);
  font-family: var(--font-serif);
}
.newsletter-cta__subhead {
  margin: 0;
  color: var(--muted);
  font-size: clamp(0.9rem, 0.86rem + 0.2vw, 1rem);
}
.newsletter-cta__social {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
}
.newsletter-cta__form {
  display: grid;
  gap: 10px;
}
.newsletter-cta__embed {
  display: flex;
  justify-content: center;
  align-items: center;
}
.newsletter-cta__embed iframe {
  width: min(100%, 480px);
  min-height: 340px;
  border: 1px solid color-mix(in oklab, var(--border) 65%, transparent);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 6px 24px rgba(13, 33, 54, 0.12);
}
@media (max-width: 600px) {
  .newsletter-cta__embed iframe {
    min-height: 360px;
  }
}

.newsletter-cta__embed iframe[data-height]{
  min-height: var(--newsletter-iframe-height, 360px);
}
.newsletter-cta__fallback {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}
.newsletter-cta__fallback a {
  color: var(--link);
  text-decoration: none;
}
.newsletter-cta__fallback a:hover {
  text-decoration: underline;
}
.newsletter-cta__label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}
.newsletter-cta__fields {
  display: flex;
  gap: 12px;
  align-items: stretch;
}
.newsletter-cta__input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 0.95rem;
  transition: border-color .15s ease, box-shadow .15s ease;
  background: var(--surface);
  color: var(--fg);
}
.newsletter-cta__submit {
  background: color-mix(in oklab, var(--link) 96%, #081c2c 4%);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .18s ease;
}
.newsletter-cta__submit:hover,
.newsletter-cta__submit:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(12, 37, 69, 0.24);
  outline: 0;
}
.newsletter-cta__input:focus-visible {
  border-color: var(--link);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--link) 25%, transparent);
  outline: 0;
}
.newsletter-cta__feedback {
  margin: 0;
  min-height: 1.2em;
  font-size: 0.82rem;
  color: var(--muted);
}
.newsletter-cta__feedback.is-success {
  color: #0a7a3c;
}
.newsletter-cta__feedback.is-error {
  color: #b30021;
}
.newsletter-cta__note {
  color: var(--muted);
  font-size: 0.78rem;
}
.newsletter-cta--active {
  border-color: var(--link);
  box-shadow: 0 8px 24px rgba(0,0,0,0.14);
}
.newsletter-cta--submitting .newsletter-cta__input {
  opacity: 0.75;
}
.newsletter-cta[data-placement="footer"] {
  margin: 48px auto 32px;
  max-width: var(--article-width);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 620px) {
  .newsletter-cta {
    padding: 20px 18px;
  }
  .newsletter-cta__fields {
    flex-direction: column;
  }
  .newsletter-cta__submit {
    width: 100%;
    text-align: center;
  }
}

[data-theme="dark"] .newsletter-cta {
  background: linear-gradient(135deg, color-mix(in oklab, var(--link) 22%, #04070c), color-mix(in oklab, var(--link) 12%, #0a1019));
  border-color: color-mix(in oklab, var(--link) 28%, #14202e);
  box-shadow: 0 26px 48px rgba(4, 12, 26, 0.55);
}
[data-theme="dark"] .newsletter-cta__submit {
  background: color-mix(in oklab, var(--link) 98%, #081524 2%);
}
[data-theme="dark"] .newsletter-cta__submit:hover,
[data-theme="dark"] .newsletter-cta__submit:focus-visible {
  box-shadow: 0 18px 38px rgba(4, 12, 26, 0.5);
}
.tags { margin: 16px auto 24px; font-size: 14px; display: flex; flex-wrap: wrap; gap: 6px; max-width: var(--article-width); width: min(100%, var(--article-width)); }
.tag { display: inline-flex; align-items: center; padding: 3px 9px; border: 1px solid rgba(0,188,212,0.35); background: rgba(0,188,212,0.06); color: #0b5b66; text-decoration: none; border-radius: 2px; line-height: 1.1; }

/* Share toolbar icons */
.share a, .share button {
  color: var(--link);
  opacity: .85;
  transition: opacity .15s ease, background-color .15s ease;
  border-radius: 6px;
  padding: 4px;
  background: transparent; /* ensure no white UA default in dark mode */
}
.share a:hover, .share a:focus-visible, .share button:hover, .share button:focus-visible {
  opacity: 1;
  background: color-mix(in oklab, var(--bg), var(--link) 10%);
}
.post .share {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px auto 16px;
  max-width: var(--article-width);
  width: min(100%, var(--article-width));
  padding: 12px 16px;
  background: color-mix(in oklab, var(--surface) 92%, var(--bg) 8%);
  border: 1px solid color-mix(in oklab, var(--border) 85%, transparent 15%);
  border-radius: 14px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
  flex-wrap: wrap;
  text-align: left;
}
.share-label {
  font-size: 14px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

[data-theme="dark"] .post .share {
  background: color-mix(in oklab, var(--surface) 78%, var(--bg) 22%);
  border-color: color-mix(in oklab, var(--border) 65%, transparent 35%);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.45);
}
.share-feedback {
  font-size: 12px;
  color: #27823b;
  display: none;
}
.form { display: grid; gap: 12px; padding: 12px 0 24px; }
.form label { display: grid; gap: 6px; }
.form input, .form textarea { padding: 10px; border: 1px solid var(--border); font-family: inherit; font-size: 16px; }
.actions { display: flex; gap: 10px; align-items: center; }
button { padding: 10px 14px; border: 1px solid var(--border); background: var(--fg); color: #fff; cursor: pointer; font-family: inherit; font-size: 16px; }
button:hover { opacity: .9; }
.secondary { color: var(--muted); text-decoration: none; }
.error { color: #a40000; border: 1px solid #f1c0c0; background: #fff7f7; padding: 8px 10px; }
.site-footer { border-top: 1px solid #161b22; padding: 18px 0; color: rgba(230,237,243,0.82); font-size: 14px; margin-top: 50px; background: var(--brand-bg); width: 100%; }
.site-footer a { color: var(--link); }
.footer-inner { padding-top: 4px; padding-bottom: 8px; }
.sitemap { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 6px 18px; align-items: start; margin-top: 6px; }
.sitemap a { display: block; color: var(--link); text-decoration: none; }
.sitemap a:hover { text-decoration: underline; }
.sitemap-title { color: rgba(230,237,243,0.8); font-weight: 600; letter-spacing: .2px; }
.footer-copy { margin-top: 8px; color: rgba(230,237,243,0.65); }

/* Search */
.actions .search { display: block; }
.actions .search input[type="search"] {
  width: 240px; max-width: 40vw; height: 32px; padding: 4px 10px; border-radius: 6px;
  border: 1px solid #263241; background: #0f141b; color: var(--brand-ink);
}
.actions .search input::placeholder { color: rgba(230,237,243,0.6); }
.search-page { margin-bottom: 8px; }
.search-page input[type="search"] { width: 100%; border: 1px solid var(--border); background: var(--bg); color: var(--fg); }

body.search-open { overflow: hidden; }
.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13, 17, 23, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 18px;
  z-index: 1200;
}
.search-overlay[hidden] { display: none !important; }
.search-dialog {
  position: relative;
  width: min(520px, 100%);
  background: var(--surface);
  color: var(--fg);
  border-radius: 16px;
  padding: 26px 24px 24px;
  box-shadow: 0 24px 48px rgba(8, 15, 26, 0.45);
  display: grid;
  gap: 18px;
}
.search-mobile {
  display: flex;
  gap: 12px;
  align-items: stretch;
}
.search-mobile input[type="search"] {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 1rem;
  background: var(--bg);
  color: var(--fg);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.search-mobile input[type="search"]:focus-visible {
  border-color: var(--link);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--link) 25%, transparent);
  outline: 0;
}
.search-mobile button[type="submit"] {
  border: none;
  border-radius: 10px;
  background: var(--link);
  color: #fff;
  font-weight: 600;
  padding: 12px 20px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .18s ease;
}
.search-mobile button[type="submit"]:hover,
.search-mobile button[type="submit"]:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(12, 18, 32, 0.18);
  outline: 0;
}
.search-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  padding: 6px;
  cursor: pointer;
  border-radius: 6px;
}
.search-close:hover,
.search-close:focus-visible {
  color: var(--link);
  background: color-mix(in oklab, var(--surface), white 12%);
}
.search-dialog label { font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.search-dialog small { font-size: 0.78rem; color: var(--muted); }
@media (max-width: 520px) {
  .search-dialog { padding: 22px 18px; gap: 14px; }
  .search-mobile { flex-direction: column; gap: 10px; }
  .search-mobile button[type="submit"] { width: 100%; }
  .search-close { top: 6px; right: 6px; }
}

/* Mobile header behavior */
@media (max-width: 1024px) {
  .search-desktop { display: none; }
  .menu-toggle, .search-toggle { display: inline-flex; }
  body.nav-open .nav { display: block; }
  .nav { display: none; flex-wrap: wrap; gap: 10px; padding: 8px 0; }
}
@media (min-width: 1025px) {
  .menu-toggle, .search-toggle { display: none; }
}

/* Admin: fix images */
.imgfix-list { display: grid; gap: 10px; }
.imgfix-item { padding: 10px 0; border-bottom: 1px solid var(--border); }
.imgfix-form { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.imgfix-form input[type="url"] { flex: 1 1 auto; padding: 8px 10px; border: 1px solid var(--border); }

/* --- Dark/light foundations --- */
html { color-scheme: light dark; }

/* Add a surface token so “cards”/notes adapt to theme */
:root { --surface: #fcfcfc; }
[data-theme="dark"] { --surface: #0f141b; }

/* --- Typography & colors that were hard-coded to black --- */
/* These had color:#121212; which disappears in dark mode */
.side-title,
.mini-title,
.body h2, .body h3,
.cat-title,
.section-head { color: var(--fg); }

/* Standfirst/deks/meta all use the muted token in both themes */
.lead-dek,
.mini-dek,
.cat-dek,
.meta { color: var(--muted); }

/* Tighten H1 and make it fluid across breakpoints */
.lead-title{
  font-size: clamp(2.1rem, 3.2vw, 3rem);
  line-height: 1.18;
  letter-spacing: -0.01em;
}

/* --- Focus & accessibility --- */
:focus-visible{
  outline: 2px solid var(--link);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Skip links: visible on focus for keyboard users */
.skip-links { position: absolute; top: 0; left: 0; width: 100%; }
.skip-link { position: absolute; left: -9999px; background: var(--brand-bg); color: var(--brand-ink); padding: 8px 12px; border-radius: 4px; text-decoration: none; }
.skip-link:focus { left: 10px; top: 10px; z-index: 1000; }

/* --- Cards & list rhythm --- */
/* Single divider between items: only bottom border from each item */
.side-card:hover,
.mini-card:hover{
  /* subtle hover that works in both themes */
  background: color-mix(in oklab, var(--surface), white 6%);
}

/* Keep thumbnails consistent and crisp */
.side-thumb,
.mini-thumb{ aspect-ratio: 16/9; object-fit: cover; object-position: 50% 50%; width: 100%; height: auto; }

/* Give bullets a little breathing room from the meta row */
.lead .bullets{ margin-top: .75rem; }

/* Ensure homepage lead standfirst has strong contrast in both themes */
.lead .lead-dek { color: var(--fg) !important; }

/* --- Components that assumed light theme; make them theme-aware --- */
.body .stat, .body .note, .keypoints { background: var(--surface); }

/* Optional: visited color that still passes AA on dark bg */
a:visited { color: color-mix(in oklab, var(--link), #6b4dff 35%); }

/* Subtle dark-mode toning to reduce glare on large images */
[data-theme="dark"] .lead-figure img,
[data-theme="dark"] .hero img{ filter: saturate(.96) contrast(.98) brightness(.98); }

/* Motion safety */
@media (prefers-reduced-motion: reduce){
  * { animation: none !important; transition: none !important; }
}

/* Subtle, targeted cross-fade when user toggles theme */
.theme-swap, .theme-swap * {
  transition: background-color .22s ease, color .22s ease, border-color .22s ease, fill .22s ease, stroke .22s ease;
}
@media (prefers-reduced-motion: reduce){
  .theme-swap, .theme-swap * { transition: none !important; }
}

/* Links */
a { color: var(--link); text-decoration-thickness: 0.08em; text-underline-offset: 3px; }
a:hover { opacity: .9; }

/* Readability helpers */
p { margin: 0 0 1.05em; }
ul, ol { padding-left: 1.3em; margin: 0 0 1.05em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 24px 0; }

/* Lead (broadsheet) */
.lead { padding: 26px 0 10px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.lead-figure { margin: 0 0 10px; position: relative; aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid var(--border); }
.lead--tag .lead-figure { aspect-ratio: 21 / 9; }
.lead-figure img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--fp-x, 50%) var(--fp-y, 50%); display: block; border: 0; }
.lead-figure img[data-fade], .hero img[data-fade]{ opacity: 0; transition: opacity .3s ease; }
.lead-figure img[data-fade].is-loaded, .hero img[data-fade].is-loaded{ opacity: 1; }
.lead-title { line-height: 1.18; margin: 0 0 8px; color: var(--fg); }
.lead-title a { color: var(--fg); text-decoration: none; transition: color .6s ease; }
.lead-title a:hover { color: var(--link); text-decoration: none; }
.lead-dek { color: var(--muted); margin: 0 0 12px; font-size: var(--fs-small); line-height: 1.6; }

/* Broadsheet article tweaks */
.body-broadsheet p:first-of-type::first-letter { float: none; font-size: inherit; line-height: inherit; padding: 0; font-weight: inherit; }
.keypoints { border: 1px solid var(--border); padding: 12px 14px; background: #fcfcfc; margin: 10px auto; max-width: var(--article-width); width: min(100%, var(--article-width)); }
.keypoints { background: var(--surface); }
.keypoints strong { display: block; margin-bottom: 6px; font-size: 15px; letter-spacing: 0.3px; text-transform: uppercase; color: var(--muted); }
.keypoints ul { margin: 0; padding-left: 1.1em; }

/* Sections by tag */
.sections { margin-top: 18px; }
.home-newsletter {
  margin: 34px auto 18px;
  display: flex;
  justify-content: center;
  padding: 0 12px;
}
.home-newsletter .newsletter-cta {
  width: min(100%, calc(var(--article-width) + 80px));
}
.home-newsletter--grid {
  padding: 0;
  display: block;
  margin: 28px 0 12px;
}
.home-newsletter--grid .newsletter-cta {
  width: min(100%, var(--article-width));
}
.section { padding: 10px 0 6px; border-top: 1px solid var(--border); container-type: inline-size; }
.section-head {
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.3;
  font-size: var(--fs-meta);
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 8px;
  padding-bottom: 2px;
  background-image: linear-gradient(var(--link), var(--link));
  background-size: 32px 2px;
  background-repeat: no-repeat;
  background-position: left bottom;
}
.section-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 16px 22px; }
.section-more { text-align: right; margin-top: 8px; }
.section-more a { font-size: 13px; color: var(--link); text-decoration: none; }
.section-more a:hover { text-decoration: underline; }
.side-col .section-more { text-align: left; margin-top: 12px; }
.mini { display: grid; grid-template-columns: 1fr; gap: 6px; }
.mini-card { display: flex; flex-direction: column; color: inherit; text-decoration: none; border-radius: 4px; }
.mini-card:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.mini-card:hover .mini-title { color: var(--link); }
.mini-media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 6px;
  border: 1px solid color-mix(in oklab, var(--border) 80%, transparent);
  background: color-mix(in oklab, var(--surface) 85%, var(--bg) 15%);
  display: block;
  margin-bottom: 8px;
}
.mini-media picture,
.mini-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.mini-thumb { width: 100%; aspect-ratio: 16 / 9; height: auto; object-fit: cover; border: 1px solid var(--border); }
.mini-text { min-height: var(--mini-text-min, 6rem); display: flex; flex-direction: column; }
.mini-title { font-size: var(--fs-title-md); margin: 0 0 4px; line-height: 1.35; }
.mini-dek { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mini-card .meta { margin-top: auto; }
.mini-title {
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.3;
  font-size: 18px;
  color: var(--fg);
  text-decoration: none;
  transition: color .6s ease;
}
.mini-dek { color: var(--muted); margin: 0; font-size: 15px; }
@media (max-width: 720px) {
  /* Make top nav a single-row horizontal scroller on mobile */
  .nav { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; gap: 6px; padding-bottom: 2px; }
  .nav .header-link { flex: 0 0 auto; font-size: 12px; line-height: 34px; height: 34px; padding: 0 6px; }
  .site-header .topbar { justify-content: space-between; align-items: center; }
  .site-header .actions { position: static; right: auto; top: auto; display: flex; align-items: center; gap: 10px; }
  .brand { margin-right: auto; }
  .brand-logo { height: 36px; }
  .actions .search { display: none; }
  .home-grid { grid-template-columns: 1fr; gap: 24px; }
  .main-col { order: 1; }
  .side-col { order: 2; }
  .side-heading { padding-left: 0; }
  .side-list { border-left: none; padding-left: 0; border-top: 1px solid var(--border); padding-top: 16px; margin-top: 12px; }
  .section-grid { grid-template-columns: 1fr; }
  .side-media { display: block; margin-bottom: 8px; }
  /* Keep hero compact above the fold on mobile */
  .lead-figure { aspect-ratio: 16 / 9; }
  .lead--tag .lead-figure { aspect-ratio: 16 / 9; }
  .hero { aspect-ratio: 16 / 9; }
}

/* Category page list */
.cat-list {
  display: grid;
  gap: clamp(16px, 0.9rem + 0.6vw, 24px);
  margin-top: 16px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: stretch;
}
/* Each list item is a single tile; layout handled inside the anchor card */
.cat-item {
  display: block;
  padding: 0;
  border: 0;
  height: 100%;
}
/* Vertical card: image on top, text below */
.cat-card {
  display: flex;
  flex-direction: column;
  gap: clamp(10px, calc(0.8rem + 0.3vw), 16px);
  color: inherit;
  text-decoration: none;
  border-radius: 8px;
  width: 100%;
  container-type: inline-size;
  min-height: 100%;
  height: 100%;
  padding: clamp(14px, 0.85rem + 0.3vw, 18px);
  border: 1px solid color-mix(in oklch, var(--border) 85%, transparent);
  background: color-mix(in oklab, var(--surface) 92%, var(--bg) 8%);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}
.cat-media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 6px;
  border: 1px solid color-mix(in oklab, var(--border), transparent 10%);
  background: color-mix(in oklab, var(--surface) 85%, var(--bg) 15%);
  flex: 0 0 auto;
}
.cat-media picture,
.cat-media img {
  display: block;
  width: 100%;
  height: 100%;
}
.cat-media img {
  position: absolute;
  inset: 0;
  object-fit: cover;
}
.cat-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cat-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 0.5rem + 0.2vw, 10px);
  flex: 1 1 auto;
}
.cat-card:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; }
.cat-card:hover,
.cat-card:focus-visible {
  border-color: color-mix(in oklch, var(--link) 30%, var(--border));
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.06);
}
.cat-card:hover .cat-title { color: var(--link); }
/* override any old horizontal card rules */
.cat-title {
  margin: 0 0 4px;
  font-size: clamp(1.05rem, calc(1rem + 0.4vw), 1.375rem);
  line-height: 1.25;
  max-width: none;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cat-title { color: var(--fg); transition: color .6s ease; }
.cat-dek {
  margin: 0 0 6px;
  color: var(--muted);
  max-width: none;
  font-size: clamp(0.95rem, calc(0.94rem + 0.25vw), 1.05rem);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cat-body .meta { margin-top: auto; }
@supports (-webkit-touch-callout: none) {
  /* Safari/iOS can round container-query units differently. Use stable values there. */
  .cat-card { gap: 14px; }
  .cat-title { font-size: clamp(1.05rem, calc(1rem + 0.2vw), 1.35rem); }
  .cat-dek { font-size: clamp(0.95rem, calc(0.93rem + 0.2vw), 1.05rem); }
}
@media (max-width: 720px) {
  .cat-card { grid-template-columns: 1fr; padding: 16px; }
  .cat-media { display: none; }
}

.pager { margin: 28px 0 12px; text-align: center; }
.pager-controls { display: inline-flex; gap: 14px; align-items: center; justify-content: center; flex-wrap: wrap; }
.pager-status { font-size: 0.92rem; color: var(--muted); }
.pager-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--fg);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .15s ease;
}
.pager-btn:hover,
.pager-btn:focus-visible {
  color: var(--link);
  border-color: color-mix(in oklab, var(--link) 45%, var(--border));
  background: color-mix(in oklab, var(--surface), white 10%);
  transform: translateY(-1px);
}
@media (max-width: 540px) {
  .pager-controls { gap: 10px; }
  .pager-btn { padding: 8px 14px; font-size: 0.9rem; }
}

/* Container queries: adapt when the available column/card width is tight */
@container (max-width: 760px){
  .section-grid { grid-template-columns: 1fr; }
}
/* Card is vertical by default; no extra query needed */

/* Tidy long titles in tiles */
.cat-title, .side-title, .mini-title{
  word-break: normal;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Related posts: force text left, image right using explicit grid placement */
.related { --related-media: 96px; }
.section.related {
  margin-top: 36px;
  padding-top: 18px;
  border-top: 1px solid color-mix(in oklab, var(--border) 75%, transparent 25%);
}
.related .section-grid{ grid-template-columns: 1fr; }
.section.related .mini-card{ display: grid !important; grid-template-columns: minmax(0,1fr) var(--related-media) !important; gap: 10px 14px; align-items: start; }
.related .section-head{ margin-bottom: 16px; }
.related .mini-text{ min-width: 0; }
.related .mini-media{ grid-column: 2; grid-row: 1 / span 3; width: var(--related-media); }
.related .mini-thumb{ width: 100% !important; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border: 1px solid var(--border); display: block; }
/* Ensure picture-based thumbs also fit the 96x64 column */
.related .mini-media img{ width: 100% !important; height: auto; aspect-ratio: 3 / 2; object-fit: cover; display: block; border: 1px solid var(--border); }
.related .mini-title{ grid-column: 1; font-size: 18px; line-height: 1.3; margin: 0 0 4px; }
.related .mini-dek{ grid-column: 1; font-size: 14px; line-height: 1.5; margin: 0 0 6px; }
.related .mini-card .meta{ grid-column: 1; }
@media (max-width: 680px){
  .section.related .mini-card{ grid-template-columns: 1fr !important; gap: 10px; }
  .related .mini-media{ grid-column: 1; grid-row: auto; }
}

/* Search results: compact media list */
.results { display: grid; gap: 10px; margin-top: 12px; }
.result-item { padding: 10px 0; border-bottom: 1px solid var(--border); }
.result-card { display: grid; grid-template-columns: 96px minmax(0,1fr); gap: 12px; color: inherit; text-decoration: none; align-items: center; }
.result-card:hover .result-title { color: var(--link); }
.result-media { display: block; }
.result-thumb { width: 96px; height: 64px; object-fit: cover; object-position: 50% 50%; border: 1px solid var(--border); display: block; border-radius: 2px; }
.result-title { margin: 0 0 2px; font-size: var(--fs-title-md); line-height: 1.3; color: var(--fg); transition: color .2s ease; }
.result-dek { margin: 0; color: var(--muted); font-size: var(--fs-meta); line-height: 1.5; }
/* Keep rows consistent across sizes; slightly smaller title on narrow viewports */
@media (max-width: 540px){ .result-title { font-size: 16px; } }

/* Lead card focus */
.lead-card { display: block; color: inherit; text-decoration: none; border-radius: 4px; }
.lead-card:focus-visible { outline: 3px solid var(--link); outline-offset: 3px; }
.lead-card:hover .lead-title { color: var(--link); }

@media (max-width: 720px) {
  .brand { font-size: 28px; }
  .lead-title { font-size: clamp(1.8rem, 5.4vw, 2.2rem); }
  .teaser .title { font-size: 24px; }
  .post .title { font-size: 36px; }
}

/* Print-friendly */
@media print {
  .site-header, .site-footer, .nav, .admin { display: none !important; }
  a { color: black; text-decoration: none; }
}
/* Breadcrumbs */
.breadcrumbs {
  font-size: clamp(0.75rem, 0.7rem + 0.2vw, 0.85rem);
  color: color-mix(in oklab, var(--fg) 85%, var(--muted) 15%);
  margin: 10px 0 12px;
  letter-spacing: 0.01em;
}
.breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; }
.breadcrumbs li { margin: 0; }
.breadcrumbs li + li::before { content: "›"; color: color-mix(in oklab, var(--fg) 80%, var(--muted) 20%); margin: 0 8px; }
.breadcrumbs a { color: inherit; text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; color: color-mix(in oklab, var(--fg) 90%, var(--link) 10%); }

.section-headrow { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-headrow .section-more { margin-top: 0; }
.section-headrow .section-more a { font-size: 13px; color: var(--link); text-decoration: none; transition: color .3s ease; }
.section-headrow .section-more a:hover { text-decoration: underline; color: color-mix(in oklab, var(--link), var(--fg) 15%); }
