/* The front page and the nine doors (prototype.py, OPENHASTINGS.md §101,
   §113, §124). It began as the stylesheet of a test under /next/, hence its
   name and the nx- in its classes.

   Loaded on every page after site.css. The look is the site's own (its
   tokens, its cards and buttons); what this adds is the doors in the bar,
   the front page's blocks and the door pages. */

/* The bar: the four intents and Live now (§126.3; it was the nine doors,
   about 990 px of links). They take their own row under the name at every
   width (the site does this below 1,020 px), and wrap rather than scroll, so
   none is out of sight and nothing hides under Menu. */
.nx-bar a { font-weight: 560; }
.header-pill:has(.nx-bar) { flex-wrap: wrap; gap: .1rem 1rem; padding: .55rem 0 .45rem; min-height: 0; }
.header-pill:has(.nx-bar) nav { order: 3; flex: 1 1 100%; }
.nav-scroll.nx-bar { flex-wrap: wrap; margin-inline: -.55rem; }
@media (max-width: 900px) { .nav-scroll.nx-bar { margin-inline: -.45rem; } }
/* Five links leave room the nine doors never did (§126.3): from 1,100 px the
   bar sits on the name's row, and from 701 px the search is a field with
   its words, not an icon, on every page. Measured in Chromium, 19 Nov 2026:
   the name 142 px, the bar 566, Help now 92, the field 232, gaps 64. */
@media (min-width: 701px) {
  .header-pill:has(.nx-bar) .header-help ~ .header-search { min-width: 14.5rem; }
  .header-pill:has(.nx-bar) .header-help ~ .header-search .label { display: inline; }
  .header-pill:has(.nx-bar) .header-help ~ .header-search kbd { display: inline-block; }
}
@media (min-width: 1100px) {
  .header-pill:has(.nx-bar) { flex-wrap: nowrap; padding: .55rem 0; }
  .header-pill:has(.nx-bar) nav { order: 0; flex: 0 1 auto; margin-left: .6rem; }
  .header-pill:has(.nx-bar) .nav-scroll.nx-bar { flex-wrap: nowrap; margin-inline: 0; }
}
/* On a phone the ten links wrapped to three rows, 149px of header on every
   page (2026-11-10). Inside the site they are one row that scrolls sideways,
   the page's own door scrolled into view (next.js) and the far edge faded so
   the row reads as longer than the screen. The front page keeps all three
   rows: it is the page for choosing a door. */
@media (max-width: 700px) {
  body.inside .nav-scroll.nx-bar {
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 2.2rem), transparent);
    mask-image: linear-gradient(90deg, #000 calc(100% - 2.2rem), transparent);
    padding-right: 2rem;
  }
  body.inside .nav-scroll.nx-bar::-webkit-scrollbar { display: none; }
  body.inside .nav-scroll.nx-bar a { flex: 0 0 auto; white-space: nowrap; }
}

body[data-next="front"] main { max-width: var(--page); padding-top: 1.2rem; }

/* 1. The box over the lit town (§107): the live index's own panel, map,
   scrim, legend and lights (site.css's .town, townmap.town_map), lit only by
   what a reader can still act on. The heading is longer than the index's,
   so it runs a little wider. */
.nx-town h1 { max-width: 16ch; }
.nx-town .town-copy { max-width: 36rem; }
/* The panel grows with its words (§126.8). At a fixed height, the hero for
   a reader whose place is kept (three lines where the plain one has a
   sentence) ran out of the top of the panel on a laptop and the "Updated"
   line was cut off. Wide screens only: on a phone the words are already in
   the flow above the map (site.css). */
@media (min-width: 701px) {
  .nx-town { height: auto; min-height: clamp(34rem, 78vh, 46rem); display: flex; align-items: flex-end; }
  .nx-town .town-copy { position: relative; left: auto; bottom: auto;
    margin: clamp(1.75rem, 3.5vw, 2.75rem) clamp(1.25rem, 3.5vw, 2.75rem) clamp(1.25rem, 3.5vw, 2.5rem); }
}
.nx-town-note { margin: .9rem 0 0; max-width: 31rem; font-size: .88rem; line-height: 1.45; color: var(--muted); text-wrap: pretty; }
.nx-town-note a { font-weight: 600; }
/* The kinds of deadline: planning comments keep the index's planning colour,
   Local Plan sites the planning-notice yellow at night and a deeper gold by
   day, where the yellow is lost on the pale land (3.6:1 on --map-land). */
:root { --nx-k-plan: #B07800; }
@media (prefers-color-scheme: dark) { :root { --nx-k-plan: var(--notice); } }
.town-svg .light.k-local-plan, .town-legend .k-local-plan { color: var(--nx-k-plan); }
.town-svg .light.k-other, .town-legend .k-other { color: var(--k-paper); }
.town[data-only="local-plan"] .light.k-local-plan, .town[data-only="other"] .light.k-other { opacity: 1; }

.nx-ask { width: min(100%, 34rem); }
.nx-try { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: .9rem 0 0; font-size: .88rem; }
.nx-try span { color: var(--muted); font-weight: 600; margin-right: .2rem; }
.nx-try a { padding: .3rem .7rem; border-radius: 999px; background: var(--card); color: var(--ink); text-decoration: none;
  box-shadow: 0 0 0 1px var(--ring-soft); }
.nx-try a:hover { color: var(--sea); box-shadow: 0 0 0 1px var(--ring); }

/* A door's or an intent's header (§126.7): its name, its question in a
   resident's words, what it holds, and what is true behind it today. It was
   the front page's lit town again, the same picture on nine pages, with the
   door's links below the fold on a laptop. */
.nx-door-head { max-width: 46rem; margin: 1.4rem 0 1.6rem; }
.nx-door-head h1 { margin: 0 0 .5rem; }
.nx-door-q { margin: 0 0 .6rem; font-size: clamp(1.15rem, 2vw, 1.45rem); line-height: 1.3; font-weight: 600; color: var(--ink); }
.nx-door-lede { margin: 0; font-size: 1.05rem; line-height: 1.5; color: var(--muted); }
.nx-door-facts { list-style: none; margin: 1.1rem 0 0; padding: 0; display: grid; gap: .5rem; }
.nx-door-facts li { padding: .7rem .95rem; border-radius: 12px; background: var(--card); box-shadow: 0 0 0 1px var(--ring-soft);
  font-size: 1rem; line-height: 1.45; }
/* no tabular figures here: Schibsted's tnum makes the comma figure-wide too,
   and "1,198 streets" read "1 ,198" (site.css says the same of .num) */
.nx-door-facts li a { margin-left: .35rem; font-weight: 600; white-space: nowrap; }
.nx-door-facts .src-line { display: block; margin-top: .15rem; }
/* The subjects behind an intent: a card each, its facts and first pages. */
.doors.nx-subjects { grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); margin-top: .4rem; }
/* four subjects sit two by two, not three and one (§127.2) */
@media (min-width: 701px) { .doors.nx-subjects.n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.nx-subjects .door h2 { margin: 0; font-size: 1.25rem; }
.nx-subjects .door h2 a { color: var(--ink); text-decoration: none; }
.nx-subjects .door h2 a:hover { color: var(--sea); }
.nx-subjects .door .nx-door-facts { margin: .2rem 0 .3rem; }
.nx-subjects .door .nx-door-facts li { padding: .5rem .7rem; background: var(--paper); font-size: .94rem; }
.nx-subjects + .nx-now { margin-top: 2.4rem; }

/* 2. Six task buttons. */
.tasks.nx-tasks { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .6rem; margin: 1.1rem 0 0; }
.tasks.nx-tasks a { display: flex; align-items: center; min-height: 3.2rem; padding: .7rem .9rem; border-radius: 14px;
  font-size: .95rem; font-weight: 620; line-height: 1.25; }
@media (max-width: 1000px) { .tasks.nx-tasks { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .tasks.nx-tasks { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
  .tasks.nx-tasks a { font-size: .9rem; padding: .6rem .75rem; } }
.nx-tasks-note { margin: .6rem 0 0; }

/* Four ways in on the front page (§126.3): four cards in a row on a desktop,
   two by two on a tablet, one a row on a phone with their subjects kept. */
.doors.nx-intents { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1000px) { .doors.nx-intents { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .doors.nx-intents { grid-template-columns: 1fr; gap: .6rem; } }

/* 4. Right now: one line, each feed a chip with its state. */
.nx-now .sec-head { margin-bottom: .6rem; }
.nx-live { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; margin: 0; font-size: .92rem; line-height: 1.4; }
.nx-li-when { color: var(--muted); font-size: .9rem; font-weight: 600; margin-right: .2rem; }
.nx-li { display: inline-flex; align-items: baseline; gap: .35rem; padding: .32rem .7rem; border-radius: 999px;
  background: var(--card); box-shadow: 0 0 0 1px var(--ring-soft); }
.nx-li::before { content: ""; align-self: center; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.nx-li.is-ok::before { background: var(--k-decided); }
.nx-li.is-warn::before { background: var(--k-problem); }
.nx-li.is-bad::before { background: var(--coral); }
.nx-li.is-stale { color: var(--muted); }
.nx-live-more { margin: .55rem 0 0; font-size: .92rem; }
.nx-live.is-stale { display: block; color: var(--coral-ink); }

/* 5. The story so far: three strips side by side. */
.nx-stories { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: 1rem; }
.nx-story { display: flex; flex-direction: column; min-width: 0; }
.nx-story .story-strip { max-width: none; margin: 0; flex: 1; }
.nx-story .story-kicker { display: none; }        /* the section's heading says it */
.nx-wait { margin: .45rem .2rem 0; font-size: .875rem; }
.nx-wait-all { grid-column: 1 / -1; margin-top: -.3rem; }   /* said once for the row (§128) */

/* The door pages: each group a section in the index's rhythm, each link a
   card that's one tap from edge to edge. */
.nx-group { margin-top: 3rem; }
/* Once live (§113), /planning/ and /business/ open with their door; the
   page's own content follows under its own heading. */
.nx-own-h { margin: 3.4rem 0 .9rem; padding-top: 1.6rem; border-top: 1px solid var(--rule); }
.nx-group > h2 { margin: 0 0 1rem; }
.nx-links { list-style: none; margin: 0; padding: 0; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: .75rem; }
.nx-links li { position: relative; padding: .95rem 1.1rem 1rem; border-radius: var(--radius); background: var(--card);
  box-shadow: 0 0 0 1px var(--ring-soft), var(--shadow-sm); line-height: 1.35; transition: box-shadow .15s; }
.nx-links li a { color: var(--ink); font-size: 1.02rem; font-weight: 650; text-decoration: none; }
.nx-links li a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.nx-links li:hover { box-shadow: 0 0 0 1px var(--ring), var(--card-lift); }
.nx-links li:hover a { color: var(--sea); }
.nx-links li:focus-within { box-shadow: 0 0 0 2px var(--sea); }
.nx-links li a:focus-visible { outline: none; }
.nx-links li span { display: block; margin-top: .25rem; color: var(--muted); font-size: .9rem; }
.nx-counts li a b { font-variant-numeric: tabular-nums; }
/* The counts by kind: four to a row, so seven read 4 + 3 and none sits alone
   (§128); two on a phone. The button under them stands clear of the cards. */
.nx-counts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 900px) { .nx-counts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.nx-counts + p { margin-top: 1.4rem; }
.nx-fact { max-width: var(--prose); margin: 0 0 1rem; }
.nx-helpnow { display: block; max-width: var(--prose); margin: 0 0 1.4rem; padding: .9rem 1.1rem; border-radius: 14px;
  background: var(--card); color: var(--ink); text-decoration: none;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--coral) 55%, transparent), var(--shadow-sm); }
.nx-helpnow b { color: var(--coral-ink); font-size: 1.05rem; }
.nx-helpnow span { display: block; margin-top: .2rem; color: var(--muted); font-size: .92rem; }
.nx-helpnow:hover b { text-decoration: underline; }

/* Report & track problems: check before you report (§113.6). */
.nx-check { margin-top: 1.4rem; padding: 1.2rem 1.25rem 1.1rem; border-radius: var(--radius); background: var(--card);
  box-shadow: 0 0 0 1px var(--ring-soft), var(--shadow-sm); }
.nx-check > h2 { margin: 0 0 .35rem; }
.nx-check-lede { max-width: var(--prose); margin: 0 0 1rem; }
.nx-check-find { display: flex; flex-wrap: wrap; align-items: end; gap: .6rem 1.2rem; }
.nx-check-form { display: flex; flex-wrap: wrap; align-items: end; gap: .5rem; }
.nx-check-form label { flex: 1 0 100%; font-size: .88rem; font-weight: 600; color: var(--muted); }
.nx-check-form input { width: 9.5rem; font: inherit; padding: .5rem .7rem; border: 1px solid var(--ring);
  border-radius: 10px; background: var(--card); color: var(--ink); }
.nx-check [hidden] { display: none; }
.nx-check-privacy { flex: 1 0 100%; margin: 0; }
.nx-check-here.busy { opacity: .6; cursor: progress; }
.nx-check-out { margin-top: 1.1rem; max-width: var(--prose); }
.nx-check-out h3 { margin: 1.2rem 0 .35rem; font-size: 1.05rem; }
.nx-check-out h3:first-child { margin-top: 0; }
.nx-check-out p { margin: 0 0 .55rem; }
.nx-check-list { list-style: none; margin: .4rem 0 .7rem; padding: 0; display: grid; gap: .5rem; }
.nx-check-list li { padding: .65rem .85rem; border-radius: 12px; background: var(--paper); box-shadow: 0 0 0 1px var(--ring-soft); line-height: 1.4; }
.nx-check-list li > a { font-weight: 650; }
.nx-ck-said { color: var(--ink); }
.nx-check-list .meta { display: block; margin-top: .2rem; }
.nx-ck-open { color: var(--coral-ink); font-weight: 650; }
.nx-ck-closed { color: var(--k-decided); font-weight: 650; }
.nx-check-steps { max-width: var(--prose); margin: 1rem 0 0; padding-left: 1.3rem; display: grid; gap: .6rem; line-height: 1.5; }

/* Data and stats: the wards on a map, one small map per figure, in /map/'s
   shading (site.css .shade-0 to .shade-4); each ward's shape is defined
   once in .nx-wdefs and drawn by <use>. */
.nx-wdefs { position: absolute; width: 0; height: 0; overflow: hidden; }
.nx-wdefs path { vector-effect: non-scaling-stroke; }
.nx-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); gap: .8rem; margin: 1rem 0; }
.nx-tile { margin: 0; padding: .8rem .9rem .9rem; border-radius: 14px; background: var(--card); box-shadow: 0 0 0 1px var(--ring-soft); min-width: 0; }
.nx-tile svg { display: block; width: 100%; height: auto; aspect-ratio: 1.6; }
.nx-tile use { stroke: var(--card); stroke-width: 1.2px; }
.nx-tile a:hover use { stroke: var(--paper); }
.nx-tile use:hover { stroke: var(--ink); }
.nx-w-none { fill: var(--rule); }
.nx-tile figcaption { display: grid; gap: .25rem; margin-top: .5rem; font-size: .9rem; line-height: 1.35; }
.nx-tile-note { color: var(--muted); font-size: .9rem; }
.nx-tile-key { display: flex; align-items: center; gap: 3px; font-size: .875rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.nx-tile-key span:first-child { margin-right: .3rem; }
.nx-tile-key span:last-child { margin-left: .3rem; }
.nx-tile figcaption > a { font-size: .9rem; font-weight: 600; }
.nx-wtable { margin: .4rem 0 .8rem; }
.nx-wtable summary { cursor: pointer; font-weight: 600; }
.nx-wtable table { font-variant-numeric: tabular-nums; }
.nx-wtable .nx-town th, .nx-wtable .nx-town td { font-weight: 650; }

/* The footer: the record. */
.nx-record b { margin-right: .3rem; }

/* The front page for someone who has been before (next.js sinceHero, §119):
   the hero's line becomes what changed at their place, one fact a line. */
.town-sub.nx-since { display: grid; gap: .45rem; }
.nx-since-line { display: block; padding-left: 1rem; position: relative; }
.nx-since-line::before { content: ""; position: absolute; left: 0; top: .62em; width: .42rem; height: .42rem; border-radius: 50%; background: var(--sea); }
.nx-since-for { display: block; font-size: .9rem; color: var(--muted); margin-top: .2rem; }
