/* ==========================================================
   Deltavisor · a property's public page (site/property/index.html)

   Layers on the shared design system and on ../css/core.css (.hsec rhythm, .btn, .site-foot).
   Two views: the check (an address box and what it found) and one property (the place, the way to
   get its history, and what that history covers). Panels are filled and never outlined, as in the
   app; each domain's color is on its title's text.
========================================================== */

/* Several blocks here set their own display, which would otherwise outrank the attribute. */
[data-view][hidden], .hist-status[hidden], .hist-picks[hidden], .hist-act__block[hidden], .hist-map[hidden],
[data-r-body][hidden], .hist-report[hidden], .hist-upsell[hidden], .hist-act__fine[hidden] { display: none; }

.sr-only {
  position: absolute; width: 0.0625rem; height: 0.0625rem; padding: 0; margin: -0.0625rem; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ==========================================================
   CHECK
========================================================== */
.hist-check .hsec__head { margin-bottom: var(--s-7); }
.hist-check .hsec__head h1 { font-size: clamp(2.25rem, 5vw, var(--t-5xl)); line-height: 1.04; letter-spacing: -0.036em; }

/* The section centers its children at the page's width; inside it, the check reads as one column. */
.hist-check__body > * { max-width: 44rem; }
.hist-form { display: flex; align-items: stretch; gap: var(--s-2); }
.hist-form__input {
  flex: 1; min-width: 0; font: inherit; font-size: var(--t-md); color: var(--ink);
  background: var(--paper-2); border: var(--rule-w) solid transparent; border-radius: var(--radius-md);
  padding: 0.875rem var(--s-4);
}
.hist-form__input::placeholder { color: var(--ink-mid); }
.hist-form__input:focus { outline: none; border-color: var(--accent); }
.hist-form .btn { padding-inline: var(--s-5); font-size: var(--t-base); }
@media (max-width: 34rem) {
  .hist-form { flex-direction: column; }
  .hist-form .btn { justify-content: center; padding-block: 0.75rem; }
}

.hist-status {
  margin-top: var(--s-5);
  background: var(--paper-1); border-radius: var(--radius-lg);
  padding: var(--s-4) var(--s-5);
  font-size: var(--t-base); line-height: 1.6; color: var(--ink-soft);
}
.hist-status b { color: var(--ink); font-weight: 600; }
.hist-status a { color: var(--ink); text-decoration: underline; text-underline-offset: 0.2em; }
.hist-status--warn b { color: var(--status-warning); }
/* While the county is being asked: a quiet pulse on the panel, never a spinner. */
.hist-status--busy { animation: hist-pulse 1.6s var(--ease) infinite alternate; }
@keyframes hist-pulse { from { background: var(--paper-1); } to { background: var(--paper-2); } }
@media (prefers-reduced-motion: reduce) { .hist-status--busy { animation: none; } }

.hist-picks { margin-top: var(--s-7); display: flex; flex-direction: column; gap: var(--s-3); }
.hist-picks__h { font-size: var(--t-xl); letter-spacing: -0.015em; }
.hist-picks__sub { color: var(--ink-mid); font-size: var(--t-sm); line-height: 1.6; }
.hist-picks__list { list-style: none; margin: var(--s-2) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.hist-pick {
  display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-4); flex-wrap: wrap;
  background: var(--paper-1); border-radius: var(--radius-md);
  padding: var(--s-4) var(--s-5);
  transition: background var(--dur) var(--ease);
}
.hist-pick:hover { background: var(--paper-2); }
.hist-pick--choice { width: 100%; border: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.hist-pick:focus-visible { outline: 0.125rem solid var(--accent); outline-offset: 0.125rem; }
.hist-pick__addr { color: var(--ink); font-weight: 500; }
.hist-pick__parcel { color: var(--ink-mid); font-size: var(--t-sm); font-variant-numeric: tabular-nums; }
.hist-picks__more { color: var(--ink-mid); font-size: var(--t-sm); padding: var(--s-2) var(--s-1); }

/* ==========================================================
   ONE PROPERTY
========================================================== */
.hist-place { padding-bottom: var(--rhythm-block); }
.hist-place__head { display: flex; flex-direction: column; gap: var(--s-3); margin-bottom: var(--s-6); }
.hist-place__address {
  font-size: clamp(1.875rem, 4.2vw, var(--t-4xl));
  line-height: 1.08; letter-spacing: -0.03em; font-weight: 600;
  max-width: 24ch; overflow-wrap: anywhere;
}
.hist-place__meta { color: var(--ink-mid); font-size: var(--t-base); font-variant-numeric: tabular-nums; }
.hist-act__block[hidden] { display: none; }
.hist-about__line { display: block; }
.hist-status .btn { margin-top: var(--s-4); }
.hist-status a.btn--primary { color: var(--on-accent); text-decoration: none; }

.hist-place__grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: var(--gap-grid); align-items: stretch; }
@media (max-width: 62rem) { .hist-place__grid { grid-template-columns: 1fr; } }

.hist-map { background: var(--paper-1); border-radius: 1.125rem; overflow: hidden; min-height: 22rem; }
.hist-map__canvas { width: 100%; height: 100%; min-height: 22rem; }
@media (max-width: 40rem) { .hist-map, .hist-map__canvas { min-height: 16rem; } }

.hist-act { display: flex; flex-direction: column; gap: var(--gap-grid); }
.hist-act__block {
  background: var(--paper-1); border-radius: 1.125rem; padding: var(--pad-card);
  display: flex; flex-direction: column; gap: var(--s-3);
}
.hist-act__h { font-size: var(--t-lg); letter-spacing: -0.012em; }
.hist-act__p { color: var(--ink-mid); font-size: var(--t-sm); line-height: 1.65; }
.hist-act__p b { color: var(--ink-soft); font-weight: 600; }
.hist-act__btn { align-self: flex-start; margin-top: var(--s-2); }
.hist-act__other { color: var(--ink-mid); font-size: var(--t-sm); padding-inline: var(--s-1); }
.hist-act__other a { color: var(--ink); text-decoration: underline; text-underline-offset: 0.2em; }

/* What its history covers: one filled panel per domain, its kinds listed with how recent each is. */
.hist-cover .hsec__head { margin-bottom: var(--s-6); }
/* Two flowing columns rather than rows, so a short domain does not leave a hole beside a long one. */
.hist-cover__grid { columns: 2; column-gap: var(--gap-grid); }
.hist-cover__grid > .hist-domain { break-inside: avoid; margin-bottom: var(--gap-grid); }
@media (max-width: 52rem) { .hist-cover__grid { columns: 1; } }

.hist-domain {
  background: var(--paper-1); border-radius: 1.125rem; padding: var(--pad-card);
  display: flex; flex-direction: column; gap: var(--s-4);
}
.hist-domain__h { font-size: var(--t-md); font-weight: 600; letter-spacing: -0.01em; }
.hist-domain[data-domain="work"] .hist-domain__h { color: var(--eg-work); }
.hist-domain[data-domain="ownership"] .hist-domain__h { color: var(--eg-ownership); }
.hist-domain[data-domain="money"] .hist-domain__h { color: var(--eg-money); }
.hist-domain[data-domain="condition"] .hist-domain__h { color: var(--eg-condition); }

.hist-kinds { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.hist-kind { padding: var(--s-3) 0; border-top: var(--rule-w) solid var(--rule); display: flex; flex-direction: column; gap: var(--s-1); }
.hist-kind:first-child { border-top: 0; padding-top: 0; }
.hist-kind__top { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-3); flex-wrap: wrap; }
.hist-kind__label { color: var(--ink); font-weight: 500; font-size: var(--t-base); }
.hist-kind__through { color: var(--ink-mid); font-size: var(--t-xs); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hist-kind__events { color: var(--ink-mid); font-size: var(--t-sm); line-height: 1.55; }

.hist-missing .hsec__head { margin-bottom: var(--s-5); }

/* The purchase's small print and the owner's name. */
.hist-act__fine { color: var(--ink-ghost); font-size: var(--t-xs); line-height: 1.55; }
.hist-act__btn:disabled { opacity: 0.6; cursor: progress; }
/* The value a side panel is about: the partner's credit, the owner's name. */
.hist-act__value { color: var(--ink); font-size: var(--t-lg); font-weight: 600; letter-spacing: -0.012em; line-height: 1.3; }

/* ==========================================================
   A BUYER'S LINK · the property's facts and its records
========================================================== */
.hist-facts { margin-top: var(--gap-grid); }
.hist-facts__grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 9.5rem), 1fr)); gap: var(--s-2);
  margin: 0;
}
.hist-fact { background: var(--paper-1); border-radius: var(--radius-md); padding: var(--s-3) var(--s-4); display: flex; flex-direction: column; gap: var(--s-1); }
.hist-fact dt { color: var(--ink-mid); font-size: var(--t-xs); }
.hist-fact dd { margin: 0; color: var(--ink); font-size: var(--t-sm); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.hist-report__head { margin-bottom: var(--s-6); }
.hist-report__bar { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-5); }
.hist-place__head--report { flex-direction: row; align-items: flex-start; justify-content: space-between; gap: var(--s-6); }
.hist-place__id { display: flex; flex-direction: column; gap: var(--s-3); min-width: 0; }
.hist-place__print { flex: none; align-self: flex-start; margin-top: var(--s-2); }
.hist-place__print[hidden] { display: none; }
@media (max-width: 40rem) {
  .hist-place__head--report { flex-direction: column; gap: var(--s-4); }
  .hist-place__print { margin-top: 0; }
}

/* The parcel and what is on record, side by side: two filled panels, rows inside. */
.hist-glance { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: var(--gap-grid); margin-top: var(--gap-grid); align-items: start; }
@media (max-width: 52rem) { .hist-glance { grid-template-columns: minmax(0, 1fr); } }
.hist-panel { background: var(--paper-1); border-radius: 1.125rem; padding: var(--pad-card); }
.hist-panel[hidden] { display: none; }
/* A panel's heading: small, uppercase, and gray, as the app's panel headings are. */
.hist-label { font-size: var(--t-xs); text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-mid); font-weight: 600; margin: 0; }
.hist-panel .hist-label { margin-bottom: var(--s-3); }
.hist-rows { margin: 0; }
.hist-rows > div { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-4); padding-block: var(--s-2); border-top: var(--rule-w) solid var(--rule); }
.hist-rows > div:first-child { border-top: 0; }
.hist-rows dt { color: var(--ink-mid); font-size: var(--t-sm); }
.hist-rows dd { margin: 0; color: var(--ink); font-size: var(--t-sm); font-variant-numeric: tabular-nums; text-align: right; overflow-wrap: anywhere; }
.hist-onrec { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); column-gap: var(--s-6); row-gap: var(--s-4); }
.hist-onrec li { display: grid; grid-template-columns: 0.5rem minmax(0, 1fr) auto; column-gap: var(--s-2); align-items: baseline; }
.hist-onrec__dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--signal, var(--ink-ghost)); align-self: center; }
.hist-onrec__kind { font-weight: 600; font-size: var(--t-sm); }
.hist-onrec__n { font-weight: 600; font-size: var(--t-sm); font-variant-numeric: tabular-nums; }
.hist-onrec__latest { grid-column: 2 / -1; color: var(--ink-mid); font-size: var(--t-xs); margin-top: 0.125rem; }

.hist-timeline { list-style: none; margin-block: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.hist-rec {
  display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: var(--s-4);
  background: var(--paper-1); border-radius: var(--radius-lg); padding: var(--s-4) var(--s-5);
}
@media (max-width: 40rem) { .hist-rec { grid-template-columns: 1fr; gap: var(--s-2); } }
.hist-rec__when { color: var(--ink-mid); font-size: var(--t-sm); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hist-rec__body { display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; }
.hist-rec__top { display: flex; align-items: baseline; gap: var(--s-2) var(--s-3); flex-wrap: wrap; }
.hist-rec__kind { color: var(--ink); font-weight: 500; }
.hist-rec__status { color: var(--ink-mid); font-size: var(--t-xs); background: var(--paper-2); border-radius: var(--radius-full); padding: 0.125rem var(--s-2); }
.hist-rec__status--now { color: var(--status-warning); }
.hist-rec__value { color: var(--ink-soft); font-size: var(--t-sm); font-variant-numeric: tabular-nums; margin-left: auto; }
.hist-rec__summary { color: var(--ink-soft); font-size: var(--t-sm); line-height: 1.55; overflow-wrap: anywhere; white-space: pre-line; }
/* Inspections fold into one line under their permit; opening it lists each. */
.hist-rec__insp { color: var(--ink-mid); font-size: var(--t-xs); font-variant-numeric: tabular-nums; }
.hist-rec__insp summary { cursor: pointer; width: fit-content; }
.hist-rec__insp summary:hover { color: var(--ink-soft); }
.hist-rec__insp ul { list-style: none; margin: var(--s-2) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-1); }
.hist-rec__insp li span { display: inline-block; min-width: 6.5rem; color: var(--ink-ghost); }
.hist-rec__more { color: var(--ink-mid); font-size: var(--t-xs); }
.hist-rec__more summary { cursor: pointer; width: fit-content; }
.hist-rec__more summary:hover { color: var(--ink-soft); }
.hist-rec__facts { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr); gap: var(--s-1) var(--s-3); margin: var(--s-2) 0 0; }
@media (max-width: 40rem) { .hist-rec__facts { grid-template-columns: minmax(0, 7.5rem) minmax(0, 1fr); } }
.hist-rec__facts dt { color: var(--ink-ghost); }
.hist-rec__facts dd { margin: 0; color: var(--ink-soft); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.hist-rec__facts dd.is-prose { white-space: pre-line; line-height: 1.55; }
.hist-rec__lines-h { margin: var(--s-3) 0 0; color: var(--ink-ghost); }
.hist-rec__lines { list-style: none; margin: var(--s-1) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-1); color: var(--ink-soft); overflow-wrap: anywhere; }
.hist-rec__lines--row { margin: 0; font-size: var(--t-sm); line-height: 1.55; }
.hist-rec__line-meta { color: var(--ink-ghost); font-size: var(--t-xs); }
.hist-rec__lines-more { margin: var(--s-1) 0 0; color: var(--ink-ghost); }
.hist-rec__links { margin: var(--s-2) 0 0; display: flex; flex-wrap: wrap; gap: var(--s-3); }
.hist-rec__links a { color: var(--accent); }

/* Year headings between records, and the filter and "show all" around them. */
.hist-year { padding: var(--s-5) 0 var(--s-1); }
.hist-year:first-child { padding-top: 0; }
.hist-year h3 { font-size: var(--t-md); font-weight: 600; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.hist-filter { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.hist-filter[hidden] { display: none; }
.hist-filter .btn[aria-pressed="true"] { background: var(--paper-3); color: var(--ink); }
.hist-filter .btn[aria-pressed="false"] { color: var(--ink-mid); }
.hist-more { margin-top: var(--s-5); }
.hist-more[hidden] { display: none; }

.hist-upsell .hist-act__p { max-width: var(--measure); }

/* Printing: only the print copy, which history.js builds at print time and removes after. */
@media screen { .hist-print { display: none !important; } }
@media print {
  @page { margin: 14mm; }
  body > *:not(.hist-print) { display: none !important; }
  body { background: #fff !important; }
  .hist-print { display: block; }
}

/* The print theme: the light theme with every surface white and no shadows; hairlines stand in for
   the fills that separated things. Colors that carry meaning (chart bars, record groups) stay. */
.theme-print {
  --paper-0: #fff; --paper-1: #fff; --paper-2: #fff; --paper-3: #fff; --paper-4: #fff; --paper-5: #fff; --paper-6: #fff;
  --bar: #fff; --shade: transparent; --ambient-glow: transparent;
  --shadow-sm: none; --shadow-md: none; --shadow-lg: none; --shadow-accent: none;
  --control-fill: #fff; --control-fill-hover: #fff; --accent-tint: #fff;
  --status-success-bg: #fff; --status-warning-bg: #fff; --status-error-bg: #fff; --status-info-bg: #fff; --status-pending-bg: #fff;
  --badge-neutral-bg: #fff; --badge-success-bg: #fff; --badge-warning-bg: #fff; --badge-danger-bg: #fff;
  --badge-info-bg: #fff; --badge-pending-bg: #fff; --badge-unknown-bg: #fff;
  background: #fff; color: var(--ink);
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.theme-print .hist-panel, .theme-print .hist-act__block, .theme-print .hist-rec, .theme-print .hist-report__chart {
  border: 1px solid var(--rule);
}

/* The print copy's layout. */
.hist-print { font-size: 10pt; }
.hist-print > * + * { margin-top: var(--s-5); }
.hist-print__head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-6); align-items: start; padding-bottom: var(--s-5); border-bottom: 1px solid var(--rule); }
.hist-print__logo { display: block; height: 1.5rem; width: auto; margin-bottom: var(--s-4); }
.hist-print__address { font-size: 1.75rem; line-height: 1.1; letter-spacing: -0.02em; font-weight: 600; margin: var(--s-2) 0; }
.hist-print__meta, .hist-print__asof { color: var(--ink-mid); font-size: var(--t-sm); }
.hist-print__qr { width: 9rem; text-align: center; }
.hist-print__qr svg { display: block; width: 9rem; height: 9rem; }
.hist-print__url { font-family: var(--font-mono); font-size: 7pt; color: var(--ink-mid); overflow-wrap: anywhere; margin-top: var(--s-2); }
.hist-print__until { font-size: var(--t-xs); color: var(--ink-mid); margin-top: var(--s-1); }
.hist-print .hist-act { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--gap-grid); }
.hist-print .hist-rec, .hist-print .hist-panel, .hist-print .hist-act__block { break-inside: avoid; }
.hist-paper { margin-top: var(--s-2); }
.hist-paper__h { color: var(--ink-mid); font-size: var(--t-xs); font-weight: 500; margin: 0 0 var(--s-1); }

/* The example chart beside the check (chart.css), and the buyer's own above their records. */
/* The check beside the example; the example drops below on narrower screens and goes once a check
   has an answer, when the check takes the whole width. */
.hist-check__layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.hist-check__layout:has(.hist-example.is-replaced),
.hist-check__layout:has(.hist-example[hidden]) { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 62rem) { .hist-check__layout { grid-template-columns: 1fr; } }
.hist-check__main .hsec__head { margin-bottom: var(--s-7); }
.hist-example { margin: 0; background: var(--paper-1); border-radius: 1.125rem; padding: var(--pad-card); display: flex; flex-direction: column; gap: var(--s-4); }
.hist-example[hidden], .hist-example.is-replaced { display: none; }
.hist-example__caption { color: var(--ink-mid); font-size: var(--t-sm); line-height: 1.55; }
.hist-report__chart { background: var(--paper-1); border-radius: var(--radius-lg); padding: var(--s-5); margin-bottom: var(--s-4); }
.hist-report__chart[hidden] { display: none; }

/* The price, stated once and plainly above what it buys. */
.hist-act__price { color: var(--ink-mid); font-size: var(--t-sm); }
.hist-act__price b { color: var(--ink); font-size: var(--t-2xl); font-weight: 600; letter-spacing: -0.02em; margin-right: var(--s-1); font-variant-numeric: tabular-nums; }

/* MapLibre's attribution as a quiet plate on the dark map, like the app's, rather than the library's
   white pill. */
.hist-map .maplibregl-ctrl-bottom-right .maplibregl-ctrl-attrib { background: var(--paper-0); color: var(--ink-mid); font-size: var(--t-2xs); border-radius: var(--radius-sm); }
.hist-map .maplibregl-ctrl-attrib a { color: var(--ink-mid); }
