/* Homepage editorial palette and page gutters. */
:root{--home-paper:#efefe3;--home-ink:#231f20;--home-rule:#231f2033}
html,body{margin:0;min-height:0;overflow:hidden;background:var(--home-paper);color:var(--home-ink)}
#precinct{max-width:none;margin:0;padding:clamp(32px,4vw,72px) 4vw clamp(22px,3vw,52px)}
#map-shell{display:grid;grid-template-columns:minmax(15rem,.85fr) minmax(0,1.65fr);column-gap:clamp(24px,5vw,96px);align-items:start;border:0;box-shadow:none;background:transparent;color:var(--home-ink)}
#map-shell .map-top{grid-column:1;grid-row:1;display:block;padding:0;border:0;background:transparent}
#map-shell .map-top .eyebrow{color:var(--home-ink);font:500 .72rem/1.4 var(--sans);letter-spacing:.12em;margin:0 0 1rem}
#map-shell .map-top h2{color:var(--home-ink);font:400 clamp(38px,4.4vw,64px)/1.02 var(--display);letter-spacing:-.035em;text-wrap:balance}
#map-shell .map-header-tools{display:block}
#map-context{display:block;padding:0;border:0;max-width:28ch;color:var(--home-ink);margin:1rem 0 1.3rem;font:400 clamp(19px,1.5vw,26px)/1.35 var(--display)}
#map-shell[data-state="wide"] #explore,.map-utility #neighbourhood-back{position:static;display:inline-flex;align-items:center;gap:.5rem;border:1px solid var(--home-ink);border-radius:2rem;background:transparent;color:var(--home-ink);box-shadow:none;padding:.65rem 1.1rem;min-height:44px;font:500 .85rem/1.2 var(--sans)}
#explore .explore-icon,#explore::before{display:none}
#explore .explore-copy strong{color:inherit;font:inherit}
#map-shell[data-state="wide"] #explore:hover,.map-utility #neighbourhood-back:hover{color:var(--home-paper);background:var(--home-ink)}
.map-utility{grid-column:1;grid-row:1;align-self:end;justify-self:start;min-height:0;padding:0;border:0;background:none}
#map-shell[data-state="wide"] .map-utility{display:none}
#stage{grid-column:2;grid-row:1;width:100%;align-self:start}
.map-bar{grid-column:2;padding:.65rem 0 0;border:0;background:transparent;color:var(--home-ink)}
.map-bar .map-caption a,.map-footer-place,.montclair-bar-copy .eyebrow{color:#4b4745}
.map-bar .wide-controls{margin:0;padding:0}
#wide-layer #map-scale{background:var(--home-paper);color:var(--home-ink);border:0;border-radius:2rem;font-weight:500;top:.75rem;left:.75rem}
#map-shell[data-state="neighbourhood"] #stage{height:clamp(310px,30vw,490px)}
.arrival-card-copy{padding:clamp(12px,1.75vw,28px)}
.arrival-card-copy strong{font-size:clamp(25px,3.15vw,52px)}
.arrival-card-copy small{font-size:clamp(9px,.7vw,12px)}
.arrival-card-copy span{font-size:.67rem;padding:.6rem .8rem}
@media(min-width:1600px){
 #map-shell{grid-template-columns:minmax(0,1fr) minmax(0,960px)}
}
@media(max-width:760px){
 #precinct{padding:28px 5vw 22px}
 #map-shell{display:flex;flex-direction:column;gap:0}
 #map-shell .map-top{width:100%;padding:0 0 16px}
 #map-shell .map-top h2{font-size:clamp(34px,6vw,44px)}
 #map-shell .map-top .eyebrow{margin-bottom:.5rem}
 #map-context{font-size:18px;margin:.5rem 0 .8rem;max-width:40ch}
 .map-utility{align-self:flex-start;margin-bottom:12px}
 .map-bar{width:100%}
 #map-shell[data-state="neighbourhood"] #stage{height:auto}
 #arrival-collection-grid{grid-template-columns:1fr}
 .arrival-card{min-height:clamp(220px,65vw,330px)}
 #map-shell[data-state="neighbourhood"] #neighbourhood-layer,#arrival-collections{position:relative}
 .arrival-card-copy{padding:20px}.arrival-card-copy strong{font-size:38px}
}
#explore .explore-copy{display:inline-flex;align-items:center;gap:.55em}

#map-context,#precinct-detail{max-width:38ch}
#precinct-detail{font:400 clamp(18px,1.35vw,23px)/1.42 var(--display);margin:0 0 1.25rem}
#map-shell[data-state="inside"] #precinct-detail{display:none}
#wide-controls{display:flex;align-items:center;flex-direction:row;flex-wrap:wrap;gap:.65rem 1rem}
#wide-controls[hidden]{display:none}
#wide-controls .map-footer-place{margin-left:auto}
#wide-controls #map-scale{position:static;background:transparent;color:var(--home-ink);border:1px solid currentColor;border-radius:2rem;min-height:44px;padding:.55rem .9rem}

#map-context,#precinct-detail{font:400 clamp(18px,1.35vw,23px)/1.42 var(--display)}
#map-shell .precinct-actions #map-scale{position:static;background:none;color:var(--home-ink);padding:.65rem .7rem;border:0;text-decoration:underline;text-underline-offset:.23em;font:500 .82rem var(--sans);min-height:44px}
.map-shell[data-state="wide"] .map-bar{display:none}
#wide-layer .camera-photo{position:absolute;inset:0;width:100%;height:100%;max-width:none;transform-origin:0 0;pointer-events:none}
#wide-layer #precinct-map{position:relative}
#precinct-map .map-annotations{transition:none}

#wide-layer{overflow:hidden}
#map-bearing{position:absolute;inset:0;transform:rotate(22deg)}

#wide-layer #precinct-map{overflow:visible}
#precinct-photo{mask-image:linear-gradient(to right,transparent,#000 7%,#000 93%,transparent),linear-gradient(to bottom,transparent,#000 8%,#000 92%,transparent);mask-composite:intersect}
.precinct-actions{grid-column:2;display:flex;align-items:center;flex-wrap:wrap;gap:.25rem;margin-top:.7rem}
#map-shell:not([data-state="wide"]) .precinct-actions{display:none}

#map-shell.is-zooming #precinct-map .map-annotations{opacity:1}

#map-shell[data-state="neighbourhood"] .map-utility{grid-column:2;grid-row:2;align-self:start;margin:.7rem 0 0}
#map-shell[data-state="neighbourhood"] .map-bar{grid-row:3}

#map-shell {--montclair-green:#2A4829;--ladies-mulberry:#7D2950}
#precinct-map .regional-target rect,#precinct-map .regional-target .target-ring,#precinct-map .site-label.local rect,#precinct-map .centre-boundary {fill:var(--ladies-mulberry)}
#precinct-map .site-label:not(.local) rect,#precinct-map .development-footprint,#precinct-map .montclair-boundary,#montclair-arrival-ground {fill:var(--montclair-green)}
#map-shell .precinct-actions #map-scale {border:1px solid currentColor;border-radius:999px;padding-inline:1.2rem;text-decoration:none}
#map-scale[hidden],.collection-controls {display:none!important}
#map-shell.is-zooming[data-state="neighbourhood"] #wide-layer {visibility:visible;opacity:1;pointer-events:none}
#map-shell[data-state="neighbourhood"] .arrival-card {animation:none}
@media(max-width:760px){
  /* The active card takes 80%; each upcoming card gets a 10% preview. */
  #arrival-collection-grid {
    grid-template-columns:minmax(0,80%);overflow:hidden;padding:0;gap:0;background:var(--montclair-green);
    touch-action:pan-y pinch-zoom;-webkit-user-select:none;user-select:none;
  }
  #arrival-collection-grid .arrival-card {grid-area:1/1;min-height:0;transition:translate .65s ease,opacity .65s ease}
  .arrival-card[data-slot="0"] {z-index:3;translate:0;box-shadow:1px 0 var(--montclair-green)}
  .arrival-card[data-slot="1"] {z-index:2;translate:12.5%;opacity:.9;box-shadow:1px 0 var(--montclair-green)}
  .arrival-card[data-slot="2"] {z-index:1;translate:25%;opacity:.76}
  #arrival-collections .collection-controls {display:flex!important;justify-content:center;gap:8px;background:var(--montclair-green);padding:8px}
  .collection-controls button {background:none;color:white;border:1px solid #ffffff80;border-radius:24px;padding:6px 14px;min-height:40px}
}

#precinct-map .development-footprint,
#precinct-map .centre-boundary {fill-opacity:.6}

/* The aerial and the collections share a single responsive picture frame. */
#map-shell {--arrival-aspect:1000/625}
@media(max-width:700px){#map-shell {--arrival-aspect:714/557}}
#map-shell:is([data-state="wide"],[data-state="neighbourhood"]) #stage {
  aspect-ratio:var(--arrival-aspect);height:auto;
}
@media(max-width:760px){
  /* Full-bleed aerial, with the same height as the inset collection frame. */
  #map-shell[data-state="wide"] #stage {
    width:100vw;margin-inline:-5vw;aspect-ratio:auto;height:calc(90vw / (var(--arrival-aspect)));
  }
}
#map-shell[data-state="neighbourhood"] #neighbourhood-layer,
#map-shell[data-state="neighbourhood"] #arrival-collections {
  position:absolute;inset:0;margin:0;height:100%;
}
#map-shell #arrival-collection-grid {height:100%}
@media(max-width:760px){
  #arrival-collections .collection-controls {position:absolute;right:12px;bottom:8px;z-index:5;background:transparent;padding:0}
  .collection-controls button {background:#2a4829}
  #map-shell .arrival-card-copy {padding-top:58px}
}

#map-shell #neighbourhood-controls {padding:0 0 14px;grid-column:2;grid-row:1}
#neighbourhood-controls[hidden]{display:none}
#map-shell[data-state="neighbourhood"] .map-bar {display:none}
@media(min-width:761px){
  #map-shell[data-state="neighbourhood"] .map-top {grid-row:1/4}
  #map-shell[data-state="neighbourhood"] #stage {grid-row:2}
  #map-shell[data-state="neighbourhood"] .map-utility {grid-row:3}
}


#arrival-collection-grid .arrival-card-copy strong {font-size:clamp(24px,2.7vw,44px);line-height:1.04;text-wrap:balance}
#arrival-collection-grid .arrival-card-copy small {max-width:29ch;font:500 clamp(12px,.9vw,15px)/1.4 var(--sans);letter-spacing:normal;text-transform:none;text-wrap:pretty}

/* Keep the caption row in the layout throughout the map-to-homes fade. */
#map-shell[data-state="wide"] #neighbourhood-controls[hidden] {
  display:flex!important;visibility:hidden;pointer-events:none;
}
@media(min-width:761px){
  #map-shell:is([data-state="wide"],[data-state="neighbourhood"]) {grid-template-rows:max-content max-content 1fr}
  #map-shell[data-state="wide"] .map-top {grid-row:1/4}
  #map-shell[data-state="wide"] #stage {grid-row:2}
  #map-shell[data-state="wide"] .precinct-actions {grid-row:3;align-self:start}
}

@media(max-width:760px){
  #arrival-collection-grid .arrival-card::after {
    background:linear-gradient(to bottom,rgba(0,0,0,.64),rgba(0,0,0,.54) 36%,transparent 72%,rgba(0,0,0,.34));
  }
  #arrival-collections .collection-controls {
    gap:0;align-items:center;isolation:isolate;
  }
  #arrival-collections .collection-controls::before {
    content:"";position:absolute;inset:9px 0;z-index:-1;
    border:1px solid rgba(255,255,255,.65);border-radius:20px;background:rgba(0,0,0,.55);
  }
  #arrival-collections .collection-controls button {
    background:transparent;border:0;border-radius:14px;color:white;min-height:44px;
    min-width:32px;padding:0 5px;font:500 12px/1 var(--sans);
  }
  #arrival-collections .collection-controls button:focus-visible {outline:2px solid white;outline-offset:-3px}
  #map-shell .arrival-card-copy {padding-top:47px}
}

/* Light address plaques distinguish the labels from the solid site footprints. */
#precinct-map .site-label {color:var(--montclair-green);filter:drop-shadow(0 2px 3px #10191040)}
#precinct-map .site-label.local {color:var(--ladies-mulberry)}
#precinct-map .site-label.site-label rect {fill:#f7f2ef;stroke:#fff;stroke-width:.65}
#precinct-map .site-label .site-name {fill:currentColor;font:400 24px var(--display);stroke:none}
#precinct-map .site-label .site-address {fill:currentColor;font:600 12px var(--sans);letter-spacing:1.1px}
#precinct-map .site-accent {stroke:currentColor;stroke-width:2}
#precinct-map .site-line {stroke:#f7f2ef;stroke-width:1;vector-effect:non-scaling-stroke}

#precinct-map .map-lockup,#precinct-map .site-label {filter:none;shape-rendering:geometricPrecision}
#precinct-map .site-label text,#precinct-map .commercial-mark text {text-rendering:geometricPrecision}
#precinct-map .site-label .site-address {font-size:13px;letter-spacing:.9px}
#precinct-map #footprint-429,#precinct-map .centre-boundary {
  stroke:white;stroke-width:1.6;stroke-opacity:.82;vector-effect:non-scaling-stroke;
}
@media(prefers-reduced-motion:no-preference){
  #map-shell[data-state="wide"]:not(.is-zooming) :is(#footprint-429,.centre-boundary) {
    animation:parcel-outline-pulse 4s ease-in-out infinite;
  }
  @keyframes parcel-outline-pulse {
    0%,65%,100% {stroke-width:1.6px}
    30% {stroke-width:3px}
  }
}

#map-shell .precinct-actions {display:flex;flex-wrap:wrap;align-items:center;gap:8px}
#map-shell:not([data-state="wide"]) .precinct-actions {display:none}
#map-shell #explore {background:#29472e;border-color:#29472e;color:white}
#map-shell #explore:hover {background:#1d3422}
#map-shell button:is(#map-scale,#neighbourhood-back,#explore):focus-visible {outline:2px solid #29472e;outline-offset:3px}

/* Keep the navigation anchored to the aerial while its camera moves. */
#stage > .precinct-actions {
  position:absolute;z-index:8;top:clamp(8px,1.2vw,18px);left:clamp(8px,1.2vw,18px);
  right:8px;margin:0;pointer-events:none;
}
#map-shell[data-state="wide"] #stage .precinct-actions button {
  pointer-events:auto;position:static;min-height:44px;padding:.65rem 1rem;
  border:1px solid #fff9;border-radius:2rem;background:#f6f4ea;color:#231f20;
  box-shadow:0 2px 12px #12221740;text-decoration:none;
}
#map-shell[data-state="wide"] #stage .precinct-actions button:hover {
  background:#7d2950;color:white;
}
#map-shell[data-state="wide"] #stage .precinct-actions button:focus-visible {
  outline:2px solid white;outline-offset:2px;box-shadow:0 0 0 5px #29472e;
}
#stage .precinct-actions button[hidden]{display:none!important}
@media(max-width:480px){
  #map-shell[data-state="wide"] #stage .precinct-actions button{font-size:.77rem;padding:.55rem .76rem}
  #stage > .precinct-actions{gap:4px}
}

@media(prefers-reduced-motion:no-preference){
  #map-shell.journey-visible[data-state="wide"] #stage #explore:not(:hover):not(:focus-visible):not(:disabled){
    animation:explore-invite 2s ease-out 2;
  }
  @keyframes explore-invite{
    0%,100%{box-shadow:0 0 0 0 #f6f4ea00}
    25%{box-shadow:0 0 0 2px #f6f4ea99}
    75%{box-shadow:0 0 0 7px #f6f4ea00}
  }
}
@media(max-width:360px){
  #map-shell[data-state="wide"] #stage .precinct-actions button{padding-inline:.5rem;font-size:.72rem}
}

#precinct-map .site-plaque {transform:translateY(30px)}
#precinct-map .local .site-plaque {transform:translateY(14px)}
@media(max-width:760px){
  #precinct-map .site-plaque {transform:translateY(58px)}
  #precinct-map .local .site-plaque {transform:translateY(46px)}
}


/* Mobile collection cards: show one complete image at a time. */
@media (max-width:760px) {
  #arrival-collection-grid { grid-template-columns:minmax(0,1fr); }
  #arrival-collection-grid .arrival-card {
    translate:none; opacity:0; visibility:hidden; box-shadow:none;
    transition:opacity .24s ease;
  }
  #arrival-collection-grid .arrival-card:first-child,
  #arrival-collection-grid .arrival-card[data-slot="0"] { opacity:1; visibility:visible; }
  #arrival-collection-grid .arrival-card[data-slot]:not([data-slot="0"]) { opacity:0; visibility:hidden; }
  #arrival-collections .collection-controls { top:8px; right:10px; bottom:auto; }
  #arrival-collections .collection-controls button { min-width:44px; }
  #map-shell #arrival-collection-grid .arrival-card-copy { padding:62px clamp(14px,3vw,24px) 14px; }
  #arrival-collection-grid .arrival-card-copy small { font-size:14px; }
  /* WordPress adds a 46px toolbar offset in logged-in mobile embeds. */
  html:has(#wpadminbar) #precinct { padding-bottom:68px; }
}
@media (max-width:760px) and (prefers-reduced-motion:reduce) {
  #arrival-collection-grid .arrival-card { transition:none; }
}
