/* Articles Factory — v3 public site styles.
   Bump app.assets.version in application.properties after editing (file is cached for a year). */

/* ---------- Tokens ---------- */
:root {
  --ink: #0F0F10;
  --ink-2: #1F2024;
  --muted: #55575E;
  --meta: #6B6D74;
  --faint: #8E9097;
  --line: #E5E5E7;
  --line-soft: #F0F0F2;
  --wash: #F5F5F6;
  --paper: #FFFFFF;
  --red: #C8161D;
  --red-logo: #B3131B;
  --serif: Newsreader, Georgia, 'Times New Roman', serif;
  --sans: Geist, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --page: 1320px;
  --gutter: clamp(20px, 4vw, 32px);
  --radius: 2px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--red); }
button { font: inherit; color: inherit; }
h1, h2, h3, h4, p, ol, ul, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
[hidden] { display: none !important; }

.wrap { max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 14px; }

/* ---------- Type helpers ---------- */
.kicker {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--red);
}
.kicker--muted { color: var(--meta); }
.meta { font-family: var(--mono); font-size: 12px; color: var(--meta); }
.more { padding: 12px 0; font-size: 14px; font-weight: 600; white-space: nowrap; }
.more--muted { color: var(--muted); }

/* ---------- Logo ---------- */
.logo { display: flex; align-items: center; gap: 3px; flex: 0 0 auto; }
.logo:hover { color: inherit; }
.logo__word {
  font-family: 'Times New Roman', Times, serif; font-size: clamp(28px, 3.4vw, 34px);
  letter-spacing: -0.02em; color: #1A1A1A; line-height: 1;
}
.logo__tag {
  position: relative; background: var(--red-logo); color: #fff;
  font-family: Oswald, 'Arial Narrow', sans-serif; font-size: clamp(18px, 2.2vw, 22px);
  font-weight: 600; letter-spacing: 0.03em; line-height: 1; padding: 5px 16px 4px 8px;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
}
.logo__tag::after {
  content: ''; position: absolute; top: 0; right: 0; width: 10px; height: 10px;
  background: #E7A1A6; clip-path: polygon(0 0, 0 100%, 100% 100%);
}
.logo--footer .logo__word { font-size: clamp(36px, 5vw, 52px); color: #fff; }
.logo--footer .logo__tag {
  background: #fff; color: var(--ink); font-size: clamp(22px, 3.2vw, 33px); padding: 6px 22px 5px 10px;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
}
.logo--footer .logo__tag::after { width: 14px; height: 14px; background: var(--faint); }

/* ---------- Header ---------- */
.site-header { position: relative; z-index: 40; background: var(--paper); border-bottom: 1px solid var(--line); }
.site-header__bar { height: 72px; display: flex; align-items: center; gap: 40px; background: var(--paper); }
.main-nav { display: none; flex: 1 1 auto; min-width: 0; align-items: stretch; height: 72px; gap: 4px; }
@media (min-width: 1000px) { .main-nav { display: flex; } }
.main-nav__item { display: flex; align-items: center; padding-left: 10px; box-shadow: inset 0 0 0 transparent; }
.main-nav__item.is-active { box-shadow: inset 0 -2px 0 var(--red); }
.main-nav__item.is-open { box-shadow: inset 0 -2px 0 var(--ink); }
.main-nav__link {
  display: flex; align-items: center; height: 44px; font-size: 15px; font-weight: 500;
  letter-spacing: -0.005em; white-space: nowrap;
}
.main-nav__item.is-active .main-nav__link { font-weight: 600; color: var(--red); }
.icon-btn {
  min-width: 44px; height: 44px; border: 0; background: none; border-radius: 4px; padding: 0;
  display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink);
}
.icon-btn:hover { color: var(--red); }
.main-nav__toggle { min-width: 32px; width: 32px; color: #8A8C93; }
.header-tools { flex: 0 0 auto; margin-left: auto; display: flex; gap: 4px; align-items: center; }
.header-tools__account { padding: 0 10px; font-size: 14px; font-weight: 600; height: 44px; display: none; align-items: center; }
@media (min-width: 640px) { .header-tools__account { display: flex; } }
.menu-btn {
  padding: 0 6px 0 10px; gap: 8px; font-family: var(--mono); font-size: 12px;
  letter-spacing: 0.06em; text-transform: uppercase;
}

.backdrop { position: fixed; inset: 0; z-index: -1; border: 0; padding: 0; background: rgba(15, 15, 16, 0.16); cursor: default; }
.panel {
  position: absolute; top: 100%; left: 0; right: 0; background: var(--paper);
  border-top: 1px solid var(--line); box-shadow: 0 24px 48px rgba(15, 15, 16, 0.08);
  max-height: calc(100vh - 72px); overflow-y: auto;
}
.panel__label { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--meta); margin-bottom: 14px; }

.mega { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); padding-top: 32px; padding-bottom: 40px; }
.mega__col { padding-right: 40px; }
.mega__col + .mega__col { padding: 0 0 0 40px; border-left: 1px solid var(--line); }
.mega__title { display: block; font-family: var(--serif); font-size: 28px; font-weight: 500; letter-spacing: -0.015em; line-height: 1.1; }
.mega__popular { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px 32px; }
.thumb-link { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 16px; align-items: center; }
.thumb-link__title { font-family: var(--serif); font-size: 17px; font-weight: 500; line-height: 1.28; }

.search-panel__form { display: flex; gap: 8px; padding-top: 24px; padding-bottom: 28px; }
.field {
  flex: 1 1 auto; min-width: 0; height: 52px; padding: 0 16px; border: 1px solid var(--ink);
  border-radius: var(--radius); font: inherit; font-size: 16px; background: var(--paper); color: var(--ink);
}
.btn-solid {
  flex: 0 0 auto; height: 52px; padding: 0 24px; border: 0; border-radius: var(--radius);
  background: var(--ink); color: #fff; font-size: 15px; font-weight: 600; cursor: pointer;
}
.btn-solid:hover { background: var(--red); }

.drawer { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); column-gap: 40px; padding-top: 8px; padding-bottom: 32px; }
.drawer__group { padding: 16px 0; border-bottom: 1px solid var(--line); }
.drawer__title { display: block; padding: 6px 0; font-family: var(--serif); font-size: 24px; font-weight: 500; letter-spacing: -0.01em; }
.drawer__links { display: flex; flex-wrap: wrap; column-gap: 16px; }
.drawer__links a { padding: 12px 0; font-size: 14px; color: var(--muted); }
.drawer__links a:hover { color: var(--red); }

/* ---------- Media (images with a tinted placeholder so nothing shifts while loading) ---------- */
.media { display: block; width: 100%; background: #DCD8CF; border-radius: var(--radius); overflow: hidden; aspect-ratio: 3 / 2; }
.media > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.media--4x5 { aspect-ratio: 4 / 5; }
.media--4x3 { aspect-ratio: 4 / 3; }
.media--16x10 { aspect-ratio: 16 / 10; }
.media--1x1 { aspect-ratio: 1 / 1; }
.tone-business { background: #D6D8DE; }
.tone-finance { background: #D2D9D4; }
.tone-health { background: #DDD5CF; }
.tone-technology { background: #D3D8DF; }
.tone-travel { background: #DCD8CF; }
.tone-animals-and-pets { background: #D9D6CB; }

/* ---------- Advertising (heights reserved up front: no layout shift) ---------- */
.adbox { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.adbox__label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }
.adbox__slot { width: 100%; overflow: hidden; }
.adbox__slot--leaderboard { max-width: 970px; min-height: 100px; }
@media (min-width: 728px) { .adbox__slot--leaderboard { min-height: 90px; } }
@media (min-width: 1000px) { .adbox__slot--leaderboard { min-height: 250px; } }
.adbox__slot--rect { width: 300px; max-width: 100%; min-height: 250px; }
.adbox__slot--tall { width: 300px; min-height: 600px; }
/* The AdSense unit itself: sized here (not by data-ad-format) so it can never outgrow its slot */
.adbox__unit { display: block; margin: 0 auto; }
.adbox__unit--leaderboard { width: 320px; height: 100px; }
@media (min-width: 728px) { .adbox__unit--leaderboard { width: 728px; height: 90px; } }
@media (min-width: 1000px) { .adbox__unit--leaderboard { width: 970px; height: 250px; } }
.adbox__unit--rect { width: 300px; height: 250px; }
.adbox__unit--tall { width: 300px; height: 600px; }
.adbox--preview .adbox__slot {
  background: repeating-linear-gradient(135deg, var(--wash) 0 10px, #EDEDEF 10px 11px);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 11px; color: var(--faint);
}

/* ---------- Section heading ---------- */
.section { padding-top: 64px; }
.section--loose { padding-top: 80px; }
.section-head { display: flex; align-items: baseline; gap: 16px; border-top: 1px solid var(--ink); padding-top: 14px; margin-bottom: 32px; }
.section-head__num { font-family: var(--mono); font-size: 12px; color: var(--red); }
.section-head__title { font-family: var(--serif); font-size: clamp(28px, 2.6vw, 36px); font-weight: 500; letter-spacing: -0.018em; line-height: 1.15; }
.section-head .more { margin-left: auto; }

/* ---------- Ranked list ("Most read") ---------- */
.rank__title {
  margin-bottom: 4px; padding-bottom: 12px; border-bottom: 1px solid var(--ink);
  font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
}
.rank { counter-reset: rank; }
.rank > li { border-bottom: 1px solid var(--line); counter-increment: rank; }
.rank a { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 8px; padding: 14px 0; }
.rank a::before {
  content: counter(rank, decimal-leading-zero); font-family: var(--mono); font-size: 12px;
  color: var(--red); padding-top: 4px; font-variant-numeric: tabular-nums;
}
.rank__text { font-family: var(--serif); font-size: 18px; font-weight: 500; line-height: 1.25; letter-spacing: -0.005em; }

/* ---------- Cards ---------- */
.story { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.story__title { font-family: var(--serif); font-size: 22px; line-height: 1.2; font-weight: 500; letter-spacing: -0.01em; text-wrap: balance; }
.story__dek { font-size: 15px; line-height: 1.5; color: var(--muted); text-wrap: pretty; }
.story-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr)); gap: 40px 32px; }

/* ---------- Home: hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; padding: 40px 0 56px; }
.hero__lead { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.hero__title { font-family: var(--serif); font-size: clamp(34px, 4.1vw, 56px); line-height: 1.04; font-weight: 500; letter-spacing: -0.022em; text-wrap: balance; }
.hero__dek { font-family: var(--serif); font-size: clamp(18px, 1.5vw, 21px); line-height: 1.45; color: var(--muted); max-width: 620px; text-wrap: pretty; }
.hero__secondary { display: flex; flex-direction: column; gap: 28px; min-width: 0; }
.hero__secondary .story__title { font-size: 23px; line-height: 1.18; letter-spacing: -0.012em; }
.hero__rank { display: flex; flex-direction: column; gap: 32px; min-width: 0; }
@media (min-width: 760px) {
  .hero { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 48px; }
  .hero__lead { grid-column: 1 / -1; }
  .hero__rank { border-left: 1px solid var(--line); padding-left: 32px; }
}
@media (min-width: 1180px) {
  .hero { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) 332px; column-gap: 32px; }
  .hero__lead { grid-column: auto; }
  .hero__secondary { border-left: 1px solid var(--line); padding-left: 32px; }
}

/* ---------- Home: topic strip ---------- */
.topics {
  display: flex; align-items: center; gap: 28px; padding: 16px 0;
  border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line);
  overflow-x: auto; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent);
  mask-image: linear-gradient(90deg, #000 88%, transparent);
}
.topics::-webkit-scrollbar { display: none; }
.topics > * { flex: 0 0 auto; }
.topics a { padding: 12px 0; font-size: 15px; font-weight: 500; white-space: nowrap; }

/* ---------- Home: latest by topic ---------- */
.mods { display: grid; grid-template-columns: minmax(0, 1fr); gap: 64px; }
@media (min-width: 980px) { .mods { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 72px; } }
.mod { display: flex; flex-direction: column; min-width: 0; }
.mod__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 18px; }
.mod__name { font-family: var(--serif); font-size: 26px; font-weight: 600; letter-spacing: -0.015em; }
.mod__lead { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
@media (min-width: 560px) { .mod__lead { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; } }
.mod__lead-text { display: flex; flex-direction: column; gap: 10px; }
.mod__list > li { border-bottom: 1px solid var(--line); }
.mod__list a { display: block; padding: 14px 0; font-family: var(--serif); font-size: 18px; font-weight: 500; line-height: 1.3; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #A7A9AF; }
.site-footer a:hover { color: #fff; }
.site-footer__top {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 32px;
  padding: 72px 0 48px; border-bottom: 1px solid #2A2B2F;
}
.site-footer__lede { max-width: 460px; font-family: var(--serif); font-size: 21px; line-height: 1.4; color: #E4E4E7; text-wrap: pretty; }
.site-footer__cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 32px; padding: 40px 0 56px; }
.site-footer__col { display: flex; flex-direction: column; }
.site-footer__col-title { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: #8E9097; margin-bottom: 8px; }
.site-footer__col a { padding: 12px 0; font-size: 15px; color: #C9CACE; }
.site-footer__legal {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px;
  padding: 20px 0 32px; border-top: 1px solid #2A2B2F; font-family: var(--mono); font-size: 12px; color: #8E9097;
}
.site-footer__legal nav { display: flex; gap: 20px; }
.site-footer__legal a { padding: 12px 0; color: #8E9097; }

/* ---------- Notices carried over from the current layout ---------- */
.notice { margin: 16px 0 0; padding: 12px 16px; border: 1px solid var(--line); border-left: 3px solid var(--red); border-radius: var(--radius); font-size: 15px; }

/* =====================================================================
   Article page
   ===================================================================== */
.art { display: grid; grid-template-columns: minmax(0, 1fr); gap: 56px; padding-top: 48px; padding-bottom: 96px; }
@media (min-width: 1000px) { .art { grid-template-columns: minmax(0, 1fr) 300px; gap: 64px; } }
@media (min-width: 1260px) {
  .art { grid-template-columns: 200px minmax(0, 1fr) 300px; gap: 56px; }
  .art--no-toc { grid-template-columns: minmax(0, 1fr) 300px; }
}
.art__main { min-width: 0; max-width: 700px; width: 100%; justify-self: center; }
.art__title { margin: 20px 0 18px; font-family: var(--serif); font-size: clamp(36px, 4.4vw, 58px); line-height: 1.02; font-weight: 500; letter-spacing: -0.028em; text-wrap: balance; }
.art__dek { margin-bottom: 28px; font-family: var(--serif); font-size: clamp(19px, 1.7vw, 22px); line-height: 1.45; color: var(--muted); text-wrap: pretty; }
.art__note { margin: 12px 0 32px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.02em; color: var(--meta); }
.art__rail { display: flex; flex-direction: column; gap: 40px; min-width: 0; }
.art__rail-sticky { position: sticky; top: 24px; }
.lg-only { display: none; }
@media (min-width: 1000px) { .lg-only { display: block; } }

.breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; font-family: var(--mono); font-size: 12px; color: var(--meta); }
.breadcrumb__current { color: var(--red); }

/* Staff-only action buttons above the title */
.admin-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.admin-bar:empty { display: none; }
.admin-bar form { margin: 0; }
.admin-bar .button {
  height: 36px; padding: 0 12px; border: 1px solid var(--ink); border-radius: var(--radius);
  background: var(--paper); color: var(--ink); font: 600 13px var(--sans); cursor: pointer;
}
.admin-bar .button:hover { background: var(--ink); color: #fff; }

/* Table of contents */
.toc-rail { display: none; }
@media (min-width: 1260px) { .toc-rail { display: block; position: sticky; top: 24px; align-self: start; max-height: calc(100vh - 48px); overflow-y: auto; } }
.toc__title { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--meta); padding-bottom: 12px; border-bottom: 1px solid var(--ink); }
.toc__progress { height: 2px; background: var(--line); }
.toc__progress-bar { width: 0; height: 2px; background: var(--red); }
.toc { margin-top: 8px; }
.toc a { display: flex; gap: 10px; padding: 10px 0; font-size: 14px; line-height: 1.35; border-bottom: 1px solid var(--line-soft); color: var(--meta); }
.toc a:hover { color: var(--red); }
.toc a.is-current { color: var(--ink); font-weight: 600; }
.toc__num { font-family: var(--mono); font-size: 11px; color: var(--faint); min-width: 18px; padding-top: 2px; font-weight: 400; }
.toc-m { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 32px; }
@media (min-width: 1260px) { .toc-m { display: none; } }
.toc-m summary { display: flex; justify-content: space-between; align-items: center; min-height: 52px; cursor: pointer; list-style: none; font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.toc-m summary::-webkit-details-marker { display: none; }
.toc-m__ico { font-size: 20px; line-height: 1; transition: transform .2s; }
.toc-m[open] .toc-m__ico { transform: rotate(45deg); }
.toc-m ol { margin-bottom: 12px; }
.toc-m li a { display: flex; gap: 12px; padding: 12px 0; font-size: 15px; border-top: 1px solid var(--line-soft); }

/* Byline */
.byline { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); }
.byline__who { display: flex; align-items: center; gap: 14px; min-width: 0; }
.byline__text { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 14px; line-height: 1.4; }
.byline__name { font-weight: 600; }
.avatar { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 999px; overflow: hidden; background: #DDD5CF; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; color: #5C4F45; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.share { display: flex; gap: 2px; }
.share__btn { font-family: var(--mono); font-size: 12px; }

/* Article body: contributor HTML, styled by element */
.prose { font-family: var(--serif); font-size: clamp(18px, 1.6vw, 20px); line-height: 1.65; color: var(--ink-2); text-wrap: pretty; overflow-wrap: break-word; counter-reset: section; }
.prose > * + * { margin-top: 22px; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose figure, .prose pre { margin: 0; }
.prose p + p, .prose * + p, .prose p + ul, .prose p + ol, .prose ul + p, .prose ol + p { margin-top: 22px; }
.prose a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose a:hover { color: var(--red); }
.prose h2, .prose h3, .prose h4, .prose h5, .prose h6 { font-family: var(--serif); color: var(--ink); font-weight: 500; line-height: 1.15; text-wrap: balance; }
.prose h2 { margin: 50px 0 0; font-size: clamp(26px, 2.6vw, 32px); letter-spacing: -0.018em; scroll-margin-top: 24px; }
.prose h2[id]::before { counter-increment: section; content: counter(section, decimal-leading-zero); display: block; margin-bottom: 8px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; color: var(--red); font-weight: 400; }
.prose h3 { margin: 36px 0 0; font-size: clamp(21px, 2vw, 24px); letter-spacing: -0.012em; }
.prose h4, .prose h5, .prose h6 { margin: 28px 0 0; font-size: 19px; font-weight: 600; }
.prose h2 + *, .prose h3 + *, .prose h4 + * { margin-top: 14px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li + li { margin-top: 8px; }
.prose li > ul, .prose li > ol { margin-top: 8px; }
.prose blockquote { padding-left: 20px; border-left: 2px solid var(--red); font-style: italic; color: var(--ink); }
.prose img, .prose video { display: block; max-width: 100%; height: auto; border-radius: var(--radius); margin-left: auto; margin-right: auto; }
.prose iframe { max-width: 100%; border: 0; }
.prose figure figcaption { margin-top: 10px; font-family: var(--mono); font-size: 11px; color: var(--meta); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }
.prose pre, .prose code { font-family: var(--mono); font-size: 0.85em; }
.prose pre { padding: 16px; background: var(--wash); border-radius: 4px; overflow-x: auto; }
.prose strong, .prose b { font-weight: 600; color: var(--ink); }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.prose table { border-collapse: collapse; width: 100%; font-family: var(--sans); font-size: 15px; line-height: 1.5; }
.prose th, .prose td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { font-weight: 600; border-bottom-color: var(--ink); }
/* In-article ad units injected by the server: reserve room so the text does not jump */
.prose .ad-unit { margin: 32px 0; min-height: 280px; font-family: var(--sans); }
/* AdSense marks a slot it could not fill; give the space back in that case */
.prose .ad-unit:has(ins[data-ad-status="unfilled"]) { display: none; }

/* Tags, author card */
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 48px; }
.tag { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: var(--radius); font-size: 14px; }
.tag:hover { border-color: var(--red); }
.author-card { display: flex; flex-direction: column; gap: 10px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--ink); }
.author-card__name { font-family: var(--serif); font-size: 22px; font-weight: 500; }
.author-card__about { font-size: 15px; line-height: 1.55; color: var(--muted); }
.author-card .more { align-self: flex-start; }

.rank--compact .rank__text { font-size: 17px; line-height: 1.28; }

/* Full-width bands under the article */
.band { border-top: 1px solid var(--ink); padding: 16px 0 80px; }
.band--plain { border-top-color: var(--line); }
.band__head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 32px; }
.band__head .more { margin-left: auto; }
.story--text { gap: 10px; padding-top: 16px; border-top: 1px solid var(--line); }
/* Pages that do not end in a full-width band add their own space above the footer */
.page-end { padding-bottom: 96px; }

/* =====================================================================
   List pages: category hub, author, tag, search, archive
   ===================================================================== */
.hub-head { padding-top: 48px; }
.hub-head .breadcrumb { margin-bottom: 20px; }
.hub-head__row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; padding-bottom: 32px; border-bottom: 1px solid var(--ink); }
@media (min-width: 960px) { .hub-head__row { grid-template-columns: minmax(0, 1fr) minmax(0, 400px); align-items: end; gap: 64px; } }
.hub-head__title-box { container-type: inline-size; min-width: 0; }
/* The inline font-size (container-query units) fits the longest line to the column; this is the fallback */
.hub-head__title { font-family: var(--serif); font-size: clamp(52px, 10vw, 136px); line-height: 0.86; font-weight: 500; letter-spacing: -0.045em; }
.hub-head__line { display: block; white-space: nowrap; }
.hub-head__amp { font-style: italic; font-weight: 400; color: var(--red); letter-spacing: 0; }
.hub-head__title--plain { font-size: clamp(36px, 5vw, 64px); line-height: 1; letter-spacing: -0.03em; text-transform: capitalize; }
.hub-head__desc { font-family: var(--serif); font-size: clamp(18px, 1.6vw, 21px); line-height: 1.45; color: var(--muted); text-wrap: pretty; }
.hub-head__page { padding-top: 14px; }

.hub-feat { padding-top: 48px; }
.feat { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
@media (min-width: 900px) { .feat { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: center; gap: 56px; } }
.feat__text { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.feat__title { font-family: var(--serif); font-size: clamp(30px, 3.4vw, 46px); line-height: 1.04; font-weight: 500; letter-spacing: -0.022em; text-wrap: balance; }
.feat__dek { font-family: var(--serif); font-size: 19px; line-height: 1.5; color: var(--muted); text-wrap: pretty; }
.feat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 40px 32px; margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--line); }
.mini { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 18px; align-items: start; }
.mini__title { font-family: var(--serif); font-size: 20px; line-height: 1.2; font-weight: 500; letter-spacing: -0.008em; text-wrap: balance; }

.with-rail { display: grid; grid-template-columns: minmax(0, 1fr); gap: 56px; padding-top: 64px; }
@media (min-width: 1040px) { .with-rail { grid-template-columns: minmax(0, 1fr) 300px; gap: 64px; } }
.with-rail__main { min-width: 0; }
.rail { display: flex; flex-direction: column; gap: 40px; min-width: 0; }
.rail__sticky { position: sticky; top: 24px; }
.section-head--tight { margin-bottom: 8px; }

.list-row { display: flex; flex-direction: column; gap: 8px; padding: 22px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.list-row__title { font-family: var(--serif); font-size: clamp(19px, 1.8vw, 23px); line-height: 1.2; font-weight: 500; letter-spacing: -0.01em; text-wrap: balance; }
.list-row__dek { font-size: 15px; line-height: 1.5; color: var(--muted); text-wrap: pretty; }
.empty { padding: 32px 0; color: var(--muted); }

.adbox--inlist { padding: 22px 0; border-bottom: 1px solid var(--line); }
.adbox__slot--inlist { min-height: 250px; }

.plain-list > li { border-bottom: 1px solid var(--line); }
.plain-list a { display: block; padding: 14px 0; font-family: var(--serif); font-size: 17px; font-weight: 500; line-height: 1.28; }

.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding-top: 32px; }
.pager__pages { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0 auto; }
.pager__num, .pager__gap { min-width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 13px; border-radius: var(--radius); }
.pager__num.is-current { background: var(--ink); color: #fff; }
.pager__step { height: 44px; display: inline-flex; align-items: center; font-size: 14px; font-weight: 600; }

/* =====================================================================
   Pages still built with their own markup (contact, FAQ, terms, privacy, password and
   verification forms, all categories, archive, errors). Several load Bootstrap and app.css
   in their own <head>, after this file, so the site chrome is re-asserted here with
   selectors those stylesheets cannot override, and their content gets the v3 type and spacing.
   ===================================================================== */
.site-header, .site-footer { font-family: var(--sans); font-size: 16px; line-height: 1.5; }
.site-header { color: var(--ink); }
.site-header a, .site-footer a { text-decoration: none; }
.site-header a { color: inherit; }
.site-header a:hover { color: var(--red); }
.site-header .main-nav__item.is-active .main-nav__link { color: var(--red); }
.site-header button, .site-footer button { border-radius: 4px; }
.site-header .btn-solid { border-radius: var(--radius); color: #fff; }
.site-header .logo:hover { color: inherit; }
.site-header ul, .site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-header .wrap, .site-footer .wrap { max-width: var(--page); padding-left: var(--gutter); padding-right: var(--gutter); }
.site-footer { color: #A7A9AF; }
.site-footer .site-footer__col a { color: #C9CACE; }
.site-footer .site-footer__legal a { color: #8E9097; }
.site-footer a:hover { color: #fff; }
.site-footer p { margin: 0; }
.skip { color: #fff; }

.legacy-page { max-width: var(--page); margin: 0 auto; padding: 48px var(--gutter) 96px; font-family: var(--sans); color: var(--ink-2); }
.legacy-page .container { max-width: 100%; padding: 0; }
.legacy-page h1, .legacy-page h2, .legacy-page h3 { font-family: var(--serif); font-weight: 500; color: var(--ink); letter-spacing: -0.018em; line-height: 1.15; }
.legacy-page h1, .legacy-page h2 { font-size: clamp(32px, 4vw, 52px); margin: 0 0 24px; }
.legacy-page h3 { font-size: clamp(21px, 2vw, 26px); margin: 32px 0 12px; }
.legacy-page h4, .legacy-page h5 { font-family: var(--sans); font-size: 17px; font-weight: 600; margin: 24px 0 8px; color: var(--ink); }
.legacy-page p, .legacy-page li { font-size: 17px; line-height: 1.6; }
.legacy-page p { margin: 0 0 16px; max-width: 760px; }
.legacy-page a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.legacy-page a:hover { color: var(--red); }
.legacy-page .colored { color: inherit; }
.legacy-page .spacer, .legacy-page .article__top--ad:empty, .legacy-page .articles__ad:empty { display: none; }
.legacy-page input[type="submit"], .legacy-page button[type="submit"], .legacy-page .btn-primary {
  min-height: 48px; padding: 0 24px; border: 0; border-radius: var(--radius); background: var(--ink); color: #fff;
  font: 600 15px var(--sans); cursor: pointer; text-decoration: none;
}
.legacy-page input[type="submit"]:hover, .legacy-page button[type="submit"]:hover, .legacy-page .btn-primary:hover { background: var(--red); color: #fff; }
.legacy-page .form-control, .legacy-page .form-select { border-radius: var(--radius); border-color: #BDBEC3; }
.legacy-page .form-control:focus, .legacy-page .form-select:focus { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.legacy-page .alert { border-radius: var(--radius); }
/* Two-column pages (all categories, archive): list on the left, link lists on the right */
.legacy-page .article__inner { display: grid; grid-template-columns: minmax(0, 1fr); gap: 56px; }
@media (min-width: 1040px) { .legacy-page .article__inner { grid-template-columns: minmax(0, 1fr) 300px; gap: 64px; } }
.legacy-page .article__list { border-top: 1px solid var(--ink); }
.legacy-page .article__list a.elem__article { display: block; padding: 16px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.legacy-page .article__list a.elem__article h3 { margin: 0; font-size: 22px; }
.legacy-page .article__list a.elem__article p { margin: 6px 0 0; font-size: 15px; color: var(--muted); }
.legacy-page .side__articles { display: flex; flex-direction: column; gap: 40px; }
.legacy-page .side__articles.short { display: none; }
.legacy-page .side__element h2 { margin: 0 0 4px; padding-bottom: 12px; border-bottom: 1px solid var(--ink); font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; }
.legacy-page .side__list ul { list-style: none; margin: 0; padding: 0; }
.legacy-page .side__list li { border-bottom: 1px solid var(--line); }
.legacy-page .side__list a { display: block; padding: 14px 0; font-family: var(--serif); font-size: 17px; font-weight: 500; line-height: 1.28; text-decoration: none; }
/* Error pages */
.big-message { max-width: var(--page); margin: 0 auto; padding: 96px var(--gutter) 120px; font-family: var(--sans); }
.big-message h2 { margin: 0; font-family: var(--serif); font-size: clamp(88px, 16vw, 200px); line-height: 0.86; font-weight: 500; letter-spacing: -0.045em; color: var(--red); }
.big-message h3 { margin: 24px 0 12px; font-family: var(--serif); font-size: clamp(28px, 3vw, 40px); font-weight: 500; letter-spacing: -0.018em; }
.big-message p { margin: 0; font-size: 18px; line-height: 1.5; color: var(--muted); }
/* The older pages' own stylesheets load after this file; #main gives these rules the last word */
#main .legacy-page h1, #main .legacy-page h2, #main .legacy-page h3,
#main .legacy-page h1 *, #main .legacy-page h2 *, #main .legacy-page h3 * { font-family: var(--serif) !important; }
#main .legacy-page * + h2, #main .legacy-page * + h1 { margin-top: 48px; }
#main .legacy-page .article__list--title h2, #main .legacy-page .side__element h2 { margin-top: 0; }
#main .legacy-page .side__element h2, #main .legacy-page .side__element h2 * { font-family: var(--mono) !important; }
#main .legacy-page ul:not([class]), #main .legacy-page ol:not([class]) { padding-left: 1.3em; margin: 0 0 16px; }
#main .legacy-page ul:not([class]) { list-style: disc; }
#main .legacy-page ol:not([class]) { list-style: decimal; }
#main .legacy-page .side__list ul { list-style: none; padding-left: 0; margin: 0; }
#main .legacy-page .side__element:not(:has(li)) { display: none; }
#main .big-message { text-align: left; width: auto; max-width: var(--page); margin: 0 auto; padding: 96px var(--gutter) 120px; }
#main .big-message h2 { display: block; background: none; padding: 0; color: var(--red); font-family: var(--serif) !important; font-weight: 500; }
#main .big-message h3 { display: block; border: 0; padding: 0; text-transform: none; color: var(--ink); font-family: var(--serif) !important; }
#main .big-message p { color: var(--muted); font-family: var(--sans); }

/* =====================================================================
   Information pages (About, Editorial guidelines, policies, Media kit)
   ===================================================================== */
.doc { max-width: 824px; padding-top: 48px; padding-bottom: 96px; }
.doc .breadcrumb { margin-bottom: 20px; }
.doc__title { font-family: var(--serif); font-size: clamp(40px, 6vw, 72px); line-height: 1; font-weight: 500; letter-spacing: -0.035em; text-wrap: balance; }
.doc__lede { margin-top: 20px; padding-bottom: 32px; border-bottom: 1px solid var(--ink); font-family: var(--serif); font-size: clamp(19px, 1.7vw, 22px); line-height: 1.45; color: var(--muted); text-wrap: pretty; }
.doc__body { margin-top: 8px; }
.doc .notice { margin: 0 0 32px; }
/* Draft passages that still need a fact or a decision */
.todo { background: #FFF1B8; color: #5C4300; padding: 1px 4px; border-radius: 2px; font-family: var(--sans); font-size: 0.85em; font-style: normal; }

/* Article credits: updated-by and reviewer */
.byline__sep { color: var(--faint); }
span.byline__name { font-weight: 600; }
.credit-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); margin-top: 48px; border-top: 1px solid var(--ink); }
.credit-cards .author-card { margin-top: 0; border-top: 0; padding: 24px 24px 24px 0; }
.credit-cards .author-card--reviewer { padding: 24px 0 24px 24px; border-left: 1px solid var(--line); }
@media (max-width: 620px) { .credit-cards .author-card--reviewer { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); } }
.admin-bar__reviewer { display: flex; gap: 8px; }
.admin-bar__reviewer select { height: 36px; padding: 0 8px; border: 1px solid var(--ink); border-radius: var(--radius); background: var(--paper); font: 13px var(--sans); max-width: 220px; }
