/* ==========================================================================
   Orange County NY DD Connection, independent resource guide
   Design tokens. See DESIGN.md for the reasoning behind every value here.
   ========================================================================== */

:root {
  /* Colour. Plum is the identity: warm and dignified, deliberately not the
     navy/steel of a government portal and not the clinical blue of a provider. */
  --ink:         #241626;
  --ink-soft:    #4A3A50;
  --muted:       #6B5D71;

  --plum:        #5E2A6E;
  --plum-dk:     #3D1A48;
  --plum-soft:   #F3EBF5;

  --moss:        #24614A;   /* the pathway: steps, progress, affirmative */
  --moss-soft:   #E7F1EC;

  --signal:      #A93213;   /* warnings only, never decoration */
  --signal-soft: #FBEDE9;

  --bg:          #FCFAFB;
  --paper:       #FFFFFF;
  --rule:        #E6DEE8;
  --rule-strong: #C9B9CE;

  /* Type. Atkinson Hyperlegible was drawn by the Braille Institute for readers
     with low vision. On a disability-services site that is a functional
     choice, not a stylistic one. Bricolage carries the headings. */
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, sans-serif;

  --step--1: clamp(0.83rem, 0.8rem + 0.15vw, 0.9rem);
  --step-0:  clamp(1.06rem, 1rem + 0.28vw, 1.19rem);
  --step-1:  clamp(1.28rem, 1.18rem + 0.5vw, 1.55rem);
  --step-2:  clamp(1.55rem, 1.36rem + 0.92vw, 2.1rem);
  --step-3:  clamp(1.86rem, 1.52rem + 1.7vw, 2.9rem);
  --step-4:  clamp(2.24rem, 1.62rem + 3.1vw, 4rem);

  /* CALIBRATION: the CSS `ch` unit is the width of "0", and Atkinson's zero is
     about 1.34x its average lowercase character. So a measure set in `ch` renders
     ~34% longer than it reads. These values are divided by that factor: 54ch here
     renders as roughly 72 actual characters, which is the target. Measured in the
     browser, not estimated. Do not "round these up" to the usual 65-75ch advice. */
  --measure: 54ch;
  --gutter: clamp(1.15rem, 0.7rem + 2.2vw, 2.6rem);
  --radius: 4px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.018em;
  color: var(--plum-dk);
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-2); margin-top: 2.2em; }
h3 { font-size: var(--step-1); margin-top: 1.8em; }
p, li { text-wrap: pretty; }
p { margin: 0 0 1.1em; }

a { color: var(--plum); text-underline-offset: 0.18em; text-decoration-thickness: 0.08em; }
a:hover { color: var(--signal); }

:where(a, button, summary, input, textarea, select):focus-visible {
  outline: 3px solid var(--plum);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip {
  position: absolute; left: -9999px;
  background: var(--plum-dk); color: #fff;
  padding: 0.8rem 1.2rem; z-index: 100; font-weight: 700;
}
.skip:focus { left: 0.5rem; top: 0.5rem; }

.wrap { width: min(100% - (var(--gutter) * 2), 74rem); margin-inline: auto; }
.prose { max-width: var(--measure); }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.prose li { margin-bottom: 0.5em; }

/* --- Standing notice -------------------------------------------------------
   This site is not the county agency. That fact is load-bearing, so it is
   built into the page frame rather than tucked into a footer. */
.notice {
  background: var(--signal-soft);
  border-bottom: 2px solid var(--signal);
  color: #47170A;
  font-size: var(--step--1);
  line-height: 1.5;
}
.notice .wrap { padding: 0.7rem 0; display: flex; gap: 0.7rem; align-items: flex-start; }
.notice p { max-width: 56ch; }   /* ~76 rendered chars, see the ch calibration note */
.notice svg { flex: none; margin-top: 0.15em; }
.notice strong { color: var(--signal); }
.notice a { color: #47170A; }

/* --- Masthead -------------------------------------------------------------- */
.masthead { background: var(--paper); border-bottom: 1px solid var(--rule); }
.masthead .wrap {
  display: flex; flex-wrap: wrap; gap: 1rem 1.5rem;
  align-items: center; justify-content: space-between; padding: 1.1rem 0;
}
.brand { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; color: inherit; }
.brand-mark {
  width: 2.6rem; height: 2.6rem; flex: none; border-radius: 50%;
  background: var(--plum); color: #fff;
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 800; font-size: 1rem; letter-spacing: -0.04em;
}
.brand-name { display: block; font-family: var(--display); font-weight: 700; font-size: 1.06rem; line-height: 1.2; color: var(--plum-dk); }
.brand-sub { display: block; font-size: 0.78rem; color: var(--muted); line-height: 1.3; margin-top: 0.15rem; }

.nav { display: flex; flex-wrap: wrap; gap: 0.4rem 1.15rem; font-size: var(--step--1); }
.nav a { color: var(--ink-soft); text-decoration: none; font-weight: 700; padding: 0.25rem 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--plum); border-bottom-color: var(--plum); }

/* --- Hero ------------------------------------------------------------------ */
.hero { padding: clamp(2.6rem, 1.5rem + 4vw, 5rem) 0 clamp(1.6rem, 1rem + 2vw, 2.8rem); }
.hero .eyebrow {
  font-family: var(--display); font-weight: 700; font-size: var(--step--1);
  letter-spacing: 0.09em; text-transform: uppercase; color: var(--moss); margin: 0 0 0.9rem;
}
.hero .lede { font-size: var(--step-1); color: var(--ink-soft); max-width: 58ch; margin-top: 1.1rem; }

/* --- The pathway: the signature element ------------------------------------
   A real sequence, so it is numbered. Each step carries an honest note about
   what it actually involves, which is the thing families say is missing. */
.pathway { list-style: none; margin: 2.5rem 0 0; padding: 0; position: relative; }
.pathway::before {
  content: ""; position: absolute; left: 1.35rem; top: 1.6rem; bottom: 1.6rem;
  width: 2px; background: linear-gradient(var(--moss), var(--rule-strong));
}
.step { position: relative; padding: 0 0 2rem 4.2rem; max-width: 58ch; }
.step:last-child { padding-bottom: 0; }
.step-n {
  position: absolute; left: 0; top: 0;
  width: 2.75rem; height: 2.75rem; border-radius: 50%;
  background: var(--moss); color: #fff;
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 800; font-size: 1.05rem;
  border: 4px solid var(--bg);
}
.step h3 { margin: 0.3rem 0 0.4rem; font-size: var(--step-1); max-width: 24ch; }
/* The pathway sits outside .prose so it can use the full column for the spine,
   which means its text needs its own measure. */
.step p { margin-bottom: 0.6rem; max-width: 54ch; }
.step .who {
  display: inline-block; font-size: var(--step--1); font-weight: 700;
  color: var(--moss); background: var(--moss-soft);
  padding: 0.18rem 0.6rem; border-radius: 999px; margin-bottom: 0.5rem;
}

/* --- Cards & panels -------------------------------------------------------- */
.grid { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); margin: 1.6rem 0; }
.card {
  background: var(--paper); border: 1px solid var(--rule);
  border-radius: var(--radius); padding: 1.35rem 1.4rem;
}
.card h3 { margin-top: 0; font-size: var(--step-0); }
.card p:last-child { margin-bottom: 0; }
.card .meta { font-size: var(--step--1); color: var(--muted); max-width: 42ch; }
.card p { max-width: 42ch; }

/* Panels carry their meaning in the heading colour and a marker that echoes the
   pathway's circular step markers, rather than the usual thick left border. */
.panel {
  background: var(--plum-soft);
  border: 1px solid color-mix(in srgb, var(--plum) 22%, transparent);
  padding: 1.35rem 1.5rem 1.4rem;
  border-radius: var(--radius);
  margin: 1.8rem 0;
  max-width: 52ch;
}
.panel > :first-child { margin-top: 0; }
.panel > :last-child { margin-bottom: 0; }
/* Panels sometimes need to be h2 to keep the document outline gapless, so an
   h2 inside one is sized like an h3 rather than promoted visually. */
.panel h2, .panel h3 {
  margin-top: 0; font-size: var(--step-0);
  display: flex; align-items: baseline; gap: 0.55rem;
}
.panel h2::before, .panel h3::before {
  content: ""; flex: none;
  width: 0.6rem; height: 0.6rem; border-radius: 50%;
  background: var(--plum); transform: translateY(-0.08em);
}
.panel p, .panel li { max-width: 48ch; }

.panel--do { background: var(--moss-soft); border-color: color-mix(in srgb, var(--moss) 26%, transparent); }
.panel--do h2, .panel--do h3 { color: var(--moss); }
.panel--do h2::before, .panel--do h3::before { background: var(--moss); }

.panel--warn { background: var(--signal-soft); border-color: color-mix(in srgb, var(--signal) 26%, transparent); }
.panel--warn h2, .panel--warn h3 { color: var(--signal); }
.panel--warn h2::before, .panel--warn h3::before { background: var(--signal); }

/* Call box: the one thing a stressed reader needs to find in two seconds. */
.callbox {
  background: var(--plum-dk); color: #F6EEF8;
  border-radius: var(--radius); padding: 1.6rem 1.7rem; margin: 2rem 0;
}
.callbox h2, .callbox h3 { color: #fff; margin-top: 0; font-size: var(--step-1); }
.callbox a { color: #F0D9F6; }
.callbox .tel {
  font-family: var(--display); font-weight: 800;
  font-size: var(--step-2); display: inline-block; margin: 0.2rem 0;
  color: #fff; text-decoration: none; border-bottom: 3px solid rgba(255,255,255,.45);
}
.callbox .tel:hover { border-bottom-color: #fff; color: #fff; }
.callbox p:last-child { margin-bottom: 0; }

table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: var(--step--1); }
.table-scroll { overflow-x: auto; }
th, td { text-align: left; padding: 0.7rem 0.8rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-family: var(--display); color: var(--plum-dk); background: var(--plum-soft); }

/* --- Sections & footer ------------------------------------------------------ */
.section { padding: clamp(2rem, 1.2rem + 2.6vw, 3.4rem) 0; }
.section--paper { background: var(--paper); border-block: 1px solid var(--rule); }

.footer { background: var(--plum-dk); color: #D9C7DF; padding: 2.8rem 0 2rem; font-size: var(--step--1); margin-top: 3rem; }
.footer h2 { color: #fff; font-size: var(--step-0); margin: 0 0 0.7rem; }
.footer a { color: #EBD9F0; }
.footer .grid { grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 2rem; }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin-bottom: 0.4rem; }
.footer .colophon { border-top: 1px solid rgba(255,255,255,.18); margin-top: 2rem; padding-top: 1.3rem; color: #B9A3C1; max-width: 56ch; }

/* Small type inside .prose inherits the parent's pixel measure, which at this
   font size is ~96 characters. Smaller text needs its own, tighter measure. */
.updated { font-size: var(--step--1); color: var(--muted); margin-top: 2.5rem;
  padding-top: 1rem; border-top: 1px solid var(--rule); max-width: 56ch; }
