/* Blogs: the guides index and article pages. Loaded after styles.css,
   so it shares the atlas tokens, masthead, footer and tab bar. */

/* ── Live strip under the masthead ──────────────────────────── */
.live-strip { background: var(--band); color: var(--band-ink); font-size: var(--t-sm); }
.live-strip a { display: flex; align-items: center; gap: 0.6rem; padding-block: 0.6rem; text-decoration: none; color: inherit; }
.live-strip b { flex: none; font-size: var(--t-xs); font-weight: 800; font-stretch: var(--wide); letter-spacing: 0.02em; text-transform: uppercase; color: var(--accent-ink); background: var(--accent); border-radius: 3px; padding: 0.12rem 0.45rem; }
.live-strip span { min-width: 0; }
.live-strip u { text-decoration-color: var(--accent); text-underline-offset: 0.2em; font-weight: 700; white-space: nowrap; }
.live-strip.is-live b::before { content: ""; display: inline-block; width: 0.45rem; height: 0.45rem; margin-right: 0.35rem; border-radius: 50%; background: currentColor; vertical-align: 0.05em; animation: blink 1.6s steps(2, start) infinite; }
@keyframes blink { to { visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .live-strip.is-live b::before { animation: none; } }

/* ── Breadcrumbs ────────────────────────────────────────────── */
.crumbs { display: flex; flex-wrap: wrap; gap: 0.3rem; list-style: none; margin: 0; padding: 0; font-size: var(--t-xs); font-weight: 600; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: 0.3rem; color: var(--line-2); }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

/* ── Index hero ─────────────────────────────────────────────── */
.b-hero {
  position: relative; overflow: hidden;
  background:
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 100% 4.5rem,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 4.5rem 100%,
    var(--sea);
  border-bottom: 1px solid var(--line);
}
.b-hero-in { display: grid; gap: 0.9rem; padding-block: 1.6rem 1.9rem; }
.b-hero h1 { font-size: clamp(2rem, 1.3rem + 3.4vw, 3.6rem); font-weight: 820; font-stretch: var(--xwide); letter-spacing: -0.025em; line-height: 0.98; max-width: 22ch; }
.b-hero p.dek { font-size: var(--t-lg); color: var(--ink-2); max-width: 40rem; line-height: 1.45; }
.kicker { display: inline-flex; align-items: center; gap: 0.45rem; justify-self: start; font-size: var(--t-xs); font-weight: 800; font-stretch: var(--wide); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink); background: var(--panel); border-radius: 999px; padding: 0.3rem 0.75rem 0.3rem 0.55rem; box-shadow: 0 0 0 1px var(--line-2); text-decoration: none; }
.kicker i { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--accent); }
.cat-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; margin: 0.3rem 0 0; padding: 0; }
.cat-chips a { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 2.4rem; padding: 0.3rem 0.85rem; font-size: var(--t-sm); font-weight: 650; text-decoration: none; background: var(--panel); border: 1px solid var(--line-2); border-radius: 999px; }
.cat-chips a:hover { border-color: var(--ink); }
.cat-chips small { font-weight: 800; font-stretch: var(--cond); color: var(--muted); }

/* ── Cards ──────────────────────────────────────────────────── */
.b-main { display: grid; gap: 2.75rem; padding-block: 2rem 1rem; }
.b-sec { display: grid; gap: 1.1rem; border-top: 2px solid var(--ink); padding-top: 0.9rem; scroll-margin-top: 5rem; }
.b-sec h2 { font-size: var(--t-2xl); font-weight: 780; font-stretch: var(--xwide); letter-spacing: -0.015em; }
.b-sec > p { font-size: var(--t-sm); color: var(--muted); max-width: 44rem; margin-top: -0.6rem; }
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 40rem) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 64rem) { .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.card-b { position: relative; display: grid; grid-template-rows: auto 1fr; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: border-color .15s, transform .15s; }
.card-b:hover { border-color: var(--ink); }
@media (prefers-reduced-motion: no-preference) { .card-b:hover { transform: translateY(-2px); } }
.card-b img { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover; background: var(--sea); border-bottom: 1px solid var(--line); }
.card-b .cb-body { display: grid; align-content: start; gap: 0.45rem; padding: 0.85rem 1rem 1rem; }
.card-b h3 { font-size: 1.15rem; font-weight: 760; font-stretch: var(--wide); line-height: 1.18; letter-spacing: -0.01em; }
.card-b h3 a { text-decoration: none; }
.card-b h3 a::after { content: ""; position: absolute; inset: 0; }
.card-b p { font-size: var(--t-sm); color: var(--ink-2); line-height: 1.45; }
.cb-meta { font-size: var(--t-xs); font-weight: 650; color: var(--muted); display: flex; gap: 0.5rem; flex-wrap: wrap; }
.cb-meta b { color: var(--accent); font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.cards.lead { gap: 1rem; }
@media (min-width: 64rem) {
  .cards.lead { grid-template-columns: 1.6fr 1fr; grid-template-rows: auto auto; }
  .cards.lead > li:first-child { grid-row: span 2; }
  .cards.lead > li:first-child h3 { font-size: 1.7rem; font-stretch: var(--xwide); }
  .cards.lead > li:first-child p { font-size: var(--t-md); }
  .cards.lead > li:not(:first-child) .card-b { grid-template-columns: 13rem 1fr; grid-template-rows: none; align-items: start; }
  .cards.lead > li:not(:first-child) img { margin: 1rem 0 1rem 1rem; width: calc(100% - 1rem); border: 1px solid var(--line); border-radius: 2px; }
}

/* ── Article header ─────────────────────────────────────────── */
.a-head { background: var(--sea); border-bottom: 1px solid var(--line);
  background:
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 100% 4.5rem,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 4.5rem 100%,
    var(--sea);
}
.a-head-in { display: grid; gap: 0.85rem; padding-block: 1.1rem 0; }
.a-head h1 { font-size: clamp(1.85rem, 1.2rem + 3vw, 3.15rem); font-weight: 820; font-stretch: var(--xwide); letter-spacing: -0.022em; line-height: 1.02; max-width: 24ch; }
.a-head .dek { font-size: var(--t-lg); color: var(--ink-2); line-height: 1.45; max-width: 44rem; }
.a-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.9rem; font-size: var(--t-sm); color: var(--muted); font-weight: 600; }
.a-meta b { color: var(--ink); font-weight: 750; }
.share-btn { display: inline-flex; align-items: center; gap: 0.35rem; min-height: 2.2rem; padding: 0.25rem 0.75rem; font-size: var(--t-sm); font-weight: 700; color: var(--ink); background: var(--panel); border: 1px solid var(--line-2); border-radius: 6px; cursor: pointer; }
.share-btn:hover { border-color: var(--ink); }
.share-btn svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.a-cover { margin: 0.4rem 0 -1px; }
.a-cover img { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630; border: 1px solid var(--line-2); border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; background: var(--panel); }
@media (min-width: 64rem) { .a-cover { max-width: 52rem; } }

/* ── Article body and contents ──────────────────────────────── */
.a-grid { display: grid; gap: 1.5rem; padding-block: 1.5rem 1rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 64rem) {
  .a-grid { grid-template-columns: minmax(0, 46rem) minmax(0, 1fr); gap: 3rem; padding-top: 2rem; }
  .a-side { position: sticky; top: 5.5rem; align-self: start; display: grid; gap: 1rem; }
}
.toc { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.toc summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; padding: 0.75rem 1rem; font-weight: 780; font-stretch: var(--wide); cursor: pointer; }
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after { content: "+"; font-size: 1.3rem; font-weight: 500; line-height: 1; color: var(--muted); }
.toc[open] summary::after { content: "−"; }
.toc ol { margin: 0; padding: 0 1rem 0.9rem 2.2rem; display: grid; gap: 0.35rem; font-size: var(--t-sm); }
.toc li::marker { font-weight: 800; font-stretch: var(--cond); color: var(--accent); }
.toc a { color: var(--ink-2); text-decoration: none; font-weight: 600; }
.prose .toc ol { gap: 0.45rem; padding-left: 1rem; }
.prose .toc ol > li { padding-left: 2rem; min-height: 0; }
.prose .toc ol > li::before { width: 1.35rem; height: 1.35rem; font-size: 0.78rem; top: 0.05em; color: var(--ink); background: var(--panel-2); }
.toc a:hover { color: var(--ink); text-decoration: underline; }
.side-cta { display: grid; gap: 0.5rem; padding: 1rem; background: var(--band); color: var(--band-ink); border-radius: var(--radius); }
.side-cta strong { font-size: var(--t-lg); font-weight: 800; font-stretch: var(--xwide); line-height: 1.15; }
.side-cta p { font-size: var(--t-sm); opacity: 0.85; }
.side-cta a { justify-self: start; margin-top: 0.25rem; padding: 0.45rem 0.85rem; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: var(--t-sm); text-decoration: none; border-radius: 6px; }
@media (max-width: 63.99rem) { .a-side .side-cta { display: none; } }

.prose { font-size: 1.0625rem; line-height: 1.7; color: var(--ink); min-width: 0; }
.prose > * + * { margin-top: 1.1rem; }
.prose h2 { margin-top: 2.6rem; padding-top: 0.8rem; border-top: 2px solid var(--ink); font-size: clamp(1.45rem, 1.2rem + 1vw, 1.85rem); font-weight: 790; font-stretch: var(--xwide); letter-spacing: -0.015em; line-height: 1.12; scroll-margin-top: 5.5rem; }
.prose h3 { margin-top: 1.8rem; font-size: 1.22rem; font-weight: 760; font-stretch: var(--wide); line-height: 1.25; scroll-margin-top: 5.5rem; }
.prose h2 + *, .prose h3 + * { margin-top: 0.7rem; }
.prose p { max-width: 42rem; }
.prose a { color: var(--ink); text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 0.18em; font-weight: 600; }
.prose a:hover { color: var(--accent); }
.prose a[target="_blank"]::after { content: "↗"; font-size: 0.75em; margin-left: 0.12em; color: var(--muted); }
.prose strong { font-weight: 760; }
.prose ul, .prose ol { padding-left: 0; list-style: none; display: grid; gap: 0.55rem; max-width: 42rem; }
.prose ul > li { position: relative; padding-left: 1.4rem; }
.prose ul > li::before { content: ""; position: absolute; left: 0.25rem; top: 0.68em; width: 0.42rem; height: 0.42rem; background: var(--accent); transform: rotate(45deg); }
.prose ol { counter-reset: n; }
.prose ol > li { position: relative; padding-left: 2.4rem; counter-increment: n; min-height: 1.8rem; }
.prose ol > li::before { content: counter(n); position: absolute; left: 0; top: 0.08em; display: grid; place-items: center; width: 1.65rem; height: 1.65rem; font-size: 0.9rem; font-weight: 820; font-stretch: var(--cond); color: var(--accent-ink); background: var(--ink); border-radius: 50%; }
.prose code { font-size: 0.92em; background: var(--panel-2); padding: 0.05rem 0.3rem; border-radius: 3px; }
.prose hr { border: 0; border-top: 1px solid var(--line-2); margin-block: 2rem; }

/* Quick answer and callouts */
.box { background: var(--panel); border: 1px solid var(--line-2); border-left: 5px solid var(--accent); border-radius: var(--radius); padding: 1rem 1.1rem 1.1rem; display: grid; gap: 0.6rem; }
.box > * + * { margin-top: 0; }
.box-t { font-size: var(--t-xs); font-weight: 800; font-stretch: var(--wide); letter-spacing: 0.07em; text-transform: uppercase; color: var(--accent); }
.box.key { border-left-color: var(--ink); }
.box.key .box-t { color: var(--ink); }
.box ul, .box ol { gap: 0.4rem; }
.box p, .box li { font-size: 1rem; line-height: 1.55; }
.callout { margin-inline: 0; padding: 0.85rem 1rem; background: var(--accent-soft); border-radius: var(--radius); font-size: 1rem; line-height: 1.55; }
.callout strong:first-child { color: var(--accent-2); }
:root[data-theme="dark"] .callout strong:first-child { color: var(--accent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .callout strong:first-child { color: var(--accent); } }

/* Tables */
.t-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); max-width: 46rem; }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.93rem; line-height: 1.4; font-variant-numeric: tabular-nums; }
.prose th, .prose td { text-align: left; padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose thead th { font-size: var(--t-xs); font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); background: var(--panel-2); white-space: nowrap; }
.prose tbody tr:last-child td { border-bottom: 0; }
.prose td.n, .prose th.n { text-align: right; white-space: nowrap; }

/* Figures and charts */
.fig { margin-inline: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; display: grid; gap: 0.8rem; max-width: 46rem; }
.fig-t { font-size: 1.02rem; font-weight: 780; font-stretch: var(--wide); line-height: 1.25; }
.fig figcaption { font-size: var(--t-xs); color: var(--muted); line-height: 1.45; }
.fig img { display: block; width: 100%; height: auto; border-radius: 3px; }
.hb { display: grid; gap: 0.32rem; list-style: none; margin: 0; padding: 0; font-variant-numeric: tabular-nums; }
.prose .hb { gap: 0.32rem; }
.prose .hb > li { padding: 0; display: grid; grid-template-columns: var(--lw, 3.2rem) minmax(0, 1fr) auto; align-items: center; gap: 0.6rem; font-size: 0.86rem; line-height: 1.3; }
.prose .hb > li::before { content: none; }
.hb-l { font-weight: 700; color: var(--ink-2); }
.hb-t { position: relative; height: 1.2rem; background: var(--panel-2); border-radius: 2px; overflow: hidden; }
.hb-f { position: absolute; inset: 0 auto 0 0; background: var(--pc, var(--ink)); border-radius: 2px; }
.hb-f.hi { background: var(--accent); }
.hb-v { font-weight: 800; font-stretch: var(--semi); min-width: 3.4rem; text-align: right; }
.stk-row { display: grid; grid-template-columns: 3rem minmax(0, 1fr) 2.2rem; align-items: center; gap: 0.6rem; font-size: 0.86rem; font-variant-numeric: tabular-nums; }
.stk-row b { font-weight: 700; color: var(--ink-2); }
.stk-row em { font-style: normal; font-weight: 800; text-align: right; color: var(--muted); font-size: var(--t-xs); }
.stk { display: flex; height: 1.45rem; gap: 1px; background: var(--panel); position: relative; }
.stk span { flex: var(--n) 0 0; background: var(--pc); min-width: 0; display: grid; place-items: center; font-size: 0.7rem; font-weight: 800; color: #fff; overflow: hidden; white-space: nowrap; }
.stk span { text-shadow: 0 0 3px rgb(0 0 0 / .55); }
.stk::after { content: ""; position: absolute; top: -3px; bottom: -3px; left: var(--maj, 50%); border-left: 2px dashed var(--ink); }
.stk-wrap { display: grid; gap: 0.35rem; }
.legend, .prose .legend { display: flex; flex-wrap: wrap; gap: 0.35rem 0.9rem; list-style: none; margin: 0; padding: 0; font-size: var(--t-xs); font-weight: 650; color: var(--ink-2); }
.prose .legend > li { padding: 0; display: inline-flex; align-items: center; gap: 0.35rem; }
.prose .legend > li::before { content: ""; position: static; transform: none; width: 0.7rem; height: 0.7rem; border-radius: 2px; background: var(--pc); }
.dumb { display: grid; gap: 0.5rem; list-style: none; margin: 0; padding: 0; }
.prose .dumb > li { padding: 0; display: grid; grid-template-columns: minmax(0, 8.5rem) minmax(0, 1fr); gap: 0.6rem; align-items: center; font-size: 0.88rem; }
.prose .dumb > li::before { content: none; }
.dumb-line { position: relative; height: 1.5rem; }
.dumb-line::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--line); }
.dumb-a, .dumb-b { position: absolute; top: 50%; translate: -50% -50%; width: 0.85rem; height: 0.85rem; border-radius: 50%; }
.dumb-a { background: var(--panel); border: 2px solid var(--pc); }
.dumb-b { background: var(--pc); }
.dumb-bar { position: absolute; top: calc(50% - 1.5px); height: 3px; background: var(--pc); opacity: 0.5; }
.dumb-n { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dumb-n small { font-weight: 600; color: var(--muted); }
.waffle { display: grid; grid-template-columns: repeat(20, minmax(0, 1fr)); gap: 3px; max-width: 30rem; }
.waffle i { aspect-ratio: 1; border-radius: 2px; background: var(--pc); }
.waffle i.l { background: transparent; box-shadow: inset 0 0 0 1.5px var(--pc); }
.hemi svg { display: block; width: 100%; max-width: 32rem; height: auto; margin-inline: auto; }
.hemi circle { fill: var(--pc); }
.tl { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; position: relative; }
.prose .tl { gap: 0; }
.prose .tl > li { position: relative; padding: 0 0 0.95rem 1.6rem; display: grid; grid-template-columns: 5.2rem minmax(0, 1fr); gap: 0.6rem; font-size: 0.93rem; line-height: 1.45; }
.prose .tl > li::before { content: ""; position: absolute; left: 0.2rem; top: 0.38em; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--panel); border: 2px solid var(--accent); transform: none; }
.prose .tl > li::after { content: ""; position: absolute; left: 0.5rem; top: 1.2em; bottom: 0; border-left: 1px solid var(--line-2); }
.prose .tl > li:last-child::after { content: none; }
.prose .tl > li:last-child { padding-bottom: 0; }
.tl b { font-weight: 800; font-stretch: var(--semi); color: var(--ink); }
.tl span { color: var(--ink-2); }

/* Questions and answers */
.qa { display: grid; gap: 0.6rem; }
.prose .qa h3 { margin-top: 0; padding-top: 1rem; border-top: 1px solid var(--line); font-size: 1.1rem; }
.prose .qa h3:first-child { border-top: 0; padding-top: 0.2rem; }

/* Mid-article call to action */
.cta { display: grid; gap: 0.6rem; padding: 1.1rem 1.15rem; background: var(--band); color: var(--band-ink); border-radius: var(--radius); max-width: 46rem; }
.cta strong { font-size: 1.2rem; font-weight: 800; font-stretch: var(--xwide); line-height: 1.15; }
.cta p { font-size: 0.97rem; line-height: 1.5; opacity: 0.88; }
.prose .cta a { justify-self: start; color: var(--accent-ink); background: var(--accent); padding: 0.5rem 0.95rem; border-radius: 6px; text-decoration: none; font-weight: 800; font-size: var(--t-sm); }
.prose .cta a:hover { color: var(--accent-ink); filter: brightness(1.08); }

/* Sources and related */
.sources { font-size: 0.92rem; }
.prose .sources li { line-height: 1.5; }
.related { display: grid; gap: 1rem; border-top: 2px solid var(--ink); padding-top: 0.9rem; margin-top: 2.5rem; }
.related h2 { font-size: var(--t-xl); font-weight: 790; font-stretch: var(--xwide); }
.a-foot-note { font-size: var(--t-xs); color: var(--muted); max-width: 42rem; margin-top: 2rem; }
