/* docs/assets/browse.css — the rent roll
   Two faces only: Archivo (everything you read) and IBM Plex Mono (everything
   you compare). Numbers are the content here, so they get the mono, the weight
   and the size; nothing else competes. Flat surfaces, hairline rules, one green. */

:root {
  --paper:      #E7ECEC;
  --sheet:      #FCFDFD;
  --sheet-2:    #F1F5F4;
  --ink:        #0F2622;
  /* The muted inks carry real content -- "size not stated", "Address not
     posted", the "any" placeholders, the multi-select instructions -- so both
     clear 4.5:1 on --paper and --sheet. --ink-2 darkens with --ink-3 to keep
     the three-step ramp from collapsing. */
  --ink-2:      #41544F;
  --ink-3:      #5A6D6B;
  --rule:       #C9D5D3;
  --rule-soft:  #DDE5E4;
  --accent:     #0B6E52;
  --accent-ink: #08543F;
  --accent-soft:#DCE9E2;
  --shadow-none: none;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:      #0B1312;
    --sheet:      #121C1A;
    --sheet-2:    #182523;
    --ink:        #E4EDEA;
    --ink-2:      #90A5A1;
    --ink-3:      #6B807C;
    --rule:       #24332F;
    --rule-soft:  #1C2A27;
    --accent:     #4FC59B;
    --accent-ink: #7FDBBB;
    --accent-soft:#13302A;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.shell { max-width: 1240px; margin: 0 auto; padding: 20px 24px 80px; }

/* ---- nav ------------------------------------------------------------- */

.nav {
  display: flex;
  gap: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
  font-size: 13px;
  font-weight: 500;
}
.nav a {
  color: var(--ink-2);
  text-decoration: none;
  padding-bottom: 14px;
  margin-bottom: -15px;
  border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

/* ---- layout ---------------------------------------------------------- */

.layout { display: grid; grid-template-columns: 1fr; gap: 28px; }

@media (min-width: 920px) {
  .layout {
    grid-template-columns: 272px minmax(0, 1fr);
    gap: 0;
  }
  .rail {
    position: sticky;
    top: 20px;
    align-self: start;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding-right: 30px;
    border-right: 1px solid var(--rule);
  }
  .results { padding-left: 36px; }
}

/* ---- filter rail ----------------------------------------------------- */

.rail { padding-top: 30px; }

.field {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--rule-soft);
}

.field-label {
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-2);
}

.field-input { display: flex; align-items: baseline; gap: 2px; justify-self: end; }

/* Ruled fields, not boxes — the rail reads as a form you've filled in. */
.rail input[type="number"] {
  font: inherit;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  width: 4.6em;
  padding: 1px 2px;
  text-align: right;
  -moz-appearance: textfield;
}
.rail input[type="number"]::-webkit-outer-spin-button,
.rail input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.rail input[type="number"]:hover { border-bottom-color: var(--ink-3); }
.rail input[type="number"]:focus {
  outline: none;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 0;
}
.rail input::placeholder { color: var(--ink-3); font-family: 'Archivo', sans-serif; }

.unit, .dash {
  font-size: 12px;
  color: var(--ink-3);
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
}
.dash { padding: 0 6px; }

.field-range { grid-template-columns: auto 1fr; }
.field-range .field-input { flex-wrap: nowrap; }
.field-range input[type="number"] { width: 3.9em; }

/* The city is the biggest decision in the rail, so it's set like a title
   you happen to be able to change, not like another dropdown. */
.field-city { border-bottom: 1px solid var(--rule); padding: 0 0 12px; display: block; }
.field-city select {
  font-family: inherit;
  font-size: 28px;
  font-weight: 600;
  font-stretch: 112%;
  letter-spacing: -0.015em;
  color: var(--ink);
  background: transparent;
  border: none;
  padding: 0;
  width: 100%;
  cursor: pointer;
}
.field-city select:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.field-hoods { display: block; padding-bottom: 14px; }
.field-hoods .field-label { display: block; margin-bottom: 7px; }
#neighbourhoods {
  font: inherit;
  font-size: 13.5px;
  width: 100%;
  color: var(--ink);
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 3px;
}
#neighbourhoods option { padding: 3px 6px; border-radius: 2px; }
#neighbourhoods option:checked {
  background: var(--accent-soft) linear-gradient(0deg, var(--accent-soft), var(--accent-soft));
  color: var(--accent-ink);
  font-weight: 600;
}
.field-help { margin: 7px 0 0; font-size: 11.5px; line-height: 1.45; color: var(--ink-3); }

.checks { padding-top: 14px; display: grid; gap: 9px; }
.check {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
  color: var(--ink-2);
  cursor: pointer;
}
.check input { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; }
.check:hover { color: var(--ink); }

/* ---- masthead: the count is the headline ----------------------------- */

.results { padding-top: 26px; }

#count {
  margin: 0 0 22px;
  font-size: clamp(23px, 3vw, 30px);
  font-weight: 500;
  font-stretch: 108%;
  letter-spacing: -0.018em;
  line-height: 1.18;
  max-width: 22ch;
}
#count .n {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-stretch: normal;
  color: var(--accent-ink);
}
#count .note {
  display: block;
  margin-top: 10px;
  font-size: 14.5px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 52ch;
}

/* ---- map ------------------------------------------------------------- */

#map {
  height: 360px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--sheet-2);
  margin-bottom: 30px;
}
/* No keyless dark tile source exists, so dark mode filters the tile pane only
   (same trick the daily dashboards use) — inverting the map would invert markers.
   A media query rather than a class the script toggles, so the tiles follow the
   OS theme even when it flips with the page already open. */
@media (prefers-color-scheme: dark) {
  #map .leaflet-tile-pane {
    filter: invert(1) hue-rotate(180deg) brightness(0.9) contrast(0.88);
  }
}
.leaflet-container { font-family: inherit; background: var(--sheet-2); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip {
  background: var(--sheet);
  color: var(--ink);
  border-radius: 3px;
  box-shadow: 0 2px 14px rgba(0, 0, 0, .18);
}
.leaflet-popup-content { margin: 10px 13px; font-size: 13px; }
.pop-rent {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  font-size: 16px;
  font-weight: 600;
}
.pop-line { color: var(--ink-2); margin-top: 2px; }
.leaflet-control-attribution { background: var(--sheet) !important; color: var(--ink-3) !important; }
.leaflet-control-attribution a { color: var(--ink-2) !important; }

/* ---- the rent roll --------------------------------------------------- */

#results { width: 100%; border-collapse: collapse; }

#results tr { border-top: 1px solid var(--rule-soft); }
#results tr:first-child { border-top: 1px solid var(--rule); }
#results tr:last-child { border-bottom: 1px solid var(--rule); }
#results tr:hover { background: var(--sheet); }

#results td { padding: 15px 14px; vertical-align: baseline; }
#results td:first-child { padding-left: 0; }
#results td:last-child { padding-right: 0; }

/* Rows come back sorted by rent, so this column is a ladder you read down. */
td.rent {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  font-size: 21px;
  font-weight: 500;
  letter-spacing: -0.045em;
  white-space: nowrap;
  width: 1%;
}

td.what { width: 99%; }
.addr { font-size: 15px; font-weight: 500; line-height: 1.35; }
.addr-missing { font-weight: 400; font-style: italic; color: var(--ink-3); }
.meta {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--ink-2);
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.meta .num {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  font-size: 12px;
  color: var(--ink);
}
.meta .soft { color: var(--ink-3); font-style: italic; }

td.hood { font-size: 13px; color: var(--ink-2); white-space: nowrap; }

td.go { white-space: nowrap; }
td.go a {
  font-size: 13px;
  font-weight: 500;
  color: var(--accent-ink);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-soft);
  padding-bottom: 1px;
}
td.go a:hover { border-bottom-color: var(--accent); }

a:focus-visible, select:focus-visible, input:focus-visible, .check input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 660px) {
  .shell { padding: 16px 16px 60px; }
  #results tr { display: grid; grid-template-columns: auto 1fr; gap: 0 14px; padding: 14px 0; }
  #results td { padding: 0; }
  td.rent { grid-row: 1; font-size: 19px; }
  td.what { grid-column: 2; grid-row: 1; }
  td.hood { grid-column: 2; margin-top: 5px; }
  td.go { grid-column: 2; margin-top: 6px; }
}
