:root {
  color-scheme: light;
  font: 100%/1.55 system-ui, sans-serif;
  color: #111;
  background: #fafafa;
  --ink: #111;
  --paper: #fff;
  --muted: #515151;
  --line: #d2d2d2;
  --control: #686868;
}
* { box-sizing: border-box; }
body { margin: 0; }
.wrap { max-width: 72rem; margin-inline: auto; padding-inline: clamp(1rem, 5vw, 3rem); }
[hidden] { display: none !important; }
header, .hero { background: var(--ink); color: var(--paper); }
.site-header { border-bottom: 1px solid #444; }
.mast, .footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .25rem 1rem;
}
.mast { min-height: 3.25rem; }
.mast-links { display: flex; align-items: center; gap: .25rem; }
.install-link {
  min-height: 2.75rem;
  background: var(--ink);
  color: var(--paper);
  border-color: #777;
}
#install-dialog {
  width: min(29rem, calc(100% - 2rem));
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: .85rem;
  background: var(--paper);
  color: var(--ink);
}
#install-dialog::backdrop { background: rgb(0 0 0 / .65); }
#install-title { display: flex; align-items: center; gap: .55rem; font-size: 1.4rem; }
#install-title img { flex: none; width: 2rem; height: 2rem; }
#install-help { margin-block: .7rem 1rem; }
.install-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; }
#install-confirm { background: var(--ink); color: var(--paper); }
.site-link { display: inline-flex; align-items: center; min-height: 2.75rem; padding-inline: .45rem; }
.site-link[aria-current="page"] { text-decoration-thickness: .15em; }
.site-link:hover { text-decoration-thickness: .15em; }
.brand { display: inline-flex; align-items: center; gap: .5rem; min-height: 2.75rem; font-size: clamp(.95rem, 3.8vw, 1.1rem); font-weight: 750; text-decoration: none; }
.brand img { width: 1.85rem; height: 1.85rem; flex-shrink: 0; }
.hero {
  position: relative;
  isolation: isolate;
  --hero-divider-height: .875rem;
  min-height: calc(56.25vw + var(--hero-divider-height));
  border-block-end: var(--hero-divider-height) solid #000;
  padding-block-end: 1rem;
}
.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 0 auto;
  aspect-ratio: 16 / 9;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgb(0 0 0 / .48), rgb(0 0 0 / .24) 42%, transparent 98%, var(--ink)),
    url("hero-crosswalk.jpg") center top / 100% auto no-repeat;
}
.hero-photo {
  display: grid;
  align-content: center;
  min-height: clamp(5rem, 11svh, 8rem);
  padding-inline: 1rem;
}
h1, h2, h3, p { margin-block: 0 .65rem; }
h1 { font-size: clamp(2.3rem, 6vw, 4.5rem); line-height: 1.08; letter-spacing: -.05em; }
h2 { font-size: clamp(1.5rem, 4vw, 2.05rem); line-height: 1.2; letter-spacing: -.025em; }
h3 { font-size: 1.19rem; line-height: 1.25; }
.hero .lead { text-align: center; }
.hero-photo h1, #category-title {
  color: var(--paper);
  text-align: center;
  font-size: clamp(2.15rem, 5vw, 4rem);
  font-weight: 850;
  line-height: 1.08;
  letter-spacing: -.05em;
}
.hero-photo h1 { margin-block-end: 0; }
.lead { max-width: 42rem; margin: 0 auto .35rem; color: #fff; text-shadow: 0 1px 5px #000, 0 1px 2px #000; }

form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .75fr) auto;
  align-items: end;
  gap: .45rem .85rem;
  margin-top: .5rem;
  padding: .75rem clamp(.75rem, 2vw, 1rem);
  border-radius: 1rem;
  background:
    linear-gradient(to right, var(--paper) 18%, rgb(255 255 255 / .62)),
    var(--paper) url("category-magnifier.jpg") right 56% / max(24rem, 52%) auto no-repeat;
  color: var(--ink);
}
label { display: block; margin-bottom: .3rem; font-weight: 700; }
input, select, button { font: inherit; color: inherit; }
input:not([type=file]), select, button {
  min-height: 3rem;
  border: 1px solid var(--control);
  border-radius: .55rem;
  background: var(--paper);
  padding: .55rem .75rem;
}
input, select { width: 100%; max-width: 100%; }
input::placeholder { color: var(--muted); opacity: 1; }
button { cursor: pointer; font-weight: 650; }
form button[type="submit"] { background: var(--ink); color: var(--paper); border-color: var(--ink); padding-inline: 1.4rem; }
#distance-note { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: .9rem; }

.distance-input { position: relative; }
#radius { padding-inline-end: 3rem; appearance: textfield; }
#radius::-webkit-inner-spin-button { appearance: none; }
.radius-presets { position: absolute; inset: 0 0 0 auto; z-index: 2; }
.radius-presets summary {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 100%;
  list-style: none;
  border-inline-start: 1px solid var(--control);
  border-radius: 0 .55rem .55rem 0;
  cursor: pointer;
}
.radius-presets summary::-webkit-details-marker { display: none; }
.radius-presets summary:focus-visible { outline-offset: -3px; }
.radius-presets summary:hover, .radius-presets button:hover { background: #eee; }
.radius-presets:not([open]) .radius-options { display: none; }
.radius-options {
  position: absolute;
  inset: calc(100% + .25rem) 0 auto auto;
  display: grid;
  min-width: 8rem;
  max-height: min(15rem, 42svh);
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--control);
  border-radius: .55rem;
  background: var(--paper);
}
.radius-options button { border: 0; border-radius: 0; text-align: start; }
.radius-options button:focus-visible { outline-offset: -3px; }

.directory-section { position: relative; isolation: isolate; background: var(--ink); }
.directory-backdrop {
  position: absolute;
  z-index: -1;
  inset: 0;
  clip-path: inset(0);
  pointer-events: none;
}
.directory-backdrop::before {
  content: "";
  display: block;
  position: fixed;
  inset: -14px;
  filter: blur(7px) brightness(.5);
  background: url("category-neighborhood.jpg") center / cover no-repeat;
}
.content { padding-block: .65rem 1rem; }
#results { scroll-margin-top: 1rem; }
.actions { display: flex; flex-wrap: wrap; gap: .55rem; margin-block: .75rem; }
#status { margin-block: .9rem; color: var(--muted); }
#resource-list { padding: 0; margin: 0; list-style: none; }
.resource-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(9rem, auto);
  align-items: start;
  gap: .25rem 1rem;
  border-top: 1px solid var(--line);
  padding-block: 1rem;
  overflow-wrap: anywhere;
}
#results-title { font-size: clamp(1.4rem, 3.25vw, 1.9rem); }
#results-title, .subsection-title, .resource-main h3, .next-step strong {
  border-block-end: 1px solid var(--line);
  padding-block-end: .35rem;
  margin-block-end: .5rem;
}
.resource-main p:last-child { margin-bottom: 0; }
.resource-item .actions { margin: 0; justify-content: flex-end; }
.resource-source { grid-column: 1 / -1; color: var(--muted); font-size: .9rem; }
.resource-source summary { width: fit-content; display: list-item; min-height: 2.75rem; padding-block: .55rem; cursor: pointer; text-decoration: underline; text-underline-offset: .2em; }
.details { color: var(--muted); font-size: .9rem; }
@media (max-width: 56rem) {
  .resource-item { grid-template-columns: minmax(0, 1fr); gap: .6rem; }
  .resource-item .actions { justify-content: flex-start; }
}
a { color: inherit; text-underline-offset: .2em; }
.actions a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: .4rem .75rem;
  border: 1px solid var(--control);
  border-radius: .5rem;
  background: var(--paper);
  font-weight: 650;
}
.actions a[href^="tel:"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
#finders, .referral { margin-top: 1.5rem; padding: 1.15rem; border: 1px solid var(--line); border-radius: .85rem; background: var(--paper); }
#finders { position: relative; isolation: isolate; }
.finder-backdrop { clip-path: inset(0 round .8rem); }
.finder-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgb(255 255 255 / .79);
}
.referral {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .15rem 1.25rem;
  flex-wrap: wrap;
  margin-top: .75rem;
  padding: .65rem 1rem;
}
.referral h2 { margin-bottom: .15rem; font-size: 1.125rem; }
.referral p { margin-bottom: 0; color: var(--muted); }
.referral a { display: inline-flex; align-items: center; min-height: 2.75rem; font-weight: 650; }
.site-footer { border-top: 1px solid #444; background: var(--ink); color: #e0e0e0; }
.footer-bar { flex-wrap: wrap; padding-block: .35rem; }
.footer-brand { font-weight: 700; }
.footer-bar nav { display: flex; flex-wrap: wrap; gap: 0 .35rem; }
.info-page { display: flex; flex-direction: column; min-height: 100vh; }
.about-content { flex: 1; width: 100%; max-width: 52rem; padding-block: clamp(1.5rem, 5vw, 3.5rem); }
.about-content h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
.about-content section { margin-top: 1.5rem; }
.about-content h2 { font-size: 1.375rem; }
.about-content li + li { margin-top: .5rem; }
.skip { position: absolute; left: 1rem; top: -6rem; z-index: 1; background: white; color: black; padding: .75rem; }
.skip:focus { top: 1rem; }
:focus-visible { outline: 3px solid black; outline-offset: 3px; }
.brand:focus-visible, .site-link:focus-visible { outline-color: white; outline-offset: -2px; }

@media (hover: hover) {
  form button[type="submit"]:hover, .actions a[href^="tel:"]:hover { background: #373737; }
}
@media (max-width: 45rem) {
  form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #search { background: var(--paper); }
  #search button[type="submit"] {
    grid-column: 1 / -1;
    background:
      linear-gradient(to right, rgb(17 17 17 / .45), var(--ink) 68%),
      var(--ink) url("category-magnifier.jpg") left 57% / auto 6.5rem no-repeat;
  }
}
.map-panel {
  margin-top: .5rem;
  padding: .75rem;
  border-radius: .85rem;
  color: var(--ink);
  background: var(--paper);
}
.map-heading { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.map-heading h2 { margin: 0; font-size: 1.2rem; }
#map-help, #map-status { margin-block: .5rem; color: var(--muted); font-size: .9rem; }
#map-status:empty { display: none; }
#area-map { height: clamp(18rem, 39svh, 28rem); background: #ddd; border: 1px solid var(--control); border-radius: .45rem; }
#area-map .leaflet-control-attribution { font-size: .8rem; }
.resource-layout {
  display: grid;
  grid-template-columns: minmax(11rem, 14rem) minmax(0, 1fr);
  background: rgb(255 255 255 / .96);
  border: 1px solid var(--line);
  border-radius: .85rem;
}
.category-rail {
  align-self: start;
  border-inline-end: 1px solid var(--line);
  border-radius: .8rem 0 0 .8rem;
  overflow: hidden;
}
#category-title {
  margin: 0;
  padding: clamp(.85rem, 2.5vw, 1.75rem) 0;
  text-shadow: 0 2px 8px #000;
}
#categories { display: grid; grid-auto-rows: 1fr; }
#category-select { display: none; }
#categories button {
  width: 100%;
  min-height: 2.75rem;
  padding: .5rem 1rem;
  line-height: 1.3;
  border: 0;
  border-block-end: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  text-align: start;
  white-space: normal;
  overflow-wrap: anywhere;
}
#categories button[aria-pressed="true"] {
  background: rgb(0 0 0 / .10);
  color: var(--ink);
  font-weight: 750;
}
#categories button:focus-visible { outline-offset: -4px; }

#categories button:hover:not([aria-pressed="true"]) { background: rgb(0 0 0 / .06); }
@media (forced-colors: active) {
  #categories button[aria-pressed="true"] { text-decoration: underline; }
}
#results { padding: clamp(.85rem, 2.5vw, 1.4rem); min-width: 0; }
@media (max-width: 45rem) {
  .directory-backdrop::before {
    /* Keep the fixed photo's cover scale stable as browser controls retract. */
    bottom: auto;
    height: calc(100vh + 28px);
    height: calc(100lvh + 28px);
  }
  .hero::before {
    aspect-ratio: 32 / 9;
    background-position: center, center 73%;
  }
  .hero-photo {
    min-height: 4.25rem;
    margin-block-end: max(0px, calc(28.125vw - 4.25rem));
  }
  .hero .lead { padding-block-start: .4rem; }
  .hero-photo h1 { font-size: clamp(1.75rem, 8vw, 2.3rem); }
  #area-map { height: clamp(15rem, 65vw, 20rem); }
  .resource-layout { grid-template-columns: minmax(0, 1fr); }
  .category-rail { border-inline-end: 0; border-radius: 0; padding: .85rem; overflow: visible; }
  #categories { display: none; }
  #category-select { display: block; }
}
.map-frame { position: relative; isolation: isolate; margin-top: .5rem; }
.map-crosshair {
  position: absolute;
  z-index: 450;
  top: 50%;
  left: 50%;
  width: 1.5rem;
  height: 1.5rem;
  transform: translate(-50%, -50%);
  pointer-events: none;
  filter: drop-shadow(0 0 2px white);
}
.map-crosshair::before, .map-crosshair::after {
  content: "";
  position: absolute;
  inset: calc(50% - 1px) 0;
  background: #111;
}
.map-crosshair::after { transform: rotate(90deg); }
#area-map { touch-action: none; }

.next-step { border-inline-start: 2px solid var(--ink); padding-inline-start: .75rem; }
.next-step strong { display: block; }

#finders ul { margin-block: .25rem 0; padding-inline-start: 1.3rem; }
#finders li a, #finders .finder-phone {
  display: block;
  min-height: 2.75rem;
  padding-block: .65rem;
  line-height: 1.4;
  font-weight: 650;
  overflow-wrap: anywhere;
}
#job-links .subsection-title { margin-block-start: 1rem; }
#finders #job-support-title:not([hidden]) + #finder-links,
#finders #job-links ul {
  padding-inline-start: 0;
  list-style: none;
}
#job-boards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 1rem;
}
@media (max-width: 45rem) {
  #job-boards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
#job-boards li, #local-jobs li, #job-support-title:not([hidden]) + #finder-links li {
  overflow-wrap: anywhere;
}
.map-crosshair::before, .map-crosshair::after { inset-inline: calc(50% - .65rem); }
.map-frame { overflow: hidden; }
#education-help { margin-block: .9rem 0; }

.map-intro { margin: .35rem 0 0; }

#categories button:last-child { border-block-end: 0; }

#finders + #resource-list:not(:empty) { margin-top: .9rem; }

.resource-phone, .finder-phone { font-weight: 650; }
