/* =========================================================
   ARTICLE PAGES — news detail template
   Load AFTER styles.css. Self-contained: only depends on the
   design tokens already defined in styles.css :root.

   Ported from the IMC article system, tokens remapped:
     --blue → --primary      --navy → --ink
     --sky  → --surface      --muted → --body
     --blue-light → --blue-500
   ========================================================= */

/* ---------- Breadcrumb ---------- */
.post-crumbs { font-size: 13px; color: var(--muted); padding-top: 34px; }
.post-crumbs a { color: var(--muted); }
.post-crumbs a:hover { color: var(--primary); }
.post-crumbs span { color: var(--ink); font-weight: 600; }

/* ---------- Shell & header ---------- */
.post { padding: 30px 0 60px; }
.post-shell { max-width: 1240px; margin: 0 auto; padding: 0 22px; }
.post-head { max-width: 840px; }
.post-tag { display: inline-block; background: var(--surface); color: var(--primary); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 6px 12px; border-radius: var(--radius-pill); }
.post-head h1 { font-size: clamp(27px, 4vw, 40px); line-height: 1.16; color: var(--ink); margin: 16px 0 14px; }
.post-standfirst { font-size: 17.5px; line-height: 1.65; color: var(--body); }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 18px; font-size: 13.5px; color: var(--muted); }
.post-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--blue-500); }
.post-hero { margin-top: 32px; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.post-hero img { display: block; width: 100%; height: auto; }

/* ---------- Two-column layout ---------- */
.post-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 60px; align-items: start; margin-top: 44px; }

.post-body h2 { font-size: clamp(21px, 2.6vw, 27px); line-height: 1.25; color: var(--ink); margin: 38px 0 14px; }
.post-body h2[id] { scroll-margin-top: 96px; }  /* clears the sticky .header */
.post-body h2:first-child { margin-top: 0; }
.post-body h3 { font-size: 17.5px; color: var(--ink); margin: 26px 0 10px; }
.post-body p { font-size: 16px; line-height: 1.8; color: var(--body); margin-bottom: 16px; }
/* plain prose lists only — component lists opt out via :not([class]) */
.post-body ul:not([class]), .post-body ol:not([class]) { margin: 0 0 18px 22px; }
.post-body ul:not([class]) > li, .post-body ol:not([class]) > li { font-size: 16px; line-height: 1.8; color: var(--body); margin-bottom: 8px; }
.post-body a:not(.btn) { color: var(--primary); font-weight: 600; text-decoration: underline; }
.post-body strong { color: var(--ink); }

/* ---------- Sticky sidebar ---------- */
/* The column overflows only on short viewports (it needs ~750px of height to fit).
   When it does, the scrollbar stays invisible until the reader is actually in the
   sidebar — the track is never a permanent grey stripe next to the article. */
.post-aside { position: sticky; top: 96px; display: grid; gap: 16px; max-height: calc(100vh - 120px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: transparent transparent; }
.post-aside:hover, .post-aside:focus-within { scrollbar-color: var(--line) transparent; }
.post-aside::-webkit-scrollbar { width: 6px; }
.post-aside::-webkit-scrollbar-track { background: transparent; }
.post-aside::-webkit-scrollbar-thumb { background: transparent; border-radius: var(--radius-pill); }
.post-aside:hover::-webkit-scrollbar-thumb, .post-aside:focus-within::-webkit-scrollbar-thumb { background: var(--line); }
.side-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.side-box > h2 { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .11em; color: var(--primary); margin: 0 0 12px; }
.side-toc ol { list-style: none; margin: 0; padding: 0; }
.side-toc li { margin: 0; }
.side-toc a { display: block; padding: 6px 11px; margin: 0 -11px; border-radius: 8px; font-size: 13.8px; line-height: 1.45; color: var(--body); font-weight: 500; text-decoration: none; transition: background var(--transition), color var(--transition); }
.side-toc a:hover { background: var(--surface); color: var(--primary); }
.side-toc a.is-active { background: var(--surface); color: var(--primary); font-weight: 700; }
/* article list */
.side-art { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.side-art:first-of-type { border-top: 0; padding-top: 0; }
.side-art img { width: 58px; height: 46px; flex: none; object-fit: cover; border-radius: 8px; }
/* 3-line cap: today's titles fit inside it — it exists so one long future headline
   can't push the sidebar past the viewport on its own. */
.side-art span { font-size: 13.5px; line-height: 1.42; font-weight: 600; color: var(--ink); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.side-art:hover span { color: var(--primary); }
.side-art[aria-current="page"] { pointer-events: none; }
.side-art[aria-current="page"] img { opacity: .45; }
.side-art[aria-current="page"] span { color: var(--blue-500); }
.side-all { display: inline-block; margin-top: 14px; font-size: 13.5px; font-weight: 700; color: var(--primary); }
.side-all:hover { text-decoration: underline; }

/* ---------- Chips: short enumerations, no explanation ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 9px; list-style: none; margin: 0 0 20px; padding: 0; }
.chips li { background: var(--surface); border: 1px solid var(--line); color: var(--ink); font-size: 14px; font-weight: 600; line-height: 1.4; padding: 9px 16px; border-radius: var(--radius-pill); }
/* .chips.links — same pill, but the whole chip is the hit area (model → product page).
   Padding moves to the <a> so the link fills the pill, not just the text. */
.chips.links li { padding: 0; transition: border-color var(--transition), background var(--transition); }
.chips.links a { display: block; padding: 9px 16px; color: inherit; font-weight: 600; text-decoration: none; }
.chips.links li:hover { background: #fff; border-color: var(--primary); }
.chips.links li:hover a { color: var(--primary); }
.chips.links a:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: var(--radius-pill); }

/* ---------- Checklist: things the reader should verify ---------- */
.checklist { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 12px; }
.checklist.two { grid-template-columns: 1fr 1fr; column-gap: 28px; }
.checklist li { position: relative; margin: 0; padding-left: 33px; font-size: 15.5px; line-height: 1.65; color: var(--body); }
.checklist li::before {
  content: ""; position: absolute; left: 0; top: 2px; width: 22px; height: 22px; border-radius: 50%;
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231559c7' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 13 4 4 10-10'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center; background-size: 13px;
}

/* ---------- Exclusion list: things that do NOT apply ---------- */
.xlist { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 12px; }
.xlist li { position: relative; margin: 0; padding-left: 33px; font-size: 15.5px; line-height: 1.65; color: var(--body); }
.xlist li::before {
  content: ""; position: absolute; left: 0; top: 2px; width: 22px; height: 22px; border-radius: 50%;
  background-color: #fdeeec;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c0392b' stroke-width='3.2' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6 6 18'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center; background-size: 11px;
}

/* ---------- Question list ---------- */
.qlist { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 10px; }
.qlist li { position: relative; margin: 0; padding: 13px 18px 13px 46px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 15.5px; line-height: 1.55; font-weight: 600; color: var(--ink); }
.qlist li::before { content: "?"; position: absolute; left: 16px; top: 13px; width: 21px; height: 21px; border-radius: 50%; background: var(--surface); color: var(--primary); font-size: 12px; font-weight: 800; display: grid; place-items: center; }

/* ---------- Definition cards: term + explanation ---------- */
.defcards { display: grid; gap: 16px; margin: 0 0 24px; }
.defcards.two { grid-template-columns: 1fr 1fr; }
.defcard { background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--primary); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 20px 24px; }
.defcard h3 { margin: 0 0 8px !important; font-size: 17px; color: var(--ink); }
.defcard p { margin: 0; font-size: 15.5px; line-height: 1.72; color: var(--body); }

/* ---------- Callouts: Example (lightbulb) / Important (triangle) ---------- */
.callout { position: relative; background: var(--surface); border-left: 3px solid var(--primary); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 19px 22px 19px 54px; margin: 26px 0; }
.callout p { margin: 0; font-size: 15.5px; line-height: 1.72; color: var(--body); }
.callout p + p { margin-top: 10px; }
.callout-head { position: absolute; left: 20px; top: 20px; line-height: 0; color: var(--primary); }
.callout-head svg { width: 22px; height: 22px; }
.callout.warn { background: #fdf4ec; border-left-color: #c07c26; }
.callout.warn .callout-head { color: #c07c26; }

/* ---------- Numbered steps: a sequence the reader works through in order ----------
   The badge carries the step number, so step headings shouldn't repeat "Step N:".
   A hairline connector runs between badges to signal the sequence. */
.steps { counter-reset: step; margin: 24px 0 8px; }
.step { position: relative; padding: 0 0 26px 54px; }
.step:last-child { padding-bottom: 0; }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0; width: 34px; height: 34px; border-radius: 50%;
  background: var(--surface); color: var(--primary); font-size: 14px; font-weight: 800;
  display: grid; place-items: center;
}
.step:not(:last-child)::after { content: ""; position: absolute; left: 16px; top: 42px; bottom: 6px; width: 2px; background: var(--line); }
.step > h3 { margin: 6px 0 12px !important; }
.step > *:last-child { margin-bottom: 0 !important; }

/* ---------- Summary checklist panel ---------- */
.checkpanel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px 32px; margin: 34px 0; }
.checkpanel h2 { margin: 0 0 8px !important; font-size: 21px; }
.checkpanel > p { margin-bottom: 0; font-size: 15.5px; }
.checkpanel .checklist { margin: 20px 0 0; }

/* ---------- Pull quote ---------- */
.pullq { margin: 24px 0; padding: 20px 26px; background: var(--surface); border-left: 3px solid var(--primary); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: 18.5px; line-height: 1.5; font-weight: 700; color: var(--ink); }

/* ---------- Editorial table: no outer box, hairline rules only ---------- */
.tbl-wrap { overflow-x: auto; margin: 0 0 10px; }
.cmp-table { width: 100%; min-width: 580px; border-collapse: separate; border-spacing: 0; font-size: 15px; }
.cmp-table.slim { min-width: 340px; }
.cmp-table th, .cmp-table td { padding: 14px 22px; text-align: left; vertical-align: top; line-height: 1.55; border-bottom: 1px solid var(--line); }
.cmp-table thead th { padding-top: 13px; padding-bottom: 13px; background: var(--surface); border-bottom: 1px solid var(--line); color: var(--ink); font-size: 12px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; white-space: nowrap; }
.cmp-table thead th:first-child { border-top-left-radius: var(--radius-sm); }
.cmp-table thead th:last-child { border-top-right-radius: var(--radius-sm); }
.cmp-table tbody th { width: 42%; font-weight: 700; color: var(--ink); }
.cmp-table tbody td { color: var(--body); }
/* Totals row — tinted band mirroring the header, closing the table off at the bottom */
.cmp-table tfoot th, .cmp-table tfoot td { background: var(--surface); color: var(--ink); font-weight: 800; border-bottom: 0; }
.cmp-table tfoot th { border-bottom-left-radius: var(--radius-sm); }
.cmp-table tfoot td { border-bottom-right-radius: var(--radius-sm); }
.tbl-note { font-size: 13px !important; line-height: 1.6; color: var(--muted); margin: 0 0 26px !important; }

.cov { display: inline-flex; align-items: baseline; gap: 9px; }
.cov::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; transform: translateY(-1px); }
.cov.yes::before { background: var(--green-600); }
.cov.no::before { background: #c0392b; }
.cov.part::before { background: #c07c26; }

/* range readout with proportional bar */
.ev-km { display: inline-block; min-width: 66px; font-size: 15.5px; font-weight: 800; color: var(--primary); }
.ev-bar { display: inline-block; vertical-align: middle; width: 130px; max-width: 38%; height: 7px; margin-left: 10px; border-radius: var(--radius-pill); background: var(--surface-2); overflow: hidden; }
.ev-bar i { display: block; height: 100%; border-radius: var(--radius-pill); background: var(--primary); }

/* ---------- Closing CTA ---------- */
.post-cta { position: relative; overflow: hidden; margin: 46px 0 0; background: var(--blue-900); border-radius: var(--radius); padding: 38px 40px; text-align: center; box-shadow: var(--shadow-lg); }
.post-cta::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(125% 150% at 50% 0%, rgba(31, 111, 229, .45) 0%, rgba(31, 111, 229, 0) 62%); }
.post-cta > * { position: relative; }
.post-cta h2 { color: #fff; font-size: clamp(21px, 2.6vw, 26px); line-height: 1.25; margin: 0 0 12px; }
.post-cta p { color: rgba(255, 255, 255, .8); font-size: 15.5px; line-height: 1.7; max-width: 580px; margin: 0 auto 14px; }
.post-cta p:last-of-type { margin-bottom: 26px; }
.post-cta__actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

.post-disclaimer { margin-top: 38px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 13.5px; line-height: 1.7; color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 1040px) {
  .post-layout { grid-template-columns: 1fr; gap: 0; margin-top: 34px; }
  .post-aside { display: contents; }   /* lets the TOC reorder above the article */
  .side-toc { order: -1; margin-bottom: 32px; }
  .post-body { order: 0; }
  .side-related { order: 1; margin-top: 34px; }
}
@media (max-width: 600px) {
  .checklist.two, .defcards.two { grid-template-columns: 1fr; }
  .checkpanel { padding: 24px 20px; }
  .pullq { padding: 16px 20px; font-size: 17px; }
  .post-cta { padding: 28px 22px; }
  .post-cta__actions .btn { width: 100%; }
}
