/* AfterFoster.org — styles.css
 * Design language mirrors FosterPath — warm neutrals, serif headings, accessible contrast.
 * Primary accent: gold #c9a84c (vs. FosterPath's moss green).
 */

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

:root {
  /* Palette */
  --cream:       #FAF7F2;
  --warm-white:  #FFFDF9;
  --sand:        #F0EAE0;
  --sand-dark:   #DDD5C8;
  --bark:        #8B7355;
  --bark-light:  #A8926E;

  /* Gold — primary accent */
  --gold:        #c9a84c;
  --gold-light:  #d9b96c;
  --gold-dark:   #a8873a;
  --gold-pale:   #fdf8ed;

  /* Sky — secondary accent */
  --sky:         #3A6B8A;
  --sky-pale:    #E8F2F8;

  /* Moss — education */
  --moss:        #4A6741;
  --moss-light:  #6B8F60;
  --moss-pale:   #EBF2E8;

  /* Rose — financial */
  --rose:        #9B4F5C;
  --rose-pale:   #F9EEF0;

  /* Purple — employment */
  --plum:        #6B5A8A;
  --plum-pale:   #F0EEF8;

  /* Amber — legal */
  --amber:       #A8873A;
  --amber-pale:  #FDF8ED;

  /* Crisis */
  --crisis:        #7B1D1D;
  --crisis-pale:   #FDF2F2;
  --crisis-border: #F5C6C6;

  /* Text */
  --text-primary:   #2C2318;
  --text-secondary: #5C4F3D;
  --text-muted:     #8B7D6B;
  --border:         rgba(139, 115, 85, 0.18);

  /* Shape */
  --radius:    10px;
  --radius-lg: 16px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--cream);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 15px;
}

/* ── HEADER ──────────────────────────────────────────────────────────────── */
header {
  background: var(--warm-white);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
  gap: 12px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-mark {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.logo-text {
  font-family: 'Lora', serif;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1;
}

.logo-text em {
  font-style: normal;
  color: var(--gold);
}

/* State selector in header nav area */
.header-state {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.header-state select {
  font-family: 'DM Sans', sans-serif;
  font-size: 12.5px;
  padding: 4px 8px;
  border: 1px solid var(--sand-dark);
  border-radius: 6px;
  background: var(--cream);
  color: var(--text-primary);
  cursor: pointer;
  outline: none;
}

.header-state select:focus {
  border-color: var(--gold-light);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.12);
}

nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

nav a {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-muted);
  text-decoration: none;
  padding: 5px 10px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

nav a:hover {
  background: var(--sand);
  color: var(--text-primary);
}

/* ── STATE BANNER ────────────────────────────────────────────────────────── */
#state-banner {
  background: var(--gold-pale);
  border-bottom: 1px solid rgba(201, 168, 76, 0.3);
  padding: 0.6rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
}

#state-banner[hidden] { display: none; }

#state-banner p { flex: 1; }

#state-banner strong { color: var(--gold-dark); }

#state-banner-close {
  background: none;
  border: none;
  font-size: 17px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  flex-shrink: 0;
  border-radius: 4px;
}

#state-banner-close:hover { color: var(--text-primary); background: var(--sand); }
#state-banner-close:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ── CRISIS STRIP ────────────────────────────────────────────────────────── */
.crisis-strip {
  background: var(--crisis-pale);
  border-bottom: 1px solid var(--crisis-border);
  padding: 0.75rem 1.5rem;
}

.crisis-strip-inner { max-width: 860px; margin: 0 auto; }

.crisis-strip-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--crisis);
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.crisis-strip-label::before { content: '🆘'; font-size: 13px; letter-spacing: 0; }

.crisis-items { display: flex; flex-wrap: wrap; gap: 8px; }

.crisis-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--crisis-border);
  border-radius: 8px;
  padding: 6px 11px;
  font-size: 12.5px;
  color: var(--text-primary);
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  line-height: 1.35;
}

.crisis-item:hover {
  border-color: var(--crisis);
  box-shadow: 0 1px 6px rgba(123,29,29,0.08);
}

.crisis-item:focus-visible {
  outline: 2px solid var(--crisis);
  outline-offset: 2px;
}

.crisis-item-name { font-weight: 500; color: var(--crisis); }
.crisis-item-num  { font-weight: 400; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.crisis-item-note { font-size: 11px; color: var(--text-muted); border-left: 1px solid var(--crisis-border); padding-left: 6px; margin-left: 2px; }

/* ── HERO ────────────────────────────────────────────────────────────────── */
.hero {
  background: var(--warm-white);
  border-bottom: 1px solid var(--border);
  padding: 4rem 1.5rem 3.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -60px; right: -80px;
  width: 360px; height: 360px;
  background: radial-gradient(circle, rgba(201,168,76,0.07) 0%, transparent 70%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -40px; left: -60px;
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(58,107,138,0.05) 0%, transparent 70%);
  pointer-events: none;
}

.hero-eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-dark);
  background: var(--gold-pale);
  border: 1px solid rgba(201, 168, 76, 0.25);
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 1.2rem;
}

h1 {
  font-family: 'Lora', serif;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
}

.hero p {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 540px;
  margin: 0 auto 2rem;
  font-weight: 300;
  line-height: 1.7;
}

/* ── HERO SEARCH ─────────────────────────────────────────────────────────── */
.hero-search {
  max-width: 460px;
  margin: 0 auto;
  position: relative;
}

.hero-search input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--cream);
  border: 1px solid var(--sand-dark);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.hero-search input:focus {
  border-color: var(--gold-light);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.12);
}

.hero-search input::placeholder { color: var(--text-muted); }

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* ── TIMELINE SECTION ────────────────────────────────────────────────────── */
.timeline-section {
  background: var(--warm-white);
  border-bottom: 1px solid var(--border);
  padding: 3rem 1.5rem;
}

.timeline-inner {
  max-width: 860px;
  margin: 0 auto;
}

.timeline-section > .timeline-inner > .section-eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-dark);
  margin-bottom: 0.5rem;
}

.timeline-section h2 {
  font-family: 'Lora', serif;
  font-size: clamp(1.3rem, 2.5vw, 1.7rem);
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.timeline-section .tl-intro {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 560px;
  margin-bottom: 2rem;
  font-weight: 300;
  line-height: 1.7;
}

/* Timeline list */
.timeline-list {
  list-style: none;
  position: relative;
  padding-left: 0;
}

.timeline-list::before {
  content: '';
  position: absolute;
  left: 19px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--gold-pale), var(--sand));
}

.tl-item {
  display: flex;
  gap: 18px;
  padding: 0 0 2rem 0;
  position: relative;
}

.tl-item:last-child { padding-bottom: 0; }

.tl-marker {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--gold-pale);
  border: 2px solid var(--gold);
  color: var(--gold-dark);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.tl-content { flex: 1; padding-top: 6px; }

.tl-age {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-dark);
  margin-bottom: 3px;
}

.tl-title {
  font-family: 'Lora', serif;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.3;
}

.tl-desc {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 10px;
}

.tl-tags { display: flex; flex-wrap: wrap; gap: 5px; }

.tl-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--gold-pale);
  color: var(--gold-dark);
  border: 1px solid rgba(201, 168, 76, 0.2);
}

/* ── FILTER BAR ──────────────────────────────────────────────────────────── */
.filters-bar {
  padding: 0.85rem 1.5rem;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  background: var(--warm-white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 58px;
  z-index: 90;
}

.filter-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-right: 2px;
  flex-shrink: 0;
}

.pill {
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 400;
  border-radius: 20px;
  border: 1px solid var(--sand-dark);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'DM Sans', sans-serif;
}

.pill:hover { background: var(--sand); }

.pill.active {
  border-color: var(--gold);
  background: var(--gold-pale);
  color: var(--gold-dark);
  font-weight: 500;
}

.pill:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ── MAIN LAYOUT ─────────────────────────────────────────────────────────── */
main {
  max-width: 860px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.results-count {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-weight: 400;
}

/* ── SECTION HEADERS ─────────────────────────────────────────────────────── */
.section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2.5rem 0 1rem;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.section-head:first-of-type { margin-top: 0; }

.section-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.section-head h2 {
  font-family: 'Lora', serif;
  font-size: 17px;
  font-weight: 500;
  color: var(--text-primary);
}

.section-head .count-badge {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-muted);
  background: var(--sand);
  padding: 2px 8px;
  border-radius: 10px;
}

/* ── RESOURCE CARDS ──────────────────────────────────────────────────────── */
.cards { display: grid; gap: 10px; }

.card {
  background: var(--warm-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow 0.15s, border-color 0.15s;
}

.card:hover {
  border-color: var(--sand-dark);
  box-shadow: 0 2px 12px rgba(44,35,24,0.06);
}

.card-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 1rem 1.1rem;
  cursor: pointer;
  user-select: none;
}

.card-header:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: -2px;
  border-radius: calc(var(--radius-lg) - 1px);
}

.card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.card-meta { flex: 1; min-width: 0; }

.card-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 2px;
  line-height: 1.3;
}

.card-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.tags { display: flex; flex-wrap: wrap; gap: 4px; }

.tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 400;
}

/* Tag colors */
.tag-gold   { background: var(--gold-pale);  color: var(--gold-dark); }
.tag-blue   { background: var(--sky-pale);   color: var(--sky); }
.tag-green  { background: var(--moss-pale);  color: var(--moss); }
.tag-rose   { background: var(--rose-pale);  color: var(--rose); }
.tag-bark   { background: var(--sand);       color: var(--bark); }
.tag-amber  { background: var(--amber-pale); color: var(--amber); }
.tag-plum   { background: var(--plum-pale);  color: var(--plum); }
.tag-age    { background: var(--sand);       color: var(--bark); font-style: italic; }

.card-arrow {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 3px;
  flex-shrink: 0;
  transition: transform 0.2s;
}

/* ── CARD BODY ───────────────────────────────────────────────────────────── */
.card-body {
  padding: 0 1.1rem 1.1rem;
  padding-left: calc(1.1rem + 40px + 14px);
  border-top: 1px solid var(--border);
}

.card-body[hidden] { display: none; }

.card-body ul {
  padding-left: 16px;
  margin: 12px 0 10px;
}

.card-body li {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 5px;
}

.card-body li strong { color: var(--text-primary); font-weight: 500; }

.tip-box {
  background: var(--gold-pale);
  border-left: 3px solid var(--gold);
  border-radius: 0 8px 8px 0;
  padding: 10px 12px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--gold-dark);
  line-height: 1.55;
}

.tip-box strong { font-weight: 500; }

.card-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  padding: 6px 13px;
  border-radius: 7px;
  border: 1px solid var(--sand-dark);
  color: var(--sky);
  background: var(--warm-white);
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
  cursor: pointer;
}

.link-btn:hover { background: var(--sky-pale); border-color: var(--sky); }

.link-btn:focus-visible {
  outline: 2px solid var(--sky);
  outline-offset: 2px;
}

/* ── CARD FOOTER ─────────────────────────────────────────────────────────── */
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
}

.report-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 11px;
}

.report-link:hover { color: var(--rose); text-decoration: underline; }

/* ── EMPTY STATE ─────────────────────────────────────────────────────────── */
.empty {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-muted);
  font-size: 14px;
}

/* ── FOOTER ──────────────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  background: var(--warm-white);
  padding: 2.5rem 1.5rem;
  text-align: center;
}

footer p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 580px;
  margin: 0 auto;
}

footer a { color: var(--gold-dark); text-decoration: none; }
footer a:hover { text-decoration: underline; }

.footer-sister {
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.footer-sister a { color: var(--moss); }

/* ── FOCUS STATES (global) ───────────────────────────────────────────────── */
a:focus-visible,
button:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── MOBILE ──────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  nav { display: none; }
  .header-state { display: none; }

  .card-body { padding-left: 1.1rem; }

  h1 { font-size: 1.7rem; }

  .crisis-items { gap: 6px; }
  .crisis-item  { font-size: 11.5px; }

  .timeline-list::before { left: 17px; }
  .tl-marker { width: 34px; height: 34px; font-size: 12px; }

  .filters-bar { gap: 6px; padding: 0.75rem 1rem; }
  main { padding: 1.5rem 1rem 3rem; }
  .timeline-section { padding: 2rem 1rem; }
}

@media (max-width: 400px) {
  header { padding: 0 1rem; }
  .crisis-strip { padding: 0.6rem 1rem; }
  .hero { padding: 2.5rem 1rem 2rem; }
}
