/* ============================================================
   RIAC — nyriac.com   shared stylesheet
   All colors live here in :root. The six region colors match
   the RIAC logo and the map on the home page.
   ============================================================ */

:root {
  --navy: #12263f;        /* brand navy (logo background) */
  --navy-deep: #0c1a2e;
  --cream: #f7f2e0;       /* logo lettering */
  --ink: #22303f;         /* body text */
  --muted: #5b6878;
  --paper: #fbfaf7;       /* page background */
  --line: #e5e1d4;

  --r1: #55b7e8;  /* Western New York   */
  --r2: #2e8540;  /* Central New York   */
  --r3: #c22b30;  /* Northern New York */
  --r4: #f2d43d;  /* Hudson Valley      */
  --r5: #ef7c28;  /* New York City      */
  --r6: #8347ad;  /* Long Island        */

  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
}

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

html { scroll-behavior: smooth; scrollbar-gutter: stable; }

body {
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
}

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; }

a { color: var(--navy); }

/* 1128px so that after this element's own 1.5rem side padding is
   subtracted, its content area is exactly 1080px — matching the
   header/hero/page-head boxes below, whose own 1080px cap has no
   padding baked in at that same outer level. */
.wrap { max-width: 1128px; margin: 0 auto; padding: 0 1.5rem; }

/* ---------- Header ---------- */

.site-header {
  margin: 12px 0 16px; padding: 0 1.5rem;
}

.header-card {
  max-width: 1080px; margin: 0 auto;
  background: var(--navy); border-radius: 14px;
  box-shadow: 0 6px 18px rgba(0,0,0,.2);
  overflow: hidden;
}

.funder-ribbon {
  background: var(--cream); color: var(--navy);
  text-align: center; font-weight: 600;
  font-size: .72rem; letter-spacing: .02em;
  padding: .3rem .9rem;
}

.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 68px; flex-wrap: wrap; padding-top: .5rem; padding-bottom: .5rem;
  border-top: 1px solid rgba(247,242,224,.15);
}

.brand { display: flex; align-items: center; gap: .8rem; text-decoration: none; }
.brand img { height: 40px; width: auto; display: block; }
.brand-text { color: var(--cream); font-family: var(--serif); display: flex; align-items: center; gap: .6rem; }
.brand-text .brand-acronym { font-size: 2.1rem; letter-spacing: .02em; line-height: 1; }
.brand-text .brand-full {
  font-family: var(--sans); font-size: .62rem; letter-spacing: .1em; text-transform: uppercase;
  opacity: .85; line-height: 1.5; display: block; text-align: center;
}

.site-nav { display: flex; align-items: center; gap: 1.6rem; }
.site-nav a {
  color: rgba(247,242,224,.8); text-decoration: none;
  font-size: .92rem; letter-spacing: .02em; padding: .35rem 0;
  border-bottom: 2px solid transparent; text-align: center;
}
.site-nav a:hover { color: var(--cream); }
.site-nav a[aria-current="page"] { color: var(--cream); border-bottom-color: var(--r4); }

/* ---------- Hero (home) ---------- */

.hero { padding: 0 1.5rem; margin-bottom: 1.5rem; }

.hero .wrap {
  max-width: 1080px;
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 3rem; align-items: center; padding: 4rem 1.5rem;
  background: linear-gradient(170deg, var(--navy) 55%, var(--navy-deep)); color: var(--cream);
  border-radius: 14px; box-shadow: 0 6px 18px rgba(0,0,0,.2);
}

.eyebrow {
  font-size: .78rem; letter-spacing: .22em; text-transform: uppercase;
  color: rgba(247,242,224,.65); margin-bottom: 1rem;
}

.hero h1 { font-size: clamp(1.9rem, 3.4vw, 2.7rem); margin-bottom: 1.1rem; }

.hero .lede { color: rgba(247,242,224,.82); font-size: 1.08rem; margin-bottom: 1.8rem; max-width: 34rem; }

.btn {
  display: inline-block; text-decoration: none; font: inherit; font-size: .95rem;
  padding: .7rem 1.5rem; border-radius: 6px; letter-spacing: .02em;
  margin: 0 .6rem .6rem 0; white-space: nowrap; border: none; cursor: pointer;
}
.btn-solid { background: var(--cream); color: var(--navy); font-weight: 600; }
.btn-solid:hover { background: #fff; }
.btn-ghost { color: var(--cream); border: 1px solid rgba(247,242,224,.45); }
.btn-ghost:hover { border-color: var(--cream); }

/* ---------- Region map ---------- */

.map-panel { min-width: 0; }
.riac-map { width: 100%; height: auto; display: block; }
.riac-map path { stroke: var(--navy); stroke-width: .8; }
.map-region { cursor: pointer; }
.map-region:hover g, .map-region:focus g { filter: brightness(1.18) saturate(1.1); }
.map-region:focus { outline: 2px solid var(--cream); outline-offset: 2px; }

.map-tooltip {
  position: fixed; z-index: 100; pointer-events: none;
  background: var(--navy-deep); color: var(--cream);
  font-size: .82rem; font-weight: 600; letter-spacing: .01em;
  padding: .4rem .7rem; border-radius: 6px; box-shadow: 0 4px 14px rgba(0,0,0,.25);
  white-space: nowrap;
}

.map-hint {
  text-align: center; font-size: .8rem; letter-spacing: .06em;
  color: rgba(247,242,224,.55); margin-top: .6rem;
}

/* Legend under the map */
.legend {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: .35rem .9rem; margin-top: 1rem; padding: 0; list-style: none;
}
.legend a {
  display: flex; align-items: center; gap: .5rem;
  color: rgba(247,242,224,.85); text-decoration: none; font-size: .82rem; padding: .15rem 0;
}
.legend a:hover { color: #fff; text-decoration: underline; }
.dot { width: .8rem; height: .8rem; border-radius: 50%; flex: none; }

/* ---------- Sections ---------- */

.section { padding: 4rem 0; }
.section-top-tight { padding-top: 1.5rem; }
.section-top-tighter { padding-top: 0; }
.section-title { font-size: 1.8rem; color: var(--navy); margin-bottom: .6rem; }
.section-title.center { text-align: center; }
.section-intro { color: var(--muted); margin-bottom: 2rem; }
/* "What we do" intro: justified with a first-line indent. */
.section-intro.justify { text-align: justify; text-indent: 3em; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.4rem; }

.card {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 1.6rem;
  text-align: center;
}
.card h3 { color: var(--navy); font-size: 1.15rem; margin-bottom: .55rem; }
.card p { color: var(--muted); font-size: .95rem; }

/* Clickable "What we do" cards (anchors); non-link .card boxes unaffected. */
a.card { text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s; }
a.card:hover { border-color: var(--navy); box-shadow: 0 4px 14px rgba(0,0,0,.08); }

.band { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.band .section-intro { text-align: justify; text-indent: 3em; }

/* ---------- Region contact cards (contact.html) ---------- */

.region-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; }

.region-card {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 1.6rem; border-top: 5px solid var(--rc, var(--navy));
  scroll-margin-top: 96px;
}
.region-card:target { box-shadow: 0 0 0 3px var(--navy); }

.region-card .region-tag {
  display: inline-block; font-size: .72rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: var(--navy);
  background: color-mix(in srgb, var(--rc) 25%, white); border-radius: 99px;
  padding: .2rem .7rem; margin-bottom: .6rem;
}
.region-card h2 { color: var(--navy); font-size: 1.35rem; margin-bottom: .35rem; }

.counties { font-size: .84rem; color: var(--muted); margin-bottom: 1rem; }
.counties strong { color: var(--ink); font-weight: 600; }

.contact-block { font-size: .95rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.contact-block + .contact-block { margin-top: 1rem; }
.contact-block .who { font-weight: 600; color: var(--navy); }
.contact-block .org { color: var(--muted); }
.contact-block p { margin: 0; }

/* ---------- Advisories ---------- */

.advisories-section { padding-top: 0; }

.advisory-list-featured { margin-top: .5rem; }

.advisory-divider { border: none; border-top: 3px solid var(--navy); margin: 1.8rem 0; }

.search-bar { margin-top: .5rem; }
.search-bar input {
  width: 100%; font: inherit; font-size: .95rem;
  padding: .65rem 1rem; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--ink);
}
.search-bar input:focus { outline: 2px solid var(--navy); outline-offset: 1px; }

.no-results { color: var(--muted); margin-top: 1.5rem; }

.advisory-list {
  list-style: none; margin-top: 1.5rem;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.4rem;
}
.advisory-list li {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 1.4rem 1.6rem;
  display: flex; flex-direction: column;
  text-align: center;
  position: relative;
  transition: border-color .15s, box-shadow .15s;
}
.advisory-list .btn-download { margin-top: auto; align-self: center; }

/* Whole card clickable: the Download link's ::after overlay covers the
   card, so a click anywhere follows the same link. No markup change, so
   the search filter, title-height equalizer and card sizing are all
   unaffected. (Each card has only this one link, so nothing is blocked.) */
.advisory-list .btn-download::after { content: ""; position: absolute; inset: 0; }
.advisory-list li:hover { border-color: var(--navy); box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.advisory-list li:hover .btn-download { background: var(--navy-deep); }

/* Searchable list: centered flex so an incomplete last row (e.g. the
   final 2 of 8 cards) centers on the page instead of sitting in the
   left slots. Search-hidden cards drop out and the rest re-center,
   so this doesn't interfere with filtering. Scoped to #advisory-list
   so the full-width featured card (plain .advisory-list) is unaffected. */
#advisory-list { display: flex; flex-wrap: wrap; justify-content: center; }
#advisory-list > li { flex: 0 1 320px; }
.advisory-list h3 {
  font-family: var(--serif); font-size: 1.15rem; color: #fff;
  background: var(--navy); border-radius: 10px 10px 0 0;
  margin: -1.4rem -1.6rem 1rem; padding: 1rem 1.6rem;
  text-align: center; line-height: 1.3;
}
/* Uniform title-bar height across the searchable advisory grid.
   The exact height is measured and applied by js/advisory-search.js
   (equalized to the tallest title); flex centres shorter titles.
   The min-height is only a no-JS fallback. */
#advisory-list h3 {
  min-height: 3.9em;
  display: flex; align-items: center; justify-content: center;
}
.advisory-list .summary { color: var(--muted); font-size: .95rem; margin-bottom: 1rem; max-width: 46rem; align-self: center; }

/* Warm accent (complementary to the site's navy) sets this card apart
   from the plain navy-on-white styling used by every other advisory. */
.advisory-list li.featured { background: color-mix(in srgb, var(--r5) 12%, white); border-color: var(--r5); padding: .85rem 1.6rem .9rem; }
.advisory-list li.featured h3 {
  background: var(--r5);
  margin: -.85rem -1.6rem .65rem; padding: .6rem 1.6rem;
  font-size: 1.3rem; text-transform: uppercase; letter-spacing: .03em;
}
.advisory-list li.featured .btn-download { background: var(--r5); }
.advisory-list li.featured:hover { border-color: var(--r5); box-shadow: 0 4px 14px rgba(239,124,40,.3); }
.advisory-list li.featured:hover .btn-download { background: color-mix(in srgb, var(--r5) 75%, black); }
.advisory-list li.featured .summary { font-size: 1.05rem; margin-bottom: .7rem; }

.btn-download {
  background: var(--navy); color: var(--cream); font-weight: 600;
  padding: .55rem 1.2rem; font-size: .88rem; margin: 0;
}
.btn-download:hover { background: var(--navy-deep); }

/* ---------- Document request form ---------- */

.request-card {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 2rem; max-width: 30rem; margin: 1.5rem auto 0;
}
.request-doc {
  background: color-mix(in srgb, var(--navy) 6%, white); border-radius: 8px;
  padding: .8rem 1rem; font-size: .9rem; color: var(--navy); margin-bottom: 1.6rem;
}
.request-doc strong { display: block; font-family: var(--serif); font-size: 1.05rem; margin-top: .15rem; }

.field { margin-bottom: 1.2rem; }
.field label { display: block; font-weight: 600; font-size: .88rem; color: var(--navy); margin-bottom: .4rem; }
.field input[type="email"],
.field select {
  width: 100%; font: inherit; font-size: .95rem;
  padding: .6rem .8rem; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--ink);
}
.field input:focus, .field select:focus { outline: 2px solid var(--navy); outline-offset: 1px; }

.radio-group { display: flex; flex-direction: column; gap: .5rem; }
.radio-group label {
  display: flex; align-items: center; gap: .55rem;
  font-weight: 400; font-size: .95rem; color: var(--ink);
}
.radio-group input { width: auto; }

.hp-field { position: absolute; left: -9999px; top: -9999px; }

.form-error {
  background: #fdf0f0; border: 1px solid #e8b8b8; border-radius: 8px;
  padding: .7rem 1rem; margin-bottom: 1.2rem; font-size: .88rem; color: #8a2c2c;
}

.request-form .btn-download { width: 100%; text-align: center; padding: .75rem 1.2rem; font-size: .95rem; }

.thanks-card {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 2.4rem; max-width: 30rem; margin: 1.5rem auto 0; text-align: center;
}
.thanks-card h2 { color: var(--navy); font-size: 1.3rem; margin-bottom: .6rem; }
.thanks-card p { color: var(--muted); margin-bottom: 1.6rem; }

/* ---------- Chief Defender survey ---------- */

.survey-card { max-width: 44rem; text-align: justify; background: none; border: none; padding: 0; margin-top: 1.5rem; }
.survey-card .radio-group label { gap: 1rem; }
.survey-card .radio-group strong { display: block; margin-bottom: 0; }
.survey-card .radio-group .opt-desc { display: block; color: var(--muted); font-style: normal; font-size: .82rem; }
.survey-card .radio-group { margin-top: 1.1rem; }

.survey-card .field {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 1.3rem 1.5rem; margin-bottom: 1.5rem;
}
.survey-title {
  font-family: var(--serif); font-size: 1.3rem; color: var(--navy); text-align: center;
  background: color-mix(in srgb, var(--navy) 7%, white); border-bottom: 1px solid var(--line);
  margin: -1.3rem -1.5rem 1.4rem; padding: .9rem 1.5rem; border-radius: 10px 10px 0 0;
}
.survey-card .survey-q { display: block; font-weight: 400; font-size: 1rem; line-height: 1.5; color: var(--navy); margin-bottom: 0; text-align: center; }
.survey-card .survey-q::after { content: ""; display: block; width: 66%; margin: 1.5rem auto; border-top: 1px solid var(--navy); }
.survey-q .qnum { color: var(--muted); margin-right: .35rem; }
.survey-q em { display: block; margin-top: .7rem; color: var(--muted); font-weight: 400; font-size: .82rem; font-style: normal; }
.field input[type="text"],
.field textarea {
  width: 100%; font: inherit; font-size: .95rem;
  padding: .6rem .8rem; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--ink);
}
.field input[type="text"]:focus, .field textarea:focus { outline: 2px solid var(--navy); outline-offset: 1px; }
.field textarea { min-height: 4.5rem; resize: vertical; }
.field-hint { font-weight: 400; font-size: .8rem; color: var(--muted); margin: .3rem 0 .5rem; }
.field-sub { margin-top: .7rem; }
.field-sub label { font-weight: 400; font-size: .82rem; color: var(--muted); margin-bottom: .3rem; }

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

.intake-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; margin-top: 1.5rem; }
.intake-card {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 1.4rem 1.6rem;
  text-align: center;
  display: flex; flex-direction: column;
  text-decoration: none; color: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.intake-card:hover { border-color: var(--navy); box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.intake-card .btn-download { margin-top: auto; align-self: center; }
.intake-card:hover .btn-download { background: var(--navy-deep); }
.intake-card h3 {
  font-family: var(--serif); font-size: 1.15rem; color: #fff;
  background: var(--navy); border-radius: 10px 10px 0 0;
  margin: -1.4rem -1.6rem 1rem; padding: 1rem 1.6rem;
}
.intake-card .summary { color: var(--muted); font-size: .95rem; margin-bottom: 1rem; }

.intake-followup {
  margin-top: 1.4rem; text-align: center;
  background: color-mix(in srgb, var(--r5) 12%, white);
  border: 1px solid var(--r5); border-radius: 10px;
  padding: 1.4rem 1.6rem;
}
.intake-followup h3 {
  font-family: var(--serif); font-size: 1.05rem; color: #fff;
  background: var(--r5); border-radius: 10px 10px 0 0;
  margin: -1.4rem -1.6rem 1.2rem; padding: 1rem 1.6rem;
}
.intake-followup .btn-download { background: var(--r5); }
.intake-followup .btn-download:hover { background: color-mix(in srgb, var(--r5) 75%, black); }

/* ---------- Notices (placeholder boxes) ---------- */

.notice {
  background: #fdf7e4; border: 1px solid #e8d998; border-radius: 8px;
  padding: .9rem 1.2rem; margin: 1.4rem 0; font-size: .9rem; color: #6b5a1c;
}

/* ---------- Page headers (inner pages) ---------- */

.page-head { padding: 0 1.5rem; margin-bottom: 1.5rem; }
.page-head .wrap {
  max-width: 1080px;
  background: var(--navy); color: var(--cream);
  border-radius: 14px; box-shadow: 0 6px 18px rgba(0,0,0,.2);
  padding-top: 2.6rem; padding-bottom: 2.6rem;
}
.page-head h1 { font-size: 2rem; margin-bottom: .4rem; text-align: center; text-transform: capitalize; }
.page-head p { color: rgba(247,242,224,.75); max-width: 44rem; text-align: center; margin: 0 auto; }
.page-head p.full { max-width: none; }
.page-head .map-panel { max-width: 32rem; margin: 2.2rem auto 0; }

.page-head-alt .wrap { background: var(--cream); color: var(--ink); border: 2px solid var(--navy); padding-top: 1.2rem; padding-bottom: 1.5rem; }
.page-head-alt h1 { color: var(--navy); }
.page-head-alt p { color: var(--muted); }

.page-head-justify p { text-align: justify; }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--navy-deep); color: rgba(247,242,224,.65);
  padding: 2.6rem 0; font-size: .85rem; margin-top: 4rem;
}
.site-footer .wrap { display: grid; gap: .5rem; text-align: center; }
.site-footer a { color: rgba(247,242,224,.85); }
.site-footer .fineprint { opacity: .75; }

/* ---------- Small screens ---------- */

@media (max-width: 820px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 2.2rem; padding-top: 2.8rem; padding-bottom: 2.8rem; }
  .region-grid { grid-template-columns: 1fr; }
  .intake-grid { grid-template-columns: 1fr; }
  .legend { grid-template-columns: repeat(2, 1fr); }
  .site-nav { gap: 1.1rem; }
}

/* ---------- Online intake (unlisted test pages) ----------
   Used only by /p9vt3xk6qz1md7bw/ while the online intake route is being
   trialled. When that content moves into intake.html, this block moves with it. */

.form-embed {
  --form-embed-height: 1200px;   /* retune the frame by changing this one number */
  margin-top: 1.5rem;
  border: 2px solid var(--navy);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}
.form-embed iframe { display: block; width: 100%; height: var(--form-embed-height); border: 0; }

.form-fallback {
  background: var(--cream); border: 1px solid var(--line); border-radius: 6px;
  padding: 1rem 1.2rem; margin-top: 1.2rem; font-size: .95rem;
}
.form-fallback p { margin: 0 0 .6rem; }
.form-fallback p:last-child { margin-bottom: 0; }

.step-block { margin-top: 2.6rem; }
.step-label {
  display: inline-block; background: var(--navy); color: var(--cream);
  font-family: var(--sans); font-size: .72rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  padding: .25rem .6rem; border-radius: 3px; margin-bottom: .7rem;
}
.doc-list, .warn-list { margin: 1rem 0 0; padding-left: 1.2rem; }
.doc-list li, .warn-list li { margin-bottom: .8rem; }

.recipient {
  background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--r2);
  padding: .9rem 1.1rem; border-radius: 4px; margin-top: 1.2rem; font-size: .95rem;
}
.recipient strong { color: var(--navy); }

.variant-switch {
  font-size: .85rem; color: var(--muted);
  border-top: 1px dashed var(--line); margin-top: 3.5rem; padding-top: 1rem;
}

@media (max-width: 820px) {
  .form-embed { --form-embed-height: 80vh; }
}

.form-escape { font-size: .9rem; color: var(--muted); margin-top: 1.4rem; }

/* Preview banner — deliberately MAGENTA, a color used nowhere else on this site, so an
   unfinished page can never be mistaken for a live one. If these pages graduate into
   intake.html, this rule and every .preview-banner using it should be deleted. */

.preview-banner {
  --preview: #b0006e;
  background: var(--preview); color: #fff;
  border-radius: 8px; padding: 1.1rem 1.3rem; margin: 1.4rem 0 2rem;
  font-size: .95rem; line-height: 1.55;
  box-shadow: 0 3px 14px rgba(176,0,110,.3);
}
.preview-banner p { margin: 0; }
.preview-banner p + p { margin-top: .5rem; }
.preview-banner strong { color: #fff; }
.preview-banner a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.preview-banner a:hover { color: #ffd9ee; }
.preview-tag {
  display: inline-block; background: #fff; color: var(--preview);
  font-family: var(--sans); font-size: .7rem; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase;
  padding: .22rem .6rem; border-radius: 3px; margin-bottom: .6rem;
}

.doc-head {
  font-family: var(--sans); font-size: .8rem; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
  margin-top: 1.6rem;
}
.doc-head:first-of-type { margin-top: 1.2rem; }
