/* ==========================================================================
   missouricounselor.com
   --------------------------------------------------------------------------
   Deliberately a distinct identity from wisdomtreetherapy.net, not a family
   resemblance. A directory this size has to work for two different people
   at once — someone scanning fast for a food pantry at 2pm, and someone in
   real crisis at 2am — so calm here is earned through clarity and verified
   trust signals (the "Last verified" freshness system), not through the
   soft, spacious, editorial feel that was right for the practice site.

   Palette: a deep, ink-heavy indigo-blue as primary — the well-tested civic
   /directory color, chosen deliberately over the wellness-app green every
   mental-health site defaults to. One warm gold accent, used for exactly
   one job: the verified-freshness signal. Category color-coding was
   considered and rejected — arbitrary hues for 9 categories aren't
   "understood" the way street-sign colors are. Icons carry category
   meaning instead; color is reserved for the one place it has a
   pre-existing universal meaning: green/amber freshness, the same logic
   as a traffic light.

   Type: Inter throughout, no editorial serif. This site's headlines are
   mostly labels — category names, organization names — a scanning job,
   not a persuading-and-feeling job.

   Ornament: none. The practice site earned one signature flourish because
   everything else was calm and spacious. This UI is busier by default
   (cards, tags, filters) — the restraint budget goes to zero here so the
   category icons and freshness colors stay the only things doing visual
   work.
   ========================================================================== */

:root {
  --paper:       #F4F6F9;
  --paper-2:     #FFFFFF;
  --paper-3:     #EDF1F6;

  --ink:         #1B2430;
  --ink-soft:    #4B5563;
  --ink-faint:   #6B7280;

  --deep:        #1E3A5F;
  --primary:     #2F5C94;
  --primary-tint:#E7EDF6;
  --haze:        #9DB1C8;
  --rule:        #DCE3ED;

  --gold:        #B9762A;
  --gold-deep:   #8C5A1E;
  --gold-tint:   #FBF0E2;

  --fresh:       #3B6D11;
  --fresh-tint:  #EAF3DE;
  --stale:       #854F0B;
  --stale-tint:  #FAEEDA;

  --alarm:       #9B2C2C;
  --alarm-tint:  #FBEAEA;

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --step--1: clamp(0.82rem, 0.79rem + 0.14vw, 0.90rem);
  --step-0:  clamp(1rem, 0.97rem + 0.16vw, 1.08rem);
  --step-1:  clamp(1.18rem, 1.10rem + 0.36vw, 1.40rem);
  --step-2:  clamp(1.40rem, 1.24rem + 0.72vw, 1.80rem);
  --step-3:  clamp(1.68rem, 1.42rem + 1.20vw, 2.30rem);
  --step-4:  clamp(2.00rem, 1.60rem + 1.80vw, 3.00rem);

  --wrap: 74rem;
  --gap:  clamp(1.25rem, 0.9rem + 1.6vw, 2.25rem);
  --bay:  clamp(2.5rem, 1.75rem + 3.5vw, 4.5rem);

  --radius: 8px;
  --radius-sm: 5px;
  --shadow: 0 1px 2px rgba(30,58,95,0.05), 0 6px 20px -10px rgba(30,58,95,0.18);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body, h1, h2, h3, h4, p, ul, ol { margin: 0; }
ul[class] { list-style: none; padding: 0; }
img, svg { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--sans);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--deep);
  text-wrap: balance;
}
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); }

p { text-wrap: pretty; }
a { color: var(--primary); text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
a:hover { color: var(--deep); }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.section { padding-block: var(--bay); }
.section--tint { background: var(--paper-3); }

.skip { position: absolute; left: -9999px; background: var(--deep); color: #fff; padding: 0.75rem 1.25rem; z-index: 200; }
.skip:focus { left: 1rem; top: 1rem; }

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

/* --- Buttons / search --------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  font-weight: 600; font-size: var(--step--1);
  padding: 0.75em 1.4em; border-radius: var(--radius);
  border: 1.5px solid transparent; text-decoration: none; cursor: pointer;
  transition: background 150ms var(--ease), border-color 150ms var(--ease);
}
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--deep); color: #fff; }
.btn--ghost { border-color: var(--haze); color: var(--deep); background: transparent; }
.btn--ghost:hover { background: var(--primary-tint); border-color: var(--primary); }

.search-bar {
  display: flex; gap: 0.5rem; background: var(--paper-2);
  border: 1.5px solid var(--rule); border-radius: var(--radius);
  padding: 0.4rem 0.4rem 0.4rem 1rem; align-items: center; max-width: 34rem;
}
.search-bar input { flex: 1; border: 0; background: none; font-size: var(--step-0); padding: 0.5rem 0; }
.search-bar input:focus { outline: none; }
.search-bar .icon { color: var(--ink-faint); flex: none; }

/* --- Header -------------------------------------------------------------- */
.masthead { position: sticky; top: 0; z-index: 60; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule); }
.masthead__inner { display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; padding-block: 0.85rem; }
.brand { display: inline-flex; align-items: center; gap: 0.55rem; text-decoration: none; color: var(--deep); }
.brand__mark { width: 28px; height: 28px; color: var(--primary); flex: none; }
.brand__name { font-size: 1.05rem; font-weight: 700; letter-spacing: -0.01em; }
.nav { display: none; align-items: center; gap: 1.4rem; }
.nav a { font-size: var(--step--1); font-weight: 600; color: var(--ink-soft); text-decoration: none; }
.nav a:hover { color: var(--deep); }
@media (min-width: 60rem) { .nav { display: flex; } }
.nav__crisis { color: var(--alarm) !important; }

/* --- Hero ------------------------------------------------------------ */
.hero { padding-block: clamp(2.5rem, 1.5rem + 5vw, 5rem) clamp(2rem, 1rem + 3vw, 3.5rem); }
.hero__inner { max-width: 40rem; }
.hero h1 { max-width: 18ch; }
.hero .lede { font-size: var(--step-1); color: var(--ink-soft); margin-top: 1rem; max-width: 36ch; }
.hero__search { margin-top: 1.75rem; }
.hero__crisis-note { margin-top: 1.25rem; font-size: var(--step--1); color: var(--ink-soft); }
.hero__crisis-note a { color: var(--alarm); font-weight: 600; }

/* --- Section headers ------------------------------------------------- */
.section__head { max-width: 26ch; }
.section__intro { color: var(--ink-soft); margin-top: 0.6rem; max-width: 46ch; }

/* --- Category grid ----------------------------------------------------- */
.cat-grid { display: grid; gap: 0.9rem; margin-top: 1.75rem; grid-template-columns: 1fr; }
@media (min-width: 34rem) { .cat-grid { grid-template-columns: repeat(3, 1fr); } }

.cat-card {
  display: flex; gap: 0.8rem; align-items: flex-start;
  background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 1rem 1.1rem; text-decoration: none; color: inherit;
  transition: border-color 150ms var(--ease), transform 150ms var(--ease);
}
.cat-card:hover { border-color: var(--primary); transform: translateY(-1px); }
.cat-card__icon { color: var(--primary); flex: none; margin-top: 0.1rem; }
.cat-card__name { font-weight: 700; font-size: var(--step-0); color: var(--deep); margin-bottom: 0.2rem; }
.cat-card__desc { font-size: var(--step--1); color: var(--ink-soft); line-height: 1.5; }

/* --- Region list --------------------------------------------------------- */
.region-list { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.5rem; }
.region-chip {
  display: inline-flex; align-items: center; gap: 0.4em;
  background: var(--paper-2); border: 1px solid var(--rule); border-radius: 999px;
  padding: 0.5rem 1rem; font-size: var(--step--1); font-weight: 600; color: var(--ink-soft);
  text-decoration: none;
}
.region-chip:hover { border-color: var(--primary); color: var(--deep); }

/* --- Resource card -------------------------------------------------------
   The one component used across Home, Category, Region, and Search.
   Region tag stays neutral on purpose — text alone is enough to read a
   region name; color there would encode nothing a hue-per-region system
   wouldn't just as arbitrarily invent. Category gets an icon, not a color.
   The only color in the whole card is the freshness line, because that's
   the one place color has a pre-existing, learnable meaning. */
.r-card {
  background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 1.1rem 1.25rem; display: flex; flex-direction: column; gap: 0.65rem;
}
.r-card__tags { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-size: var(--step--1); }
.r-card__cat { display: inline-flex; align-items: center; gap: 0.35em; color: var(--primary); font-weight: 600; }
.r-card__cat .icon { color: var(--primary); }
.r-card__region { color: var(--ink-faint); }
.r-card__region::before { content: "\00b7"; margin-right: 0.5rem; color: var(--rule); }
.r-card__name { font-size: var(--step-1); font-weight: 700; color: var(--ink); }
.r-card__desc { font-size: var(--step--1); color: var(--ink-soft); line-height: 1.5; }
.r-card__meta { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; font-size: var(--step--1); color: var(--ink-soft); }
.r-card__meta a { color: var(--primary); text-decoration: none; }
.r-card__meta a:hover { text-decoration: underline; }
.r-card__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  border-top: 1px solid var(--rule); padding-top: 0.65rem; margin-top: 0.15rem;
}
.r-card__verified { display: inline-flex; align-items: center; gap: 0.35em; font-size: var(--step--1); font-weight: 600; }
.r-card__verified--fresh { color: var(--fresh); }
.r-card__verified--stale { color: var(--stale); }
.r-card__more { font-size: var(--step--1); font-weight: 700; color: var(--primary); text-decoration: none; white-space: nowrap; }

.r-grid { display: grid; gap: 1rem; margin-top: 1.75rem; grid-template-columns: 1fr; }
@media (min-width: 48rem) { .r-grid { grid-template-columns: repeat(2, 1fr); } }

.r-card--empty { border-style: dashed; color: var(--ink-soft); text-align: center; align-items: center; padding: 1.75rem 1.25rem; }
.r-card--empty p { font-size: var(--step--1); }

/* --- Breadcrumbs ------------------------------------------------------- */
.crumbs { font-size: var(--step--1); color: var(--ink-faint); margin-bottom: 1.25rem; display: flex; flex-wrap: wrap; gap: 0.4em; }
.crumbs a { color: var(--ink-soft); text-decoration: none; }
.crumbs a:hover { color: var(--primary); text-decoration: underline; }

/* --- Detail page contact block ------------------------------------------ */
.detail-tags { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 1rem; }
.detail-tag { display: inline-flex; align-items: center; gap: 0.4em; background: var(--primary-tint); color: var(--deep); font-size: var(--step--1); font-weight: 600; padding: 0.35rem 0.8rem; border-radius: 999px; }
.detail-tag--region { background: var(--paper-3); color: var(--ink-soft); }

.contact-block { background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.25rem 1.5rem; display: grid; gap: 0.75rem; }
.contact-row { display: flex; gap: 0.75rem; align-items: flex-start; font-size: var(--step-0); }
.contact-row .icon { color: var(--primary); flex: none; margin-top: 0.15rem; }
.contact-row a { font-weight: 600; }

.verify-block { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 1.25rem; padding: 0.9rem 1.1rem; background: var(--paper-3); border-radius: var(--radius); font-size: var(--step--1); }

/* --- Forms ---------------------------------------------------------------- */
.form { display: grid; gap: 1.1rem; max-width: 32rem; margin-top: 1.5rem; }
.field { display: grid; gap: 0.4rem; }
.field__label { font-size: var(--step--1); font-weight: 700; }
.field__hint { font-size: var(--step--1); font-weight: 400; color: var(--ink-faint); }
.field__input, .field__area, .field__select {
  border: 1.5px solid var(--rule); border-radius: var(--radius-sm);
  background: var(--paper-2); padding: 0.7rem 0.85rem; font-size: var(--step-0); font-family: var(--sans);
}
.field__input:focus, .field__area:focus, .field__select:focus { outline: none; border-color: var(--primary); }
.field__area { min-height: 6rem; resize: vertical; }
.form__note { font-size: var(--step--1); color: var(--ink-faint); max-width: 38ch; }
.form-jump { display: flex; gap: 1.25rem; font-size: var(--step--1); font-weight: 600; margin-top: 1rem; }

/* --- Notice callout (advisory, not urgent — distinct from the alarm/crisis palette) --- */
.notice { background: var(--gold-tint); border: 1px solid #E6CFAA; border-radius: var(--radius); padding: 1rem 1.25rem; font-size: var(--step--1); color: #5C4318; margin-bottom: 1.5rem; }
.notice strong { color: var(--gold-deep); }

/* --- Legal page prose ------------------------------------------------------ */
.legal-body { max-width: 42rem; }
.legal-body h2 { font-size: var(--step-1); margin-top: 2em; }
.legal-body p, .legal-body ul { color: var(--ink-soft); margin-top: 0.9em; }
.legal-body ul { padding-left: 1.2em; }
.legal-body li + li { margin-top: 0.4em; }
.legal-body a { font-weight: 600; }

/* --- Trust strip --------------------------------------------------------- */
.trust-grid { display: grid; gap: 1rem; margin-top: 1.75rem; grid-template-columns: 1fr; }
@media (min-width: 44rem) { .trust-grid { grid-template-columns: repeat(3, 1fr); } }
.trust-item { background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.1rem 1.25rem; }
.trust-item h3 { font-size: var(--step-0); margin-bottom: 0.4rem; }
.trust-item p { font-size: var(--step--1); color: var(--ink-soft); }

/* --- Suggest teaser -------------------------------------------------------- */
.teaser { background: var(--primary-tint); border-radius: var(--radius); padding: 1.5rem 1.75rem; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; margin-top: var(--bay); }
.teaser p { font-weight: 600; color: var(--deep); }

/* --- Crisis band ------------------------------------------------------------ */
.crisis-band { background: var(--alarm-tint); border-block: 1px solid #E7C9C9; }
.crisis-band__inner { padding-block: 0.9rem; font-size: var(--step--1); color: #6B1F1F; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.crisis-band a { color: var(--alarm); font-weight: 700; }
.crisis-band .btn--ghost { border-color: var(--alarm); color: var(--alarm); }

/* --- Footer ----------------------------------------------------------------- */
.footer { background: var(--deep); color: #C9D6E8; padding-block: var(--bay) 2rem; font-size: var(--step--1); }
.footer__grid { display: grid; gap: 2rem; }
@media (min-width: 44rem) { .footer__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 64rem) { .footer__grid { grid-template-columns: 1.3fr 1fr 1fr 1fr; } }
.footer__head { font-size: var(--step--1); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #fff; margin-bottom: 0.85rem; }
.footer__list { display: grid; gap: 0.5rem; }
.footer__list a { color: #C9D6E8; text-decoration: none; }
.footer__list a:hover { color: #fff; text-decoration: underline; }
.footer__blurb { margin-top: 0.75rem; max-width: 32ch; color: #A9BBD4; }
.footer__base { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,0.14); display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; align-items: center; justify-content: space-between; }
.footer__sponsor { display: inline-flex; align-items: center; gap: 0.5rem; color: #fff; text-decoration: none; font-weight: 600; }
.footer__sponsor:hover { color: var(--gold-tint); }
.footer__legal { display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; }
.footer__legal a { color: #A9BBD4; text-decoration: none; }
.footer__legal a:hover { color: #fff; text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
