/*
 * planning-areas.css: GH #4570, the CVSDH planning-area pages.
 *
 * WHY its own file: only a brand with planning areas (CVSDH) links it (the nav, on
 * every page of that brand), so the other four brands load none of it. That is also
 * why the brand palette and fonts below may sit on :root and body: they reach CVSDH
 * pages only. Plain CSS (no Bootstrap additions), mobile first: base rules are the
 * phone layout and min-width blocks widen them. Class names are the ones
 * views/planning_area_fragments.go, planning_area_svg.go and the CVSDH home renderer
 * write.
 *
 * WHY these tokens (GH #4570, mockup v2 2026-11-28, from the owner's pick of the
 * watercolor map, option A): warm paper with navy, matching the map; Cormorant
 * Garamond italic for headings, logo and map labels, and Inter for the body (both
 * linked with this file), the system sans standing in until Inter loads. Spacing in
 * 4px steps.
 */
:root {
  --pa-bg: #faf6ee;
  --pa-panel: #ffffff;
  --pa-ink: #2a2219;
  --pa-muted: #7d6b4f;
  --pa-line: #e8dfcf;
  --pa-accent: #1f3a5f;
  --pa-gold: #b8893a;
  --pa-price: #2f5d3a;
  --pa-serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --pa-sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}
body {
  background: var(--pa-bg);
  color: var(--pa-ink);
  font-family: var(--pa-sans);
}
a {
  color: var(--pa-accent);
}

/* The logo is the region's name in the italic serif (nav, mockup v2). */
.pa-logo {
  display: inline-block;
  padding: 8px 0;
  font: italic 600 26px/1.1 var(--pa-serif);
  color: var(--pa-accent);
  white-space: nowrap;
}
.logo-wrapper a:hover .pa-logo,
.logo-wrapper a:focus .pa-logo {
  text-decoration: underline;
}

.pa-home-head,
.pa-landing-head,
.pa-quick-search,
.pa-areas,
.pa-picker,
.pa-below {
  font-size: 15px;
  line-height: 1.45;
}
.pa-title {
  font: italic 600 30px/1.1 var(--pa-serif);
  color: var(--pa-accent);
  margin: 0 0 6px;
}
.pa-stats {
  margin: 0 0 10px;
  font-weight: 600;
  color: var(--pa-muted);
}
.pa-summary {
  margin: 0 0 14px;
  max-width: 68ch;
  font-size: 14px;
}
.pa-summary cite {
  font-style: normal;
  font-size: 12px;
}
.pa-summary cite a {
  color: var(--pa-muted);
}

/* The map box: the inline SVG fits it whole (preserveAspectRatio meet); the paper
   colour fills any letterbox so the map reads edge to edge. */
#pa-map {
  position: relative;
  width: 100%;
  height: 340px;
  background: #f7f1e6;
  overflow: hidden;
}
.pa-svg {
  display: block;
  width: 100%;
  height: 100%;
}
/* GH #4570 (owner 2026-11-28: option A "Watercolor"): the reviewed option's palette
   and strokes. Areas are washes (fill set per area by planning_area_svg.go) with a
   soft ink edge. On a landing page (mockup v2) the page's own area is outlined in navy
   and the others dim. */
.pa-shape {
  fill-rule: evenodd;
  fill-opacity: 0.8;
  stroke: #6d5a3f;
  stroke-opacity: 0.55;
  stroke-width: 2;
}
.pa-svg-focus .pa-shape {
  fill-opacity: 0.45;
}
.pa-svg-focus .pa-shape.pa-current {
  fill-opacity: 0.8;
  stroke: var(--pa-accent);
  stroke-opacity: 0.9;
  stroke-width: 4;
}
/* Hover, keyboard focus and the card-to-map sync (.pa-hot) brighten the area. WHY on
   the link: the path's own filter is the wash, which a CSS filter would replace. */
.pa-svg a {
  cursor: pointer;
  transition: filter 0.15s;
}
.pa-svg a:hover,
.pa-svg a:focus,
.pa-svg a.pa-hot {
  filter: brightness(1.07);
}
.pa-svg a:focus {
  outline: none;
}
.pa-svg a:focus-visible .pa-shape {
  stroke: #3b2f22;
  stroke-opacity: 1;
  stroke-width: 5;
}
/* Neighbour slices: a faint wash with a dashed edge; Rancho Bernardo dotted, no fill
   (owner: "add Rancho Bernardo as a dotted-line"). The fade mask hides the far side. */
.pa-slice {
  fill: #e9e0cf;
  stroke: #bfae8f;
  stroke-width: 1.2;
  stroke-dasharray: 6 5;
  opacity: 0.8;
}
.pa-slice.pa-slice-dotted {
  fill: none;
  stroke-dasharray: 1 5;
  stroke-linecap: round;
}
/* Labels: the italic serif with a paper halo, the "N from $pK" line in a small sans. */
.pa-area-label,
.pa-slice-label {
  font-family: var(--pa-serif);
  font-style: italic;
  font-weight: 500;
  fill: #3b2f22;
  paint-order: stroke;
  stroke: rgba(247, 241, 230, 0.8);
  stroke-width: 5px;
  stroke-linejoin: round;
}
/* An area label is never a pointer target: the area's shape under it is the link. */
.pa-area-label {
  pointer-events: none;
}
/* A neighbour label is its own link (GH #4570 mockup v2, owner: "Make the surroundings
   clickable"), so it takes the pointer. */
.pa-slice-label {
  font-size: 32px;
  fill: #7d6b4f;
  letter-spacing: 0.02em;
  stroke-width: 6px;
  pointer-events: auto;
}
/* GH #4570 mockup v2: a neighbour slice or label opens that neighbourhood's search. */
.pa-nb {
  cursor: pointer;
}
/* WHY all: the dotted slice's fill is none, so without it only its stroke is hit. */
.pa-slice.pa-slice-dotted {
  pointer-events: all;
}
/* Hover, keyboard focus and the slice-label sync (.pa-hot) darken the slice as in the
   mockup, and turn its label navy; the .pa-stat line keeps its own fill. */
.pa-nb:hover .pa-slice,
.pa-nb:focus-visible .pa-slice,
.pa-nb.pa-hot .pa-slice {
  opacity: 1;
  fill: #e2d4b8;
}
.pa-nb:hover .pa-slice-label,
.pa-nb.pa-hot .pa-slice-label {
  fill: var(--pa-accent);
}
/* WHY: the area brightness rule above targets every map link; a neighbour darkens
   instead, so it must not also brighten. */
.pa-svg a.pa-nb:hover,
.pa-svg a.pa-nb:focus,
.pa-svg a.pa-nb.pa-hot {
  filter: none;
}
.pa-area-label .pa-stat,
.pa-slice-label .pa-stat {
  font-family: var(--pa-sans);
  font-style: normal;
  font-weight: 600;
  fill: #6d5a3f;
}
.pa-slice-label .pa-stat {
  font-size: 17px;
  fill: #8f7d60;
}
/* The paper grain overlays the whole map; clicks pass through to the links below. */
.pa-paper {
  pointer-events: none;
}
/* GH #4570 mockup v2 (page.tpl.html .pin): a listing pin is a gold dot with a white
   ring, grown from r 8 to 12 while its result card is hovered (.pa-hot, set by
   planning-area-map.js). WHY no pointer events: a pin is not a link, and the area link
   under it must stay clickable. */
.pa-pin {
  fill: var(--pa-gold);
  stroke: #ffffff;
  stroke-width: 2.5;
  pointer-events: none;
  transition: r 0.15s;
}
.pa-pin.pa-hot {
  r: 12px;
}

/* Home: the search row under the H1 (mockup v2); its extra fields sit behind "More
   filters". */
.pa-home-head {
  padding-top: 20px;
}
/* The home sub-line is regular weight (mockup v2 page.tpl.html sets 400 on it). */
.pa-home-head .pa-stats {
  font-weight: 400;
}
.pa-quick-search {
  margin: 0 0 18px;
}
.pa-search {
  display: flex;
  gap: 8px;
  max-width: 560px;
}
.pa-search input {
  flex: 1 1 auto;
  min-width: 0;
  height: 44px;
  padding: 10px;
  border: 1px solid var(--pa-line);
  border-radius: 6px;
  background: var(--pa-panel);
  box-shadow: none;
}
.pa-search-go {
  min-height: 44px;
  padding: 10px 16px;
  border: 0;
  border-radius: 6px;
  background: var(--pa-accent);
  color: #ffffff;
  font-weight: 600;
}
.pa-search-go:hover,
.pa-search-go:focus {
  background: #16304f;
  color: #ffffff;
}
.pa-more {
  margin: 8px 0 0;
}
.pa-more > summary {
  display: inline-block;
  min-height: 44px;
  padding: 12px 0;
  cursor: pointer;
  color: var(--pa-accent);
}
.pa-section-title {
  font: italic 600 22px/1.2 var(--pa-serif);
  color: var(--pa-accent);
  margin: 0 0 12px;
}

/* Area cards (mockup v2): white panels on the paper, the name in the italic serif,
   the "N from $pK" line, a one-line teaser. */
.pa-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  padding: 0;
  margin: 0 0 24px;
  list-style: none;
}
/* WHY min-width 0: a grid item defaults to its content's width, and the one-line
   teaser would otherwise stretch every column past the container. */
.pa-card {
  min-width: 0;
}
.pa-card a {
  display: block;
  height: 100%;
  min-height: 44px;
  padding: 14px;
  background: var(--pa-panel);
  border: 1px solid var(--pa-line);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
}
.pa-card-name {
  margin: 0 0 4px;
  font: italic 600 21px/1.2 var(--pa-serif);
  color: var(--pa-accent);
}
/* GH #4570: the card's "N from $pK" line, the map label's figure. */
.pa-card-stat {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--pa-ink);
}
.pa-card-summary {
  display: block;
  font-size: 13px;
  color: var(--pa-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pa-card a:hover,
.pa-card a:focus,
.pa-card.pa-hot a {
  outline: 2px solid var(--pa-gold);
}

/* Chips: one row that wraps (mockup v2), each a pill with its "N from $pK". */
.pa-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 16px;
  padding: 0;
}
.pa-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  margin: 0;
  padding: 5px 11px;
  background: var(--pa-panel);
  border: 1px solid var(--pa-line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: normal;
  color: var(--pa-ink);
  white-space: nowrap;
  text-decoration: none;
}
.pa-chip:hover,
.pa-chip:focus {
  border-color: var(--pa-accent);
  text-decoration: none;
}
/* Picker toggle chips: the real checkbox stays focusable but is drawn as the chip. */
.pa-picker fieldset {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0 8px;
  margin: 0 0 16px;
  padding: 0;
  border: 0;
  min-width: 0;
}
.pa-picker .pa-chips {
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
}
.pa-picker legend {
  flex: 0 0 100%;
  font-size: 12px;
  font-weight: bold;
  border: 0;
  margin: 0 0 4px;
  color: var(--pa-muted);
}
.pa-toggle {
  position: relative;
  cursor: pointer;
}
.pa-toggle input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.pa-toggle:has(input:checked),
.pa-chip.pa-chip-on {
  background: var(--pa-accent);
  border-color: var(--pa-accent);
  color: #ffffff;
}
.pa-toggle:has(input:focus-visible) {
  outline: 2px solid var(--pa-ink);
  outline-offset: 2px;
}
/* A chip's "N from $pK", quieter than the name. */
.pa-chip-count {
  margin-left: 6px;
  color: inherit;
  opacity: 0.7;
}
.pa-area-nav .pa-chips {
  margin: 0 0 16px;
}
.pa-chip-go {
  flex: 0 0 auto;
  min-height: 32px;
  border: 0;
  border-radius: 999px;
  background: var(--pa-accent);
  color: #ffffff;
}
/* GH #4570: an empty landing page's honest empty state (the mockup's dashed box). */
.pa-empty {
  margin: 16px 0;
  padding: 28px;
  border: 1px dashed var(--pa-line);
  border-radius: 8px;
  text-align: center;
  color: var(--pa-muted);
}
.pa-empty-title {
  display: block;
  margin: 0 0 6px;
  font: italic 600 21px/1.2 var(--pa-serif);
  color: var(--pa-accent);
}
/* On a CVSDH search page the search summary reads as a plain line over the chips. */
#main:has(.pa-picker) > .well.pageHeading {
  background: none;
  border: 0;
  box-shadow: none;
  padding: 0;
  margin: 0 0 8px;
}

/* Landing page: the heading block carries the area's numbers, so the result list's
   own "Found N listings" line and the "revise search" link above it are dropped there.
   WHY every direct link of #main: _header_body nests the "revise search" <a> inside
   #revise-toggle's <a>, which the HTML parser splits into sibling links. */
.pa-landing-head ~ .list-results .found,
.pa-landing-head ~ #main > a {
  display: none;
}
.pa-landing-head {
  padding-top: 20px;
}

/* GH #4570 (owner: "change the layout to be more like zillow: map on the left,
   listings on the right"): the split view on the home, landing and search pages
   (planningAreaHomeHero, planningAreaSearchSplitOpen). Phone first: the map stacks on
   top at a fixed height (mockup v2: 340px), the listings below. */
.pa-split-map {
  position: relative;
  background: #f7f1e6;
  border-bottom: 1px solid var(--pa-line);
}
/* The result cards as white panels on the paper (mockup v2), gold-outlined on hover
   and, through the pin sync's .pa-hot (GH #4570), while keyboard focus is inside. */
.pa-split-list .result-card {
  background: var(--pa-panel);
  border: 1px solid var(--pa-line);
  border-radius: 8px;
  overflow: hidden;
}
.pa-split-list .result-card:hover,
.pa-split-list .result-card.pa-hot {
  outline: 2px solid var(--pa-gold);
}
.pa-below {
  margin-top: 24px;
}
.pa-credit {
  font-size: 12px;
  color: var(--pa-muted);
  margin: 8px 0 16px;
}

/* Detail: the listing's planning area is one Geographic Areas line. */
.pa-detail-link {
  font-weight: bold;
}

/* Phone-width sticky Call / Message bar; the page keeps room for it at its end. */
.pa-callbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  gap: 8px;
  padding: 8px 16px;
  background: var(--pa-panel);
  border-top: 1px solid var(--pa-line);
}
.pa-callbar .btn {
  flex: 1 1 0;
  min-height: 44px;
  padding-top: 11px;
}
body:has(.pa-callbar) {
  padding-bottom: 64px;
}
html:has(.pa-callbar) {
  scroll-padding-bottom: 64px;
}

/* Phone-width nav: one row. WHY: below 1280px every tab is icon-only, and this brand's
   eight tabs at Bootstrap's 15px side padding (48px each, plus the profile caret) wrap
   to two rows inside a 390px phone's 360px container. 10px a side (38px a tab, the
   same padding _global.css gives every brand from 1280px) fits ~316px on one row and
   keeps each target above WCAG 2.5.8's 24px. Wider screens keep the shared padding. */
@media (max-width: 599px) {
  .nav-wrapper .nav-tabs > li > a {
    padding-left: 10px;
    padding-right: 10px;
  }
  .pa-logo {
    font-size: 22px;
  }
}

/* Tablet and up: no call bar; the split view side by side. */
@media (min-width: 768px) {
  .pa-callbar {
    display: none;
  }
  body:has(.pa-callbar) {
    padding-bottom: 0;
  }
  html:has(.pa-callbar) {
    scroll-padding-bottom: 0;
  }
  .pa-title {
    font-size: 34px;
  }
  .pa-home .pa-title {
    font-size: 40px;
  }

  /* GH #4570 split view (mockup v2, page.tpl.html: the map column a little wider).
     WHY one viewport: the owner requires the map never to be chopped below the fold,
     so the body is a column whose header rows keep their height and whose split
     takes exactly what is left; the map fits that whole (meet) and only the list
     column scrolls. The body's other children (nav, call bar, scripts) keep their own
     height. */
  body:has(> .pa-split) {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }
  body:has(> .pa-split) > * {
    flex: none;
  }
  /* WHY flex basis 0 and min-height 0: the split fills the remaining height and may
     shrink below its content, which the list column then scrolls. */
  body:has(> .pa-split) > .pa-split {
    flex: 1 1 0;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    align-items: stretch;
  }
  /* The map column stretches to the split's full height beside the list. */
  .pa-split-map {
    position: relative;
    height: auto;
    margin: 0;
    border-bottom: 0;
    border-right: 1px solid var(--pa-line);
    overflow: hidden;
  }
  .pa-split #pa-map {
    height: 100%;
  }
  /* The list column is the one scroller, so the map stays in view. */
  .pa-split-list {
    min-height: 0;
    overflow-y: auto;
  }
  /* WHY width auto: Bootstrap's .container fixes a page-wide width at each
     breakpoint, which would overflow the half-width column. */
  .pa-split-list .container {
    width: auto;
  }
  /* The result cards as a grid in the column, two cards a row at every split width
     (mockup v2 page.tpl.html .grid: two columns, one only in the phone frame). WHY
     grid, not the Bootstrap columns: their percentage
     widths and the breakpoint clearfix divs assume a page-wide row. Floats,
     widths, the clearfix divs and the row's clearfix pseudo-elements (which a grid
     would lay out as items) are neutralised here only. */
  .pa-split-list .list-results .row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
  .pa-split-list .list-results .row::before,
  .pa-split-list .list-results .row::after {
    content: none;
  }
  .pa-split-list .list-results .result-wrap {
    float: none;
    width: auto;
  }
  .pa-split-list .list-results .clearfix {
    display: none;
  }
}
