/* nch-core · site shell (2026-09-30).
   The masthead is the homepage's docked bar (nch-homepage-atlas.php .nch-nav--dock +
   assets/nch-header-cta.css), solid from first paint. Values are copied, not
   restyled — change them there and here together. Every rule is scoped under
   .nch-mast / .nch-place so the legacy per-template CSS and GeneratePress's
   element styles (button, a, nav) cannot leak in. */

:root {
  --nch-shell-ink: #14384A;
  --nch-shell-ink-deep: #0F2C3C;
  --nch-shell-sand: #F5D9A8;
  --nch-shell-sand-soft: #F2DDBE;
  --nch-shell-bone: #F6F2EA;
  --nch-shell-bone-raised: #FDFBF6;
  --nch-shell-font: "Montserrat", "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --nch-shell-ease: cubic-bezier(.23, 1, .32, 1);
  --nch-mast-h: 76px;
}
@media (max-width: 899px) { :root { --nch-mast-h: 64px; } }
/* 900–1149px: desktop bar height, menu sheet */

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

/* Skip link: first focusable element on every interior page */
.nch-skip { position: fixed; left: 16px; top: 12px; z-index: 10001; padding: 12px 16px; border-radius: 3px;
  background: var(--nch-shell-sand); color: var(--nch-shell-ink); font: 600 13px/1 var(--nch-shell-font); text-decoration: none;
  transform: translateY(-160%); transition: transform 160ms var(--nch-shell-ease); }
.nch-skip:focus { transform: none; outline: 2px solid var(--nch-shell-ink); outline-offset: 2px; }
.nch-main-anchor { display: block; height: 0; scroll-margin-top: var(--nch-mast-h); }
.nch-main-anchor:focus { outline: none; }

/* ── Masthead ─────────────────────────────────────────────────────────── */
.nch-mast { position: sticky; top: 0; z-index: 900; margin: 0; padding: 0; border: 0;
  font-family: var(--nch-shell-font); color: #fff; view-transition-name: nch-mast; }
.nch-mast *, .nch-mast *::before, .nch-mast *::after { box-sizing: border-box; }
.admin-bar .nch-mast { top: 32px; }
@media (max-width: 782px) { .admin-bar .nch-mast { top: 46px; } }

.nch-mast__bar { position: relative; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 0;
  min-height: var(--nch-mast-h); padding: 16px clamp(20px, 3.2vw, 56px);
  background: rgba(15, 44, 60, .96); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px -18px rgba(0, 0, 0, .6); }

.nch-mast a { text-decoration: none; }
.nch-mast .nch-mast__logo { justify-self: start; display: inline-flex; align-items: center; gap: 10px; color: #fff; }
.nch-mast .nch-mast__logo svg { flex: none; width: 34px; height: 34px; fill: #fff; }
.nch-mast__word { display: grid; gap: 3px; line-height: 1; }
.nch-mast__word b { font-size: 9.5px; font-weight: 700; letter-spacing: .24em; text-transform: uppercase; color: #fff; }
.nch-mast__word i { font-style: normal; font-size: 17px; font-weight: 600; letter-spacing: .01em; color: #fff; }

.nch-mast__links { justify-self: center; display: flex; align-items: center; gap: clamp(14px, 1.6vw, 26px); }
.nch-mast .nch-mast__links a { position: relative; padding: 8px 0; font-size: 11px; font-weight: 500; line-height: 1.2; letter-spacing: .16em;
  text-transform: uppercase; color: rgba(255, 255, 255, .88); white-space: nowrap; transition: color .2s; }
.nch-mast .nch-mast__links a:hover, .nch-mast .nch-mast__links a:focus-visible { color: #fff; }
/* the section you are in: a short sand rule under the word, nothing louder */
.nch-mast .nch-mast__links a.is-current { color: #fff; }
.nch-mast .nch-mast__links a.is-current::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--nch-shell-sand); }

.nch-mast__end { justify-self: end; display: flex; align-items: center; gap: clamp(12px, 1.4vw, 20px); }
.nch-mast .nch-mast__map { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 0 4px;
  font-size: 11px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: rgba(255, 255, 255, .88); transition: color .2s; }
.nch-mast .nch-mast__map svg { width: 17px; height: 17px; fill: var(--nch-shell-sand); flex: none; }
.nch-mast .nch-mast__map:hover { color: #fff; }

/* Sand CTA — assets/nch-header-cta.css */
.nch-mast .nch-mast__cta { display: inline-flex; align-items: center; justify-content: center; flex: none; min-height: 44px; padding: 8px 16px;
  font-family: var(--nch-shell-font); font-size: .65625rem; font-weight: 600; line-height: 1.25; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap;
  color: var(--nch-shell-ink); background: var(--nch-shell-sand); border: 1px solid var(--nch-shell-sand); border-radius: 3px; box-shadow: none;
  transition: background 140ms, border-color 140ms; }
@media (hover: hover) { .nch-mast .nch-mast__cta:hover { color: var(--nch-shell-ink); background: var(--nch-shell-bone-raised); border-color: var(--nch-shell-bone-raised); } }

.nch-mast .nch-mast__burger { display: none; position: relative; width: 44px; height: 44px; margin: 0 -10px 0 0; padding: 0;
  appearance: none; -webkit-appearance: none; background: none; border: 0; border-radius: 3px; color: #fff; cursor: pointer; box-shadow: none; }
/* three 22px lines, like the homepage's .mast-burger; the middle one leaves when it becomes × */
.nch-mast__burger-lines { position: absolute; left: 11px; width: 22px; top: 50%; height: 0; }
.nch-mast__burger-lines i { position: absolute; left: 0; width: 22px; height: 2px; margin-top: -1px; background: #F3EFE4; border-radius: 2px;
  transition: transform 220ms var(--nch-shell-ease), opacity 160ms; }
.nch-mast__burger-lines i:nth-child(1) { transform: translateY(-7px); }
.nch-mast__burger-lines i:nth-child(3) { transform: translateY(7px); }
.nch-mast__burger[aria-expanded="true"] .nch-mast__burger-lines i:nth-child(1) { transform: rotate(45deg); }
.nch-mast__burger[aria-expanded="true"] .nch-mast__burger-lines i:nth-child(2) { opacity: 0; }
.nch-mast__burger[aria-expanded="true"] .nch-mast__burger-lines i:nth-child(3) { transform: rotate(-45deg); }

.nch-mast a:focus-visible, .nch-mast button:focus-visible { outline: 2px solid var(--nch-shell-sand); outline-offset: 3px; box-shadow: none; }
.nch-mast .nch-mast__cta:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--nch-shell-ink), 0 0 0 4px var(--nch-shell-sand); }

/* Narrow desktops: the Map link keeps its island and drops the word */
@media (max-width: 1279px) {
  .nch-mast .nch-mast__map span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}
/* Partial collapse (Michael, 2026-09-30): priority-nav.js keeps as many links as fit and folds the rest
   into "More"; only when fewer than two fit does the bar become logo + menu (data-pn="menu").
   The sand CTA shows from 900px, like the homepage; below that it lives in "More" / the menu sheet. */
@media (max-width: 899px) {
  .nch-mast__bar { padding: 12px 20px; }
  .nch-mast__end > .nch-mast__cta { display: none; }
}
.nch-mast__bar[data-pn="partial"] { grid-template-columns: auto minmax(0, 1fr) auto; }
.nch-mast__bar[data-pn="menu"] { grid-template-columns: 1fr auto; }
.nch-mast__bar[data-pn="menu"] .nch-mast__links, .nch-mast__bar[data-pn="menu"] .nch-mast__map,
.nch-mast__bar[data-pn="menu"] .nch-mast__end > .nch-mast__cta { display: none; }
.nch-mast__bar[data-pn="menu"] .nch-mast__burger { display: block; }
/* Without the script: the fixed breakpoint (the full row overflows below 1150px) */
@media (max-width: 1149px) {
  html:not(.nch-pn-on) .nch-mast__bar { grid-template-columns: 1fr auto; }
  html:not(.nch-pn-on) .nch-mast__links, html:not(.nch-pn-on) .nch-mast .nch-mast__map, html:not(.nch-pn-on) .nch-mast__end > .nch-mast__cta { display: none; }
  html:not(.nch-pn-on) .nch-mast .nch-mast__burger { display: block; }
}

/* Menu sheet (phones/tablets) */
.nch-mast__menu { position: fixed; left: 0; right: 0; bottom: 0; top: var(--nch-mast-h); z-index: 899; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; justify-content: space-between; gap: 32px; padding: 8px 20px calc(24px + env(safe-area-inset-bottom));
  background: var(--nch-shell-ink-deep); }
.admin-bar .nch-mast__menu { top: calc(var(--nch-mast-h) + 46px); }
.nch-mast__menu[hidden] { display: none; }
.nch-mast__menu.is-entering { animation: nch-menu-in 240ms var(--nch-shell-ease) both; }
@keyframes nch-menu-in { from { opacity: 0; transform: translateY(-8px); } }
.nch-mast__menu nav { display: grid; }
@media (min-width: 900px) { .nch-mast__menu { padding-inline: max(20px, calc((100% - 560px) / 2)); } }
.nch-mast .nch-mast__menu nav a { display: flex; align-items: center; min-height: 56px; padding: 0 2px; border-bottom: 1px solid rgba(246, 242, 234, .12);
  font-size: 13px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: rgba(255, 255, 255, .92); }
.nch-mast .nch-mast__menu nav a.is-current { color: var(--nch-shell-sand); }
/* a section's pages under its link in the phone menu */
.nch-mast__menu-sub { display: grid; padding: 4px 0 10px 16px; border-bottom: 1px solid rgba(246, 242, 234, .12); }
.nch-mast .nch-mast__menu nav .nch-mast__menu-sub a { min-height: 40px; border-bottom: 0; font-size: 11px; letter-spacing: .14em; color: rgba(255, 255, 255, .72); }
.nch-mast .nch-mast__menu nav .nch-mast__menu-sub a[aria-current] { color: var(--nch-shell-sand); }
.nch-mast__menu-foot { display: grid; gap: 12px; }
.nch-mast .nch-mast__menu-map { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, .55); border-radius: 99px; background: rgba(9, 28, 40, .45); color: #fff;
  font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.nch-mast .nch-mast__menu-map svg { width: 18px; height: 18px; fill: var(--nch-shell-sand); }
.nch-mast .nch-mast__cta--block { width: 100%; min-height: 48px; }
html.nch-menu-open, html.nch-menu-open body { overflow: hidden; }

/* Hide what the shell replaces, in case a template still prints it */
body.nch-shell .site-header, body.nch-shell #site-navigation, body.nch-shell .main-navigation,
body.nch-shell #mobile-header { display: none !important; }

/* The detail-page sidebars were sized for the old 56px nav */
body.nch-shell .nch-dev-sidebar, body.nch-shell .nch-hood-sidebar { top: var(--nch-mast-h); max-height: calc(100vh - var(--nch-mast-h)); }

/* Wide article tables scroll inside the column instead of widening the page (live: the Hoʻopili page scrolled
   sideways at ~1150px). Same fix nch-single-page.php got on 2026-09-18. */
body.nch-shell .nch-dev-article, body.nch-shell .nch-hood-article { min-width: 0; }
body.nch-shell :is(.nch-dev-article, .nch-hood-article) .entry-content table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Page sidebar (nch-single-page.php): the section's related guides sit under its pages */
body.nch-shell .nch-page-sidebar-label--sub { margin-top: 24px; }

/* Headings reached by an anchor clear the sticky bar */
body.nch-shell :target { scroll-margin-top: calc(var(--nch-mast-h) + 16px); }

/* ── Map window on mapped detail pages ────────────────────────────────── */
/* Echoes the homepage's map window (#atlas-hero .compass / .map-open): dark glass, sand island, tracked caps. */
.nch-place { position: relative; z-index: 3; width: 248px; aspect-ratio: 16 / 10; margin: 0; border-radius: 14px; overflow: hidden;
  background: #14425C; box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .8), 0 0 0 1px rgba(255, 255, 255, .18);
  font-family: var(--nch-shell-font); isolation: isolate; }
.nch-place, .nch-place * { box-sizing: border-box; }
.nch-place a, .nch-place a:hover, .nch-place a:focus { text-decoration: none; }
.nch-place .nch-place__window { position: absolute; inset: 0; display: block; }
.nch-place .nch-place__window img { display: block; width: 100%; height: 100%; object-fit: cover; margin: 0; max-width: none; border-radius: 0;
  transition: transform 600ms var(--nch-shell-ease); }
.nch-place .nch-place__window::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(9, 28, 40, .55) 0%, rgba(9, 28, 40, 0) 34%, rgba(9, 28, 40, 0) 52%, rgba(9, 28, 40, .7) 100%); }
@media (hover: hover) { .nch-place:hover .nch-place__window img { transform: scale(1.04); } }
.nch-place__pin { position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%;
  background: var(--nch-shell-sand); box-shadow: 0 0 0 3px rgba(15, 44, 60, .85), 0 0 0 9px rgba(245, 217, 168, .28); pointer-events: none; }
.nch-place__cap { position: absolute; left: 12px; top: 10px; right: 12px; z-index: 2; pointer-events: none;
  font-size: 10px; font-weight: 600; line-height: 1.3; letter-spacing: .14em; text-transform: uppercase; color: var(--nch-shell-sand-soft);
  text-shadow: 0 1px 6px rgba(0, 0, 0, .5); }
.nch-place .nch-place__go { position: absolute; left: 10px; bottom: 10px; z-index: 2; display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 14px 0 11px; border: 1px solid rgba(255, 255, 255, .55); border-radius: 99px;
  background: rgba(9, 28, 40, .55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); color: #fff;
  font-size: 10.5px; font-weight: 600; line-height: 1; letter-spacing: .14em; text-transform: uppercase; white-space: nowrap;
  transition: background 160ms, border-color 160ms; }
.nch-place .nch-place__go svg { width: 16px; height: 16px; fill: var(--nch-shell-sand); flex: none; }
@media (hover: hover) { .nch-place .nch-place__go:hover { background: rgba(9, 28, 40, .8); border-color: #fff; color: #fff; } }
.nch-place .nch-place__go:focus-visible { outline: 2px solid var(--nch-shell-sand); outline-offset: 3px; }
.nch-place__credit { position: absolute; right: 8px; bottom: 6px; z-index: 2; pointer-events: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 8.5px; letter-spacing: .02em; color: rgba(255, 255, 255, .7); }

/* Desktop: the window sits in the hero's lower-right, where the photo is quiet */
@media (min-width: 900px) {
  .nch-dev-hero-content, .nch-hood-hero-content { position: relative; }
  .nch-dev-hero-content .nch-place, .nch-hood-hero-content .nch-place { position: absolute; right: 48px; bottom: 48px; }
  .nch-dev-hero-content:has(.nch-place), .nch-hood-hero-content:has(.nch-place) { padding-right: calc(48px + 248px + 32px); }
}
/* General pages with a pin (e.g. Ālia): centred under the title in the page's title band */
.nch-page-hero .nch-place { margin: 24px auto 0; }

/* Phones/tablets: a slim window under the badges; only the button opens the map (no accidental taps while scrolling) */
@media (max-width: 899px) {
  .nch-place { width: 100%; max-width: 420px; aspect-ratio: auto; height: 104px; margin-top: 20px; border-radius: 12px; }
  .nch-place .nch-place__window { pointer-events: none; }
}
@media (hover: none) { .nch-place .nch-place__window { pointer-events: none; } }

/* Map window ⇄ full map (the name is set only for the navigation, by site-shell.js / home-shell.js) */
::view-transition-group(nch-map) { animation-duration: 460ms; animation-timing-function: cubic-bezier(.77, 0, .175, 1); }
::view-transition-old(nch-map), ::view-transition-new(nch-map) { height: 100%; object-fit: cover; overflow: hidden; }
/* The bar is the same on both pages: hold it still while the content crossfades */
::view-transition-group(nch-mast) { animation-duration: 0s; }

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(nch-map) { animation-duration: 0s; }   /* the map morph moves; with reduced motion it only crossfades */
  .nch-skip, .nch-mast__burger-lines i, .nch-place .nch-place__window img { transition: none; }
  .nch-mast__menu.is-entering { animation: none; }
  .nch-place:hover .nch-place__window img { transform: none; }
}
@media print { .nch-mast, .nch-skip, .nch-place { display: none !important; } }

/* Keep every neighborhood summary value visible on phones and tablets. The
   desktop strip stays unchanged; long values wrap inside equal-width cells. */
@media (max-width: 768px) {
  body.nch-shell.single-neighborhood .nch-stats-bar-inner {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  body.nch-shell.single-neighborhood .nch-stat { min-width: 0; }
  body.nch-shell.single-neighborhood .nch-stat:nth-child(even) { border-right: 0; }
  body.nch-shell.single-neighborhood .nch-stat:only-child { grid-column: 1 / -1; }
  body.nch-shell.single-neighborhood .nch-stat-value { overflow-wrap: anywhere; }
}
