/* =============================================================
   RouteOps — Route & Fleet Software Insight
   Archetype 06: Magazine Multi-Page, RouteOps navy/teal/amber palette.
   Signature: reading progress + drop caps.
   Single stylesheet. Sections in order: tokens, reset, utilities,
   typography, components, sections, effects, responsive, reduced-motion.
   ============================================================= */

/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  /* Surfaces — warm paper, print-inspired */
  --paper:      #f7f5f0;
  --paper-2:    #efeae0;
  --paper-3:    #e6e0d3;
  --white:      #ffffff;

  /* Navy stage — masthead, footer, article plates */
  --navy:       #0b2540;
  --navy-deep:  #08182a;
  --navy-mid:   #123a5c;

  /* Ink */
  --ink:        #16293c;
  --ink-soft:   #33475b;
  --ink-mute:   #566e84;
  --faint:      #7b8fa2;

  /* Accents.
     --accent (blue) is the only accent used for TEXT on paper: 5.6:1 on
     --paper, comfortably past WCAG AA. Teal and amber are reserved for
     rules, marks and text on navy, where they clear AA easily but would
     fail on a light background. */
  --accent:      #0e5fa4;
  --accent-deep: #0a4880;
  --teal:        #12b0a0;
  --teal-deep:   #0f9c8e;
  --amber:       #f4a118;

  /* Lines — hairlines are the structural device of this archetype */
  --line:        #d8d2c5;
  --line-soft:   #e4dfd4;
  --line-strong: #16293c;

  /* Type */
  --display: "Playfair Display", Georgia, "Times New Roman", serif;
  --serif:   "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans:    "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, Arial, sans-serif;

  /* Fluid scale */
  --step-5: clamp(2.6rem, 1.5rem + 4.4vw, 4.6rem);
  --step-4: clamp(2rem, 1.35rem + 2.6vw, 3.1rem);
  --step-3: clamp(1.6rem, 1.25rem + 1.5vw, 2.25rem);
  --step-2: clamp(1.32rem, 1.15rem + 0.7vw, 1.68rem);
  --step-1: clamp(1.1rem, 1.03rem + 0.3vw, 1.28rem);
  --step-0: clamp(1rem, 0.97rem + 0.15vw, 1.08rem);
  --step--1: clamp(0.84rem, 0.82rem + 0.08vw, 0.9rem);
  --step--2: 0.76rem;

  /* Layout */
  --measure: 68ch;
  --container: 1180px;
  --gutter: clamp(1.1rem, 4vw, 2.4rem);

  /* Easings */
  --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in:    cubic-bezier(0.7, 0, 0.84, 0);
  --ease-soft:  cubic-bezier(0.25, 0.46, 0.45, 0.94);

  --radius: 4px;
  --radius-lg: 8px;
}

/* Cross-page transitions (progressive: ignored where unsupported) */
@view-transition { navigation: auto; }

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  tab-size: 2;
  overflow-x: clip;            /* clip, not hidden — preserves sticky */
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--step-0);
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
  font-variant-numeric: oldstyle-nums;
}

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3, h4, h5, h6 { text-wrap: balance; line-height: 1.16; letter-spacing: -0.015em; }
hr { border: 0; border-top: 1px solid var(--line); }

::selection { background: var(--amber); color: var(--navy-deep); }

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

/* =============================================================
   3. Utilities
   ============================================================= */
.skip-link {
  position: fixed;
  top: -120px;
  left: 1rem;
  z-index: 9999;
  padding: 0.7rem 1.15rem;
  background: var(--navy-deep);
  color: var(--paper);
  font-family: var(--sans);
  font-weight: 600;
  border-radius: var(--radius);
  transition: top 0.3s var(--ease-out);
}
.skip-link:focus { top: 1rem; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--narrow { max-width: 780px; }

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

.muted { color: var(--ink-mute); }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.8rem; }
.mt-2 { margin-top: 1.6rem; }
.mt-3 { margin-top: 2.6rem; }

.rule {
  border: 0;
  border-top: 1px solid var(--line-strong);
  margin-block: 2.4rem;
}
.rule--hair { border-top-color: var(--line); }

/* =============================================================
   4. Typography
   ============================================================= */
.kicker,
.eyebrow {
  display: inline-block;
  font-family: var(--sans);
  font-size: var(--step--2);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  font-variant-numeric: lining-nums;
}
.kicker--onnavy, .eyebrow--onnavy { color: var(--teal); }

.display { font-family: var(--display); font-weight: 700; }

.lede {
  font-size: var(--step-1);
  color: var(--ink-soft);
  line-height: 1.6;
  max-width: 62ch;
}

.byline {
  font-family: var(--sans);
  font-size: var(--step--1);
  color: var(--ink-mute);
  font-variant-numeric: lining-nums;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.9rem;
}
.byline strong { color: var(--ink); font-weight: 600; }
.byline .sep { color: var(--line); }

/* =============================================================
   5. Components
   ============================================================= */

/* --- Masthead / navigation ------------------------------------ */
.masthead {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--navy-deep);
  color: var(--paper);
  border-bottom: 1px solid rgba(18, 176, 160, 0.28);
}

.masthead__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 62px;
  padding-block: 0.55rem;
}

.brandmark {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--paper);
  line-height: 1;
}
.brandmark img { width: 34px; height: 34px; }
.brandmark em { color: var(--teal); font-style: italic; }

.masthead__nav { display: none; }

.nav-link {
  position: relative;
  padding: 0.3rem 0;
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(247, 245, 240, 0.82);
  transition: color 0.3s var(--ease-out);
}
.nav-link:hover,
.nav-link:focus-visible { color: var(--paper); }
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1.5px;
  background: var(--teal);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.45s var(--ease-soft);
}
.nav-link:hover::after,
.nav-link:focus-visible::after { transform: scaleX(1); transform-origin: left; }
.nav-link[aria-current="page"] { color: var(--paper); }
.nav-link[aria-current="page"]::after { transform: scaleX(1); background: var(--amber); }

.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px; height: 44px;
  padding: 0 10px;
  margin-right: -10px;
}
.nav-toggle span {
  display: block; height: 2px; width: 100%;
  background: var(--paper);
  transition: transform 0.4s var(--ease-out), opacity 0.25s linear;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-mobile {
  background: var(--navy-deep);
  border-top: 1px solid rgba(247, 245, 240, 0.12);
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.5s var(--ease-soft);
}
.nav-mobile[data-open="true"] { max-height: 30rem; }
.nav-mobile ul { list-style: none; padding: 0.5rem 0 1.1rem; margin: 0; }
.nav-mobile a {
  display: block;
  padding: 0.72rem var(--gutter);
  font-family: var(--sans);
  font-size: 1rem;
  color: rgba(247, 245, 240, 0.88);
  border-bottom: 1px solid rgba(247, 245, 240, 0.07);
}
.nav-mobile a[aria-current="page"] { color: var(--amber); }

/* --- Buttons --------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.72rem 1.4rem;
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1.5px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 0.4s var(--ease-soft), background-color 0.3s var(--ease-out),
              color 0.3s var(--ease-out), border-color 0.3s var(--ease-out);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); transition-duration: 0.1s; }

.btn--primary { background: var(--navy); color: var(--paper); }
.btn--primary:hover { background: var(--navy-deep); }

.btn--accent { background: var(--amber); color: var(--navy-deep); }
.btn--accent:hover { background: #e0910d; }

.btn--ghost { border-color: var(--line-strong); color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); }

.btn--onnavy { border-color: rgba(247, 245, 240, 0.45); color: var(--paper); }
.btn--onnavy:hover { background: var(--paper); color: var(--navy-deep); border-color: var(--paper); }

.btn--sm { padding: 0.48rem 0.95rem; font-size: 0.83rem; }

/* --- Article cards --------------------------------------------- */
.card {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-top: 1px solid var(--line-strong);
  padding-top: 1.05rem;
  height: 100%;
}
.card__media {
  display: block;
  overflow: hidden;
  margin-bottom: 0.95rem;
  background: var(--paper-2);
  aspect-ratio: 1200 / 630;
}
.card__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease-soft);
}
.card:hover .card__media img { transform: scale(1.035); }

.card__cat {
  font-family: var(--sans);
  font-size: var(--step--2);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.card__title {
  font-family: var(--display);
  font-size: var(--step-2);
  font-weight: 700;
  margin-top: 0.4rem;
  line-height: 1.2;
}
.card__title a { background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0% 1.5px; background-repeat: no-repeat; background-position: 0 100%;
  transition: background-size 0.45s var(--ease-soft), color 0.3s var(--ease-out); }
.card:hover .card__title a { background-size: 100% 1.5px; color: var(--accent); }

.card__excerpt {
  margin-top: 0.55rem;
  color: var(--ink-soft);
  font-size: 0.97rem;
  line-height: 1.6;
}
.card__meta {
  margin-top: auto;
  padding-top: 0.85rem;
  font-family: var(--sans);
  font-size: var(--step--2);
  color: var(--faint);
  font-variant-numeric: lining-nums;
  letter-spacing: 0.02em;
}

/* Featured card — the cover story */
.card--featured .card__title { font-size: var(--step-4); }
.card--featured .card__excerpt { font-size: var(--step-1); max-width: 58ch; }

/* --- Grids ------------------------------------------------------ */
.grid { display: grid; gap: 2rem 1.9rem; }
.grid--2 { grid-template-columns: 1fr; }
.grid--3 { grid-template-columns: 1fr; }
.grid--4 { grid-template-columns: 1fr; }

/* --- Ad slots ---------------------------------------------------
   Policy notes that are baked into these rules:
   - every unit carries a visible "Advertisement" label;
   - height is reserved before load, so nothing shifts (CLS = 0);
   - the styling deliberately does NOT resemble a card, button or nav
     item, which is what Google's placement policy prohibits.        */
.ad-slot {
  margin-block: 2.2rem;
  text-align: center;
}
.ad-slot__label {
  display: block;
  font-family: var(--sans);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 0.4rem;
}
.ad-slot__frame {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100px;
  background: var(--paper-2);
  border: 1px dashed var(--line);
  overflow: hidden;
}
.ad-slot__frame ins { display: block; width: 100%; }
.ad-slot__hint {
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--faint);
  padding: 1rem;
}
.ad-slot--rect .ad-slot__frame { min-height: 280px; }
.ad-slot--sidebar { margin-top: 0; }
.ad-slot--live .ad-slot__frame { background: none; border: 0; min-height: 0; }

/* --- Callouts --------------------------------------------------- */
.callout {
  margin-block: 1.9rem;
  padding: 1.15rem 1.35rem;
  background: var(--paper-2);
  border-left: 3px solid var(--accent);
  font-size: 0.98rem;
}
.callout h4 {
  font-family: var(--sans);
  font-size: var(--step--2);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.4rem;
}
.callout p:last-child { margin-bottom: 0; }
.callout--key { border-left-color: var(--teal-deep); background: #e9f4f2; }
.callout--key h4 { color: #0b7a70; }
.callout--warn { border-left-color: var(--amber); background: #fdf3e0; }
.callout--warn h4 { color: #8a5a06; }

/* --- Tables ----------------------------------------------------- */
.table-wrap {
  overflow-x: auto;
  margin-block: 1.9rem;
  border-top: 2px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}
.table-wrap table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 0.9rem;
}
.table-wrap th, .table-wrap td {
  padding: 0.72rem 0.9rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.table-wrap th {
  font-weight: 700;
  font-size: var(--step--2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}
.table-wrap tbody tr:last-child td { border-bottom: 0; }
.table-wrap tbody tr:nth-child(even) { background: rgba(22, 41, 60, 0.028); }

/* --- Breadcrumbs ------------------------------------------------ */
.crumbs {
  font-family: var(--sans);
  font-size: var(--step--2);
  color: var(--faint);
  letter-spacing: 0.04em;
  margin-bottom: 1.1rem;
}
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.45rem; padding: 0; margin: 0; }
.crumbs li::after { content: "/"; margin-left: 0.45rem; color: var(--line); }
.crumbs li:last-child::after { content: ""; }
.crumbs a:hover { color: var(--accent); text-decoration: underline; }

/* --- Table of contents ------------------------------------------ */
.toc {
  margin-block: 2rem;
  padding: 1.2rem 1.4rem;
  background: var(--paper-2);
  border-top: 2px solid var(--line-strong);
}
/* The table of contents sits inside .prose, whose h2 rule would otherwise
   turn this small utility label into a full display heading. Matching with
   .prose .toc h2 outranks it. */
.toc h2,
.prose .toc h2 {
  font-family: var(--sans);
  font-size: var(--step--2);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0 0 0.7rem;
  padding-top: 0;
  border-top: 0;
}
.toc ol,
.toc ul {
  margin: 0;
  padding-left: 1.15rem;
  font-family: var(--sans);
  font-size: 0.92rem;
  columns: 1;
}
/* Sections that already number themselves get an unnumbered list — no
   bullets either, or the item reads "• 1. Governing law". */
.toc ul { list-style: none; padding-left: 0; }
.toc li { margin-bottom: 0.35rem; }
.toc a { color: var(--ink-soft); }
.toc a:hover { color: var(--accent); text-decoration: underline; }

/* --- Aside ------------------------------------------------------ */
.aside-module {
  margin-bottom: 2rem;
  padding-top: 0.9rem;
  border-top: 2px solid var(--line-strong);
}
.aside-module h3 {
  font-family: var(--sans);
  font-size: var(--step--2);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 0.85rem;
}
.aside-list { list-style: none; padding: 0; margin: 0; }
.aside-list li { padding-block: 0.7rem; border-bottom: 1px solid var(--line); }
.aside-list li:last-child { border-bottom: 0; }
.aside-list a {
  font-family: var(--display);
  font-size: 1.03rem;
  font-weight: 600;
  line-height: 1.3;
  display: block;
}
.aside-list a:hover { color: var(--accent); }
.aside-list span {
  display: block;
  font-family: var(--sans);
  font-size: var(--step--2);
  color: var(--faint);
  margin-top: 0.25rem;
}

/* --- Author box -------------------------------------------------- */
.author-box {
  display: flex;
  gap: 1.1rem;
  margin-top: 2.6rem;
  padding-top: 1.4rem;
  border-top: 2px solid var(--line-strong);
}
.author-box img { width: 58px; height: 58px; flex: none; border-radius: 50%; }
.author-box strong { font-family: var(--sans); font-size: 0.98rem; }
.author-box p { font-size: 0.94rem; color: var(--ink-soft); margin-top: 0.4rem; }

/* --- Share ------------------------------------------------------- */
.share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-top: 2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}
.share > span {
  font-family: var(--sans);
  font-size: var(--step--2);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-right: 0.3rem;
}

/* --- Tag list ---------------------------------------------------- */
.tag-list { list-style: none; display: flex; flex-wrap: wrap; gap: 0.45rem; padding: 0; margin-top: 1.6rem; }
.tag-list a {
  display: inline-block;
  padding: 0.28rem 0.62rem;
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--ink-mute);
  background: var(--paper-2);
  border-radius: 2px;
}
.tag-list a:hover { background: var(--ink); color: var(--paper); }

/* --- Search & filters -------------------------------------------- */
.searchbar {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.75rem 1rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.searchbar svg { flex: none; width: 19px; height: 19px; color: var(--faint); }
.searchbar input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  font-family: var(--sans);
  font-size: 0.98rem;
  color: var(--ink);
}
.searchbar input:focus { outline: none; }
.searchbar:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(14, 95, 164, 0.12); }

.filter-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.filter-chip {
  padding: 0.4rem 0.85rem;
  font-family: var(--sans);
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 100px;
  background: var(--paper);
  transition: background-color 0.3s var(--ease-out), color 0.3s var(--ease-out),
              border-color 0.3s var(--ease-out);
}
.filter-chip:hover { border-color: var(--ink); }
.filter-chip[aria-pressed="true"] { background: var(--navy); color: var(--paper); border-color: var(--navy); }

.search-empty { margin-top: 2rem; color: var(--ink-mute); }

/* --- Pagination --------------------------------------------------- */
.pagination {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0;
  margin-top: 3rem;
  font-family: var(--sans);
  font-size: 0.9rem;
  font-variant-numeric: lining-nums;
}
.pagination a, .pagination span {
  display: inline-block;
  min-width: 40px;
  padding: 0.45rem 0.7rem;
  text-align: center;
  border: 1px solid var(--line);
}
.pagination a:hover { border-color: var(--ink); }
.pagination [aria-current="page"] { background: var(--navy); color: var(--paper); border-color: var(--navy); }

/* --- Forms --------------------------------------------------------- */
.form-grid { display: grid; gap: 1.1rem; }
.field { display: flex; flex-direction: column; gap: 0.35rem; }
.field label, .checkbox-row label {
  font-family: var(--sans);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 0.68rem 0.85rem;
  font-family: var(--sans);
  font-size: 0.96rem;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.field textarea { min-height: 150px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 95, 164, 0.12);
}
.checkbox-row { display: flex; align-items: flex-start; gap: 0.6rem; }
.checkbox-row input { margin-top: 0.28rem; width: 17px; height: 17px; flex: none; accent-color: var(--accent); }
.checkbox-row label { font-weight: 400; font-size: 0.88rem; }
.checkbox-row a { color: var(--accent); text-decoration: underline; }

.form-status {
  margin-top: 0.9rem;
  padding: 0.75rem 1rem;
  font-family: var(--sans);
  font-size: 0.9rem;
  border-left: 3px solid var(--teal-deep);
  background: #e9f4f2;
}
.form-status[data-state="error"] { border-left-color: #b4261c; background: #fbeceb; }

/* --- Newsletter block ---------------------------------------------- */
.newsletter {
  background: var(--navy-deep);
  color: var(--paper);
  padding-block: clamp(2.6rem, 6vw, 4rem);
  margin-top: 4rem;
}
.newsletter h2 { font-family: var(--display); font-size: var(--step-3); }
.newsletter p { color: rgba(247, 245, 240, 0.76); margin-top: 0.7rem; max-width: 52ch; }
.newsletter form { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.5rem; }
.newsletter input[type="email"] {
  flex: 1 1 260px;
  min-width: 0;
  padding: 0.75rem 0.95rem;
  font-family: var(--sans);
  font-size: 0.96rem;
  color: var(--paper);
  background: rgba(247, 245, 240, 0.08);
  border: 1px solid rgba(247, 245, 240, 0.28);
  border-radius: var(--radius);
}
.newsletter input::placeholder { color: rgba(247, 245, 240, 0.45); }
.newsletter input:focus { outline: none; border-color: var(--teal); }
.newsletter small { display: block; margin-top: 0.9rem; font-family: var(--sans); font-size: 0.78rem; color: rgba(247, 245, 240, 0.55); }
.newsletter a { color: var(--teal); text-decoration: underline; }

/* --- Cookie banner --------------------------------------------------- */
.cookie-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 300;
  background: var(--navy-deep);
  color: var(--paper);
  border-top: 2px solid var(--teal);
  padding: 1.1rem var(--gutter) 1.25rem;
  transform: translateY(110%);
  transition: transform 0.55s var(--ease-out);
}
.cookie-banner[data-open="true"] { transform: translateY(0); }
.cookie-banner__inner {
  max-width: var(--container);
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  justify-content: space-between;
}
.cookie-banner p { font-family: var(--sans); font-size: 0.86rem; line-height: 1.55; max-width: 62ch; color: rgba(247, 245, 240, 0.85); }
.cookie-banner a { color: var(--teal); text-decoration: underline; }
.cookie-banner__actions { display: flex; flex-wrap: wrap; gap: 0.55rem; }

/* --- Footer ----------------------------------------------------------- */
.site-footer {
  background: var(--navy-deep);
  color: rgba(247, 245, 240, 0.72);
  padding-block: 3.2rem 2rem;
  margin-top: 4rem;
  font-family: var(--sans);
  font-size: 0.88rem;
}
.newsletter + .site-footer { margin-top: 0; }
.site-footer h3 {
  font-family: var(--sans);
  font-size: var(--step--2);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 0.9rem;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 0.5rem; }
.site-footer a:hover { color: var(--paper); text-decoration: underline; }
.footer-grid { display: grid; gap: 2.2rem; }
.footer-about p { margin-top: 0.9rem; max-width: 40ch; line-height: 1.6; }
.footer-bottom {
  margin-top: 2.6rem;
  padding-top: 1.4rem;
  border-top: 1px solid rgba(247, 245, 240, 0.13);
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.4rem;
  justify-content: space-between;
  font-size: 0.8rem;
  color: rgba(247, 245, 240, 0.55);
}

/* =============================================================
   6. Sections
   ============================================================= */

.section { padding-block: clamp(2.6rem, 6vw, 4.4rem); }
.section--tint { background: var(--paper-2); }
.section__head { margin-bottom: 2.2rem; }
.section__head h2 {
  font-family: var(--display);
  font-size: var(--step-3);
  margin-top: 0.45rem;
}
.section__head p { margin-top: 0.7rem; color: var(--ink-soft); max-width: 60ch; }

/* --- Cover masthead panel (home) --------------------------------- */
.cover {
  background: var(--navy-deep);
  color: var(--paper);
  padding-block: clamp(2.2rem, 5vw, 3.4rem);
  border-bottom: 3px solid var(--amber);
}
.cover__issue {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.4rem;
  justify-content: space-between;
  font-family: var(--sans);
  font-size: var(--step--2);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
  padding-bottom: 0.9rem;
  border-bottom: 1px solid rgba(247, 245, 240, 0.18);
  font-variant-numeric: lining-nums;
}
.cover h1 {
  font-family: var(--display);
  font-size: var(--step-5);
  font-weight: 700;
  margin-top: 1.5rem;
  max-width: 26ch;
}
.cover h1 em { font-style: italic; color: var(--teal); }
.cover__sub {
  margin-top: 1.1rem;
  font-size: var(--step-1);
  color: rgba(247, 245, 240, 0.78);
  max-width: 58ch;
}
.cover__actions { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.9rem; }
/* Three even columns on narrow screens: the labels are too long to sit on
   one flex line at 390px and would otherwise orphan the third figure. */
.cover__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.4rem 1rem;
  margin-top: 2.4rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(247, 245, 240, 0.18);
}
.cover__stat strong {
  display: block;
  font-family: var(--display);
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--paper);
  font-variant-numeric: lining-nums;
  line-height: 1;
}
.cover__stat span {
  display: block;
  margin-top: 0.35rem;
  font-family: var(--sans);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(247, 245, 240, 0.55);
}

/* --- Page header (articles, topics, static pages) ------------------ */
.page-header { padding-block: clamp(1.8rem, 4vw, 2.8rem) 0; }
.page-header h1 {
  font-family: var(--display);
  font-size: var(--step-4);
  margin-top: 0.55rem;
}
.page-header .lede { margin-top: 0.9rem; }

/* --- Value cards ---------------------------------------------------- */
.value-card { border-top: 1px solid var(--line-strong); padding-top: 1rem; }
.value-card__icon { color: var(--accent); margin-bottom: 0.7rem; }
.value-card__icon svg { width: 30px; height: 30px; }
.value-card h3 { font-family: var(--display); font-size: var(--step-2); }
.value-card p { margin-top: 0.5rem; color: var(--ink-soft); font-size: 0.96rem; }

/* --- Topic cards ----------------------------------------------------- */
.topic-card {
  display: block;
  padding: 1.2rem 1.3rem;
  background: var(--paper);
  border: 1px solid var(--line);
  transition: border-color 0.35s var(--ease-out), transform 0.45s var(--ease-soft),
              box-shadow 0.45s var(--ease-soft);
}
.topic-card:hover {
  border-color: var(--navy);
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(11, 37, 64, 0.09);
}
.topic-card strong { display: block; font-family: var(--display); font-size: var(--step-2); }
.topic-card span { display: block; margin-top: 0.45rem; color: var(--ink-mute); font-size: 0.92rem; }
.topic-card .topic-card__count {
  margin-top: 0.85rem;
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: lining-nums;
}

/* --- Article page --------------------------------------------------- */
.article-header { padding-block: clamp(1.8rem, 4vw, 2.6rem) 0; }
.article-header h1 {
  font-family: var(--display);
  font-size: var(--step-4);
  margin-top: 0.6rem;
  max-width: 22ch;
}
.article-header .lede { margin-top: 1rem; }
.article-header .byline { margin-top: 1.3rem; padding-top: 1rem; border-top: 1px solid var(--line); }

.article-hero {
  margin-block: 1.8rem;
  overflow: hidden;
  background: var(--paper-2);
}
.article-hero img { width: 100%; }
.article-hero figcaption {
  margin-top: 0.55rem;
  font-size: 0.86rem;
  font-style: italic;
  color: var(--faint);
}

.layout-with-aside { display: grid; gap: 2.6rem; }
/* Grid and flex children default to min-width:auto, which lets a wide child
   (a data table with a min-width, typically) stretch the whole column past
   the viewport. Overflow on <html> would then clip it out of sight rather
   than prevent it. Allowing these to shrink is what makes the table scroll
   inside its own wrapper instead. */
.layout-with-aside > *,
.grid > * { min-width: 0; }

/* --- Prose ------------------------------------------------------------ */
.prose { max-width: var(--measure); }
.prose > * + * { margin-top: 1.15rem; }
.prose p { line-height: 1.72; }
.prose h2 {
  font-family: var(--display);
  font-size: var(--step-3);
  margin-top: 2.6rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  scroll-margin-top: 6rem;
}
.prose h3 {
  font-family: var(--display);
  font-size: var(--step-2);
  margin-top: 1.9rem;
  scroll-margin-top: 6rem;
}
.prose h4 { font-family: var(--sans); font-size: 1.02rem; margin-top: 1.5rem; }
.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  transition: color 0.25s var(--ease-out);
}
.prose a:hover { color: var(--accent-deep); text-decoration-thickness: 2px; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin-bottom: 0.55rem; }
.prose li::marker { color: var(--accent); }
.prose strong { font-weight: 700; color: var(--ink); }
.prose blockquote {
  margin-block: 2rem;
  padding-left: 1.4rem;
  border-left: 3px solid var(--amber);
  font-style: italic;
  color: var(--ink-soft);
}
.prose code {
  font-family: "Cascadia Mono", ui-monospace, Consolas, monospace;
  font-size: 0.88em;
  background: var(--paper-2);
  padding: 0.12em 0.35em;
  border-radius: 2px;
}

.disclosure-note {
  margin-top: 2.2rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--faint);
  line-height: 1.6;
}
.disclosure-note a { color: var(--ink-mute); text-decoration: underline; }

/* =============================================================
   7. Effects — five, one of which is the signature
   ============================================================= */

/* 7.1 SIGNATURE (a) — reading progress bar.
   Sits under the sticky masthead and fills as the article body scrolls. */
.reading-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  z-index: 150;
  background: rgba(22, 41, 60, 0.1);
  pointer-events: none;
}
.reading-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--amber));
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.08s linear;
}

/* 7.2 SIGNATURE (b) — drop cap on the opening paragraph. */
.prose > p:first-of-type::first-letter {
  float: left;
  font-family: var(--display);
  font-size: 4.3em;
  line-height: 0.82;
  font-weight: 700;
  font-style: italic;
  color: var(--accent);
  margin: 0.06em 0.11em -0.04em 0;
}

/* 7.3 Pull quote — breaks the measure, quotation mark as ornament. */
.pullquote {
  position: relative;
  margin-block: 2.6rem;
  padding-top: 2.2rem;
  font-family: var(--display);
  font-size: var(--step-2);
  font-style: italic;
  line-height: 1.42;
  color: var(--navy);
  border-top: 2px solid var(--line-strong);
  border-bottom: 2px solid var(--line-strong);
  padding-bottom: 1.6rem;
}
.pullquote::before {
  content: "\201C";
  position: absolute;
  top: -0.15em;
  left: -0.02em;
  font-size: 4.6rem;
  line-height: 1;
  color: var(--amber);
  font-style: normal;
}
.pullquote cite {
  display: block;
  margin-top: 0.8rem;
  font-family: var(--sans);
  font-size: 0.82rem;
  font-style: normal;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

/* 7.4 Animated underline — already applied to .nav-link and .card__title.
   Reused here for inline editorial links in the footer and lists. */
.underline-link {
  position: relative;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size 0.45s var(--ease-soft);
}
.underline-link:hover, .underline-link:focus-visible { background-size: 100% 1px; }

/* 7.5 Reveal on scroll — content fades up as it enters the viewport.
   Kept under 40px so it stays a micro-interaction, not a parallax.

   Note the inversion: content is NEVER hidden by the stylesheet alone.
   JavaScript adds .is-armed, and only to elements that start below the
   fold, and only once it has a working IntersectionObserver to take it
   back off again. If the script is absent, stale, blocked or broken,
   the worst case is that the fade does not play — never a blank page
   where an article should be. */
[data-reveal] {
  transition: opacity 0.75s var(--ease-soft), transform 0.75s var(--ease-soft);
}
[data-reveal].is-armed {
  opacity: 0;
  transform: translateY(26px);
}

/* Subtle parallax on featured images (archetype 06 caps this at ~20px). */
.parallax-media { will-change: transform; }

/* =============================================================
   8. Responsive
   ============================================================= */
@media (min-width: 540px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .toc ol, .toc ul { columns: 2; column-gap: 2rem; }
  /* Enough room now for the figures to group tightly instead of spreading
     across the full measure. */
  .cover__stats { display: flex; flex-wrap: wrap; gap: 1.4rem 2.6rem; }
}

@media (min-width: 720px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid--2 { grid-template-columns: repeat(2, 1fr); }
  .newsletter .container { display: grid; grid-template-columns: 1fr 1fr; gap: 2.4rem; align-items: center; }
  .newsletter form { margin-top: 0; }
}

@media (min-width: 960px) {
  .masthead__nav { display: flex; align-items: center; gap: 1.6rem; }
  .nav-toggle { display: none; }
  .nav-mobile { display: none; }
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .grid--4 { grid-template-columns: repeat(4, 1fr); }
  .footer-grid { grid-template-columns: 1.6fr 1fr 1fr 1fr; }
  .layout-with-aside { grid-template-columns: minmax(0, 1fr) 300px; gap: 3.2rem; }
  .layout-with-aside__aside { position: sticky; top: 6rem; align-self: start; }
  /* The cover reads as a magazine front page: headline and standfirst run
     the full measure, with the figures as a rule-topped band beneath. An
     earlier two-column split left the right half of the masthead empty. */
  .card--featured { grid-column: span 2; }
  .card--featured .card__media { aspect-ratio: 21 / 9; }
}

@media (min-width: 1280px) {
  .layout-with-aside { grid-template-columns: minmax(0, 1fr) 320px; }
}

/* =============================================================
   9. Reduced motion
   Only genuinely intrusive motion is switched off here. Hovers,
   fades, underlines, card lifts and the progress bar all keep
   running — Windows ships this preference enabled on a lot of
   machines, and gating everything would hand those users a dead page.
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .parallax-media { transform: none !important; }
  [data-reveal] { transition-duration: 0.35s; }
  @view-transition { navigation: none; }
}

/* =============================================================
   10. Print — a trade publication gets read on paper
   ============================================================= */
@media print {
  .masthead, .site-footer, .cookie-banner, .ad-slot, .newsletter,
  .share, .reading-progress, .layout-with-aside__aside, .toc { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .prose { max-width: none; }
  .prose a::after { content: " (" attr(href) ")"; font-size: 0.85em; color: #555; }
}
