/* ---------------------------------------------------------------
   Christchurch, lately — a live map of what the city has reported.
   Map is the page. Chrome floats over it and stays out of the way.
   --------------------------------------------------------------- */

:root {
  --paper:   #f4f1ea;
  --paper-2: #fbfaf7;
  --ink:     #16171b;
  --ink-2:   #4d5058;
  --ink-3:   #83868f;
  --rule:    #dedacf;
  --rule-2:  #e9e5dc;
  --alert:   #b23a2c;
  --warn:    #b3762a;
  --calm:    #3d7a63;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans:  ui-sans-serif, system-ui, -apple-system, "Segoe UI", Inter, sans-serif;

  --shadow: 0 4px 24px rgba(20, 18, 12, .13), 0 1px 3px rgba(20, 18, 12, .08);
}

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

a { color: inherit; }

#map {
  position: absolute;
  inset: 0;
  background: var(--paper-2);
}

/* --------------------------------------------------------------- wordmark */

.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.wordmark-mark {
  width: 24px; height: 24px;
  border-radius: 50%;
  flex: none;
  background:
    radial-gradient(circle at 50% 50%, transparent 0 2.5px, var(--ink) 2.5px 3.5px, transparent 3.5px),
    radial-gradient(circle at 50% 50%, transparent 0 6.5px, var(--ink) 6.5px 7.5px, transparent 7.5px),
    radial-gradient(circle at 50% 50%, transparent 0 10px, var(--alert) 10px 12px, transparent 12px);
}

.wordmark b {
  display: block;
  font: 600 16px/1.2 var(--serif);
  letter-spacing: -.015em;
}

.wordmark i {
  display: block;
  font-style: normal;
  font-size: 11px;
  color: var(--ink-3);
  line-height: 1.3;
}

/* ------------------------------------------------------------------ panel */

.panel {
  position: absolute;
  z-index: 600;
  /* Clears the floating chrome. */
  top: 74px; left: 16px;
  width: 316px;
  max-height: calc(100% - 92px);
  display: flex;
  flex-direction: column;
  background: rgba(251, 250, 247, .96);
  backdrop-filter: blur(10px);
  border: 1px solid var(--rule);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 13px 13px 11px;
  border-bottom: 1px solid var(--rule-2);
}

.panel-toggle {
  margin-left: auto;
  flex: none;
  width: 24px; height: 24px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: transparent;
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.panel-toggle:hover { border-color: var(--ink); color: var(--ink); }

.panel-body {
  padding: 13px;
  display: grid;
  gap: 13px;
  flex: none;          /* the feed below takes the leftover height, not this */
}

.panel.collapsed .modes,
.panel.collapsed .jump,
.panel.collapsed .mode-panel,
.panel.collapsed .panel-foot { display: none; }

/* ------------------------------------------------------------ panel foot */

.panel-foot {
  display: grid;
  grid-auto-flow: column;
  gap: 1px;
  padding: 0;
  border-top: 1px solid var(--rule);
  background: var(--rule-2);
  flex: none;
}

.panel-foot a {
  padding: 9px 6px;
  background: var(--paper-2);
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.panel-foot a:hover { background: var(--ink); color: var(--paper); }

/* ------------------------------------------------------------------ range */

.range {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 3px;
  background: var(--paper);
  border: 1px solid var(--rule-2);
  border-radius: 8px;
}

.range button {
  font: inherit;
  font-size: 13px;
  padding: 6px 4px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
}

.range button:hover { color: var(--ink); }

.range button.on {
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
}

/* ------------------------------------------------------------------ tally */

.tally {
  display: flex;
  align-items: baseline;
  gap: 7px;
  flex-wrap: wrap;
}

.tally b {
  font: 400 30px/1 var(--serif);
  letter-spacing: -.02em;
}

.tally span {
  font-size: 12.5px;
  color: var(--ink-3);
}

/* ------------------------------------------------------------- categories */

.cats {
  display: grid;
  gap: 1px;
}

.cat {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 6px 7px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.cat:hover { background: var(--paper); }

.cat .swatch {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex: none;
  background: var(--c);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.12);
}

.cat .cat-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cat .cat-n {
  margin-left: auto;
  color: var(--ink-3);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.cat:not(.on) { color: var(--ink-3); }
.cat:not(.on) .swatch { background: transparent; box-shadow: inset 0 0 0 1.5px var(--rule); }
.cat:not(.on) .cat-label { text-decoration: line-through; }

/* Clicking a category isolates it, so there needs to be an obvious way back
   that is not "click the same thing again and hope". */
.show-all {
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 10px;
  border: 1px solid var(--rule);
  border-radius: 7px;
  background: var(--paper);
  color: var(--ink-2);
  cursor: pointer;
}

.show-all:hover { border-color: var(--ink); color: var(--ink); }

/* The map style switcher sits in the same segmented control as the ranges,
   but with four options it needs to wrap rather than squeeze. */
#basemap { grid-template-columns: repeat(3, 1fr); }

/* Fade tiles in — a half-drawn basemap under coloured dots looks broken. */
.basetile {
  animation: tileIn .25s ease-out;
}

@keyframes tileIn { from { opacity: 0 } to { opacity: 1 } }

@media (prefers-reduced-motion: reduce) {
  .basetile { animation: none; }
}

/* Over satellite imagery the panel needs a firmer edge to stay readable. */
body.dark-base .panel,
body.dark-base .sheet {
  box-shadow: 0 4px 30px rgba(0, 0, 0, .32), 0 1px 3px rgba(0, 0, 0, .2);
}

/* ------------------------------------------------------------------- jump */

.jump { margin: 0 13px 12px; flex: none; }

.jump input {
  width: 100%;
  font: inherit;
  font-size: 13.5px;
  padding: 8px 11px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
}

.jump input:focus {
  outline: 2px solid var(--ink);
  outline-offset: -1px;
}

/* ------------------------------------------------------------------ modes */

.modes {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 3px;
  margin: 13px 13px 11px;
  padding: 3px;
  background: var(--paper);
  border: 1px solid var(--rule-2);
  border-radius: 9px;
  flex: none;
}

.modes button {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 4px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
}

.modes button:hover { color: var(--ink); }

.modes button[aria-selected="true"] {
  background: var(--ink);
  color: var(--paper);
}

.mode-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.mode-panel[hidden] { display: none; }

/* ------------------------------------------------------------------ fields */

.field { display: block; }

.field > span {
  display: block;
  font: 600 10.5px/1 var(--sans);
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 6px;
}

.field select {
  width: 100%;
  font: inherit;
  font-size: 13.5px;
  padding: 8px 10px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--paper-2);
  color: var(--ink);
  cursor: pointer;
}

.field select:focus { outline: 2px solid var(--ink); outline-offset: -1px; }

.layer-q {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-2);
  font-style: italic;
}

.layer-q:empty { display: none; }

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--ink-2);
  cursor: pointer;
}

.check input { margin: 0; cursor: pointer; }

/* ------------------------------------------------------------------- lists */

.list-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 13px 9px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule-2);
  font: 600 11px/1 var(--sans);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
  flex: none;
}

.list-n {
  margin-left: auto;
  letter-spacing: 0;
  text-transform: none;
  font-weight: 400;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------------- feed */



.live {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--calm);
  margin-left: auto;
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse { 0%, 100% { opacity: 1 } 50% { opacity: .25 } }

.feed {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
  min-height: 120px;
}

.feed li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 9px;
  padding: 9px 13px;
  border-bottom: 1px solid var(--rule-2);
  cursor: pointer;
}

.feed li:hover { background: var(--paper); }

.feed li::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--c, var(--ink-3));
  margin-top: 5px;
  grid-row: 1 / 3;
}

.feed .f-type {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}

.feed .f-where {
  font-size: 12px;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed .f-when {
  font-size: 11px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

/* A report that appeared on a refresh, so the list visibly moves. */
.feed li.fresh { animation: flash 3s ease-out; }

@keyframes flash {
  from { background: #fdf3d0; }
  to   { background: transparent; }
}

.feed .empty-feed {
  padding: 16px 13px;
  color: var(--ink-3);
  font-size: 12.5px;
  font-style: italic;
}

@media (prefers-reduced-motion: reduce) {
  .live, .feed li.fresh { animation: none; }
}

/* ------------------------------------------------------------------- peek */

/* Hover card. Costs no request — the details for everything in view are
   already warmed — so a passing cursor can show what actually happened. */
.peek {
  position: fixed;
  z-index: 700;
  width: 260px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--c, var(--ink-3));
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(20, 18, 12, .18);
  overflow: hidden;
  pointer-events: none;   /* never steal the click meant for the pin */
  animation: peekIn .1s ease-out;
}

@keyframes peekIn { from { opacity: 0 } to { opacity: 1 } }

.peek img {
  display: block;
  width: 100%;
  height: 132px;
  object-fit: cover;
  background: var(--rule-2);
}

.peek-body { padding: 10px 12px; }

.peek-body b {
  display: block;
  font-size: 13.5px;
  line-height: 1.3;
}

.peek-body p {
  margin: 5px 0 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ink-2);
}

.peek-body i {
  display: block;
  margin-top: 6px;
  font-style: normal;
  font-size: 11.5px;
  color: var(--ink-3);
}

@media (prefers-reduced-motion: reduce) {
  .peek { animation: none; }
}

/* Touch devices have no hover, and a card that follows a tap is just in the
   way — the sheet already does that job. */
@media (hover: none) {
  .peek { display: none; }
}

/* ------------------------------------------------------------------ sheet */

/* A full-width bottom sheet rather than a corner card — a 285 KB photo and a
   paragraph of notes need room, and the corner card cropped both. */

.sheet {
  position: absolute;
  z-index: 650;
  left: 348px; right: 0; bottom: 0;
  display: grid;
  /* Photo column is deliberately large: these are the reporter's own photos
     and they are most of the value of a report. */
  grid-template-columns: 210px minmax(0, 1fr) 200px;
  gap: 22px;
  padding: 18px 22px;
  background: rgba(251, 250, 247, .975);
  backdrop-filter: blur(12px);
  border-top: 3px solid var(--c, var(--ink-3));
  box-shadow: 0 -6px 30px rgba(20, 18, 12, .14);
  max-height: 40vh;
  animation: rise .16s ease-out;
}

@keyframes rise {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.sheet-close {
  position: absolute;
  top: 10px; right: 14px;
  width: 26px; height: 26px;
  border: 1px solid var(--rule);
  border-radius: 7px;
  background: var(--paper-2);
  color: var(--ink-3);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}

.sheet-close:hover { color: var(--ink); border-color: var(--ink); }

.sheet-photo {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: var(--rule-2);
  display: grid;
  place-items: center;
  min-height: 150px;
  max-height: 32vh;
}

.sheet-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}

/* Click the photo for the full frame — object-fit: cover crops, and sometimes
   the thing being reported is at the edge of the shot. */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: grid;
  place-items: center;
  padding: 32px;
  background: rgba(20, 18, 12, .82);
  backdrop-filter: blur(3px);
  cursor: zoom-out;
  animation: fade .12s ease-out;
}

@keyframes fade { from { opacity: 0 } to { opacity: 1 } }

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 10px;
  box-shadow: 0 12px 50px rgba(0, 0, 0, .5);
}

.lightbox-hint {
  position: absolute;
  bottom: 18px; left: 50%;
  transform: translateX(-50%);
  color: rgba(251, 250, 247, .75);
  font-size: 12.5px;
}

.sheet-nophoto {
  color: var(--ink-3);
  font-size: 12px;
  font-style: italic;
}

.sheet-main { min-width: 0; overflow-y: auto; }

.sheet-cat {
  font: 600 10.5px/1 var(--sans);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--c, var(--ink-3));
  margin-bottom: 7px;
}

.sheet h2 {
  font: 400 22px/1.2 var(--serif);
  letter-spacing: -.016em;
  margin: 0 0 10px;
}

.sheet-notes {
  margin: 0 0 15px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 68ch;
}

.sheet-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
}

.sheet-facts dt {
  font: 600 10px/1 var(--sans);
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 4px;
}

.sheet-facts dd {
  margin: 0;
  font-size: 14.5px;
  font-variant-numeric: tabular-nums;
}

.sheet-side {
  display: flex;
  flex-direction: column;
  gap: 7px;
  align-content: start;
}

.sheet-btn {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  padding: 9px 12px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--paper-2);
  color: var(--ink-2);
  cursor: pointer;
}

.sheet-btn:hover { border-color: var(--ink); color: var(--ink); }

.sheet-btn.primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.sheet-btn.primary:hover { background: #000; }

/* Below this the three columns cannot all be useful, so the actions wrap. */
@media (max-width: 1080px) {
  .sheet { grid-template-columns: 170px minmax(0, 1fr); }
  .sheet-side { grid-column: 1 / -1; flex-direction: row; }
  .sheet-btn { flex: 1; }
}

@media (max-width: 820px) {
  .sheet {
    left: 0;
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 16px;
    max-height: 72vh;
    overflow-y: auto;
  }
  .sheet-photo { min-height: 0; max-height: 34vh; }
  .sheet h2 { font-size: 20px; }
  .sheet-notes { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  .sheet { animation: none; }
}

/* ---------------------------------------------------------------- loading */

.loading {
  position: absolute;
  z-index: 700;
  top: 22px; left: 50%;
  transform: translateX(-50%);
  padding: 7px 14px;
  background: rgba(251, 250, 247, .96);
  border: 1px solid var(--rule);
  border-radius: 100px;
  box-shadow: var(--shadow);
}

.spinner {
  display: block;
  width: 15px; height: 15px;
  border: 2px solid var(--rule);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ================================================================
   Address deep-dive page (address.html)
   ================================================================ */

body.page { overflow: auto; }

/* ----------------------------------------------------------------- chrome */

/* The same header on every view. Four renderings of one dataset — space, time,
   aggregate, image — so moving between them should feel like tabs in an app,
   not like leaving one website for another. */

.chrome {
  position: sticky;
  top: 0;
  z-index: 800;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 11px 20px;
  background: rgba(244, 241, 234, .94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}

/* On the map the chrome floats over the tiles rather than pushing them down. */
body:not(.page) .chrome {
  position: absolute;
  left: 0; right: 0;
}

.chrome .wordmark { text-decoration: none; flex: none; }

.views {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--paper);
  border: 1px solid var(--rule-2);
  border-radius: 9px;
}

.views a {
  padding: 6px 13px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-3);
  text-decoration: none;
  white-space: nowrap;
}

.views a:hover { color: var(--ink); }

.views a[aria-current="page"] {
  background: var(--ink);
  color: var(--paper);
}

.chrome-find {
  margin-left: auto;
  flex: 0 1 260px;
  min-width: 0;
}

.chrome-find input {
  width: 100%;
  font: inherit;
  font-size: 13px;
  padding: 8px 12px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--paper-2);
  color: var(--ink);
}

.chrome-find input:focus { outline: 2px solid var(--ink); outline-offset: -1px; }
.chrome-find input.busy { opacity: .6; }

@media (max-width: 900px) {
  .chrome { gap: 12px; padding: 9px 14px; flex-wrap: wrap; }
  .chrome-find { flex-basis: 100%; margin-left: 0; order: 3; }
  .views { margin-left: auto; }
}

@media (max-width: 560px) {
  .chrome .wordmark i { display: none; }
  .views a { padding: 6px 10px; font-size: 12.5px; }
}

/* ------------------------------------------------- directory in the panel */

.dir-panel { overflow-y: auto; flex: 1; min-height: 0; padding-bottom: 8px; }

.dir-sec { border-bottom: 1px solid var(--rule-2); }

.dir-sec h4 {
  margin: 0;
  padding: 11px 13px 7px;
  font: 600 10.5px/1 var(--sans);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.dir-list { display: grid; padding-bottom: 6px; }

.dir-list button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 13px 8px 26px;
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
  position: relative;
}

.dir-list button::before {
  content: "";
  position: absolute;
  left: 13px; top: 13px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--c, var(--ink-3));
}

.dir-list button:hover { background: var(--paper); }

.dir-list b { display: block; font-size: 13.5px; font-weight: 600; }

.dir-list i {
  display: block;
  font-style: normal;
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--ink-3);
  margin-top: 1px;
}

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 30px 24px 70px;
}

.addr-title {
  font: 400 clamp(24px, 4vw, 34px)/1.15 var(--serif);
  letter-spacing: -.02em;
  margin: 0 0 26px;
}

.cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 400px);
  gap: 38px;
  align-items: start;
}

.mini-map {
  position: sticky;
  top: 74px;
  height: 340px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  overflow: hidden;
}

.section-head {
  font: 600 12px/1 var(--sans);
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 15px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.section-head .count {
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  font-size: 12.5px;
}

section.land { margin-bottom: 40px; }

.land-items { display: grid; gap: 9px; }

.finding {
  background: var(--paper-2);
  border: 1px solid var(--rule-2);
  border-left: 3px solid var(--ink-3);
  border-radius: 8px;
  padding: 12px 15px;
}

.finding.sev-high   { border-left-color: var(--alert); }
.finding.sev-medium { border-left-color: var(--warn); }
.finding.sev-low    { border-left-color: var(--calm); }

.finding-label {
  font: 600 10.5px/1 var(--sans);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 6px;
}

.finding-title { font-weight: 600; font-size: 15px; line-height: 1.35; }
.finding-detail { color: var(--ink-2); font-size: 13.5px; margin-top: 5px; }
.finding-meta { color: var(--ink-3); font-size: 12px; margin-top: 5px; }

.clear { color: var(--ink-3); font-style: italic; padding: 10px 0; }

.group { border-bottom: 1px solid var(--rule-2); }

.group > summary {
  cursor: pointer;
  padding: 12px 2px;
  display: flex;
  align-items: center;
  gap: 9px;
  list-style: none;
  font-size: 14.5px;
}

.group > summary::-webkit-details-marker { display: none; }

.group > summary::before {
  content: "";
  width: 9px; height: 9px;
  border-radius: 50%;
  flex: none;
  background: var(--src, var(--ink-3));
}

.group[open] > summary { font-weight: 600; }

.group summary .blurb { color: var(--ink-3); font-size: 12.5px; font-weight: 400; }
.group summary .n { margin-left: auto; color: var(--ink-3); font-size: 12.5px; font-weight: 400; }

.records { padding: 2px 0 14px; display: grid; gap: 2px; }

.record {
  padding: 9px 11px;
  border-radius: 7px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 12px;
}

.record:hover { background: var(--paper-2); }

.record-title { font-size: 14px; font-weight: 500; }
.record-dist { color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.record-detail { grid-column: 1 / -1; color: var(--ink-2); font-size: 13px; }
.record-meta { grid-column: 1 / -1; color: var(--ink-3); font-size: 11.5px; font-variant-numeric: tabular-nums; }

.record img {
  grid-column: 1 / -1;
  margin-top: 7px;
  max-width: 240px;
  width: 100%;
  border-radius: 6px;
  border: 1px solid var(--rule-2);
}

/* Placeholder bars while a section's request is in flight, so the page has
   shape immediately instead of collapsing to nothing. */
.skeleton { display: grid; gap: 9px; }

.skeleton span {
  display: block;
  height: 58px;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--rule-2) 25%, var(--paper-2) 50%, var(--rule-2) 75%);
  background-size: 300% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}

.skeleton span:nth-child(2) { animation-delay: .12s; opacity: .75; }
.skeleton span:nth-child(3) { animation-delay: .24s; opacity: .5; }

@keyframes shimmer {
  0%   { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton span { animation: none; }
}

/* ------------------------------------------------------- explore / directory */

.hero { max-width: 660px; margin: 26px 0 40px; }

.hero h1 {
  font: 400 clamp(28px, 4.6vw, 42px)/1.13 var(--serif);
  letter-spacing: -.022em;
  margin: 0 0 16px;
  text-wrap: balance;
}

.hero p { margin: 0; color: var(--ink-2); font-size: 16.5px; }

.lead-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 52px;
}

.lead {
  display: block;
  text-decoration: none;
  padding: 20px 22px 18px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 12px;
  transition: border-color .12s, transform .12s;
}

.lead:hover { border-color: var(--ink); transform: translateY(-2px); }

.lead-tag {
  font: 600 10.5px/1 var(--sans);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--alert);
  margin-bottom: 10px;
}

.lead h2 {
  font: 400 21px/1.25 var(--serif);
  letter-spacing: -.015em;
  margin: 0 0 9px;
}

.lead p { margin: 0 0 14px; color: var(--ink-2); font-size: 14.5px; }

/* Live figure on each card — the city keeps moving and the landing page
   should show it. Reserves its line so a late number does not shift layout. */
.lead-stat {
  display: block;
  min-height: 1.4em;
  margin-bottom: 12px;
  font-size: 12.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.lead-go { font-size: 13.5px; font-weight: 600; }
.lead-go::after { content: " →"; }

.dir-head {
  font: 400 24px/1.2 var(--serif);
  letter-spacing: -.015em;
  margin: 0 0 6px;
}

.dir-sub { margin: 0 0 26px; color: var(--ink-3); font-size: 14px; }

.dir-groups { display: grid; gap: 34px; }

.dir-group h3 {
  font: 600 12px/1 var(--sans);
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 14px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--rule);
  display: flex;
  gap: 12px;
  align-items: baseline;
  flex-wrap: wrap;
}

.dir-group h3 span {
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  font-size: 12.5px;
}

.dir-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 9px;
}

.tile {
  position: relative;
  display: block;
  text-decoration: none;
  padding: 13px 15px 13px 30px;
  background: var(--paper-2);
  border: 1px solid var(--rule-2);
  border-radius: 9px;
  transition: border-color .12s;
}

.tile:hover { border-color: var(--c, var(--ink)); }

.tile-dot {
  position: absolute;
  left: 14px; top: 17px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--c, var(--ink-3));
}

.tile b { display: block; font-size: 14.5px; font-weight: 600; }

.tile i {
  display: block;
  font-style: normal;
  font-size: 12.5px;
  color: var(--ink-3);
  margin-top: 3px;
  line-height: 1.4;
}

.tile-note {
  display: inline-block;
  font-style: normal;
  font-size: 10.5px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--warn);
  margin-top: 6px;
}

.addr-form {
  display: flex;
  gap: 8px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.addr-form input {
  flex: 1;
  min-width: 220px;
  font: inherit;
  padding: 11px 14px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--paper-2);
  color: var(--ink);
}

.addr-form input:focus { outline: 2px solid var(--ink); outline-offset: -1px; }

.addr-form button {
  font: inherit;
  font-weight: 600;
  padding: 11px 18px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
}

.addr-form button:hover { background: #000; }

.addr-hit {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  font-size: 14px;
  margin-top: 6px;
  padding: 10px 13px;
  border: 1px solid var(--rule-2);
  border-radius: 8px;
  background: var(--paper-2);
  cursor: pointer;
}

.addr-hit:hover { border-color: var(--ink); }

.addr-note { margin: 14px 0 0; color: var(--ink-3); font-size: 14px; }

/* ----------------------------------------------------------------- trends */

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px;
  background: var(--rule-2);
  border: 1px solid var(--rule-2);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 44px;
}

.tile-stat { background: var(--paper-2); padding: 16px 18px; }

.tile-stat dt {
  font: 600 10.5px/1 var(--sans);
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 8px;
}

.tile-stat dd {
  margin: 0;
  font: 400 27px/1 var(--serif);
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}

.chart-block { margin-bottom: 46px; }

.chart-head {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.chart-block h2 {
  font: 400 21px/1.2 var(--serif);
  letter-spacing: -.015em;
  margin: 0;
}

.chart-head .range { margin-left: auto; width: auto; grid-template-columns: none; display: flex; }
.chart-head .range button { padding: 5px 11px; font-size: 12.5px; }

.chart-sub { margin: 5px 0 16px; color: var(--ink-3); font-size: 13.5px; }

#chart { position: relative; margin-top: 14px; }

.chart-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.chart-svg .axis {
  font: 11px var(--sans);
  fill: var(--ink-3);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 14px;
}

.key {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--ink-2);
}

.key i {
  width: 10px; height: 10px;
  border-radius: 3px;
  display: inline-block;
}

.tip {
  position: absolute;
  top: 8px;
  width: 200px;
  padding: 10px 12px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 9px;
  box-shadow: var(--shadow);
  font-size: 12.5px;
  pointer-events: none;
  z-index: 5;
}

.tip strong { display: block; font-size: 12.5px; }
.tip-total { color: var(--ink-3); margin-bottom: 7px; font-size: 11.5px; }

.tip div {
  display: flex;
  align-items: center;
  gap: 7px;
  line-height: 1.7;
}

.tip div i {
  width: 8px; height: 8px;
  border-radius: 2px;
  flex: none;
}

.tip div b { margin-left: auto; font-variant-numeric: tabular-nums; }

.two-up {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 40px;
}

/* ------------------------------------------------------------ live stream */

.live-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 30px 0 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
  font: 600 11px/1 var(--sans);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.live-head .live { margin-left: auto; }

.stream { list-style: none; margin: 0; padding: 0; }

.ev {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  padding: 15px 0;
  border-bottom: 1px solid var(--rule-2);
}

/* Things that have not happened yet are the only ones you can still act on. */
.ev.ahead {
  background: linear-gradient(90deg, rgba(255, 248, 220, .55), transparent 60%);
  margin: 0 -12px;
  padding-left: 12px;
  padding-right: 12px;
}

.ev.fresh { animation: flash 3s ease-out; }

.ev-when b {
  display: block;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.ev.ahead .ev-when b { color: var(--warn); }

.ev-when i {
  display: block;
  margin-top: 4px;
  font-style: normal;
  font-size: 11px;
  color: var(--ink-3);
  padding-left: 11px;
  position: relative;
}

/* The kind of thing, as a coloured dot rather than a label chip. */
.ev-when i::before {
  content: "";
  position: absolute;
  left: 0; top: 4px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--c, var(--ink-3));
}

.ev-body b { font-size: 15.5px; font-weight: 600; line-height: 1.35; }

.ev-body p {
  margin: 5px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 74ch;
}

.ev-body i {
  display: block;
  margin-top: 5px;
  font-style: normal;
  font-size: 12.5px;
  color: var(--ink-3);
}

.ev-map {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
  text-decoration: none;
  border: 1px solid var(--rule);
  border-radius: 7px;
  padding: 5px 10px;
  white-space: nowrap;
}

.ev-map:hover { border-color: var(--ink); color: var(--ink); }

/* The kind filter needs to wrap; it is not a three-up segmented control. */
#kinds, #wall-filter, #season-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 4px;
  width: auto;
  grid-template-columns: none;
}

#kinds button, #wall-filter button, #season-pick button {
  padding: 6px 12px;
  border-radius: 100px;
}

@media (max-width: 620px) {
  .ev { grid-template-columns: 1fr auto; gap: 4px 12px; }
  .ev-when { grid-column: 1 / -1; display: flex; gap: 10px; align-items: baseline; }
  .ev-when i { margin-top: 0; }
}

/* ------------------------------------------------------------- photo wall */

.wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
  margin: 30px 0 0;
}

.shot {
  margin: 0;
  background: var(--paper-2);
  border: 1px solid var(--rule-2);
  border-radius: 10px;
  overflow: hidden;
  cursor: zoom-in;
  transition: border-color .12s, transform .12s;
}

.shot:hover {
  border-color: var(--c, var(--ink));
  transform: translateY(-2px);
}

.shot img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--rule-2);
}

.shot figcaption {
  padding: 9px 11px 11px;
  border-top: 3px solid var(--c, var(--ink-3));
}

.shot figcaption b {
  display: block;
  font-size: 13px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shot figcaption i {
  display: block;
  margin-top: 3px;
  font-style: normal;
  font-size: 11.5px;
  color: var(--ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wall-more { text-align: center; padding: 34px 0 10px; }
.wall-more .sheet-btn { display: inline-block; width: auto; padding: 10px 22px; }
.wall-more .chart-sub { margin-top: 12px; }

/* The opened photo. */
.shot-full {
  margin: 0;
  max-width: min(1000px, 92vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: var(--paper-2);
  border-radius: 12px;
  overflow: hidden;
  cursor: default;
  box-shadow: 0 14px 60px rgba(0, 0, 0, .5);
}

.shot-full img {
  display: block;
  max-height: 66vh;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  background: #16171b;
  margin: 0 auto;
}

.shot-full figcaption {
  padding: 14px 18px 16px;
  border-top: 3px solid var(--c, var(--ink-3));
}

.shot-full figcaption b { font-size: 16px; }

.shot-full figcaption p {
  margin: 7px 0 0;
  font-size: 14px;
  color: var(--ink-2);
  max-width: 70ch;
}

.shot-full figcaption i {
  display: block;
  margin-top: 8px;
  font-style: normal;
  font-size: 12.5px;
  color: var(--ink-3);
}

.shot-full figcaption a {
  display: inline-block;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.shot-full figcaption a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- columns */

/* Vertical bars for anything cyclical — a week or a day reads wrong as a
   horizontal list, because the order is the information. */
.cols {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 150px;
  margin-top: 18px;
}

.cols.tall { height: 230px; gap: 6px; }

.col {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
}

.col-bar {
  width: 100%;
  min-height: 2px;
  border-radius: 4px 4px 0 0;
  transition: opacity .12s;
}

.col:hover .col-bar { opacity: .78; }

/* Stacked segments inside one year's column. */
.col-bar.stack {
  display: flex;
  flex-direction: column-reverse;
  overflow: hidden;
  background: none !important;
}

.stack-seg { width: 100%; display: block; }

.col-label {
  font-size: 11px;
  color: var(--ink-3);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.col-value {
  font-size: 10.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* The extremes are the point of these charts, so name them. */
.col.peak .col-label { color: var(--ink); font-weight: 600; }
.col.low .col-label { color: var(--ink-3); font-style: italic; }

.chart-note {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--ink-2);
}

/* ---------------------------------------------------------------- records */

.record-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule-2);
}

.record-row b { font-weight: 600; font-size: 14.5px; }

.record-n {
  margin-left: auto;
  font: 400 24px/1 var(--serif);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--ink-2);
  padding: 2px 8px 2px 6px;
  border: 1px solid var(--rule-2);
  border-radius: 100px;
  background: var(--paper-2);
}

.chip::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--c, var(--ink-3));
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(90px, 34%) 1fr auto;
  align-items: center;
  gap: 4px 11px;
  padding: 5px 0;
}

/* Rows that link into the map. Reading a ranking and then having to go find
   the place yourself is what made this feel like separate pages. */
a.bar-row {
  text-decoration: none;
  color: inherit;
  padding: 5px 8px;
  margin: 0 -8px;
  border-radius: 7px;
}

a.bar-row:hover { background: var(--paper-2); }
a.bar-row:hover .bar-label { text-decoration: underline; }

.bar-label {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  height: 9px;
  background: var(--rule-2);
  border-radius: 5px;
  overflow: hidden;
}

.bar-fill {
  display: block;
  height: 100%;
  border-radius: 5px;
}

.bar-n {
  font-size: 12.5px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.bar-sub {
  grid-column: 2 / -1;
  font-size: 11.5px;
  color: var(--ink-3);
  margin-top: -3px;
}

.state { padding: 60px 24px; text-align: center; color: var(--ink-3); }
.state.bad { color: var(--alert); }
.state .spinner { margin: 0 auto 12px; }

.errline { color: var(--alert); font-size: 12.5px; padding: 6px 2px; }

.note {
  margin-top: 44px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  color: var(--ink-3);
  font-size: 12.5px;
  max-width: 78ch;
}

/* --------------------------------------------------------------- leaflet */

.leaflet-container { font: inherit; background: var(--paper-2); }

.leaflet-popup-content-wrapper {
  border-radius: 8px;
  box-shadow: 0 6px 22px rgba(0,0,0,.14);
}

.leaflet-popup-content { margin: 10px 13px; font-size: 13px; line-height: 1.45; }

.leaflet-control-attribution {
  background: rgba(251,250,247,.82) !important;
  font-size: 10.5px !important;
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 900px) {
  .cols { grid-template-columns: 1fr; gap: 20px; }
  .mini-map { position: static; order: -1; height: 260px; }
}

@media (max-width: 700px) {
  .panel {
    top: 0; left: 0;
    width: 100%;
    max-height: 52%;
    border-radius: 0 0 12px 12px;
    border-left: 0;
    border-right: 0;
    border-top: 0;
  }
  /* The panel takes the top half on a phone, so cap the feed or the sheet at
     the bottom has nothing left to sit in. */
  .feed { max-height: 34vh; }
  .loading { top: auto; bottom: 12px; }
  .wrap, .masthead-inner { padding-left: 16px; padding-right: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 3s; }
}
