/* =============================================================================
   recoveryshit.com — BASEMENT BULLETIN
   The useful wall in a church basement. Printed list, marker ink, worn paper.

   Implements docs/art-direction.md. If a value is not in that guide, it does
   not belong here.

   FONTS ARE SELF-HOSTED ON PURPOSE. The guide names Google Fonts; we do not
   use the CDN. A recovery site must not hand every visitor's IP and referrer
   to a third party, and the vision doc's anonymity rule outranks a delivery
   note. Cut once with fonttools, committed. Still no build step.
     oswald-var.woff2    18,512   wght 500-700, latin
     plexsans-var.woff2  23,064   wght 400-700, wdth pinned 100, latin
     plexmono-400.woff2   7,972
     plexmono-500.woff2   7,980
     TOTAL               57,528   (target 65KB)

   CONTRAST, measured with tools/contrast-check.php:
     ink #191714 on paper #E6DCC7 ........ 13.14
     ink-soft #5F584C on paper ...........  5.16
     ink on yellow #F1BE38 ............... 10.36   <- CALL AHEAD
     paper-light #F7F0E2 on ink .......... 15.77   <- tap-to-call
     success #235430 on paper ............  6.48
     line #6B6459 on paper ...............  4.29   (non-text, needs 3.0)
     red #BC321F on paper ................  4.27   large text / marks ONLY
     red-text #A32918 on paper ...........  5.34   <- red at normal sizes

   TWO RULES THAT ARE LOAD-BEARING:
     1. --red is a signal color at display sizes and for marks. It measures
        4.27:1, which clears the 3.0 bar for large text and UI but NOT the 4.5
        bar for body copy. Red text below 24px (or below 18.66px bold) must
        use --red-text. Never fill a background with --red and put text on it.
     2. Status is never color alone. CALL AHEAD and VERIFIED are always words.
   ============================================================================= */

/* ---------------------------------------------------------------- fonts ---- */

@font-face {
  font-family: "Oswald";
  src: url("/assets/fonts/oswald-var.woff2") format("woff2");
  font-weight: 500 700;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("/assets/fonts/plexsans-var.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/assets/fonts/plexmono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/assets/fonts/plexmono-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

/* ---------------------------------------------------------------- tokens --- */

:root {
  /* Paper, marker ink, a fire door, coffee-room yellow. */
  --paper: #E6DCC7;
  --ink: #191714;
  --ink-soft: #5F584C;
  --red: #BC321F;
  --red-text: #A32918;
  --yellow: #F1BE38;
  --paper-light: #F7F0E2;
  --line: #6B6459;
  --success: #235430;

  --font-display: "Oswald", "Haettenschweiler", "Arial Narrow", Impact, sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Roboto Mono", "DejaVu Sans Mono", monospace;

  /* 760px reading measure, 960px for filters and listing rows. */
  --measure: 760px;
  --measure-wide: 960px;
  --gutter: 20px;

  --tap: 44px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background-color: var(--paper);
  /* One local tileable paper grain. Sits under open page areas only; every
     dense element below re-asserts an opaque background to keep it out of
     form controls, listing rows, tap-to-call buttons and the crisis strip. */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23g)' opacity='0.12'/%3E%3C/svg%3E");
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

.wrap { max-width: var(--measure); margin: 0 auto; padding: 0 var(--gutter); }
.wrap-wide { max-width: var(--measure-wide); margin: 0 auto; padding: 0 var(--gutter); }

a { color: var(--ink); text-underline-offset: 3px; }
a:hover { color: var(--red-text); }

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 2px;
}

/* The signature motif: a black rule with a small red route mark.
     01 ─────────────────── →
   Oswald carries neither an arrow nor a box-drawing glyph, so the rule is
   drawn as a gradient and the arrow is set in Plex Mono, which has U+2192. */
.mark { display: flex; align-items: center; gap: 14px; }
.mark::after {
  content: "\2192";
  flex: 1 1 auto;
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1;
  color: var(--red);
  text-align: right;
  background-image: linear-gradient(var(--ink), var(--ink));
  background-size: calc(100% - 1.6em) 2px;
  background-position: left center;
  background-repeat: no-repeat;
}

/* ---------- masthead + nav ---------- */

.masthead { padding: 26px 0 0; }

.brand,
.home-title {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(2rem, 7vw, 2.9rem);
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
}
.brand:hover { color: var(--ink); }
/* Large display type, so --red clears the 3.0 large-text bar at 4.27:1. */
.brand span,
.home-title span { color: var(--red); }

.masthead-place {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.tagline { margin-top: 12px; font-size: 1.05rem; color: var(--ink-soft); }

/* Wraps into a grid. Never scrolls sideways — the guide forbids it outright. */
nav.mainnav {
  margin-top: 22px;
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
}
nav.mainnav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
}
nav.mainnav a {
  display: flex;
  align-items: center;
  min-height: var(--tap);
  padding: 10px 0;
  margin-right: 22px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 3px solid transparent;
  transition: color 140ms ease;
}
nav.mainnav a:hover { color: var(--ink); }
/* Active is a red rule AND a weight change AND full-ink text. Never color alone. */
nav.mainnav a[aria-current="page"] {
  color: var(--ink);
  font-weight: 500;
  border-bottom-color: var(--red);
}

/* ---------- page structure ---------- */

.pagehead { padding: 34px 0 24px; border-bottom: 2px solid var(--ink); }
.page {
  font-family: var(--font-display);
  font-size: clamp(2rem, 7vw, 3rem);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 1.05;
}
.lede { margin-top: 12px; color: var(--ink-soft); font-size: 1.08rem; max-width: 62ch; }

section { padding: 36px 0; border-bottom: 1px solid var(--line); }
section:last-of-type { border-bottom: none; }

h2 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.15;
  margin-bottom: 16px;
}
h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
p { max-width: 68ch; }
p + p { margin-top: 14px; }

ul.plain { list-style: none; margin-top: 14px; max-width: 68ch; }
ul.plain li { padding: 8px 0 8px 26px; position: relative; }
ul.plain li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.05em;
  width: 14px;
  height: 2px;
  background: var(--red);
}

/* ---------- home routes ---------- */

.routes { margin-top: 26px; border-top: 2px solid var(--ink); }

.route {
  display: flex;
  align-items: baseline;
  gap: 18px;
  padding: 22px 4px;
  border-bottom: 2px solid var(--ink);
  text-decoration: none;
  color: var(--ink);
  background: var(--paper);
  transition: background-color 140ms ease;
}
.route:hover { background: var(--paper-light); color: var(--ink); }

.route-num {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--red-text);
}
.route-body { flex: 1 1 auto; min-width: 0; }
.route-title {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 5.5vw, 2.2rem);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 1.1;
}
.route-note {
  display: block;
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 1rem;
  max-width: 52ch;
}

.route-arrow {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1;
  color: var(--red);
  transition: transform 140ms ease;
}
.route:hover .route-arrow { transform: translateX(3px); }

/* Not a destination. No number, no arrow, no hover — it must never read as a
   route that happens to be styled quietly. */
.route-soon {
  padding: 18px 4px;
  border-bottom: 2px solid var(--ink);
  color: var(--ink-soft);
}
.route-soon strong {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}

/* ---------- notices ---------- */

.banner {
  background: var(--paper-light);
  border: 2px solid var(--ink);
  padding: 16px 18px;
  margin-top: 22px;
  font-size: 1rem;
}
.banner p { max-width: none; }
.banner strong { font-weight: 700; }

/* The treatment page's 911/988 block. High priority, above the filters.
   Emphasis is a solid rule across the TOP, per the guide's crisis-strip
   language — not a colored tab down one side. */
.banner.crisis-banner {
  background: var(--ink);
  color: var(--paper-light);
  border-color: var(--ink);
  border-top: 8px solid var(--red);
  padding: 18px;
  font-size: 1.08rem;
}
.banner.crisis-banner a { color: var(--paper-light); font-weight: 700; }
.banner.crisis-banner a:hover { color: var(--yellow); }

/* One plain-language line above each list. Every record is unverified today,
   so this carries the explanation instead of the per-row chip shouting it
   sixty times over. */
.list-notice {
  margin-top: 22px;
  padding: 12px 14px;
  background: var(--yellow);
  color: var(--ink);
  border: 2px solid var(--ink);
  font-size: 0.97rem;
}
.list-notice p { max-width: none; }
.list-notice strong { font-weight: 700; }

/* ---------- filters ---------- */

/* An inline control block, not a floating card. */
.filters {
  padding: 22px 0;
  margin: 0;
  border-bottom: 2px solid var(--ink);
}
.filter-row { display: grid; gap: 14px; }
@media (min-width: 620px) { .filter-row { grid-template-columns: 1fr 1fr 1fr; } }

.field label {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
}
input, textarea, select {
  width: 100%;
  padding: 12px;
  font-size: 16px; /* below this iOS zooms the page on focus */
  font-family: var(--font-body);
  background: var(--paper-light);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 2px; /* the only radius in the file: focus clarity on native controls */
  min-height: 48px;
}
textarea { min-height: 110px; }

/* Rectangular press controls, never pill chips. */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chip {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 10px 16px;
  min-height: var(--tap);
  background: var(--paper-light);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 0;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease;
}
.chip[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper-light);
}

.result-count {
  margin-top: 18px;
  max-width: none;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

.linkish {
  background: none;
  border: none;
  color: var(--ink);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
  /* inline-flex + min-height keeps a 44px tap target without a visible box */
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 4px;
  width: auto;
  margin: 0;
}
.linkish:hover { color: var(--red-text); }

/* ---------- listings ---------- */

.day-group { margin-top: 34px; }
.day-group > h2 {
  padding-bottom: 10px;
  border-bottom: 2px solid var(--ink);
  margin-bottom: 0;
}

/* Stacked bulletin rows. No card fill, no floating box, square corners. */
.listing {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 18px 4px;
}
.listing-top { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; }
.listing-time {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink);
  white-space: nowrap;
}
/* Event dates are ranges, not clock times — they must wrap or a multi-day
   range blows the page out sideways on a phone. */
.listing-date {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink);
}
.listing-name {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  max-width: none;
}
.listing-where { margin-top: 6px; font-size: 0.98rem; }
.listing-notes { margin-top: 6px; font-size: 0.95rem; color: var(--ink-soft); }
.listing-notes a { color: var(--ink-soft); }
.listing-notes a:hover { color: var(--red-text); }

/* The number is the label. It is never hidden behind "Call now". */
.phone-hint {
  display: block;
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.listing-phone {
  display: inline-flex;
  align-items: center;
  margin-top: 5px;
  padding: 12px 20px;
  min-height: 48px;
  background: var(--ink);
  color: var(--paper-light);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.4rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: background-color 140ms ease;
}
.listing-phone:hover,
.listing-phone:active { background: #000; color: var(--paper-light); }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  padding: 5px 9px;
  border-radius: 0;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-soft);
}
.tag.fellowship { border-color: var(--ink); color: var(--ink); }
/* Yellow ground, ink text, and the literal words. Compact on purpose: with
   nothing verified yet this renders on every single row. */
.tag.unverified {
  background: var(--yellow);
  border-color: var(--ink);
  color: var(--ink);
}
.tag.verified { border-color: var(--success); color: var(--success); }

.empty {
  background: var(--paper-light);
  border: 2px dashed var(--ink);
  padding: 28px 22px;
  margin-top: 22px;
  color: var(--ink);
}
.empty p { max-width: none; }
.empty p + p { margin-top: 12px; }

/* ---------- forms ---------- */

/* A clean printed form on paper. */
form.tdm {
  margin-top: 20px;
  background: var(--paper-light);
  border: 2px solid var(--ink);
  padding: 22px;
  max-width: var(--measure);
}
form.tdm label {
  display: block;
  margin: 14px 0 5px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink);
}
form.tdm button {
  width: 100%;
  margin-top: 20px;
  padding: 15px;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--paper-light);
  background: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 0;
  min-height: 48px;
  cursor: pointer;
  transition: background-color 140ms ease;
}
form.tdm button:hover,
form.tdm button:active { background: #000; }
form.tdm button:disabled { background: var(--ink-soft); border-color: var(--ink-soft); cursor: default; }

.form-msg { margin-top: 14px; font-weight: 700; display: none; max-width: none; }
.form-msg.ok { color: var(--success); display: block; }
.form-msg.err { color: var(--red-text); display: block; }

/* honeypot */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- footer ---------- */

footer {
  margin-top: 44px;
  padding: 0 0 56px;
  border-top: 2px solid var(--ink);
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.footnav { list-style: none; display: flex; flex-wrap: wrap; margin: 18px 0 26px; }
.footnav a {
  display: flex;
  align-items: center;
  min-height: var(--tap);
  margin-right: 24px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-decoration: none;
}
.footnav a::before { content: "\2192"; color: var(--red); margin-right: 8px; }
.footnav a:hover { color: var(--ink); }

/* Never a small-print disclaimer. Ink on paper, solid ink rule above it. */
.crisis {
  max-width: none;
  border-top: 2px solid var(--ink);
  padding-top: 22px;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.15rem, 3.6vw, 1.5rem);
  letter-spacing: 0.01em;
  text-transform: uppercase;
  line-height: 1.25;
}
.crisis a { color: var(--red-text); text-decoration-thickness: 2px; }
.crisis a:hover { color: var(--ink); }

footer p + p { margin-top: 12px; }

/* ---------- motion ---------- */

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
