/* Family League of Baltimore, concept redesign by Stoa
   Motif: the braid (four Results-Area wing-colors woven together).
   Type: Bricolage Grotesque (display/UI) + Newsreader (body serif). */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("fonts/bricolage-grotesque-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
  font-style: normal;
}
@font-face {
  font-family: "Alegreya";
  src: url("fonts/alegreya-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
  font-style: normal;
}
@font-face {
  font-family: "Alegreya";
  src: url("fonts/alegreya-italic-latin.woff2") format("woff2");
  font-weight: 400 500;
  font-display: swap;
  font-style: italic;
}

:root {
  --navy: #0B1F4D;
  --navy-deep: #081636;
  --ink: #23283A;
  --muted: #555B6E;
  --paper: #FBF8F1;
  --mist: #EFEBE0;
  --line: #DAD3C2;
  --white: #FFFFFF;

  /* Results-Area wings: -t = AA text tone, -f = brighter fill tone */
  --edu-t: #0E7C7B;  --edu-f: #16A6A0;
  --health-t: #1C7F46; --health-f: #26A85C;
  --econ-t: #8C5600; --econ-f: #EFC04A;
  --safe-t: #C0402B; --safe-f: #E2674C;

  --action: #0E7C7B;
  --action-dark: #0A5E5D;
  --accent: #C0402B;
  --accent-ink: #992F1A;

  --display: "Bricolage Grotesque", "Trebuchet MS", system-ui, sans-serif;
  --body: "Alegreya", Georgia, "Times New Roman", serif;

  --maxw: 1120px;
  --radius: 14px;
  --shadow: 0 14px 36px -22px rgba(11, 31, 77, .55);
  --braid: repeating-linear-gradient(115deg,
      var(--edu-f) 0 14px, var(--health-f) 14px 28px,
      var(--econ-f) 28px 42px, var(--safe-f) 42px 56px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.62;
  color: var(--ink);
  background-color: var(--paper);
  background-image: url("tex-paper.png");
  background-size: cover;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .display { font-family: var(--display); color: var(--navy); line-height: 1.08; letter-spacing: -.012em; font-weight: 800; }
h1 { font-size: clamp(2.1rem, 5.4vw, 3.5rem); margin: 0 0 .5rem; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); margin: 0 0 .6rem; }
h3 { font-size: 1.3rem; margin: 0 0 .35rem; font-weight: 700; }
p { margin: 0 0 1rem; }
a { color: var(--action-dark); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
img { max-width: 100%; display: block; }
:focus-visible { outline: 3px solid var(--navy); outline-offset: 3px; border-radius: 4px; }
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--navy); color: #fff; padding: .7rem 1.1rem; font-family: var(--display); font-weight: 700;
}
.skip-link:focus { left: .5rem; top: .5rem; color:#fff; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }
.lede { font-size: 1.2rem; color: var(--muted); }
.eyebrow {
  font-family: var(--display); font-weight: 700; text-transform: uppercase;
  letter-spacing: .14em; font-size: .78rem; color: var(--accent-ink); margin: 0 0 .4rem;
}
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- the braid rule ---------- */
.braid-rule { height: 7px; background: var(--braid); border: 0; margin: 0; }
.braid-rule.thin { height: 4px; }

/* ---------- chrome: banner ---------- */
.proto-banner {
  background: var(--navy-deep); color: #EAE3D2; font-family: var(--display);
  font-size: .82rem; font-weight: 600; text-align: center; padding: .5rem 1rem; letter-spacing: .01em;
}
.proto-banner strong { color: #fff; }

/* ---------- chrome: header ---------- */
.site-header { background: var(--paper); position: sticky; top: 0; z-index: 40; border-bottom: 1px solid var(--line); }
.header-bar { display: flex; align-items: center; gap: 1.25rem; padding: .85rem 1.25rem; max-width: var(--maxw); margin: 0 auto; }
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; flex: 0 0 auto; }
.brand img { height: 46px; width: auto; }
.brand-text { font-family: var(--display); font-weight: 800; color: var(--navy); line-height: 1.02; font-size: 1.05rem; }
.brand-text span { display: block; font-weight: 600; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.header-search { margin-left: auto; flex: 1 1 240px; max-width: 340px; }
.nav-toggle {
  margin-left: auto; display: none; align-items: center; gap: .5rem;
  background: var(--navy); color: #fff; border: 0; border-radius: 10px;
  font-family: var(--display); font-weight: 700; font-size: .95rem; padding: .6rem .9rem; min-height: 44px; cursor: pointer;
}
.primary-nav ul { list-style: none; display: flex; gap: .25rem; margin: 0; padding: 0; flex-wrap: wrap; }
.primary-nav a {
  display: inline-block; font-family: var(--display); font-weight: 700; font-size: .96rem;
  color: var(--navy); text-decoration: none; padding: .55rem .7rem; border-radius: 9px; min-height: 24px;
}
.primary-nav a:hover, .primary-nav a:focus-visible { background: var(--mist); color: var(--accent); }
.primary-nav a[aria-current="page"] { color: var(--accent); box-shadow: inset 0 -3px 0 var(--accent); border-radius: 4px; }
.nav-row { background: var(--white); border-bottom: 1px solid var(--line); }
.nav-row .wrap { display: flex; align-items: center; min-height: 52px; }

.search-field { display: flex; align-items: stretch; border: 2px solid var(--navy); border-radius: 999px; overflow: hidden; background: #fff; }
.search-field input { flex: 1; border: 0; padding: .55rem .9rem; font-family: var(--body); font-size: 1rem; color: var(--ink); background: transparent; min-width: 0; }
.search-field input:focus { outline: none; }
.search-field button {
  border: 0; background: var(--navy); color: #fff; font-family: var(--display); font-weight: 700;
  padding: 0 1rem; cursor: pointer; min-height: 44px;
}
.search-field button:hover { background: var(--action-dark); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem; font-family: var(--display); font-weight: 700;
  text-decoration: none; border: 2px solid transparent; border-radius: 999px; padding: .7rem 1.3rem;
  min-height: 44px; cursor: pointer; font-size: 1rem; transition: transform .12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #a4341f; color: #fff; }
.btn-ghost { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-ghost:hover { background: var(--navy); color: #fff; }
.btn-light { background: #fff; color: var(--navy); border-color: #fff; }

/* ---------- hero (duotone + braid edge) ---------- */
.hero { position: relative; background: var(--navy-deep); color: #F3EEE2; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: 1;
  background: url("tex-woven-navy.png") center/cover; opacity: .5; }
.hero-photo { position: absolute; inset: 0; z-index: 1; background-size: cover; background-position: center 28%; mix-blend-mode: luminosity; opacity: .82; }
.hero-photo::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(105deg, rgba(8,16,40,.95) 0 40%, rgba(11,31,77,.74) 76%, rgba(14,124,123,.5)); }
.hero::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  box-shadow: inset 0 -70px 90px -50px rgba(6,14,36,.85), inset 0 60px 80px -60px rgba(6,14,36,.6); }
.hero-inner { position: relative; z-index: 2; max-width: var(--maxw); margin: 0 auto; padding: 4.2rem 1.25rem 4.6rem; }
.hero h1 { color: #fff; max-width: 16ch; }
.hero .lede { color: #E7E0D0; max-width: 46ch; font-size: 1.28rem; }
.hero-search { margin-top: 1.6rem; max-width: 540px; }
.hero-search .search-field { border-color: #fff; }
.hero-search .search-field button { background: var(--accent); }
.hero-search .search-field button:hover { background:#a4341f; }
.hero-tags { margin-top: .9rem; display: flex; flex-wrap: wrap; gap: .5rem; }
.hero-tags a { background: rgba(255,255,255,.12); color: #fff; text-decoration: none; font-family: var(--display); font-weight: 600; font-size: .85rem; padding: .35rem .8rem; border-radius: 999px; }
.hero-tags a:hover { background: rgba(255,255,255,.26); }
.hero-edge { position: relative; z-index: 2; height: 8px; background: var(--braid); }

/* ---------- sections ---------- */
section { padding: 3.2rem 0; }
.section-head { max-width: 60ch; margin-bottom: 1.6rem; }
.band-mist { background: var(--mist); }
.band-navy {
  background-color: var(--navy); color: #E9E3D4; position: relative;
  background-image: linear-gradient(rgba(11,31,77,.84), rgba(8,22,54,.9)), url("tex-woven-navy.png");
  background-size: cover; background-position: center;
}
.band-navy h2, .band-navy h3 { color: #fff; }
.band-navy a { color: #fff; }

/* ---------- the braid: Results Areas ---------- */
.areas { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.area-card {
  display: block; text-align: left; text-decoration: none; cursor: pointer;
  background: #fff; border: 0; border-top: 7px solid var(--w, var(--navy));
  border-radius: 0 0 var(--radius) var(--radius); padding: 1.2rem 1.1rem 1.3rem;
  box-shadow: var(--shadow); color: var(--ink); font-family: var(--body); position: relative;
  overflow: hidden; isolation: isolate;
  transition: transform .16s ease, box-shadow .16s ease;
}
.area-card::after {
  content: ""; position: absolute; z-index: -1; right: -22px; bottom: -22px;
  width: 116px; height: 116px; background: var(--emblem) center/contain no-repeat;
  opacity: .14; transition: opacity .16s ease, transform .16s ease;
}
.area-card:hover, .area-card:focus-visible { transform: translateY(-5px); box-shadow: 0 22px 44px -22px rgba(11,31,77,.6); }
.area-card:hover::after, .area-card:focus-visible::after { opacity: .26; transform: scale(1.08) rotate(-3deg); }
.area-card .area-k { font-family: var(--display); font-weight: 700; font-size: .76rem; letter-spacing: .12em; text-transform: uppercase; color: var(--w, var(--navy)); }
.area-card h3 { color: var(--navy); margin: .3rem 0 .4rem; font-size: 1.18rem; }
.area-card p { margin: 0; color: var(--muted); font-size: .98rem; }
.area-edu { --w: var(--edu-t); --emblem: url("emblem-edu.png"); }
.area-health { --w: var(--health-t); --emblem: url("emblem-health.png"); }
.area-econ { --w: var(--econ-t); --emblem: url("emblem-econ.png"); }
.area-safe { --w: var(--safe-t); --emblem: url("emblem-safe.png"); }

/* wing chips / list markers */
.wing-ticks { display: inline-flex; gap: 3px; vertical-align: middle; }
.wing-ticks i { width: 7px; height: 16px; border-radius: 2px; display: inline-block; }
.wing-ticks i:nth-child(1){ background: var(--edu-f);} .wing-ticks i:nth-child(2){ background: var(--health-f);}
.wing-ticks i:nth-child(3){ background: var(--econ-f);} .wing-ticks i:nth-child(4){ background: var(--safe-f);}

.tag {
  display: inline-flex; align-items: center; gap: .4rem; font-family: var(--display); font-weight: 700;
  font-size: .76rem; letter-spacing: .03em; padding: .25rem .6rem; border-radius: 999px; line-height: 1.4;
  border: 1.5px solid currentColor;
}
.tag::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.tag-edu { color: var(--edu-t); } .tag-health { color: var(--health-t); }
.tag-econ { color: var(--econ-t); } .tag-safe { color: var(--safe-t); }
.tag-open { color: var(--health-t); } .tag-closed { color: var(--muted); }

/* ---------- ledger band ---------- */
.ledger { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 1.5rem; align-items: start; }
.stat { font-family: var(--display); }
.stat b { display: block; font-size: clamp(2.4rem, 5vw, 3.4rem); font-weight: 800; color: #fff; line-height: 1; letter-spacing: -.02em; }
.stat span { color: #CFE7E6; font-size: .98rem; font-family: var(--body); }

/* ---------- generic card grid (used sparingly) ---------- */
.grid { display: grid; gap: 1.2rem; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem;
  box-shadow: var(--shadow);
}
.card.flat { box-shadow: none; }
.card h3 a { text-decoration: none; color: var(--navy); }
.card h3 a:hover { color: var(--accent); }
.card .meta { font-family: var(--display); font-weight: 600; font-size: .82rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }

/* front doors */
.doors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
.door { position: relative; overflow: hidden; isolation: isolate; background: #fff; border: 1px solid var(--line); border-left: 6px solid var(--accent); border-radius: 12px; padding: 1.3rem; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); transition: transform .16s ease, box-shadow .16s ease; }
.door::after { content: ""; position: absolute; z-index: -1; right: -16px; bottom: -16px; width: 92px; height: 92px; background: var(--emblem) center/contain no-repeat; opacity: .12; transition: opacity .16s ease; }
.door:nth-child(1){ border-left-color: var(--edu-f); --emblem: url("emblem-edu.png"); } .door:nth-child(2){ border-left-color: var(--econ-f); --emblem: url("emblem-econ.png"); } .door:nth-child(3){ border-left-color: var(--safe-f); --emblem: url("emblem-safe.png"); }
.door h3 { color: var(--navy); }
.door:hover { transform: translateY(-3px); box-shadow: 0 20px 40px -22px rgba(11,31,77,.55); }
.door:hover::after { opacity: .22; }
.door .go { font-family: var(--display); font-weight: 700; color: var(--action-dark); }

/* funders strip */
.funders { display: flex; flex-wrap: wrap; gap: .55rem 1.4rem; align-items: center; }
.funders li { list-style: none; font-family: var(--display); font-weight: 700; color: var(--navy); font-size: 1.02rem; opacity: .9; }
.funders { padding: 0; margin: 0; }

/* ---------- funding index ---------- */
.controls { display: grid; grid-template-columns: 1fr; gap: 1rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; box-shadow: var(--shadow); }
.chip-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
  font-family: var(--display); font-weight: 700; font-size: .9rem; cursor: pointer;
  background: var(--mist); color: var(--navy); border: 2px solid transparent; border-radius: 999px;
  padding: .45rem .9rem; min-height: 38px;
}
.chip[aria-pressed="true"] { background: var(--navy); color: #fff; }
.chip.w-edu[aria-pressed="true"]{ background: var(--edu-t);} .chip.w-health[aria-pressed="true"]{ background: var(--health-t);}
.chip.w-econ[aria-pressed="true"]{ background: var(--econ-t);} .chip.w-safe[aria-pressed="true"]{ background: var(--safe-t);}
.chip:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }

.opps { display: grid; gap: 1rem; margin-top: 1.4rem; padding: 0; }
.opp {
  list-style: none; background: #fff; border: 1px solid var(--line); border-left: 8px solid var(--w, var(--navy));
  border-radius: 12px; padding: 1.2rem 1.3rem; box-shadow: var(--shadow);
}
.opp.area-edu { --w: var(--edu-f); } .opp.area-health { --w: var(--health-f); }
.opp.area-econ { --w: var(--econ-f); } .opp.area-safe { --w: var(--safe-f); }
.opp .opp-top { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: space-between; }
.opp h3 { margin: .5rem 0 .3rem; }
.opp .deadline { font-family: var(--display); font-weight: 700; color: var(--navy); }
.opp .award { color: var(--muted); }
.count-line { font-family: var(--display); font-weight: 700; color: var(--navy); margin: 1.2rem 0 0; }

/* ---------- search results ---------- */
.results { display: grid; gap: .9rem; padding: 0; margin: 1.4rem 0 0; }
.result { list-style: none; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 1.1rem 1.2rem; box-shadow: var(--shadow); }
.result h3 { margin: 0 0 .25rem; }
.result h3 a { text-decoration: none; color: var(--navy); }
.result h3 a:hover { color: var(--accent); }
.result .kind { font-family: var(--display); font-weight: 700; font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; color: var(--accent-ink); }
.result p { margin: .3rem 0 0; color: var(--muted); }
.empty { position: relative; overflow: hidden; background: var(--mist); border: 1px dashed var(--line); border-radius: 12px; padding: 1.6rem; color: var(--muted); }
.empty::after { content: ""; position: absolute; right: -28px; bottom: -34px; width: 150px; height: 150px; background: url("img/butterfly.png") center/contain no-repeat; opacity: .12; pointer-events: none; }
.empty .wing-ticks { margin-bottom: .6rem; position: relative; z-index: 1; }

/* 404, a loose thread */
.nf { position: relative; overflow: hidden; }
.nf::after {
  content: ""; position: absolute; z-index: 0; right: -40px; top: 50%; transform: translateY(-50%);
  width: 360px; height: 360px; background: url("img/butterfly.png") center/contain no-repeat;
  opacity: .12; pointer-events: none;
}
.nf .wrap { position: relative; z-index: 1; }
@media (max-width: 760px) { .nf::after { width: 220px; right: -80px; opacity: .08; } }

/* ---------- prose pages ---------- */
.prose { max-width: 70ch; }
.prose h2 { margin-top: 2.2rem; }
.prose ul { padding-left: 0; list-style: none; }
.prose ul li { position: relative; padding-left: 1.6rem; margin-bottom: .55rem; }
.prose ul li::before { content: ""; position: absolute; left: 0; top: .55em; width: 12px; height: 4px; border-radius: 2px; background: var(--braid); }
.callout { background: var(--mist); border-left: 6px solid var(--action); border-radius: 0 12px 12px 0; padding: 1.1rem 1.3rem; margin: 1.4rem 0; }
.note { font-size: .9rem; color: var(--muted); font-style: italic; }

/* breadcrumb */
.crumb { font-family: var(--display); font-weight: 600; font-size: .85rem; color: var(--muted); padding-top: 1.4rem; }
.crumb a { color: var(--action-dark); text-decoration: underline; }
.prose a, .callout a, .lede a { text-decoration: underline; }
.page-head { padding: 1.4rem 0 1.8rem; }
.page-head.band-mist { position: relative; overflow: hidden; }
.page-head.band-mist::after {
  content: ""; position: absolute; z-index: 0; right: -70px; top: 50%; transform: translateY(-50%);
  width: 320px; height: 320px; background: url("img/butterfly.png") center/contain no-repeat;
  opacity: .1; pointer-events: none;
}
.page-head.band-mist .wrap { position: relative; z-index: 1; }
@media (max-width: 760px) { .page-head.band-mist::after { display: none; } }

/* before/after a11y panel */
.ba { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.ba .before { background: #fff; border: 1px solid var(--line); border-top: 7px solid var(--safe-t); border-radius: 0 0 12px 12px; padding: 1.3rem; }
.ba .after { background: #fff; border: 1px solid var(--line); border-top: 7px solid var(--health-t); border-radius: 0 0 12px 12px; padding: 1.3rem; }
.ba b.num { font-family: var(--display); font-size: 2.6rem; font-weight: 800; display: block; line-height: 1; }
.ba .before b.num { color: var(--safe-t); } .ba .after b.num { color: var(--health-t); }

/* definition rows (contact / ecac) */
.deflist { display: grid; gap: .2rem; margin: 0; }
.deflist div { display: grid; grid-template-columns: 150px 1fr; gap: .8rem; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.deflist dt { font-family: var(--display); font-weight: 700; color: var(--navy); }
.deflist dd { margin: 0; }

/* ---------- footer ---------- */
.site-footer { background: var(--navy); color: #C9D2E6; padding: 0 0 2.2rem; margin-top: 1rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; padding-top: 2.4rem; }
.site-footer .foot-h { font-family: var(--display); color: #fff; font-size: .85rem; text-transform: uppercase; letter-spacing: .12em; margin: 0 0 .7rem; font-weight: 700; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.footer-brand img { height: 52px; margin-bottom: .6rem; }
.footer-disclaimer { border-top: 1px solid rgba(255,255,255,.18); margin-top: 1.8rem; padding-top: 1.2rem; font-size: .88rem; color: #AEB9D4; }
.footer-disclaimer a { text-decoration: underline; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .areas { grid-template-columns: repeat(2, 1fr); }
  .ledger { grid-template-columns: 1fr; gap: 1rem; }
  .grid-3, .grid-2, .doors { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.4rem; }
  .ba { grid-template-columns: 1fr; }
  .deflist div { grid-template-columns: 1fr; gap: .1rem; }
}
@media (max-width: 760px) {
  .header-search { display: none; }
  .nav-toggle { display: inline-flex; }
  .primary-nav { display: none; width: 100%; }
  .primary-nav.open { display: block; padding-bottom: .8rem; }
  .primary-nav ul { flex-direction: column; gap: .15rem; }
  .primary-nav a { display: block; padding: .7rem .6rem; }
  .nav-row .wrap { flex-wrap: wrap; min-height: 0; }
  .nav-row:not(:has(.primary-nav.open)) { border-bottom: 0; }
}
@media (max-width: 520px) {
  .areas { grid-template-columns: 1fr; }
  .opp .opp-top { gap: .3rem; }
}
