/* ===== Borough pages =====
   Shared by /brooklyn/ /manhattan/ /queens/ /bronx/ /staten-island/, which are
   generated by tools/build-borough-pages.js. Loaded after style.css.

   Every rule is scoped under .bp (the <main>), so nothing here can reach the
   site header, the mobile drawer or the footer. */

.bp {
  --bp-green: #1F4B33;
  --bp-green-deep: #173A27;
  --bp-red: #DC2225;
  --bp-red-dark: #B81C1F;
  --bp-red-on-green: #FF7779;
  --bp-cream: #FDF4E7;
  --bp-brown: #241A10;
  --bp-ink: #241A10;
  --bp-muted: rgba(36, 26, 16, 0.68);
  --bp-faint: rgba(36, 26, 16, 0.5);
  --bp-line: rgba(36, 26, 16, 0.12);
  --bp-radius: 10px;
  --pz-accent: #DC2225; /* breadcrumb hover, as on every other content page */
  display: block;
  background: #fff;
  color: var(--bp-ink);
}
.bp *, .bp *::before, .bp *::after { box-sizing: border-box; }

.bp-in { max-width: var(--page-max); margin: 0 auto; padding: 0 24px; }

.bp-sec { padding: 56px 0; scroll-margin-top: var(--topbar-h); }
.bp-sec--cream { background: var(--bp-cream); }
/* Two white sections in a row share their gap instead of doubling it. */
.bp-sec:not(.bp-sec--cream) + .bp-sec:not(.bp-sec--cream) { padding-top: 8px; }

.bp-kicker {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--bp-red);
  margin: 0 0 10px;
}
.bp-h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--bp-green);
  margin: 0;
  text-wrap: balance;
}
.bp-sub { font-size: 0.95rem; line-height: 1.5; color: var(--bp-muted); margin: 6px 0 0; }

.bp-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px 24px;
  flex-wrap: wrap;
  margin: 0 0 22px;
}
.bp-textlink {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--bp-red);
  text-decoration: none;
  white-space: nowrap;
  padding: 8px 0;
}
.bp-textlink:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Buttons: the site's pill language (see /neighborhoods/). */
.bp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease;
}
.bp-btn-solid { background: var(--bp-green); color: #fff; }
.bp-btn-solid:hover { background: var(--bp-green-deep); }
.bp-btn-outline { background: transparent; color: var(--bp-green); border-color: var(--bp-green); }
.bp-btn-outline:hover { background: rgba(31, 75, 51, 0.07); }
.bp-btn:focus-visible,
.bp-chip:focus-visible,
.bp-guide:focus-visible,
.bp-row-link:focus-visible,
.bp-ec-name a:focus-visible { outline: 2px solid var(--bp-green); outline-offset: 3px; }

.bp-sr {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ------------------------------------------------------------------ hero */
.bp-hero { padding: calc(var(--topbar-h) + 18px) 0 48px; }
.bp-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr);
  gap: 40px;
  align-items: stretch;
}
.bp-hero .bc { margin: 0 0 18px; }
.bp-h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.3rem, 5.2vw, 3.6rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  color: var(--bp-green);
  margin: 0 0 18px;
  text-wrap: balance;
}
.bp-lead {
  font-size: 1.18rem;
  line-height: 1.5;
  font-weight: 500;
  color: var(--bp-ink);
  max-width: 38em;
  margin: 0 0 12px;
}
.bp-intro {
  font-size: 0.98rem;
  line-height: 1.65;
  color: var(--bp-muted);
  max-width: 42em;
  margin: 0 0 26px;
}
.bp-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Hero photo: one borough photo beside the intro, cropped to the panel by
   object-fit. Each photo's object-position (set in the config) keeps its
   subject in frame. */
.bp-photo {
  position: relative;
  margin: 0;
  min-height: 300px;
  border-radius: var(--bp-radius);
  overflow: hidden;
  background: var(--bp-brown);
}
.bp-photo img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover; display: block;
}

/* -------------------------------------------------------- Editor's Choice */
.bp-ec-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.bp-ec-grid[data-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 820px; }
.bp-ec-grid[data-count="1"] { grid-template-columns: minmax(0, 1fr); max-width: 640px; }

.bp-ec {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--bp-line);
  border-radius: var(--bp-radius);
  overflow: hidden;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.bp-ec:hover { border-color: rgba(220, 34, 37, 0.45); box-shadow: 0 6px 18px rgba(36, 26, 16, 0.08); }
.bp-ec-photo { height: 168px; background: var(--bp-line); }
.bp-ec-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* Text-only card in a row with a photo: the same height, set in type. */
.bp-ec-band {
  height: 168px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 20px 18px;
  background: var(--bp-green);
  color: var(--bp-cream);
}
.bp-ec:nth-child(3n+2) .bp-ec-band { background: var(--bp-brown); }
.bp-ec:nth-child(3n) .bp-ec-band { background: var(--bp-green-deep); }
.bp-ec-band-where {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(253, 244, 231, 0.78);
}
.bp-ec-band-style {
  margin-top: auto;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.9rem;
  line-height: 1;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
/* The band already says style and neighborhood, so the small line under it
   steps back to screen readers only (the band itself is aria-hidden). */
@media (min-width: 901px) {
  .bp-ec--band .bp-ec-meta {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
}
.bp-ec-body { flex: 1; display: flex; flex-direction: column; padding: 18px 20px 14px; }
.bp-ec-meta {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--bp-red);
  margin: 0 0 6px;
}
.bp-ec-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.22rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}
.bp-ec-name a { color: var(--bp-ink); text-decoration: none; }
/* The whole card is the link; the Passport buttons sit above it. */
.bp-ec-name a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.bp-ec-blurb { font-size: 0.9rem; line-height: 1.55; color: var(--bp-muted); margin: 0 0 16px; }
.bp-ec-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--bp-line);
}
.bp-ec-addr { font-size: 0.8rem; line-height: 1.35; color: var(--bp-faint); margin: 0; min-width: 0; }

/* Passport controls: passport.js fills every [data-pp-for]. By default it
   floats them over a card's corner; here they get their own slot in the row,
   so they can never sit on top of a name or an address. */
.bp-pp { position: relative; z-index: 2; flex-shrink: 0; }
.bp-pp .pp-controls { position: static; }

.bp-ec-more { margin-top: 30px; }
.bp-ec-more-h {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--bp-faint);
  margin: 0 0 10px;
}

/* ----------------------------------------------------------- compact rows */
.bp-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.bp-rows--more { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bp-rows--dir { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.bp-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 0 10px 0 0;
  background: #fff;
  border: 1px solid var(--bp-line);
  border-radius: 8px;
  transition: border-color 0.12s ease;
}
.bp-row:hover { border-color: rgba(220, 34, 37, 0.45); }
.bp-row[hidden] { display: none; }
.bp-row-link {
  flex: 1;
  min-width: 0;
  display: block;
  padding: 11px 0 11px 14px;
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
}
.bp-row-name {
  display: block;
  font-family: var(--font-display-2);
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.3;
  color: var(--bp-ink);
  overflow-wrap: anywhere;
}
.bp-row-meta { display: block; font-size: 0.76rem; line-height: 1.4; color: var(--bp-faint); margin-top: 2px; }
.bp-row-ec {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--bp-red);
  white-space: nowrap;
  margin-left: 4px;
}

/* -------------------------------------------------------------------- map */
.bp-map-card {
  border: 1px solid var(--bp-line);
  border-radius: var(--bp-radius);
  overflow: hidden;
  background: #fff;
}
.bp-map-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-bottom: 1px solid var(--bp-line);
}
.bp-chips { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.bp-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid rgba(36, 26, 16, 0.2);
  background: #fff;
  color: var(--bp-ink);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.bp-chip:hover { border-color: var(--bp-green); }
.bp-chip[aria-pressed="true"] { background: var(--bp-green); border-color: var(--bp-green); color: #fff; }
.bp-chip-n { margin-left: 5px; opacity: 0.6; font-variant-numeric: tabular-nums; }
.bp-map-hint { margin: 0; font-size: 0.8rem; color: var(--bp-faint); }

.bp-map { position: relative; width: 100%; height: 460px; }
.bp-map .maplibregl-ctrl-attrib { font-size: 9px; }

/* Pins and popups: unchanged from the old borough pages. */
.bp .nbhd-pin {
  width: 28px; height: 28px;
  cursor: pointer;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  transition: transform 0.15s ease;
}
.bp .nbhd-pin:hover { transform: scale(1.2); }
.bp .nbhd-pin.selected { transform: scale(1.15); }
.bp .nbhd-pin.selected .nbhd-slice { fill: #FFD500; }
.bp .maplibregl-popup-content {
  padding: 0 !important;
  border-radius: 8px !important;
  overflow: hidden;
  font-family: var(--font-body);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18) !important;
  min-width: 180px;
  max-width: 240px;
}
.bp .nbhd-popup-head {
  background: var(--color-crust, #1F4B33);
  color: #fff;
  padding: 8px 12px;
  font-weight: 700;
  font-size: 0.85rem;
  line-height: 1.25;
}
.bp .nbhd-popup-body { padding: 8px 12px; font-size: 0.78rem; color: #171717; line-height: 1.4; }
.bp .nbhd-popup-style {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 20px;
  background: rgba(23, 23, 23, 0.08);
  margin-bottom: 4px;
}
.bp .nbhd-popup-link {
  display: block;
  margin-top: 6px;
  font-size: 0.75rem;
  color: #DC2225;
  font-weight: 600;
  text-decoration: none;
}
.bp .nbhd-popup-link:hover { text-decoration: underline; }

/* ------------------------------------------------------ neighborhood guides */
.bp-guide-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.bp-guide-grid[data-count="2"],
.bp-guide-grid[data-count="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bp-guide-grid[data-count="1"] { grid-template-columns: minmax(0, 560px); }

.bp-guide {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 150px;
  padding: 22px 24px 20px;
  border-radius: var(--bp-radius);
  background: var(--bp-green);
  color: var(--bp-cream);
  text-decoration: none;
  transition: background-color 0.12s ease;
}
.bp-guide:nth-child(even) { background: var(--bp-green-deep); }
.bp-guide:hover { background: #12301F; }
.bp-guide-name {
  margin-top: auto;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.45rem;
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: #fff;
}
.bp-guide-desc { font-size: 0.88rem; line-height: 1.45; color: rgba(253, 244, 231, 0.8); }
.bp-guide-cta {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--bp-red-on-green);
}
.bp-guide:hover .bp-guide-cta { text-decoration: underline; text-underline-offset: 3px; }

.bp-crawls { margin: 18px 0 0; font-size: 0.92rem; line-height: 1.55; color: var(--bp-muted); }
.bp-crawls a { color: var(--bp-red); font-weight: 600; }

/* -------------------------------------------------------------- directory */
.bp-dir-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px 32px;
  flex-wrap: wrap;
}
.bp-when-open { display: none; }
[aria-expanded="true"] > .bp-when-open { display: inline; }
[aria-expanded="true"] > .bp-when-closed { display: none; }

.bp-dir-panel { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--bp-line); }
.bp-dir-tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin: 0 0 10px; }
.bp-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; flex: 0 1 200px; }
.bp-field--grow { flex: 1 1 240px; }
.bp-field-label {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--bp-muted);
}
.bp-field input,
.bp-field select {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid rgba(36, 26, 16, 0.25);
  border-radius: 8px;
  background: #fff;
  color: var(--bp-ink);
  font: inherit;
  font-size: 16px; /* 16px stops iOS zooming the page on focus */
}
.bp-field input:focus-visible,
.bp-field select:focus-visible { outline: 2px solid var(--bp-green); outline-offset: 1px; border-color: var(--bp-green); }
.bp-dir-count {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--bp-muted);
  margin: 0 0 12px;
}
.bp-dir-empty { font-size: 0.92rem; color: var(--bp-muted); margin: 8px 0 0; }
.bp-linkbtn {
  padding: 0; border: 0; background: none; cursor: pointer;
  font: inherit; color: var(--bp-red); font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px;
}
.bp-dir-foot { display: flex; justify-content: center; margin-top: 22px; }

/* ----------------------------------------------------------------- tablet */
@media (max-width: 900px) {
  .bp-hero-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .bp-photo { min-height: 0; aspect-ratio: 4 / 3; }
  .bp-ec-grid,
  .bp-ec-grid[data-count="2"] { grid-template-columns: minmax(0, 1fr); max-width: 640px; }
  .bp-ec-band { display: none; } /* stacked cards have no row to match */
  .bp-guide-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ----------------------------------------------------------------- phone */
@media (max-width: 600px) {
  .bp-in { padding: 0 16px; }
  .bp-hero { padding-bottom: 32px; }
  .bp-hero .bc { margin-bottom: 14px; }
  .bp-h1 { font-size: clamp(2rem, 9.5vw, 2.5rem); margin-bottom: 14px; }
  .bp-lead { font-size: 1.05rem; }
  .bp-intro { font-size: 0.94rem; margin-bottom: 20px; }
  .bp-actions .bp-btn { flex: 1 1 0; padding-left: 14px; padding-right: 14px; }
  .bp-sec { padding: 40px 0; }
  .bp-head { margin-bottom: 18px; }
  .bp-ec-photo { height: 150px; }
  .bp-ec-body { padding: 16px 16px 12px; }
  .bp-rows--more,
  .bp-rows--dir { grid-template-columns: minmax(0, 1fr); }
  .bp-map { height: 380px; }
  .bp-map-bar { padding: 10px; }
  .bp-guide-grid,
  .bp-guide-grid[data-count] { grid-template-columns: minmax(0, 1fr); }
  .bp-guide { min-height: 0; padding: 20px; }
  .bp-guide-name { font-size: 1.3rem; }
  .bp-field,
  .bp-field--grow { flex: 1 1 100%; }
  .bp-dir-cta .bp-btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .bp-btn, .bp-chip, .bp-ec, .bp-row, .bp-guide, .bp .nbhd-pin { transition: none; }
}
