/* ==========================================================================
   THE SAFE LINE — shared stylesheet
   Edit notes:
   - Palette and type tokens live in :root below. Change once, applies site-wide.
   - Body face is Atkinson Hyperlegible (Braille Institute), chosen for
     low-vision legibility. Display face is Bitter (slab serif).
   - Print styles at the bottom print ONLY the phone card when present.
   ========================================================================== */

:root {
  --paper: #f4f6f5;      /* cool mist background */
  --ink: #17272b;        /* deep slate text */
  --pine: #23594e;       /* primary green — links, headings, rules */
  --pine-soft: #e2ece7;  /* tinted panels */
  --flag: #9e2b25;       /* signal red — red-flag markers ONLY */
  --line: #c7d2cd;       /* hairline borders */
  --measure: 70ch;
}

* { box-sizing: border-box; }

html { font-size: 19px; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Atkinson Hyperlegible", "Segoe UI", Arial, sans-serif;
  line-height: 1.65;
}

/* ---------- Skip link & focus ---------- */
.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: #fff; padding: .5rem 1rem;
}
.skip:focus { left: 0; z-index: 10; }

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

/* ---------- Header & navigation ---------- */
header.site {
  border-bottom: 4px solid var(--pine);
  background: #fff;
  padding: 1.1rem 1.25rem .9rem;
}
.brand {
  font-family: "Bitter", Georgia, serif;
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: .04em;
  color: var(--pine);
  text-decoration: none;
  text-transform: uppercase;
}
.brand span { color: var(--ink); }
.tagline {
  margin: .1rem 0 0;
  font-size: .85rem;
  color: #46595a;
}
nav.site {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 0 .75rem;
}
nav.site ul {
  list-style: none;
  margin: 0; padding: 0;
  display: flex; flex-wrap: wrap;
}
nav.site a {
  display: block;
  padding: .65rem .6rem;
  color: var(--ink);
  text-decoration: none;
  font-size: .92rem;
  border-bottom: 4px solid transparent;
}
nav.site a:hover { color: var(--pine); text-decoration: underline; }
nav.site a[aria-current="page"] {
  border-bottom-color: var(--flag);
  font-weight: 700;
  color: var(--pine);
}

/* ---------- Main column ---------- */
main {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 2.25rem 1.25rem 3.5rem;
}

.eyebrow {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--pine);
  margin: 0 0 .4rem;
}

h1 {
  font-family: "Bitter", Georgia, serif;
  font-weight: 800;
  font-size: 2.15rem;
  line-height: 1.18;
  margin: 0 0 .8rem;
}
h2 {
  font-family: "Bitter", Georgia, serif;
  font-weight: 700;
  font-size: 1.42rem;
  line-height: 1.25;
  margin: 2.4rem 0 .6rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}
h3 {
  font-family: "Bitter", Georgia, serif;
  font-weight: 700;
  font-size: 1.08rem;
  margin: 1.6rem 0 .35rem;
}

p { margin: 0 0 1rem; }

.standfirst {
  font-size: 1.12rem;
  color: #2c3f42;
}

a { color: var(--pine); text-decoration: underline; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 3px; }

ul, ol { padding-left: 1.35rem; margin: 0 0 1.1rem; }
li { margin-bottom: .45rem; }

/* ---------- Red-flag triad ---------- */
.flags {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: .75rem;
  margin: 1.4rem 0;
  padding: 0;
  list-style: none;
}
.flags li {
  background: #fff;
  border: 1px solid var(--line);
  border-top: 5px solid var(--flag);
  padding: .85rem .9rem;
  margin: 0;
}
.flags b {
  display: block;
  font-family: "Bitter", Georgia, serif;
  font-size: 1.02rem;
  color: var(--flag);
  margin-bottom: .25rem;
}
.flags span { font-size: .92rem; }

/* Inline red-flag "tell" line inside scam entries */
.tell {
  margin: .5rem 0 0;
  padding-left: 1.4rem;
  position: relative;
  font-size: .95rem;
}
.tell::before {
  content: "▲";
  position: absolute; left: 0; top: .1rem;
  color: var(--flag);
  font-size: .8rem;
}
.tell b { color: var(--flag); }

/* ---------- Scam entries ---------- */
article.scam {
  background: #fff;
  border: 1px solid var(--line);
  padding: 1.1rem 1.2rem .9rem;
  margin: 0 0 1rem;
}
article.scam h3 { margin-top: 0; }

/* ---------- Panels & callouts ---------- */
.panel {
  background: var(--pine-soft);
  border-left: 5px solid var(--pine);
  padding: 1rem 1.2rem;
  margin: 1.4rem 0;
}
.panel.urgent {
  background: #f7e9e8;
  border-left-color: var(--flag);
}
.panel h2, .panel h3 { border: 0; padding-top: 0; margin-top: 0; }

/* ---------- Checklist (real sequence, numbered) ---------- */
ol.steps { counter-reset: step; list-style: none; padding: 0; }
ol.steps > li {
  counter-increment: step;
  position: relative;
  padding: .2rem 0 .9rem 3.1rem;
  margin: 0;
}
ol.steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: .1rem;
  width: 2.15rem; height: 2.15rem;
  border-radius: 50%;
  background: var(--pine);
  color: #fff;
  font-family: "Bitter", Georgia, serif;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
ol.steps b { font-family: "Bitter", Georgia, serif; }

/* ---------- Resource list ---------- */
dl.resources dt {
  font-weight: 700;
  font-family: "Bitter", Georgia, serif;
  margin-top: 1rem;
}
dl.resources dd { margin: .15rem 0 0 0; }
.phone-number {
  font-family: "Bitter", Georgia, serif;
  font-weight: 700;
  white-space: nowrap;
}

/* ---------- Signature element: the printable phone card ---------- */
.phonecard-wrap { margin: 2.2rem 0 1rem; }
.phonecard {
  background: #fffdf8;
  border: 2px dashed var(--ink);
  padding: 1.3rem 1.4rem 1.1rem;
  max-width: 34rem;
}
.phonecard .card-head {
  font-family: "Bitter", Georgia, serif;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: .95rem;
  border-bottom: 2px solid var(--ink);
  padding-bottom: .4rem;
  margin: 0 0 .7rem;
}
.phonecard ul { list-style: none; padding: 0; margin: 0 0 .8rem; }
.phonecard li { padding-left: 1.3rem; position: relative; margin-bottom: .35rem; font-size: .98rem; }
.phonecard li::before {
  content: "▲"; color: var(--flag);
  position: absolute; left: 0; font-size: .75rem; top: .18rem;
}
.phonecard .rule {
  font-family: "Bitter", Georgia, serif;
  font-weight: 700;
  font-size: 1.05rem;
  margin: 0 0 .55rem;
}
.phonecard .fill-in {
  font-size: .92rem;
  margin: 0;
  border-top: 1px solid var(--line);
  padding-top: .55rem;
}
.print-hint { font-size: .85rem; color: #46595a; margin-top: .5rem; }
button.print {
  font: inherit;
  font-weight: 700;
  background: var(--pine);
  color: #fff;
  border: 0;
  padding: .55rem 1.1rem;
  margin-top: .6rem;
  cursor: pointer;
}
button.print:hover { background: #1b463d; }

/* ---------- Footer ---------- */
footer.site {
  border-top: 4px solid var(--pine);
  background: #fff;
  margin-top: 3rem;
  padding: 1.4rem 1.25rem 2rem;
  font-size: .85rem;
  color: #46595a;
}
footer.site .inner { max-width: var(--measure); margin: 0 auto; }
footer.site p { margin-bottom: .5rem; }

/* ---------- Print: emit only the phone card if the page has one ---------- */
@media print {
  header.site, nav.site, footer.site, .print-hint, button.print { display: none !important; }
  body { background: #fff; }
  body.has-card main > * { display: none; }
  body.has-card main .phonecard-wrap { display: block; }
  .phonecard { border-color: #000; }
}

/* ---------- Motion & small screens ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
@media (max-width: 540px) {
  html { font-size: 18px; }
  h1 { font-size: 1.75rem; }
}
