:root {
  --max-width: 1100px;
  --spacing: 1.5rem;

  --color-accent-wash: #eef3fc;
  --color-panel-bg: #f5f7fa;
  --color-footer-bg: #f5f5f5;
  --color-positive: #0b6e4f;
  --color-inactive: #8a8a8a;
  --color-error: #b3261e;
  --color-success: #1a7f37;
  --color-caveat-bg: #fff8e1;
  --color-caveat-accent: #e0b800;
  --color-highlight: #fff3a8;
}

@media (max-width: 640px) {
  :root {
    --spacing: 0.75rem;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

h1 {
  /* Size and margin only. Weight, letter-spacing and line-height come from
     the shared stylesheet's heading rule — overriding font-weight here is
     what had headings landing at 400 while every sibling site rendered them
     semibold. */
  font-size: 1.75rem;
  margin: 0 0 0.5rem;
}

h2 {
  /* Same as h1: weight comes from the shared heading rule. */
  font-size: 1.25rem;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.35rem;
  margin: 2rem 0 1rem;
}

small,
.small {
  font-size: var(--text-sm);
}

code,
.code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  background: var(--color-panel-bg);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

a {
  color: var(--color-link);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--color-link-hover);
}

.num {
  /* Tabular figures, but left-aligned: the digits still line up column to
     column so magnitudes stay comparable, without the ragged left edge that
     right-alignment gives a column of mixed-width prices. */
  font-variant-numeric: tabular-nums;
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--spacing);
}

main {
  padding: var(--spacing) 0 3rem;
}

.skip-link {
  position: absolute;
  top: -4rem;
  left: 0;
  background: #fff;
  color: var(--color-text);
  padding: 0.6rem 1rem;
  z-index: 1000;
  border-radius: 0 0 6px 0;
}

.skip-link:focus {
  top: 0;
}

:focus-visible {
  outline: 2px solid var(--color-link);
  outline-offset: 2px;
}

.site-header :focus-visible {
  outline-color: #fff;
}

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

.site-header {
  background: var(--color-header-bg);
  color: var(--color-header-text);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--spacing);
  min-height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-title {
  /* The logo is an <h1> on the home page and a <p> everywhere else, so it
     inherits the shared stylesheet's heading letter-spacing and line-height
     on one and the body's on the other — measured at 2.8px difference in
     width, and a line box 4.4px taller. Pinning both makes the element type
     stop mattering. */
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 0.5rem 0;
}

@media (max-width: 640px) {
  .site-title {
    font-size: 1.1rem;
  }
}

.site-title a {
  color: inherit;
  text-decoration: none;
}

.site-title-open {
  color: #fff;
  font-weight: 700;
}

.site-title-thing {
  color: #fff;
  opacity: 0.7;
  font-weight: 600;
}

.header-search {
  display: flex;
  gap: 0.4rem;
}

.header-search input[type='search'] {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  border-radius: 4px;
  padding: 0.4rem 0.6rem;
  min-width: 12rem;
}

.header-search input[type='search']::placeholder {
  color: rgba(255, 255, 255, 0.75);
}

.header-search button {
  background: #fff;
  color: var(--color-header-bg);
  border: none;
  border-radius: 4px;
  padding: 0.4rem 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

@media (max-width: 600px) {
  .network-bar .sister-links {
    display: none;
  }
}

.breadcrumb {
  margin: 0 0 0.5rem;
  font-size: var(--text-sm);
  color: var(--color-muted);
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumb li + li::before {
  content: '\203A';
  margin: 0 0.4rem;
  color: var(--color-muted);
}

.panel {
  background: var(--color-panel-bg);
  border-radius: 6px;
  padding: var(--spacing);
}

.layout-with-sidebar {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: var(--spacing);
  align-items: start;
}

.layout-with-sidebar > * {
  min-width: 0;
}

@media (max-width: 640px) {
  .layout-with-sidebar {
    grid-template-columns: 1fr;
  }
}

.sidebar {
  position: sticky;
  top: 1.5rem;
}

@media (max-width: 640px) {
  .sidebar {
    position: static;
  }
}

.filter-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
}

.filter-form label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-muted);
  margin-bottom: 0.25rem;
}

.filter-form input,
.filter-form select {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 0.45rem 0.6rem;
  font: inherit;
}

.filter-form button {
  background: var(--color-link);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.55rem 1rem;
  font-weight: 600;
  cursor: pointer;
  justify-self: start;
}

.filter-form button:hover {
  background: var(--color-link-hover);
}

/* The home page's only form: one field, so the button sits beside it instead
   of dropping to its own line the way it does under the multi-field search
   form. Capped in width too — a search box the full 1100px reads as a page
   banner rather than something to type an address into. */
.home-search {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  max-width: 34rem;
}

/* Narrower than this and the two side by side leave the field too short to
   show a typed address, so the button drops back onto its own line. */
@media (max-width: 400px) {
  .home-search {
    grid-template-columns: minmax(0, 1fr);
  }
}

.table-scroll {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  font-weight: 600;
  color: var(--color-muted);
  border-bottom: 2px solid var(--color-border);
  padding: 0.5rem 0.75rem;
}

.data-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--color-border);
}

/* Sortable headings. They keep the heading's muted colour rather than taking
   the link colour: a row of blue across the top of a table reads as
   navigation away from the page, when these only reorder what is already on
   it. The underline on hover is what says they are clickable. */
.data-table th a {
  color: inherit;
  text-decoration: none;
  /* One line per heading. The arrow is enough extra width to wrap "Last
     price" mid-label on a phone, which reads as two columns; the table is
     already inside .table-scroll, so being a little wider costs nothing. */
  white-space: nowrap;
}

.data-table th a:hover,
.data-table th a:focus-visible {
  color: var(--color-link);
  text-decoration: underline;
}

/* The sorted column, darker than its neighbours so the arrow is not the only
   thing marking it — the arrow is hidden from screen readers, and aria-sort
   is doing that job for them. */
.data-table th[aria-sort='ascending'] a,
.data-table th[aria-sort='descending'] a {
  color: var(--color-text);
}

.data-table tbody tr:hover {
  background: var(--color-panel-bg);
}

.data-table td:first-child,
.data-table th:first-child {
  padding-left: 0;
}

.data-table td:last-child,
.data-table th:last-child {
  padding-right: 0;
}

.data-table .empty-row td {
  text-align: center;
  color: var(--color-muted);
  padding: 2.5rem 0;
}

dl.facts {
  display: grid;
  grid-template-columns: 10rem 1fr;
  gap: 0.6rem 1rem;
  margin: 0;
}

dl.facts dt {
  font-weight: 600;
  color: var(--color-muted);
}

dl.facts dd {
  margin: 0;
}

@media (max-width: 640px) {
  dl.facts {
    grid-template-columns: 1fr;
  }

  dl.facts dd {
    margin-bottom: 0.5rem;
  }
}

.format-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  font-size: 0.8rem;
  text-decoration: none;
}

.format-pill:hover {
  background: var(--color-panel-bg);
}

.format-pill::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  background-color: currentColor;
  -webkit-mask: no-repeat center / contain;
  mask: no-repeat center / contain;
}

.format-pill.format-json::before {
  -webkit-mask-image: url('../img/formats/json.svg');
  mask-image: url('../img/formats/json.svg');
}

.badge {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 600;
  color: #fff;
  border-radius: 999px;
  padding: 0.15rem 0.65rem;
}

.badge-positive {
  background: var(--color-positive);
}

.badge-inactive {
  background: var(--color-inactive);
}

.tag-pill {
  display: inline-block;
  font-size: 0.78rem;
  background: var(--color-accent-wash);
  color: var(--color-link);
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  margin: 2rem 0;
}

.pagination a,
.pagination .disabled {
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 0.45rem 1rem;
  text-decoration: none;
}

.pagination .disabled {
  color: var(--color-muted);
}

.pagination .status {
  color: var(--color-muted);
  font-size: var(--text-sm);
}

.error-message {
  color: var(--color-error);
  font-weight: 600;
}

.caveat {
  background: var(--color-caveat-bg);
  border-left: 3px solid var(--color-caveat-accent);
  padding: 0.75rem 1rem;
  font-size: var(--text-sm);
  margin: 1rem 0;
}

.search-highlight {
  background: var(--color-highlight);
}

.site-footer {
  background: var(--color-footer-bg);
  color: var(--color-muted);
  font-size: var(--text-sm);
  padding: var(--spacing) 0;
  margin-top: 3rem;
}

.site-footer a {
  color: var(--color-muted);
}

.site-footer .footer-links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0 1rem;
  padding: 0;
  margin: 0 0 0.5rem;
}

/* --- sale price history chart ------------------------------------------- */
/* Drawn by ECharts from the sales table (static/js/chart.js). The HEIGHT is
   set by that script, not here: the element is useless without JavaScript, so
   its natural zero height is the right no-JS result, and sizing it in script
   keeps the chart working for a reader whose cached copy of this stylesheet
   predates it. */

.price-chart {
  width: 100%;
  margin: 0 0 1.5rem;
}

.price-chart:not(:empty) {
  margin-bottom: 1.5rem;
}

/* --- property location map ----------------------------------------------- */
/* MapLibre, initialised by static/js/map.js from the [data-oc-map]
   attributes. A fixed-size aside beside the address facts, matching the
   sibling sites' contact-with-aside layout. The HEIGHT is set by that script,
   not here — the element does nothing without JavaScript, so its natural zero
   height is the right no-JS result: the facts list just takes the full width
   and no empty box is left behind. */

.facts-with-map {
  display: flex;
  flex-direction: row;
  align-items: start;
  gap: var(--spacing);
}

.facts-with-map .facts {
  flex: 1 1 0;
  min-width: 0;
}

.property-map {
  flex: 0 0 auto;
  width: 280px;
  border-radius: 4px;
  overflow: hidden;
}

/* Below this the map and the address list can't sit side by side without
   squeezing both, so the map drops underneath and spans the width. */
@media (max-width: 640px) {
  .facts-with-map {
    flex-direction: column;
  }

  .property-map {
    width: 100%;
  }
}

/* --- random properties on the home page ---------------------------------- */

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

.random-properties li {
  padding: 0.15rem 0;
}

/* Inline, so each property is one line of a list rather than a stacked pair
   that reads as a card. */
.random-properties .small {
  color: var(--color-muted);
}

/* --- home page layout ----------------------------------------------------- */
/* Search and the random sample on the left, the site totals in a panel beside
   them — the shape the sibling sites' home pages use. */

.index-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 15rem;
  gap: 0 2.5rem;
  align-items: start;
}

/* One column below this: 15rem of panel plus a usable search field doesn't
   fit, and the totals are the half that can wait until after the search. */
@media (max-width: 640px) {
  .index-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--spacing) 0;
  }
}

.stats-panel {
  background: var(--color-panel-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 0.75rem 1rem;
}

.stats-panel dl {
  margin: 0;
}

.stats-panel dt {
  font-size: 0.8rem;
  color: var(--color-muted);
  margin-top: 0.75rem;
}

.stats-panel dt:first-of-type {
  margin-top: 0;
}

.stats-panel dd {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* A qualifier under a figure — smaller than the number it belongs to, so the
   pair still reads as one entry rather than two. */
.stats-panel .stat-sub {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-muted);
}
