/* ============================================================
   Scrannr — Content-page extras (About, methodology, guides)
   Builds on the locked tokens in shared.css, the base typography
   in home.css and the article/prose components in compare.css.
   Adds NO new brand colours — tokens only.
   ============================================================ */

/* Give in-article anchor targets room under the sticky header */
.article :where(h2, h3)[id] { scroll-margin-top: 88px; }

/* ===== GUIDE-CARD GRID (guides hub + "related" blocks) ===== */
.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(258px, 1fr));
  gap: 16px;
}
.guide-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--ring), var(--shadow-sm);
  padding: 24px 24px 22px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.guide-card:hover { transform: translateY(-3px); box-shadow: var(--ring), var(--shadow-md); }
.guide-card-tag {
  font-family: 'Manrope', sans-serif;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--green-deep);
}
.guide-card-title {
  font-family: 'Manrope', sans-serif;
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.015em;
  line-height: 1.2;
  color: var(--ink);
}
.guide-card-dek { font-size: 14.5px; color: var(--ink-2); line-height: 1.55; }
.guide-card-meta {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-3);
}
.guide-card-meta .arrow {
  color: var(--green);
  transition: transform 0.2s ease;
  font-weight: 700;
}
.guide-card:hover .guide-card-meta .arrow { transform: translateX(3px); }

/* ===== TABLE OF CONTENTS ("On this page") ===== */
.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xs);
  padding: 16px 20px;
  margin: 0 auto;
  max-width: var(--maxw-narrow);
}
.toc h2 {
  font-family: 'Manrope', sans-serif;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  margin: 0 0 10px;
}
.toc ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.toc li { font-size: 14.5px; line-height: 1.4; color: var(--ink-2); }
.toc a { color: var(--green-deep); text-decoration: none; }
.toc a:hover { color: var(--green); text-decoration: underline; text-underline-offset: 2px; }

/* ===== KEY-TAKEAWAYS BOX ===== */
.keypoints {
  background: var(--green-soft);
  border: 1px solid var(--border);
  border-left: 3px solid var(--green);
  border-radius: var(--r-md);
  padding: 18px 22px;
  margin: 0 auto;
  max-width: var(--maxw-narrow);
}
.keypoints h2 {
  font-family: 'Manrope', sans-serif;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--green-deep);
  margin: 0 0 10px;
}
.keypoints ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 7px; }
.keypoints li { font-size: 15px; color: var(--ink-2); line-height: 1.5; }
.keypoints strong { color: var(--ink); font-weight: 600; }

/* ===== SOURCES / REFERENCES LIST ===== */
.sources {
  max-width: var(--maxw-narrow);
  margin: 0 auto;
  padding: 0;
  list-style: none;
  counter-reset: src;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sources > li {
  counter-increment: src;
  position: relative;
  padding-left: 34px;
  font-size: 14.5px;
  color: var(--ink-2);
  line-height: 1.5;
}
.sources > li::before {
  content: counter(src);
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green-deep);
  font-family: 'Manrope', sans-serif;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sources .src-pub { display: block; font-weight: 600; color: var(--ink); }
.sources a { color: var(--green-deep); text-decoration: underline; text-underline-offset: 2px; word-break: break-word; }
.sources a:hover { color: var(--green); }

/* ===== ABOUT — COMPANY FACTSHEET ===== */
.factsheet {
  max-width: var(--maxw-narrow);
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
  padding: 8px 24px;
}
.factsheet .fact {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 8px 20px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
}
.factsheet .fact:first-child { border-top: none; }
.factsheet dt {
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.factsheet dd { margin: 0; font-size: 15px; color: var(--ink); line-height: 1.5; }
.factsheet dd a { color: var(--green-deep); text-decoration: underline; text-underline-offset: 2px; }
.factsheet dd a:hover { color: var(--green); }

/* ===== RESPONSIVE ===== */
@media (max-width: 560px) {
  .factsheet { padding: 4px 18px; }
  .factsheet .fact { grid-template-columns: 1fr; gap: 2px; padding: 12px 0; }
  .guide-card { padding: 20px; }
}

/* ============================================================
   ADDITIVES SECTION (hub + spokes) — appended 2026-07
   The .risk-badge--* colour sets mirror the app's canonical
   severity palette (scranner/src/lib/theme.js COLORS.severity)
   verbatim, so the site badge matches the in-app pills. They are
   app state colours, not new brand tokens — shared.css stays locked.
   ============================================================ */

/* ===== RISK BADGE ===== */
.risk-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 11px 3px 9px;
  border-radius: var(--r-pill);
  border: 1px solid var(--rb-border);
  background: var(--rb-bg);
  color: var(--rb-text);
  font-family: 'Manrope', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.6;
  white-space: nowrap;
}
.risk-badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--rb-strong);
  flex: none;
}
.risk-badge--lg { padding: 6px 16px 6px 13px; font-size: 14.5px; gap: 9px; }
.risk-badge--lg::before { width: 9px; height: 9px; }
/* App severity palette, verbatim (bg / border / text / textStrong) */
.risk-badge--safe     { --rb-bg: #BBF7D0; --rb-border: #86EFAC; --rb-text: #15803D; --rb-strong: #166534; }
.risk-badge--limited  { --rb-bg: #FEF08A; --rb-border: #FDE047; --rb-text: #A16207; --rb-strong: #854D0E; }
.risk-badge--moderate { --rb-bg: #FED7AA; --rb-border: #FDBA74; --rb-text: #9A3412; --rb-strong: #7C2D12; }
.risk-badge--high     { --rb-bg: #FECACA; --rb-border: #FCA5A5; --rb-text: #B91C1C; --rb-strong: #991B1B; }

/* ===== SPOKE: risk row under the H1 ===== */
.page-risk {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}
.page-risk-cat { font-size: 15px; color: var(--ink-3); }

/* ===== SPOKE: concern chips inside the factsheet ===== */
.concern-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.concern-chip {
  display: inline-block;
  padding: 3px 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  line-height: 1.6;
}

/* ===== SPOKE: mid-page install CTA ===== */
.mid-cta { text-align: center; }
.mid-cta p { margin: 0 0 16px; font-size: 15.5px; color: var(--ink-2); }

/* ===== HUB: search + risk filter controls =====
   Hidden without JS (progressive enhancement — the full list renders
   regardless); BaseHead's jsFlag adds .js to <html>. */
.additive-controls { display: none; }
.js .additive-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  max-width: var(--maxw);
  margin: 26px 0 0;
}
.additive-search {
  flex: 1 1 240px;
  min-width: 200px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface);
  font: inherit;
  font-size: 15px;
  color: var(--ink);
}
.additive-search:focus { outline: 2px solid var(--green); outline-offset: 1px; border-color: var(--green); }
.filter-chip {
  cursor: pointer;
  padding: 7px 14px 7px 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  line-height: 1.6;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.filter-chip::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rb-strong);
  flex: none;
}
.filter-chip--safe     { --rb-bg: #BBF7D0; --rb-border: #86EFAC; --rb-text: #15803D; --rb-strong: #166534; }
.filter-chip--limited  { --rb-bg: #FEF08A; --rb-border: #FDE047; --rb-text: #A16207; --rb-strong: #854D0E; }
.filter-chip--moderate { --rb-bg: #FED7AA; --rb-border: #FDBA74; --rb-text: #9A3412; --rb-strong: #7C2D12; }
.filter-chip--high     { --rb-bg: #FECACA; --rb-border: #FCA5A5; --rb-text: #B91C1C; --rb-strong: #991B1B; }
.filter-chip[aria-pressed="true"] {
  background: var(--rb-bg);
  border-color: var(--rb-border);
  color: var(--rb-text);
}
.additive-count { font-size: 13.5px; color: var(--ink-3); margin-left: auto; }
.no-results {
  max-width: var(--maxw);
  margin: 28px auto 0;
  font-size: 15.5px;
  color: var(--ink-2);
}

/* ===== HUB: category sections + dense card grid ===== */
/* Author display rules beat the UA [hidden] default, so restore it for
   everything the hub filter script toggles. */
.additive-card[hidden], .cat-section[hidden], .no-results[hidden] { display: none; }
.cat-section .section-title { margin-bottom: 4px; }
.cat-section .cat-count { font-size: 14px; color: var(--ink-3); margin: 0 0 18px; }
.additive-grid { grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 12px; }
.additive-card { padding: 16px 18px 14px; gap: 6px; }
.additive-card .guide-card-tag {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.additive-card .guide-card-title { font-size: 16.5px; }

@media (max-width: 560px) {
  .additive-count { margin-left: 0; flex-basis: 100%; }
  .additive-card { padding: 14px 16px 12px; }
}
