/* ==========================================================================
   AI Observer: shared stylesheet
   Prototype for index.html, category.html and article.html.
   Structure follows a classic news layout. Written to be portable into a
   WordPress theme: tokens on :root, plain BEM-style classes, no frameworks.
   ========================================================================== */

/* 1. Tokens ----------------------------------------------------------------- */
:root {
  --navy: #09132d;          /* brand dark blue (replaces black) */
  --navy-700: #101f45;      /* raised surfaces on dark */
  --navy-600: #1a2d5f;      /* borders on dark */
  --accent: #3884fa;        /* brand accent: buttons, bars, focus, links on dark */
  --accent-ink: #09132d;    /* text on accent buttons (5.1:1) */
  --link: #1d5fcc;          /* accent, darkened for text on white (5.9:1) */
  --link-hover: #144aa3;
  --ink: #0e1730;           /* body text */
  --muted: #4a5468;         /* secondary text on white (7:1) */
  --on-dark: #ffffff;
  --on-dark-muted: #b9c4dc; /* secondary text on navy (10:1) */
  --line: #d8dee9;
  --soft: #f2f5fa;
  --white: #ffffff;

  --font-head: "Fira Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --container: 1200px;
  --gutter: 16px;
  --radius: 4px;
}

/* 2. Base ------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink);
  background: var(--white);
}
img, svg { display: block; max-width: 100%; height: auto; }
h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.18;
  margin: 0;
  color: inherit;
}
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.site-header :focus-visible,
.site-footer :focus-visible,
.band--dark :focus-visible { outline-color: #8ab8ff; }

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap;
}
.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 100;
  padding: 12px 16px;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 700; border-radius: var(--radius);
}
.skip-link:focus { top: 8px; }

/* 3. Buttons and form controls ---------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px;
  border: 2px solid transparent; border-radius: var(--radius);
  font-weight: 700; line-height: 1; text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn--accent { background: #2b6ce0; color: #fff; } /* white text needs 4.5:1; the brand blue #3884fa gives 3.6:1 */
.btn--accent:hover { background: #1d5fcc; }
.btn--outline { border-color: currentColor; background: transparent; }
.btn--outline:hover { background: rgba(56, 132, 250, 0.12); }
.btn--small { min-height: 36px; padding: 0 14px; font-size: 0.9rem; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0;
  background: transparent; border: 0; color: inherit; border-radius: var(--radius);
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.12); }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.field { display: grid; gap: 6px; }
.field label { font-weight: 600; }
.field input[type="email"], .field input[type="search"], .field input[type="text"] {
  width: 100%; min-height: 48px; padding: 0 14px;
  border: 2px solid #6f7b94; border-radius: var(--radius);
  background: var(--white); color: var(--ink);
}
.field input:focus-visible, .field textarea:focus-visible { outline-offset: 0; border-color: var(--accent); }
.field textarea { width: 100%; min-height: 120px; padding: 12px 14px; border: 2px solid #6f7b94; border-radius: var(--radius); background: var(--white); color: var(--ink); resize: vertical; }

/* 4. Site header ------------------------------------------------------------ */
.site-header { background: var(--navy); color: var(--on-dark); }
.site-header__bar {
  display: flex; align-items: center; gap: 8px;
  min-height: 64px;
}
.logo {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: "Fira Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; font-weight: 600; font-size: 1.5rem;
  letter-spacing: -0.01em; color: var(--on-dark);
  padding: 6px 4px;
}
.logo:hover { text-decoration: none; }
.logo svg { width: 34px; height: 34px; flex: none; }
.logo__mark-bg { fill: var(--accent); }
.logo__mark-fg { fill: none; stroke: var(--navy); stroke-width: 2.4; stroke-linecap: round; }
.logo__mark-dot { fill: var(--navy); }

.primary-nav ul { display: flex; gap: 4px; }
.primary-nav a {
  display: block; padding: 12px 12px;
  font-weight: 500; font-size: 0.95rem; border-radius: var(--radius);
}
.primary-nav a:hover { background: rgba(255, 255, 255, 0.1); text-decoration: none; }
.primary-nav a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--accent); border-radius: 0; }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.menu-toggle { display: none; }
.menu-toggle .icon-close { display: none; }
.menu-toggle[aria-expanded="true"] .icon-open { display: none; }
.menu-toggle[aria-expanded="true"] .icon-close { display: block; }

.search-panel { background: var(--navy-700); border-top: 1px solid var(--navy-600); }
.search-panel[hidden] { display: none; }
.search-panel form { display: flex; gap: 8px; padding-block: 12px; align-items: end; }
.search-panel .field { flex: 1; }
.search-panel .field label { color: var(--on-dark); }

.topics-bar { border-top: 1px solid var(--navy-600); }
.topics-bar ul { display: flex; gap: 4px 20px; overflow-x: auto; padding: 2px 0; scrollbar-width: thin; }
.topics-bar a {
  display: block; padding: 10px 0; font-size: 0.875rem; font-weight: 500;
  color: var(--on-dark-muted); white-space: nowrap;
}
.topics-bar a:hover { color: var(--on-dark); }
.topics-bar a[aria-current="page"] { color: var(--on-dark); box-shadow: inset 0 -3px 0 var(--accent); }

/* 5. Section headings, kickers, meta --------------------------------------- */
.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  border-top: 5px solid var(--accent);
  padding-top: 12px; margin-bottom: 16px;
}
.section-head h2, .section-head h1 { font-size: 1.5rem; }
.section-head a { font-size: 0.9rem; font-weight: 700; color: var(--link); }
.band--dark .section-head a { color: #8ab8ff; }

.kicker { font-size: 0.875rem; font-weight: 700; color: var(--link); }
.kicker a:hover { text-decoration: underline; }
.meta { font-size: 0.875rem; color: var(--muted); margin: 0; }
.meta time { white-space: nowrap; }
.band--dark .meta, .band--dark .kicker { color: var(--on-dark-muted); }

.topic-row {
  display: flex; flex-wrap: wrap; gap: 4px 18px;
  border-top: 1px solid var(--line); padding-top: 10px; margin-bottom: 18px;
  font-size: 0.875rem; font-weight: 700;
}
.topic-row a { padding: 4px 0; }
.topic-row a:first-child { color: var(--ink); }
.topic-row a + a { color: var(--link); }

/* 6. Cards and story modules ------------------------------------------------ */
.media { position: relative; overflow: hidden; background: var(--soft); border-radius: var(--radius); }
.media img { width: 100%; height: 100%; object-fit: cover; }
.media--16x9 { aspect-ratio: 16 / 9; }
.media--4x3 { aspect-ratio: 4 / 3; }
.media--3x2 { aspect-ratio: 3 / 2; }
.media--1x1 { aspect-ratio: 1 / 1; }
.media__badge {
  position: absolute; left: 8px; bottom: 8px;
  background: var(--navy); color: var(--on-dark);
  font-size: 0.8125rem; font-weight: 700; padding: 4px 8px; border-radius: 2px;
}

/* Stretched-link card: the headline link covers the whole card */
.card { position: relative; display: flex; flex-direction: column; gap: 10px; }
.card__title { font-size: 1.125rem; }
.card__title a::after { content: ""; position: absolute; inset: 0; }
.card:hover .card__title a { text-decoration: underline; text-underline-offset: 3px; }
.card__text { margin: 0; color: var(--muted); font-size: 0.9375rem; }
.card--lg .card__title { font-size: 1.75rem; }
.band--dark .card__text { color: var(--on-dark-muted); }

/* Lead module: text left, image right */
.lead { position: relative; display: grid; grid-template-columns: 5fr 7fr; gap: 24px; align-items: start; }
.lead__title { font-size: 1.75rem; margin-bottom: 10px; }
.lead__title a::after { content: ""; position: absolute; inset: 0; }
.lead__title a:hover { text-decoration: underline; text-underline-offset: 4px; }
.lead__summary { color: var(--muted); margin-bottom: 10px; }
.more-coverage { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
.more-coverage__label { font-size: 0.8125rem; font-weight: 700; color: var(--muted); margin: 0 0 6px; }
.more-coverage li + li { margin-top: 10px; }
.more-coverage a { position: relative; z-index: 1; font-weight: 600; font-family: var(--font-head); font-size: 1.0625rem; line-height: 1.25; }
.more-coverage a:hover { text-decoration: underline; text-underline-offset: 3px; }
.more-coverage .meta { margin-top: 2px; }

/* Compact rows (headline + thumb) */
.rows > li { padding: 14px 0; border-top: 1px solid var(--line); }
.rows > li:first-child { border-top: 0; padding-top: 0; }
.row { position: relative; display: grid; grid-template-columns: 1fr 96px; gap: 14px; align-items: start; }
.row--text { grid-template-columns: 1fr; }
.row__title { font-size: 1.0625rem; }
.row__title a::after { content: ""; position: absolute; inset: 0; }
.row:hover .row__title a { text-decoration: underline; text-underline-offset: 3px; }
.row .meta { margin-top: 4px; }
.row .media { grid-column: 2; grid-row: 1; }
.row--wide { grid-template-columns: 1fr 260px; gap: 24px; align-items: start; }
.row--wide .row__title { font-size: 1.375rem; }
.row .kicker { margin: 0 0 4px; font-size: 0.8125rem; }
.row__excerpt { margin: 8px 0 0; color: var(--muted); font-size: 1rem; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.row--wide .meta { margin-top: 10px; }

/* Ranked list (most read) */
.ranked { counter-reset: rank; }
.ranked li {
  counter-increment: rank; position: relative;
  padding: 12px 0 12px 36px; border-top: 1px solid var(--line);
}
.ranked li:first-child { border-top: 0; }
.ranked li::before {
  content: counter(rank);
  position: absolute; left: 0; top: 12px;
  font-family: var(--font-head); font-weight: 600; font-size: 1.25rem; color: var(--link);
  width: 26px; text-align: center;
}
.ranked a { font-family: var(--font-head); font-weight: 600; font-size: 1.0625rem; line-height: 1.25; }
.ranked a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* 7. Layout grids ----------------------------------------------------------- */
.page-section { padding-block: 32px; }
.page-section + .page-section { padding-top: 8px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; align-items: start; }
.rail { display: grid; gap: 32px; }
.rail--sticky { position: sticky; top: 16px; }
.stack > * + * { margin-top: 40px; }

.grid { display: grid; gap: 24px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* 8. Full-width bands ------------------------------------------------------- */
.band { padding-block: 40px; }
.band--dark { background: var(--navy); color: var(--on-dark); }
.band--soft { background: var(--soft); }

/* Newsletter signup */
.newsletter { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center; }
.newsletter__title { font-size: 2rem; margin-bottom: 10px; }
.newsletter__text { margin: 0; color: var(--on-dark-muted); max-width: 46ch; }
.newsletter-form { display: grid; gap: 12px; }
.newsletter-form .field label { color: var(--on-dark); }
.newsletter-form__row { display: flex; gap: 8px; align-items: stretch; }
.newsletter-form__row .field { flex: 1; }
.newsletter-form__row .btn { align-self: end; min-height: 48px; }
.form-note { margin: 0; font-size: 0.875rem; color: var(--on-dark-muted); }
.form-note a { text-decoration: underline; text-underline-offset: 3px; }
.form-status { margin: 0; min-height: 1.5em; font-weight: 600; }
.form-status[data-state="error"] { color: #ffb4a8; }
.form-status[data-state="ok"] { color: #9ff0bd; }

/* Compact newsletter card for rails and articles */
.signup-card { background: var(--navy); color: var(--on-dark); padding: 24px; border-radius: var(--radius); border-top: 5px solid var(--accent); }
.signup-card h2, .signup-card h3 { font-size: 1.375rem; margin-bottom: 8px; }
.signup-card > p { color: var(--on-dark-muted); margin-bottom: 16px; }
.signup-card .newsletter-form__row { flex-direction: column; }
.signup-card .newsletter-form__row .btn { align-self: stretch; }

/* Directory teaser cards (AI agencies) */
.dir-card {
  position: relative; display: flex; flex-direction: column; gap: 6px;
  padding: 20px; background: var(--white); border: 1px solid var(--line); border-top: 4px solid var(--accent);
  border-radius: var(--radius);
}
.dir-card h3 { font-size: 1.1875rem; }
.dir-card h3 a::after { content: ""; position: absolute; inset: 0; }
.dir-card:hover h3 a { text-decoration: underline; text-underline-offset: 3px; }
.dir-card p { margin: 0; color: var(--muted); font-size: 0.9375rem; }

/* Awards promo */
.promo { display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; align-items: center; }
.promo h2 { font-size: 2rem; margin-bottom: 10px; }
.promo p { color: var(--on-dark-muted); max-width: 52ch; }

/* 9. Category header -------------------------------------------------------- */
.breadcrumb { font-size: 0.875rem; color: var(--on-dark-muted); padding-top: 16px; }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.breadcrumb li + li::before { content: "/"; margin-right: 8px; opacity: 0.7; }
.breadcrumb a { text-decoration: underline; text-underline-offset: 3px; }
.breadcrumb--light { color: var(--muted); padding-top: 0; margin-bottom: 14px; }
.cat-head { background: linear-gradient(180deg, var(--navy) 0%, #0d1c42 100%); color: var(--on-dark); padding-bottom: 28px; }
.cat-head h1 { font-size: 3rem; margin: 12px 0 8px; }
.cat-head p { margin: 0 0 18px; max-width: 62ch; color: var(--on-dark-muted); font-size: 1.0625rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips a {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px;
  border: 1px solid var(--navy-600); border-radius: 999px;
  background: var(--navy-700); font-size: 0.875rem; font-weight: 600;
}
.chips a:hover { text-decoration: none; border-color: var(--accent); }
.chips a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.cat-top { display: grid; grid-template-columns: 6fr 6fr; gap: 32px; align-items: stretch; }
.lead-col { display: flex; flex-direction: column; }
.lead-col > .card { flex: 1; }
/* Lead image absorbs spare height so both columns end on the same line */
.card--fill .media { flex: 1 1 auto; aspect-ratio: auto; min-height: 240px; }
.card--fill .media img { position: absolute; inset: 0; }
.cat-top .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.feature-split { display: grid; grid-template-columns: 4fr 5fr; gap: 32px; align-items: center; }
.feature-split h2 { font-size: 1.75rem; margin-bottom: 10px; }
.feature-split .more-coverage { margin-top: 16px; }

.pagination { margin-top: 32px; }
.pagination ul { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pagination a, .pagination span.page {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; min-height: 44px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--radius); font-weight: 700;
}
.pagination a { color: var(--link); }
.pagination a:hover { background: var(--soft); text-decoration: none; }
.pagination a[aria-current="page"] { background: var(--navy); color: var(--on-dark); border-color: var(--navy); }
.pagination .gap { padding: 0 4px; color: var(--muted); }

/* 10. Article --------------------------------------------------------------- */
.article-hero-band { background: linear-gradient(180deg, var(--navy) 0%, #0d1c42 100%); color: var(--on-dark); padding: 28px 0 36px; }
.article-hero-band .kicker { margin: 0 0 12px; color: #8ab8ff; font-size: 0.9375rem; }
.article-hero-band .kicker a { text-decoration: underline; text-underline-offset: 3px; }
.article-hero-band h1 { font-size: 3rem; max-width: 880px; }

.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; align-items: start; padding-top: 24px; }
.article-main { min-width: 0; }
.hero-figure { margin: 0; }
.hero-figure .media { border-radius: 0; }
.hero-figure figcaption, .inline-figure figcaption { font-size: 0.875rem; color: var(--muted); padding-top: 10px; }

/* Body column is narrower than the image and centred under it */
.article-body { max-width: 700px; margin: 28px auto 0; }
.article-body > * + * { margin-top: 36px; }

.byline { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.byline__by { font-size: 0.9375rem; font-weight: 700; margin: 0 0 2px; }
.byline__by a { text-decoration: underline; text-underline-offset: 3px; }
.share { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.share .btn { min-height: 40px; }

.prose { font-size: 1.125rem; line-height: 1.7; }   /* 18px article text */
.prose > * + * { margin-top: 1.2em; }
.prose p { margin-bottom: 0; }
.prose h2 { font-size: 1.5rem; margin-top: 1.9em; }
.prose h3 { font-size: 1.375rem; margin-top: 1.6em; }
.prose a { color: var(--link); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose a:hover { color: var(--link-hover); text-decoration-thickness: 2px; }
/* Cards inside the article keep their own link styling */
.prose .card a { color: inherit; text-decoration: none; }
.prose .card a:hover { color: inherit; text-decoration: underline; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li + li { margin-top: 0.5em; }
.prose li::marker { color: var(--link); }

.inline-figure { margin-inline: 0; }
.inline-related { border-top: 5px solid var(--accent); padding-top: 12px; }
.inline-related h2 { font-size: 1.125rem; margin: 0 0 14px !important; }
.inline-related .grid { gap: 16px; }
.inline-related .card__title { font-size: 1rem; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; font-size: 0.875rem; font-weight: 600; color: var(--link); }
.tags a:hover { background: var(--soft); text-decoration: none; }

.authors { display: grid; gap: 20px; border-top: 1px solid var(--line); padding-top: 24px; }
.author { display: grid; grid-template-columns: 64px 1fr; gap: 16px; align-items: start; }
.author .media { border-radius: 50%; width: 64px; height: 64px; }
.author h2, .author h3 { font-size: 1.0625rem; margin-bottom: 2px; }
.author p { margin: 0; font-size: 0.9375rem; color: var(--muted); }
.author a, .conversation a { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }

.conversation { border-top: 1px solid var(--line); padding-top: 24px; }
.conversation h2 { font-size: 1.75rem; margin-bottom: 6px; }
.comment-form { display: grid; gap: 12px; margin: 18px 0 8px; }
.comments > li { display: grid; grid-template-columns: 40px 1fr; gap: 12px; padding: 16px 0; border-top: 1px solid var(--line); }
.comments p { margin: 0; }
.comment__head { font-size: 0.9375rem; margin-bottom: 4px !important; }
.comment__head time { color: var(--muted); margin-left: 8px; font-size: 0.875rem; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--navy); color: var(--on-dark); display: grid; place-items: center; font-weight: 700; font-size: 0.8125rem; }

/* 10b. Page, search, 404 and author templates ------------------------------- */
.page-article { min-width: 0; max-width: 700px; }
.page-article > .meta { margin-bottom: 16px; }
.toc { border: 1px solid var(--line); border-left: 5px solid var(--accent); background: var(--soft); padding: 18px 20px; border-radius: var(--radius); }
.toc h2 { font-size: 1.0625rem; margin: 0 0 8px !important; }
.toc ol { list-style: decimal; padding-left: 1.3em; font-size: 1rem; line-height: 1.5; }
.toc li + li { margin-top: 4px; }
.prose h2[id] { scroll-margin-top: 16px; }

.side-nav h2 { font-size: 1.125rem; padding-top: 12px; border-top: 5px solid var(--accent); margin-bottom: 8px; }
.side-nav a { display: block; padding: 10px 0; border-top: 1px solid var(--line); font-weight: 600; color: var(--ink); }
.side-nav li:first-child a { border-top: 0; }
.side-nav a:hover { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
.side-nav a[aria-current="page"] { color: var(--link); box-shadow: inset 3px 0 0 var(--accent); padding-left: 12px; }

.search-form { display: flex; gap: 8px; align-items: end; max-width: 640px; }
.search-form .field { flex: 1; }
.search-form .btn { min-height: 48px; }
.search-form--hero .field label { color: var(--on-dark); }
.results-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.results-bar .meta { margin: 0; }
.field--inline { display: flex; align-items: center; gap: 8px; }
.field--inline select { min-height: 44px; padding: 0 12px; border: 2px solid #6f7b94; border-radius: var(--radius); background: var(--white); color: var(--ink); }
.field--inline select:focus-visible { outline-offset: 0; border-color: var(--accent); }
.row__excerpt mark, mark { background: #dbe8ff; color: var(--ink); padding: 0 2px; border-radius: 2px; }
.empty-state h2 { font-size: 1.75rem; margin-bottom: 10px; }
.empty-state p { color: var(--muted); max-width: 56ch; }
.empty-state h3 { font-size: 1.125rem; margin: 28px 0 6px; }
.link-list li { border-top: 1px solid var(--line); }
.link-list li:first-child { border-top: 0; }
.link-list a { display: block; padding: 10px 0; font-weight: 600; color: var(--link); }
.link-list a:hover { color: var(--link-hover); text-decoration: underline; text-underline-offset: 3px; }
.chips--light a { background: var(--white); border-color: var(--line); color: var(--link); }
.chips--light a:hover { border-color: var(--accent); background: var(--soft); }

.not-found { padding-block: 56px 48px; }
.not-found__code { font-family: var(--font-head); font-weight: 600; font-size: 7rem; line-height: 1; color: #7388b5; /* 3.5:1 on white, decorative */ margin: 0 0 8px; }
.not-found h1 { font-size: 2.5rem; margin: 4px 0 12px; }
.not-found__text { max-width: 52ch; color: var(--muted); font-size: 1.125rem; margin: 0 0 24px; }
.not-found .search-form { margin-bottom: 20px; }
.not-found__links { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; }
.btn--outline-dark { border-color: var(--navy); color: var(--navy); background: transparent; }
.btn--outline-dark:hover { background: var(--soft); }

.author-head .kicker { margin: 0; color: #8ab8ff; }
.author-head h1 { margin: 6px 0 10px; }
.author-head__grid { display: grid; grid-template-columns: 148px minmax(0, 1fr); gap: 28px; align-items: start; margin-top: 20px; }
.author-head__photo { border-radius: 50%; width: 148px; height: 148px; border: 3px solid var(--accent); }
.author-head__links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0 0 14px; }
.author-head__links a { text-decoration: underline; text-underline-offset: 3px; font-weight: 600; color: #8ab8ff; }
.author-head .author-head__stat { margin: 0; font-size: 0.9375rem; color: var(--on-dark); }
.cat-head .author-head__stat strong { font-family: var(--font-head); font-size: 1.125rem; }

@media (max-width: 640px) {
  .search-form { flex-direction: column; align-items: stretch; }
  .not-found { padding-block: 32px; }
  .not-found__code { font-size: 4.5rem; }
  .not-found h1 { font-size: 2rem; }
  .author-head__grid { grid-template-columns: 1fr; gap: 16px; }
  .author-head__photo { width: 104px; height: 104px; }
}

/* 10c. Front-page top stories (three columns under the header) ---------------- */
.top-stories { padding-bottom: 40px; border-bottom: 1px solid var(--line); }
.top-strip { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 24px; margin: 0; padding: 16px 0 14px; font-size: 0.875rem; color: var(--muted); }
.top-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.45fr) minmax(0, 1fr); align-items: stretch; }
.top-side { padding-right: 32px; display: flex; flex-direction: column; gap: 28px; }
.top-main { padding: 0 32px; border-inline: 1px solid var(--line); }
.top-latest { padding-left: 32px; }

.top-stories .kicker { margin: 18px 0 6px; font-size: 0.875rem; }
.top-date { margin: 0; font-size: 0.875rem; color: var(--muted); }
.top-card { position: relative; }
.top-card + .top-card { border-top: 1px solid var(--line); padding-top: 28px; }
.top-card__title { font-size: 1.625rem; line-height: 1.15; margin: 0 0 12px; }
.top-card__title a::after, .top-lead__title a::after { content: ""; position: absolute; inset: 0; }
.top-card:hover .top-card__title a, .top-lead:hover .top-lead__title a { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; }
.top-card .media { margin-top: 0; }
.top-card + .top-card .media { position: relative; }

.top-lead { position: relative; }
.top-lead__title { font-size: clamp(2rem, 3.6vw, 3.25rem); line-height: 1.05; margin: 0 0 14px; text-wrap: balance; }
.top-lead__summary { margin: 0; font-size: 1.25rem; line-height: 1.5; color: var(--muted); max-width: 60ch; }
.top-more { margin-top: 24px; border-top: 1px solid var(--line); }
.top-more li { padding: 12px 0 0; }
.top-more a { font-family: var(--font-head); font-weight: 600; font-size: 1.0625rem; color: var(--ink); }
.top-more a:hover { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }

.top-latest h2 { font-size: 1.375rem; padding-top: 12px; border-top: 6px solid var(--navy); margin: 0 0 6px; }
.top-latest li { padding: 16px 0 18px; border-bottom: 1px solid var(--line); }
.top-latest li:last-child { border-bottom: 0; }
.top-latest__title { font-size: 1.375rem; line-height: 1.2; margin: 6px 0 0; }
.top-latest__title a:hover { text-decoration: underline; text-underline-offset: 3px; color: var(--link-hover); }

@media (max-width: 1000px) {
  .top-grid { grid-template-columns: 1fr; gap: 32px; }
  .top-main { order: 1; padding: 0; border-inline: 0; }
  .top-side { order: 2; padding-right: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
  .top-card + .top-card { border-top: 0; padding-top: 0; }
  .top-latest { order: 3; padding-left: 0; }
}
@media (max-width: 640px) {
  .top-side { grid-template-columns: 1fr; }
  .top-lead__summary { font-size: 1.125rem; }
  .top-card__title { font-size: 1.375rem; }
  .top-card + .top-card { border-top: 1px solid var(--line); padding-top: 24px; }
}

/* 11. Footer ---------------------------------------------------------------- */
.site-footer { background: var(--navy); color: var(--on-dark); margin-top: 48px; }
.site-footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; padding-block: 48px 32px; }
.site-footer h2 { font-size: 1rem; margin-bottom: 14px; }
.site-footer p { color: var(--on-dark-muted); font-size: 0.9375rem; max-width: 44ch; }
.site-footer .tagline { font-family: var(--font-head); font-weight: 600; font-size: 1.125rem; color: var(--on-dark-muted); margin: 14px 0 10px; }
.site-footer li + li { margin-top: 2px; }
.site-footer li a { display: inline-block; padding: 6px 0; font-size: 0.9375rem; color: var(--on-dark-muted); }
.site-footer li a:hover { color: var(--on-dark); }
.site-footer__bottom { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: center; border-top: 1px solid var(--navy-600); padding-block: 20px; font-size: 0.875rem; color: var(--on-dark-muted); }
.site-footer__bottom p { margin: 0; max-width: none; }
.social { display: flex; gap: 4px; }
.social a { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: var(--radius); }
.social a:hover { background: rgba(255, 255, 255, 0.12); }
.social svg { width: 22px; height: 22px; fill: currentColor; }

/* 12. Responsive ------------------------------------------------------------ */
@media (max-width: 1080px) {
  .layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; }
  .article-layout { grid-template-columns: minmax(0, 1fr) 260px; gap: 28px; }
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .menu-toggle { display: inline-flex; }
  .js .primary-nav { display: none; position: absolute; left: 0; right: 0; top: 64px; z-index: 50; background: var(--navy-700); border-top: 1px solid var(--navy-600); }
  .js .primary-nav.is-open { display: block; }
  .primary-nav { position: static; }
  .primary-nav ul { flex-direction: column; gap: 0; padding: 8px var(--gutter) 16px; }
  .primary-nav a { padding: 14px 4px; font-size: 1.0625rem; }
  .primary-nav a[aria-current="page"] { box-shadow: none; color: #8ab8ff; }
  .site-header { position: relative; }
  .header-actions .btn { display: none; }

  .layout, .article-layout { grid-template-columns: 1fr; }
  .rail--sticky { position: static; }
  .lead, .cat-top, .feature-split, .newsletter, .promo { grid-template-columns: 1fr; }
  .lead .media { order: -1; }
  .cat-head h1 { font-size: 2.25rem; }
  .article-hero-band h1 { font-size: 2.25rem; }
  .article-hero-band { padding: 20px 0 28px; }
  .site-footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .grid--2, .grid--3, .grid--4, .cat-top .grid { grid-template-columns: 1fr; }
  .row--wide { grid-template-columns: 1fr 104px; gap: 12px; }
  .row--wide .row__title { font-size: 1.0625rem; }
  .row__excerpt { display: none; }
  .card--fill .media { min-height: 0; aspect-ratio: 16 / 9; flex: none; }
  .newsletter-form__row { flex-direction: column; }
  .newsletter-form__row .btn { align-self: stretch; }
  .newsletter__title, .promo h2 { font-size: 1.625rem; }
  .site-footer__grid { grid-template-columns: 1fr; gap: 28px; }
  .prose { font-size: 1.125rem; }
}

/* 13. User preferences ------------------------------------------------------ */

/* 14. Hover and press motion ------------------------------------------------
   assets/js/motion.js drives these on Feel springs (mass, stiffness, damping):
   the numbers below are written by the springs, there are no durations here.
   Without JavaScript (or in forced-colors mode) the plain hover rules above apply.
   Underlines grow from --u (0 to 1). Links get 4px of vertical padding, which
   does not change the layout but lifts the hit area to 24px or more. */
.prose a, .toc a, .meta a, .byline__by a, .hero-figure figcaption a, .author-head__links a, .author a, .form-note a { padding-block: 4px; }
html.fx :is(.card__title a, .top-card__title a, .top-lead__title a, .row__title a, .dir-card h3 a, .lead__title a,
  .more-coverage a, .top-more a, .top-latest__title a, .ranked a, .side-nav a, .link-list a, .topics-bar a,
  .site-footer li a, .topic-row a, .section-head a, .kicker a, .primary-nav a, .breadcrumb a) {
  text-decoration: none !important; /* the spring-driven line below replaces the instant underline */
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 0 calc(100% - var(--u-off, 3px));
  background-size: calc(var(--u, 0) * 100%) var(--u-h, 2px);
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
html.fx :is(.card__title a, .top-card__title a, .top-lead__title a, .row__title a, .dir-card h3 a, .lead__title a,
  .more-coverage a, .top-more a, .top-latest__title a, .ranked a, .side-nav a, .link-list a,
  .site-footer li a, .section-head a, .kicker a, .breadcrumb a) { padding-block: 4px; }
html.fx :is(.prose a, .toc a, .meta a, .byline__by a, .hero-figure figcaption a, .author-head__links a, .author a, .form-note a):not(.card a, .btn) {
  text-decoration: none !important;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 0 calc(100% - 3px);
  background-size: 100% calc(1px + var(--u, 0) * 2px);
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
html.fx .primary-nav a { --u-h: 3px; --u-off: 0px; background-image: linear-gradient(var(--accent), var(--accent)); }
html.fx .breadcrumb a { background-size: 100% calc(1px + var(--u, 0) * 2px); --u-off: 4px; }
html.fx .card__title a, html.fx .top-card__title a, html.fx .top-lead__title a, html.fx .row__title a, html.fx .dir-card h3 a, html.fx .lead__title a { --u-off: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  .btn--accent, .chips a[aria-current="page"] { border-color: ButtonText; }
  .section-head { border-top-color: CanvasText; }
}
@media print {
  .site-header, .site-footer, .signup-card, .newsletter, .rail, .share, .skip-link { display: none !important; }
  .prose { font-size: 12pt; }
}
