/* ==========================================================================
   Local Resources directory — "neighborhood field guide" design system.
   Scoped under .res-page so it owns the content world without fighting the
   site's (dark) header/footer chrome. Map-first, warm, oriented for a stressed
   human looking for help right now.
   Palette: pine (structure) · meadow (go/open) · clay (the one accent) · paper.
   Type: Bricolage Grotesque (display, bulletin-board voice) + Hanken Grotesk (body).
   ========================================================================== */

.res-page {
  --pine:   #16352a;   /* deep green — structural frames, map border, bands */
  --meadow: #2f7d4f;   /* mid green — links, "open now", go */
  --clay:   #d4822e;   /* harvest amber — THE accent: primary CTA, markers */
  --clay-d: #b76a1d;
  --paper:  #faf6ee;   /* warm page ground */
  --card:   #ffffff;
  --ink:    #20271f;   /* warm near-black body text */
  --muted:  #5c6b5a;   /* secondary text */
  --line:   #e3ddcf;   /* hairline on paper */
  --mist:   #eef2e8;   /* pale green surface */

  background: var(--paper);
  color: var(--ink);
  font-family: 'Hanken Grotesk', system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
.res-page * { box-sizing: border-box; }
/* Only style bare prose links green — classed link components (.res-row__name,
   .res-btn, .res-citycard, .res-savebtn…) keep their own colors instead of being
   forced green (which made names unreadable on the pale-green row hover). */
.res-page a:not([class]) { color: var(--meadow); }
/* Content headings dark on light surfaces — overrides the marketing site's global
   (light) h2/h3 from seo-pages.css, which otherwise renders near-white on white. */
.res-page h2, .res-page h3 { color: var(--pine); }
.res-hero .res-title { color: #fff; }
.res-band--pine h2, .res-band--pine h3 { color: #f0ead9; }

.res-wrap { max-width: 1140px; margin: 0 auto; padding: 0 20px; }

/* ---- Hero / orientation header -------------------------------------------- */
.res-hero {
  background:
    radial-gradient(120% 140% at 85% -20%, rgba(212,130,46,.16), transparent 55%),
    var(--pine);
  color: #f3efe4;
  padding: 44px 0 38px;
  position: relative;
  overflow: hidden;
}
.res-hero::after { /* topographic-ish baseline rule, like a county map edge */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px;
  background: repeating-linear-gradient(90deg, var(--clay) 0 22px, transparent 22px 40px);
  opacity: .9;
}
.res-eyebrow {
  font-size: .8rem; letter-spacing: .14em; text-transform: uppercase;
  font-weight: 600; color: #c9b79a; margin: 0 0 10px;
}
.res-title {
  font-family: 'Bricolage Grotesque', 'Hanken Grotesk', sans-serif;
  font-weight: 700; font-size: clamp(2rem, 4.6vw, 3.1rem); line-height: 1.02;
  letter-spacing: -.02em; margin: 0 0 12px; color: #fff;
}
.res-lede { font-size: 1.15rem; max-width: 44ch; margin: 0 0 18px; color: #e7e1d3; }
.res-chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.res-chip {
  font-size: .82rem; font-weight: 600; padding: 5px 12px; border-radius: 999px;
  background: rgba(255,255,255,.1); color: #f0ead9; border: 1px solid rgba(255,255,255,.14);
}
.res-chip--live { background: var(--clay); color: #2a1a06; border-color: transparent; }
.res-orglink { margin: 12px 0 0; font-size: .95rem; }
.res-orglink a { color: #f0c89a; text-decoration: underline; }
.res-hero--photo { min-height: 300px; display: flex; flex-direction: column; justify-content: center; }
.res-photocredit { position: absolute; bottom: 9px; right: 14px; font-size: .68rem; color: rgba(255,255,255,.55); }

/* ---- Org gallery ---------------------------------------------------------- */
.res-gallery { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr);
  gap: 12px; margin: 22px 0 0; overflow-x: auto; padding-bottom: 4px; scroll-snap-type: x proximity; }
.res-gallery img { width: 100%; height: 170px; object-fit: cover; border-radius: 14px;
  border: 1px solid var(--line); scroll-snap-align: start; background: var(--mist); }
@media (max-width: 600px) { .res-gallery { grid-auto-columns: 78%; } }

/* ---- Info grid ("what to bring / how it works") --------------------------- */
.res-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.res-info-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 22px 24px; }
.res-info-card h3 { font-family: 'Bricolage Grotesque', sans-serif; margin: 0 0 12px; font-size: 1.2rem; }
.res-info-card ul, .res-info-card ol { margin: 0; padding-left: 1.2em; }
.res-info-card li { margin: 7px 0; }
.res-info-note { margin: 14px 0 0; padding: 12px 14px; background: var(--mist); border-radius: 10px; font-size: .92rem; }
@media (max-width: 860px) { .res-info-grid { grid-template-columns: 1fr; } }

/* ---- Map + list split (the signature) ------------------------------------- */
.res-split { display: grid; grid-template-columns: 1.05fr .95fr; gap: 0; margin: 26px 0 0;
  border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--card);
  box-shadow: 0 18px 40px -28px rgba(22,53,42,.5); }
.res-map { min-height: 520px; height: 100%; background: var(--mist); }
.res-map .leaflet-container { height: 100%; min-height: 520px; font-family: inherit; }
.res-listpane { max-height: 600px; overflow-y: auto; border-left: 1px solid var(--line); }
.res-listpane__head {
  position: sticky; top: 0; z-index: 2; background: var(--card);
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.res-listpane__count { font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.res-filter { display: inline-flex; background: var(--mist); border-radius: 999px; padding: 3px; gap: 2px; }
.res-filter__btn {
  border: 0; background: transparent; cursor: pointer; font: 600 .84rem 'Hanken Grotesk', sans-serif;
  color: var(--muted); padding: 6px 13px; border-radius: 999px; white-space: nowrap;
}
.res-filter__btn.is-on { background: var(--pine); color: #fff; }
.res-badge--soon { background: rgba(212,130,46,.12); color: var(--clay-d); }
.res-empty { padding: 24px 18px; color: var(--muted); font-size: .95rem; }
.res-linkbtn { border: 0; background: none; color: var(--meadow); font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; }
.res-row[hidden] { display: none; }
.res-row {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px;
  border-bottom: 1px solid var(--line); cursor: pointer; transition: background .12s ease; position: relative;
}
.res-row__thumb { width: 66px; height: 66px; border-radius: 10px; object-fit: cover; flex: none;
  background: var(--mist); border: 1px solid var(--line); }
/* Branded placeholder thumb (no photo yet): gradient tile + the name's initial.
   Pure CSS, zero image requests — replaces the per-view Mapbox/Street-View thumbs. */
.res-thumb--ph { display: flex; align-items: center; justify-content: center; box-sizing: border-box;
  background: linear-gradient(135deg, var(--pine), var(--meadow)); border-color: transparent;
  color: #fff; font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700; font-size: 1.6rem; line-height: 1; }
.res-row__body { min-width: 0; flex: 1; }
.res-row:hover, .res-row.is-active { background: var(--mist); }
.res-row.is-active::before { content:""; position:absolute; left:0; top:0; bottom:0; width:4px; background:var(--clay); }
/* .res-page prefix beats the broad `.res-page a` green so names stay dark + readable,
   including on the pale-green row hover. */
.res-page .res-row__name { font-weight: 700; font-size: 1.05rem; color: var(--ink); text-decoration: none; }
/* Stretched link: make the whole row clickable (the row already shows cursor:pointer),
   not just the name. Overlay covers the row; no JS, WebView-safe. */
.res-page .res-row__name::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.res-page .res-row__name:hover, .res-row:hover .res-row__name, .res-row.is-active .res-row__name { color: var(--clay-d); }
.res-row__meta { color: var(--muted); font-size: .9rem; margin: 3px 0 0; }
.res-row__hours { font-size: .9rem; margin: 4px 0 0; }
/* Eligibility chips on listing rows ("do I qualify?" at a glance). */
.res-elig { margin: 7px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.res-chip { display: inline-flex; align-items: center; font-size: .72rem; font-weight: 600;
  padding: 2px 9px; border-radius: 999px; line-height: 1.6; white-space: nowrap; }
.res-chip--id { background: rgba(211,130,46,.16); color: var(--clay-d); }
.res-chip--area { background: rgba(22,53,42,.09); color: var(--pine); }
.res-chip--appt { background: rgba(127,127,127,.14); color: var(--muted); }
/* "Who qualifies & what to bring" block on the place page. */
.res-qualify { margin: 22px 0 0; padding: 16px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--mist); }
.res-qualify .res-h2 { margin: 0 0 6px; }
.res-qual { margin: 0; }
.res-qual > div { display: grid; grid-template-columns: 116px 1fr; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.res-qual > div:first-of-type { border-top: 0; }
.res-qual dt { font-weight: 700; color: var(--pine); font-size: .92rem; }
.res-qual dd { margin: 0; color: var(--ink); }
.res-qual__hint { display: block; color: var(--muted); font-size: .85rem; margin-top: 2px; }
.res-qual-src { margin: 13px 0 0; font-style: italic; color: var(--muted); font-size: .92rem; }
.res-qual-note { margin: 8px 0 0; font-size: .85rem; color: var(--muted); }
.res-badge {
  display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .03em;
  text-transform: uppercase; padding: 2px 8px; border-radius: 6px; vertical-align: 2px;
}
.res-badge--open  { background: rgba(47,125,79,.14); color: var(--meadow); }
.res-badge--closed{ background: rgba(92,107,90,.14); color: var(--muted); }
.res-badge--mobile{ background: rgba(212,130,46,.16); color: var(--clay-d); }

/* Leaflet popup — force dark text (the site's global light `strong` makes the
   pantry name invisible on the white popup otherwise). */
.res-page .leaflet-popup-content { color: var(--ink); font-family: 'Hanken Grotesk', sans-serif; margin: 9px 14px; }
.res-page .leaflet-popup-content strong { color: var(--pine); font-family: 'Bricolage Grotesque', sans-serif; }
.res-page .leaflet-popup-content-wrapper { border-radius: 10px; }

/* leaflet marker number bubble */
.res-pin {
  background: var(--clay); color: #2a1a06; font-weight: 800; font-size: 13px;
  width: 26px; height: 26px; border-radius: 50% 50% 50% 2px; transform: rotate(45deg);
  display: grid; place-items: center; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3);
}
.res-pin > span { transform: rotate(-45deg); }
.res-pin.is-active { background: var(--pine); color: #fff; }

/* ---- Section bands (the "better delimiters") ------------------------------ */
.res-band { padding: 40px 0; margin-top: 40px; }
.res-band--mist  { background: var(--mist); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.res-band--clay  { background: linear-gradient(180deg, #f6ede0, #f3e6d3); border-top: 3px solid var(--clay); }
.res-band--pine  { background: var(--pine); color: #f0ead9; }
.res-band h2 {
  font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700;
  font-size: clamp(1.5rem, 3vw, 2.1rem); letter-spacing: -.01em; margin: 0 0 8px;
}
.res-band p.sub { color: var(--muted); margin: 0 0 18px; max-width: 52ch; }
.res-band--pine p.sub { color: #cfc8b6; }

.res-btn {
  display: inline-block; background: var(--clay); color: #2a1a06; font-weight: 700;
  text-decoration: none; padding: 12px 22px; border-radius: 10px; border: 0; cursor: pointer;
  font-size: 1rem; transition: background .15s ease, transform .05s ease;
}
.res-btn:hover { background: var(--clay-d); color: #2a1a06; }
.res-btn:active { transform: translateY(1px); }
.res-btn--ghost { background: transparent; border: 1.5px solid currentColor; color: inherit; }

/* ---- Rich detail cards (below the map, full info) ------------------------- */
.res-detail-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(330px,1fr)); }
.res-dcard {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px;
  border-top: 4px solid var(--meadow);
}
.res-dcard--mobile { border-top-color: var(--clay); }
.res-dcard h3 { font-family:'Bricolage Grotesque',sans-serif; margin: 0 0 4px; font-size: 1.18rem; }
.res-dcard h3 a { color: var(--ink); text-decoration: none; }
.res-dcard h3 a:hover { color: var(--meadow); }
.res-dcard .addr { color: var(--muted); font-size: .92rem; margin: 0 0 10px; }
.res-dcard .hours { font-size: .95rem; margin: 0 0 10px; }
.res-tags { margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.res-tag { font-size: .76rem; padding: 3px 10px; border-radius: 999px; background: var(--mist); color: var(--meadow); }
.res-callahead { font-size: .82rem; color: var(--muted); margin: 12px 0 0; display: flex; align-items: center; gap: 6px; }

/* ---- Neighbor Notes ------------------------------------------------------- */
.res-notes { display: grid; gap: 14px; margin: 18px 0 0; }
.res-note { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px;
  border-left: 4px solid var(--clay); }
.res-note__body { margin: 0; }
.res-note__by { font-size: .82rem; color: var(--muted); margin: 6px 0 0; }
.res-noteform { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; max-width: 560px; }
.res-noteform label { display: block; font-weight: 600; font-size: .9rem; margin: 0 0 6px; }
.res-noteform textarea, .res-noteform input {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  font: inherit; background: var(--paper); margin-bottom: 12px; }
.res-noteform textarea { min-height: 92px; resize: vertical; }
.res-formmsg { font-size: .9rem; margin: 6px 0 0; }

/* ---- FAQ ------------------------------------------------------------------ */
.res-faq details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.res-faq summary { font-weight: 700; cursor: pointer; font-family: 'Bricolage Grotesque', sans-serif; }
.res-faq summary::-webkit-details-marker { color: var(--clay); }
.res-faq p { margin: 10px 0 0; color: var(--muted); }

/* ---- Volunteer bridge ----------------------------------------------------- */
.res-bridge { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--mist); border: 1px solid var(--line); border-radius: 14px; padding: 16px 20px; margin: 18px 0; }

/* ---- Pillar: city index --------------------------------------------------- */
.res-near-me { margin: 0 0 20px; }
.res-citygrid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); }
/* plain card (hub type grid) */
.res-citycard { display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
  text-decoration: none; color: var(--ink); transition: border-color .12s, transform .05s; }
.res-citycard:hover { border-color: var(--clay); transform: translateY(-1px); }
.res-citycard .n { font-weight: 700; }
.res-citycard .c { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
/* photo card (pillar city grid) — Unsplash city photo with a label overlay */
.res-citycard--photo { position: relative; display: block; height: 168px; padding: 0; border-radius: 14px;
  overflow: hidden; border: 1px solid var(--line); }
.res-citycard--photo.is-blank { background: linear-gradient(135deg, var(--pine), var(--meadow)); }
.res-citycard__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: transform .3s ease; }
.res-citycard--photo:hover { transform: none; border-color: var(--clay); }
.res-citycard--photo:hover .res-citycard__img { transform: scale(1.05); }
.res-citycard__label { position: absolute; left: 0; right: 0; bottom: 0; padding: 44px 16px 14px;
  display: flex; flex-direction: column; gap: 2px; color: #fff;
  background: linear-gradient(to top, rgba(12,28,21,.97) 8%, rgba(12,28,21,.78) 42%, rgba(12,28,21,.25) 72%, transparent); }
.res-citycard__label .n { color: #fff; font-weight: 700; font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1.15rem; line-height: 1.15; text-shadow: 0 1px 4px rgba(0,0,0,.7); }
.res-citycard__label .c { color: #fff; font-size: .98rem; font-weight: 600; opacity: 1;
  font-variant-numeric: tabular-nums; text-shadow: 0 1px 4px rgba(0,0,0,.7); }

.res-section { padding: 36px 0; }
.res-section > h2 { font-family:'Bricolage Grotesque',sans-serif; font-size: clamp(1.4rem,2.6vw,1.9rem);
  letter-spacing:-.01em; margin: 0 0 16px; }

/* ---- Place page ----------------------------------------------------------- */
.res-hero--place .res-lede { max-width: 60ch; }
.res-place-grid { display: grid; grid-template-columns: 1fr 340px; gap: 28px; margin: 28px 0 0; align-items: start; }
.res-place-main { min-width: 0; }
.res-h2 { font-family:'Bricolage Grotesque',sans-serif; font-size: 1.25rem; margin: 26px 0 12px; }
.res-place-photo { margin: 0 0 18px; }
.res-place-photo img { width: 100%; max-height: 260px; object-fit: cover; border-radius: 14px; border: 1px solid var(--line); display: block; }
.res-place-photo figcaption { font-size: .72rem; color: var(--muted); margin-top: 5px; }
.res-facts { margin: 0; }
.res-facts > div { display: grid; grid-template-columns: 120px 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.res-facts dt { font-weight: 700; color: var(--muted); font-size: .9rem; margin: 0; }
.res-facts dd { margin: 0; }

.res-weekstrip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.res-weekday { border: 1px solid var(--line); border-radius: 10px; padding: 10px 6px; text-align: center; background: var(--card); }
.res-weekday .d { display: block; font-weight: 700; font-size: .8rem; color: var(--muted); }
.res-weekday .t { display: block; font-size: .72rem; margin-top: 4px; line-height: 1.3; }
.res-weekday.is-open { background: rgba(47,125,79,.08); border-color: rgba(47,125,79,.3); }
.res-weekday.is-open .t { color: var(--meadow); font-weight: 600; }
.res-weekday.is-closed .t { color: var(--muted); opacity: .6; }
.res-weekday.is-today { outline: 2px solid var(--clay); outline-offset: 1px; }

.res-occlist { list-style: none; padding: 0; margin: 12px 0 0; }
.res-occlist li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .95rem; }
#res-calendar { margin: 8px 0 4px; --fc-border-color: var(--line); --fc-today-bg-color: rgba(212,130,46,.08); font-size: .85rem; }

/* ---- Save kit ------------------------------------------------------------- */
.res-place-side { position: sticky; top: 16px; display: grid; gap: 14px; }
.res-placemap { height: 220px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--mist); }
.res-placemap .leaflet-container { height: 100%; }
.res-btn--block { display: block; text-align: center; }
.res-savekit { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px; border-top: 4px solid var(--clay); }
.res-savekit h3 { font-family:'Bricolage Grotesque',sans-serif; margin: 0 0 2px; font-size: 1.1rem; }
.res-save-sub { color: var(--muted); font-size: .85rem; margin: 0 0 12px; }
.res-save-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.res-savebtn { display: block; text-align: center; text-decoration: none; cursor: pointer;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 10px;
  padding: 10px 8px; font: 600 .9rem 'Hanken Grotesk', sans-serif; }
.res-savebtn:hover { border-color: var(--clay); color: var(--clay-d); }
.res-qr { display: flex; justify-content: center; margin: 14px 0 6px; }
.res-qr img, .res-qr canvas { border: 6px solid #fff; border-radius: 8px; }
.res-save-link { text-align: center; font-size: .82rem; color: var(--muted); margin: 0; word-break: break-all; }

@media (max-width: 860px) {
  .res-place-grid { grid-template-columns: 1fr; }
  .res-place-side { position: static; }
  .res-facts > div { grid-template-columns: 1fr; gap: 2px; }
  .res-weekstrip { grid-template-columns: repeat(4, 1fr); }
}

/* ---- Responsive ----------------------------------------------------------- */
@media (max-width: 860px) {
  .res-split { grid-template-columns: 1fr; }
  .res-map { min-height: 340px; }
  .res-map .leaflet-container { min-height: 340px; }
  .res-listpane { border-left: 0; border-top: 1px solid var(--line); max-height: none; }
  .res-bridge { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .res-row, .res-citycard, .res-btn { transition: none; }
}
