/* ============================================================
   STAY STEADY — style.css
   Purpose: help households stabilize essential expenses after
   income loss. Tone: steady, private, respectful, action-oriented.
   Palette: deep teal #103B4F | steady blue-teal #1C6E7E | sage #5B8A72
            sand #E8DCC8 | off-white #F7F5F0 | terracotta #C06B4E | ink #22303A
   Type: Libre Franklin (headings) + system-friendly body
   ============================================================ */

:root {
  --teal: #103B4F;
  --teal-2: #1C6E7E;
  --teal-dk: #0B2C3B;
  --sage: #5B8A72;
  --sage-dk: #47705A;
  --sand: #E8DCC8;
  --sand-2: #F0E9DA;
  --paper: #F7F5F0;
  --terra: #C06B4E;
  --terra-dk: #A5543A;
  --ink: #22303A;
  --ink-soft: #5A6a72;
  --line: #DED6C6;
  --white: #fff;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 6px 22px rgba(16, 59, 79, 0.11);
  --head: "Libre Franklin", -apple-system, "Segoe UI", sans-serif;
  --body: "Libre Franklin", -apple-system, "Segoe UI", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--body); background: var(--paper); color: var(--ink); line-height: 1.65; font-size: 17px; }
img { max-width: 100%; }
a { color: var(--teal-2); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

.skip-link { position: absolute; left: -9999px; background: var(--terra); color: #fff; padding: 10px 16px; z-index: 100; font-weight: 700; border-radius: 8px; }
.skip-link:focus { left: 10px; top: 10px; }

/* ---------- crisis bar ---------- */
.crisis-bar { background: var(--teal-dk); color: #DCE8EC; text-align: center; padding: 9px 16px; font-size: 0.92rem; font-weight: 600; }
.crisis-bar strong { color: #fff; }
.crisis-bar a { color: #fff; text-decoration: underline; }

/* ---------- header ---------- */
.hdr { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; }
.hdr-inner { max-width: 1120px; margin: 0 auto; padding: 13px 20px; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--teal); font-family: var(--head); font-weight: 800; font-size: 1.28rem; letter-spacing: -0.01em; }
.brand .mark { width: 37px; height: 37px; border-radius: 10px; background: var(--sage); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 1.15rem; }
.brand .p2 { color: var(--sage); }
.nav { display: flex; gap: 3px; flex-wrap: wrap; align-items: center; }
.nav a { color: var(--teal); text-decoration: none; font-weight: 600; font-size: 0.9rem; padding: 9px 12px; border-radius: 8px; transition: background .15s; }
.nav a:hover, .nav a.on { background: var(--sand-2); }
.nav a.cta { background: var(--teal); color: #fff; }
.nav a.cta:hover { background: var(--teal-2); }

/* ---------- buttons ---------- */
.btn { display: inline-block; font-family: var(--body); font-weight: 700; font-size: 0.98rem; padding: 12px 22px; border-radius: 10px; border: none; cursor: pointer; text-decoration: none; text-align: center; transition: all .15s; }
.btn:active { transform: translateY(1px); }
.btn-teal { background: var(--teal); color: #fff; }
.btn-teal:hover { background: var(--teal-2); }
.btn-sage { background: var(--sage); color: #fff; }
.btn-sage:hover { background: var(--sage-dk); }
.btn-terra { background: var(--terra); color: #fff; }
.btn-terra:hover { background: var(--terra-dk); }
.btn-line { background: transparent; color: var(--teal); border: 2px solid var(--teal); }
.btn-line:hover { background: var(--teal); color: #fff; }
.btn-sm { padding: 8px 14px; font-size: 0.86rem; }
.btn-lg { padding: 15px 28px; font-size: 1.05rem; }

/* ---------- hero ---------- */
.hero { background: linear-gradient(165deg, var(--teal) 0%, #16506122 100%), var(--teal); color: #fff; padding: 56px 20px 60px; position: relative; overflow: hidden; }
.hero-inner { max-width: 1120px; margin: 0 auto; position: relative; }
.hero .eyebrow { display: inline-block; background: rgba(255,255,255,0.12); padding: 6px 14px; border-radius: 999px; font-weight: 700; font-size: 0.8rem; letter-spacing: 0.05em; margin-bottom: 16px; }
.hero h1 { font-family: var(--head); font-size: clamp(2.1rem, 5.2vw, 3.3rem); font-weight: 800; line-height: 1.1; letter-spacing: -0.015em; max-width: 800px; }
.hero h1 .u { color: var(--sand); }
.hero p.lede { margin-top: 14px; font-size: 1.12rem; max-width: 640px; color: #D7E3E7; }

/* ---------- protect-first strip ---------- */
.protect { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; margin-top: 26px; }
.protect h2 { font-family: var(--head); font-size: 1.15rem; color: var(--teal); margin-bottom: 4px; }
.protect .sub { color: var(--ink-soft); margin-bottom: 16px; font-size: 0.96rem; }
.protect-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px,1fr)); gap: 12px; }
.pf { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px; text-decoration: none; color: var(--teal); text-align: center; transition: all .15s; }
.pf:hover { border-color: var(--sage); transform: translateY(-3px); }
.pf .pi { font-size: 1.7rem; display: block; margin-bottom: 6px; }
.pf .pt { font-weight: 700; display: block; font-size: 0.92rem; }
.pf .po { font-size: 0.74rem; color: var(--terra-dk); font-weight: 700; }

/* ---------- search ---------- */
.search-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; margin-top: 20px; }
.search-card h2 { font-family: var(--head); font-size: 1.05rem; color: var(--teal); margin-bottom: 14px; }
.s-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 12px; }
.fld label { display: block; font-weight: 700; font-size: 0.76rem; color: var(--ink-soft); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.05em; }
.fld input, .fld select { width: 100%; padding: 12px 14px; border: 2px solid var(--line); border-radius: var(--radius-sm); font-family: var(--body); font-size: 0.98rem; background: var(--paper); color: var(--ink); }
.fld input:focus, .fld select:focus { outline: 3px solid var(--sage); outline-offset: 1px; border-color: var(--sage); }

/* ---------- sections ---------- */
.section { padding: 54px 0; }
.section.alt { background: #fff; }
.sec-head { margin-bottom: 26px; }
.sec-head .k { color: var(--sage-dk); font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.78rem; }
.sec-head h2 { font-family: var(--head); font-size: clamp(1.6rem, 3.4vw, 2.2rem); font-weight: 800; letter-spacing: -0.01em; margin-top: 4px; }
.sec-head p { color: var(--ink-soft); max-width: 640px; margin-top: 6px; }

/* ---------- category tiles ---------- */
.cats { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px,1fr)); gap: 14px; }
.cat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 16px; text-decoration: none; color: var(--teal); transition: all .16s; }
.cat:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--sage); }
.cat .ci { font-size: 1.6rem; display: block; margin-bottom: 8px; }
.cat .ct { font-family: var(--head); font-weight: 700; display: block; font-size: 0.98rem; }
.cat .cs { font-size: 0.8rem; color: var(--ink-soft); }

/* ---------- resource cards ---------- */
.res-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px,1fr)); gap: 18px; }
.res-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 10px; transition: all .16s; position: relative; }
.res-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.res-card.urgent-card { border-left: 5px solid var(--terra); }
.res-card h3 { font-family: var(--head); font-size: 1.12rem; font-weight: 700; line-height: 1.25; }
.res-card h3 a { color: var(--teal); text-decoration: none; }
.res-card h3 a:hover { color: var(--teal-2); }
.res-where { color: var(--ink-soft); font-weight: 600; font-size: 0.88rem; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 0.73rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--sand-2); color: var(--teal); }
.tag.cat-t { background: #DCEAE4; color: var(--sage-dk); }
.tag.urgent { background: #F5E1D8; color: var(--terra-dk); }
.tag.apphelp { background: #DBE7EC; color: var(--teal-2); }
.res-note { font-size: 0.9rem; color: var(--ink-soft); }
.res-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 0.77rem; color: var(--ink-soft); font-weight: 600; }
.sample-flag { display: inline-block; font-size: 0.67rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--terra-dk); background: #F5E1D8; border: 1px dashed var(--terra); padding: 2px 8px; border-radius: 6px; }

/* ---------- filters ---------- */
.filters { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 22px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip { display: inline-flex; align-items: center; gap: 7px; font-size: 0.85rem; font-weight: 700; color: var(--teal); background: var(--paper); border: 2px solid var(--line); border-radius: 999px; padding: 8px 14px; cursor: pointer; user-select: none; }
.chip input { accent-color: var(--sage); cursor: pointer; width: 16px; height: 16px; }
.chip:has(input:checked) { background: var(--sage); border-color: var(--sage); color: #fff; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 16px 0; flex-wrap: wrap; }
.count { font-weight: 800; color: var(--ink-soft); }

/* ---------- detail ---------- */
.d-hero { background: var(--teal); color: #fff; padding: 44px 20px; }
.d-hero h1 { font-family: var(--head); font-size: clamp(1.8rem, 4.2vw, 2.6rem); font-weight: 800; line-height: 1.1; }
.d-hero .where { color: #D7E3E7; font-weight: 600; margin-top: 6px; }
.d-grid { display: grid; grid-template-columns: 1fr 330px; gap: 26px; align-items: start; }
@media (max-width: 880px) { .d-grid { grid-template-columns: 1fr; } }
.d-block { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 18px; }
.d-block h2 { font-family: var(--head); font-size: 1.15rem; font-weight: 700; margin-bottom: 12px; color: var(--teal); }
.facts { list-style: none; }
.facts li { display: flex; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.facts li:last-child { border-bottom: none; }
.facts .k { color: var(--ink-soft); font-weight: 700; }
.facts .v { text-align: right; font-weight: 600; }
.side { background: #fff; border: 1px solid var(--line); border-top: 5px solid var(--sage); border-radius: var(--radius); padding: 22px; margin-bottom: 18px; }
.side h3 { font-family: var(--head); font-weight: 700; margin-bottom: 12px; color: var(--teal); }
.side .btn { width: 100%; margin-bottom: 9px; }
.mini { font-size: 0.83rem; color: var(--ink-soft); background: var(--paper); border-radius: 10px; padding: 11px 13px; }

/* ---------- notices ---------- */
.notice { background: #F5E1D8; border-left: 5px solid var(--terra); border-radius: 10px; padding: 15px 18px; color: #7A3A25; margin: 18px 0; }
.notice.teal { background: #DBE7EC; border-color: var(--teal-2); color: #10495B; }
.notice.sage { background: #DCEAE4; border-color: var(--sage); color: #2F5240; }

/* ---------- prose / checklist ---------- */
.prose { max-width: 800px; }
.prose h2 { font-family: var(--head); font-size: 1.45rem; font-weight: 800; color: var(--teal); margin: 30px 0 10px; }
.prose h3 { font-size: 1.12rem; font-weight: 700; margin: 20px 0 8px; color: var(--teal); }
.prose p, .prose li { color: #37454E; margin-bottom: 10px; }
.prose ul, .prose ol { padding-left: 24px; margin-bottom: 14px; }
.check-list { list-style: none; padding-left: 0 !important; }
.check-list li { position: relative; padding: 11px 0 11px 38px; border-bottom: 1px solid var(--line); font-weight: 500; }
.check-list li::before { content: "✓"; position: absolute; left: 4px; top: 10px; width: 24px; height: 24px; background: #DCEAE4; color: var(--sage-dk); border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; }

/* ---------- priority cards (what to protect first) ---------- */
.priority { display: grid; gap: 16px; }
.pri { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: grid; grid-template-columns: 54px 1fr; gap: 16px; align-items: start; }
.pri .rank { width: 54px; height: 54px; border-radius: 14px; background: var(--teal); color: #fff; font-family: var(--head); font-weight: 800; font-size: 1.5rem; display: inline-flex; align-items: center; justify-content: center; }
.pri h3 { font-family: var(--head); font-weight: 700; font-size: 1.15rem; margin-bottom: 4px; }
.pri p { color: var(--ink-soft); font-size: 0.95rem; margin-bottom: 8px; }

/* ---------- FAQ ---------- */
.faq { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 12px; overflow: hidden; }
.faq summary { cursor: pointer; padding: 18px 22px; font-weight: 700; color: var(--teal); list-style: none; position: relative; font-family: var(--head); }
.faq summary::after { content: "+"; position: absolute; right: 22px; color: var(--sage); font-size: 1.4rem; }
.faq[open] summary::after { content: "–"; }
.faq .a { padding: 0 22px 18px; color: var(--ink-soft); }

/* ---------- form ---------- */
.form-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; max-width: 720px; }
.frow { margin-bottom: 16px; }
.frow label { display: block; font-weight: 700; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); margin-bottom: 6px; }
.frow input, .frow select, .frow textarea { width: 100%; padding: 12px 14px; border: 2px solid var(--line); border-radius: var(--radius-sm); font-family: var(--body); font-size: 0.98rem; background: var(--paper); }
.frow textarea { min-height: 110px; resize: vertical; }
.frow input:focus, .frow select:focus, .frow textarea:focus { outline: 3px solid var(--sage); border-color: var(--sage); }

.empty { text-align: center; padding: 56px 20px; color: var(--ink-soft); background: #fff; border: 2px dashed var(--line); border-radius: var(--radius); font-weight: 600; }
.cta { background: var(--sage); color: #fff; padding: 48px 20px; text-align: center; }
.cta h2 { font-family: var(--head); font-size: clamp(1.5rem, 3.5vw, 2.2rem); font-weight: 800; }
.cta p { max-width: 560px; margin: 10px auto 20px; color: #E6F0EA; }

.ftr { background: var(--teal-dk); color: #A7BDC4; padding: 46px 20px 30px; font-size: 0.92rem; }
.ftr-grid { max-width: 1120px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 28px; }
@media (max-width: 760px) { .ftr-grid { grid-template-columns: 1fr 1fr; } }
.ftr h4 { color: #fff; font-family: var(--head); font-weight: 700; margin-bottom: 12px; font-size: 0.95rem; }
.ftr a { color: #A7BDC4; text-decoration: none; display: block; padding: 3px 0; }
.ftr a:hover { color: var(--sand); }
.ftr-legal { max-width: 1120px; margin: 28px auto 0; padding-top: 18px; border-top: 1px solid var(--teal); font-size: 0.82rem; color: #7A929B; }

.hidden { display: none !important; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 28px; }
.center { text-align: center; }

@media (max-width: 640px) {
  .hdr-inner { justify-content: center; }
  .nav { justify-content: center; }
}

/* ---------- solidarity band + community board (added) ---------- */
.solidarity { background: var(--sand); color: var(--teal); padding: 30px 20px; text-align: center; }
.solidarity .in { max-width: 800px; margin: 0 auto; }
.solidarity h2 { font-family: var(--head); font-weight: 800; font-size: clamp(1.4rem, 3.2vw, 2rem); }
.solidarity p { font-weight: 600; margin-top: 8px; font-size: 1.04rem; color: var(--ink); }
.solidarity .heart { font-size: 1.6rem; }
.note-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.note-card.mine { border-color: var(--sage); border-style: dashed; }
.note-card .n-text { font-weight: 600; font-size: 1.02rem; color: var(--ink); }
.note-card .n-meta { font-size: 0.82rem; color: var(--ink-soft); font-weight: 700; }
.note-badge { display: inline-block; font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; padding: 2px 9px; border-radius: 999px; }
.note-badge.tip { background: #DCEAE4; color: var(--sage-dk); }
.note-badge.mine { background: #DBE7EC; color: var(--teal-2); }

/* ---------- map page (added) ---------- */
:root { --map-accent: #1C6E7E; }
#map { height: 62vh; min-height: 420px; border-radius: 16px; border: 2px solid var(--line); z-index: 1; }
.map-jumps { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.leaflet-popup-content { font-family: inherit; font-size: 0.92rem; line-height: 1.5; }

/* ---------- 988 lifeline button (added — do not remove) ---------- */
.lifeline-btn {
  position: fixed; right: 14px; bottom: 14px; z-index: 999;
  display: inline-flex; align-items: center; gap: 7px;
  background: #4A2A8A; color: #fff; text-decoration: none;
  font-weight: 800; font-size: 0.86rem; line-height: 1;
  padding: 11px 16px; border-radius: 999px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.28);
  border: 2px solid rgba(255,255,255,0.85);
}
.lifeline-btn:hover { background: #5C3AA6; color: #fff; }
.lifeline-btn .lb-sub { font-weight: 600; font-size: 0.72rem; opacity: 0.9; }
@media (max-width: 640px) { .lifeline-btn .lb-sub { display: none; } }
