/*
 * The property report (/report, sites/pages/report). In print it's an A4 information pack: a full-bleed cover,
 * then numbered chapters with the address and page numbers in the page margins. On screen the same document
 * sits on a sheet under a print button. Type and colour come from the theme's custom properties (base.css and
 * the theme file), so the report matches the site it came from. Tints are mixed from the accent rather than
 * taken from --color-bg-alt, which some themes set dark.
 */

.report {
  --report-ink: var(--color-text);
  --report-muted: var(--color-muted);
  --report-rule: var(--color-rule);
  --report-accent: var(--color-accent);
  --report-tint: color-mix(in srgb, var(--color-accent) 7%, #fff);
  --report-tint-strong: color-mix(in srgb, var(--color-accent) 14%, #fff);
  --report-pad: clamp(1.5rem, 5vw, 3.5rem);
  counter-reset: report-chapter;
  padding: calc(var(--nav-height) + 1.5rem) 0 4rem;
  background: color-mix(in srgb, var(--color-text) 5%, var(--color-bg));
  color: var(--report-ink);
}

.report__toolbar {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.75rem 1rem;
  width: min(100% - 2 * var(--gutter), 900px); margin: 0 auto 1.25rem;
}
.report__sheet {
  width: min(100% - 2 * var(--gutter), 900px); margin-inline: auto;
  background: var(--color-surface, #fff);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 18px 50px rgba(0, 0, 0, 0.1);
}
@media (max-width: 700px) {
  .report__sheet { width: 100%; box-shadow: none; }
}

/* ------------------------------------------------------------------ labels shared by every part */
.report-cover__kicker, .report-stats__label, .report-terms dt, .report-spec__title, .report-subhead,
.report-chapter__meta dt, .report-table thead th, .report-nearby__category, .report-visit__date span {
  font-family: var(--font-ui);
  font-size: 0.7em;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--report-muted);
}

/* ------------------------------------------------------------------ cover */
.report-cover__photo { margin: 0; }
.report-cover__photo img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.report-cover__body { padding: var(--report-pad); }
.report-cover__kicker {
  display: flex; justify-content: space-between; gap: 1rem; margin: 0 0 1.75em;
  padding-bottom: 0.9em; border-bottom: 1px solid var(--report-accent); color: var(--report-accent);
}
.report__title { margin: 0; font-size: 1em; line-height: 1; }
.report-cover__street {
  display: block; font-size: clamp(2.2em, 1.4em + 3vw, 3.4em); line-height: 1.04; letter-spacing: var(--heading-tracking);
  text-transform: var(--heading-case);
}
.report-cover__locality {
  display: block; margin-top: 0.55em; font-family: var(--font-ui); font-size: 1.05em; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--report-muted);
}
.report-cover__headline {
  margin: 1.4em 0 0; font-family: var(--font-display); font-weight: var(--heading-weight);
  font-size: 1.35em; line-height: 1.3; color: var(--report-accent);
}
.report-cover__tagline { margin: 0.35em 0 0; color: var(--report-muted); }

.report-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(6.5em, 1fr));
  margin: 2em 0 0; border-block: 1px solid var(--report-rule);
}
.report-stats__item {
  display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 0.3em;
  padding: 1em 1.1em; border-left: 1px solid var(--report-rule);
}
.report-stats__item:first-child { border-left: 0; padding-left: 0; }
.report-stats__value {
  display: flex; align-items: center; gap: 0.4em; margin: 0; white-space: nowrap;
  font-family: var(--font-display); font-weight: var(--heading-weight); font-size: clamp(1.45em, 1em + 1.6vw, 1.9em); line-height: 1;
}
.report-stats__icon { flex: none; width: auto; height: 0.55em; color: var(--report-accent); }
.report-stats__label { margin: 0; }

.report-terms {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(9em, 1fr)); gap: 1em 1.5em;
  margin: 1.4em 0 0;
}
.report-terms__item { display: flex; flex-direction: column; gap: 0.25em; }
.report-terms dt { margin: 0; }
.report-terms dd { margin: 0; font-weight: 600; font-size: 1.05em; }

.report-cover__foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1.5em 2em;
  margin-top: 2.2em; padding-top: 1.6em; border-top: 1px solid var(--report-rule);
}

/* an agent: portrait, name, role, how to reach them */
.report-person { display: flex; align-items: center; gap: 1em; min-width: 0; }
.report-person__photo {
  flex: none; display: grid; place-items: center; width: 4.2em; height: 4.2em; border-radius: 50%; overflow: hidden;
  background: var(--report-tint); border: 1px solid var(--report-rule);
}
.report-person__photo img { width: 100%; height: 100%; object-fit: cover; }
.report-person__photo--logo { border-radius: var(--radius-sm); background: #fff; }
.report-person__photo--logo img { object-fit: contain; padding: 0.4em; }
.report-person__initials { font-family: var(--font-display); font-size: 1.35em; color: var(--report-accent); }
.report-person__body { min-width: 0; }
.report-person__body p { margin: 0; }
.report-person__name { font-family: var(--font-display); font-weight: var(--heading-weight); font-size: 1.2em; line-height: 1.2; }
.report-person__role { color: var(--report-muted); font-size: 0.9em; }
.report-person__lines { margin-top: 0.3em !important; font-size: 0.9em; }
.report-person__links { list-style: none; margin: 0.5em 0 0; padding: 0; font-size: 0.92em; }
.report-person__links li { display: flex; align-items: center; gap: 0.55em; }
.report-person__links svg, .report-person__links i { width: 1em; color: var(--report-accent); }

/* a QR code back to the site */
.report-qr { display: flex; align-items: center; gap: 1em; }
.report-qr__code { flex: none; width: 5.5em; height: 5.5em; }
.report-qr__text { display: flex; flex-direction: column; gap: 0.15em; margin: 0; max-width: 22em; font-size: 0.88em; line-height: 1.4; color: var(--report-muted); }
.report-qr__text strong { font-size: 1.1em; color: var(--report-ink); }
.report-qr__text span { color: var(--report-accent); font-weight: 600; overflow-wrap: anywhere; }

/* ------------------------------------------------------------------ chapters */
.report-chapter { counter-increment: report-chapter; padding: var(--report-pad); border-top: 1px solid var(--report-rule); }
.report-chapter__title {
  display: flex; align-items: baseline; gap: 0.6em; margin: 0 0 1.1em;
  font-size: clamp(1.6em, 1.2em + 1.5vw, 2.2em); line-height: 1.1;
}
.report-chapter__title::before {
  content: counter(report-chapter, decimal-leading-zero);
  font-family: var(--font-ui); font-size: 0.4em; font-weight: 600; letter-spacing: 0.12em;
  color: var(--report-accent); padding-bottom: 0.3em; border-bottom: 1.5px solid var(--report-accent);
  transform: translateY(-0.35em);
}
.report-chapter__lede { font-family: var(--font-display); font-weight: var(--heading-weight); font-size: 1.3em; line-height: 1.45; max-width: 38em; }
.report-chapter__lede p { margin: 0 0 0.6em; }
.report-chapter__text { margin-top: 1.4em; columns: 2 18em; column-gap: 2.5em; }
.report-chapter__text p { margin: 0 0 0.85em; }
.report-chapter__text strong { font-weight: 600; color: var(--report-accent); }
.report-chapter__meta { display: flex; flex-wrap: wrap; gap: 0.5em 2.5em; margin: -0.4em 0 1.4em; }
.report-chapter__meta div { display: flex; align-items: baseline; gap: 0.6em; }
.report-chapter__meta dd { margin: 0; font-weight: 600; }
.report-subhead { margin: 2.2em 0 0.9em; padding-bottom: 0.6em; border-bottom: 1px solid var(--report-ink); color: var(--report-ink); }
.report-note { margin: 0.6em 0 0; font-size: 0.85em; color: var(--report-muted); }

/* photographs: one large beside two stacked */
.report-photos { display: grid; gap: 0.6em; margin-top: 2em; }
.report-photos__item { display: flex; flex-direction: column; gap: 0.4em; margin: 0; min-height: 0; }
.report-photos__item img { flex: 1; min-height: 0; width: 100%; height: 100%; object-fit: cover; }
.report-photos figcaption { flex: none; font-size: 0.78em; color: var(--report-muted); }
.report-photos--1 .report-photos__item img { aspect-ratio: 16 / 9; }
.report-photos--2 { grid-template-columns: 1fr 1fr; }
.report-photos--2 .report-photos__item img { aspect-ratio: 4 / 3; }
.report-photos--3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 16 / 9; }
.report-photos--3 .report-photos__item:first-child { grid-row: span 2; }

/* floor plans */
.report-plan { margin: 0 0 1.5em; break-inside: avoid; }
.report-plan img { width: 100%; height: auto; object-fit: contain; }
.report-plan figcaption { margin-top: 0.6em; font-size: 0.85em; color: var(--report-muted); }

/* features, details and outgoings: label and value on one ruled line, groups side by side in rows (a grid
   rather than columns, so a page break falls between rows of groups instead of re-balancing them) */
.report-specs { display: grid; grid-template-columns: repeat(auto-fit, minmax(18em, 1fr)); gap: 1.8em 2.5em; align-items: start; }
.report-spec { break-inside: avoid; }
.report-spec__title { margin: 0 0 0.5em; color: var(--report-accent); }
.report-list { margin: 0; }
.report-list > div { display: flex; justify-content: space-between; align-items: baseline; gap: 1em; padding: 0.45em 0; border-bottom: 1px solid var(--report-rule); }
.report-list dt { min-width: 0; }
.report-list dd { margin: 0; text-align: right; color: var(--report-muted); }
.report-rooms { display: grid; grid-template-columns: repeat(auto-fit, minmax(18em, 1fr)); gap: 1em 2.5em; margin: 0; align-items: start; }
.report-rooms__item { break-inside: avoid; }
.report-rooms dt { font-weight: 600; }
.report-rooms dd { margin: 0.2em 0 0; color: var(--report-muted); }
.report-rooms dd p { margin: 0; }

/* location */
.report-nearby {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(12em, 1fr)); gap: 1px;
  list-style: none; margin: 0; padding: 0; background: var(--report-rule); border: 1px solid var(--report-rule);
}
.report-nearby__item { display: flex; flex-direction: column; gap: 0.2em; padding: 0.9em 1em; background: var(--report-tint); }
.report-nearby__category { display: flex; align-items: center; gap: 0.5em; color: var(--report-accent); }
.report-nearby__category svg, .report-nearby__category i { width: 1.2em; height: 1.2em; }
.report-nearby__name { font-weight: 600; line-height: 1.3; margin-top: 0.2em; }
.report-nearby__distance { font-size: 0.85em; color: var(--report-muted); }

.report-table { width: 100%; border-collapse: collapse; font-size: 0.92em; }
.report-table th, .report-table td { text-align: left; padding: 0.5em 0.75em 0.5em 0; border-bottom: 1px solid var(--report-rule); vertical-align: top; }
.report-table thead th { padding-top: 0; border-bottom: 1px solid var(--report-ink); }
.report-table tbody th { font-weight: 600; }
.report-table td { color: var(--report-muted); }
.report-table .report-table__num { text-align: right; padding-right: 0; white-space: nowrap; font-variant-numeric: tabular-nums; }
.report-table tbody tr:nth-child(even) > * { background: color-mix(in srgb, var(--color-accent) 4%, #fff); }

.report-places { display: grid; grid-template-columns: repeat(auto-fit, minmax(16em, 1fr)); gap: 0.5em 2.5em; }
.report-places__group { break-inside: avoid; margin-bottom: 1.2em; }
.report-places .report-list dd { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* inspect and enquire: open homes beside documents, then the agents */
.report-contact { display: grid; gap: 2em 3em; grid-template-columns: repeat(auto-fit, minmax(18em, 1fr)); align-items: start; margin-bottom: 2.2em; }
.report-contact .report-subhead { margin-top: 0; }
.report-people { display: grid; gap: 1em; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19em), 1fr)); align-items: stretch; }
.report-visits { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6em; }
.report-visit { display: flex; align-items: center; gap: 1em; }
.report-visit__date {
  flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 4.2em; height: 4.2em;
  background: var(--report-accent); color: var(--color-accent-contrast, #fff); line-height: 1.05; border-radius: var(--radius-sm);
}
.report-visit__date span { font-size: 0.62em; color: inherit; opacity: 0.85; letter-spacing: 0.1em; }
.report-visit__date strong { font-family: var(--font-display); font-weight: var(--heading-weight); font-size: 1.55em; }
.report-visit__body { display: flex; flex-direction: column; }
.report-docs { list-style: none; margin: 0; padding: 0; }
.report-docs li { display: flex; align-items: baseline; gap: 0.7em; padding: 0.5em 0; border-bottom: 1px solid var(--report-rule); }
.report-docs li > svg, .report-docs li > i { flex: none; width: 0.9em; color: var(--report-accent); transform: translateY(0.1em); }
.report-docs__title { flex: 1; }
.report-docs__note { font-size: 0.85em; color: var(--report-muted); text-align: right; }
.report-person--card { align-items: flex-start; padding: 1.2em; border: 1px solid var(--report-rule); }
.report-person--card .report-person__links { overflow-wrap: anywhere; }
.report-qr--panel { padding: 1.2em; background: var(--report-tint); border: 1px solid var(--report-tint-strong); }
.report-qr--panel .report-qr__code { width: 6.5em; height: 6.5em; }

/* small print, beside a QR code back to the site */
.report-legal {
  display: flex; flex-wrap: wrap; align-items: center; gap: 1.5em 2.5em;
  padding: 0 var(--report-pad) var(--report-pad); font-size: 0.78em; color: var(--report-muted);
}
.report-legal__text { flex: 1 1 28em; }
.report-legal__text p { margin: 0 0 0.6em; }
.report-legal__text p:last-child { margin-bottom: 0; }
.report-legal__demo { font-weight: 600; color: var(--report-ink); }
.report-legal__source { color: var(--report-accent); }
.report-legal .report-qr { flex: 0 1 auto; font-size: 1.15em; }

/* ------------------------------------------------------------------ print */
@page {
  size: A4;
  margin: 15mm 16mm 17mm;
  @bottom-left { content: "Property report"; vertical-align: top; padding-top: 5mm; font-family: var(--font-body); font-size: 7pt; letter-spacing: 0.04em; color: #77736c; }
  @bottom-right { content: counter(page) " / " counter(pages); vertical-align: top; padding-top: 5mm; font-family: var(--font-body); font-size: 7pt; letter-spacing: 0.04em; color: #77736c; }
}
@page report-cover {
  margin: 0;
  @bottom-left { content: none; }
  @bottom-right { content: none; }
}

@media print {
  .report {
    --report-pad: 0;
    padding: 0; background: none; font-size: 9pt; line-height: 1.5;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .report a { color: inherit; }
  .report__sheet { width: auto; margin: 0; box-shadow: none; background: none; }

  /* The cover is its own named page with no margins, exactly one A4 sheet. */
  .report-cover { page: report-cover; display: flex; flex-direction: column; height: 297mm; overflow: hidden; }
  .report-cover__photo { flex: 0 0 150mm; min-height: 0; }
  .report-cover__photo img { height: 100%; aspect-ratio: auto; }
  .report-cover__body { flex: 1; display: flex; flex-direction: column; min-height: 0; padding: 10mm 16mm 12mm; background: var(--color-bg); }
  .report-cover__kicker { margin-bottom: 7mm; padding-bottom: 2.5mm; font-size: 6.5pt; }
  .report-cover__street { font-size: 31pt; }
  .report-cover__locality { font-size: 9.5pt; margin-top: 2.5mm; }
  .report-cover__headline { margin-top: 5mm; font-size: 13pt; }
  .report-cover__tagline { font-size: 9pt; }
  .report-stats { margin-top: 6mm; }
  .report-stats__item { padding: 3.5mm 4mm; }
  .report-stats__value { font-size: 19pt; }
  .report-terms { margin-top: 5mm; }
  .report-cover__foot { margin-top: auto; padding-top: 5mm; flex-wrap: nowrap; }
  .report-qr__code { width: 21mm; height: 21mm; }

  /* Chapters run on from one another (the home starts page two); photographs, plans, groups and table rows
     never split across pages, and a heading never ends one. */
  .report-chapter { padding: 0; border: 0; }
  .report-chapter + .report-chapter { margin-top: 10mm; }
  .report-chapter--plans, .report-chapter--contact { break-inside: avoid; }
  .report-chapter__title { font-size: 20pt; margin-bottom: 5mm; padding-bottom: 3mm; border-bottom: 0.75pt solid var(--report-rule); break-after: avoid; }
  .report-chapter__lede { font-size: 12.5pt; }
  .report-chapter__text { columns: 2; column-gap: 8mm; margin-top: 4mm; text-align: justify; hyphens: auto; }
  .report-photos { margin-top: 5mm; gap: 2.5mm; break-inside: avoid; }
  .report-photos--3 { height: 112mm; aspect-ratio: auto; }
  .report-subhead { margin: 7mm 0 3mm; padding-bottom: 1.5mm; break-after: avoid; }
  .report-specs, .report-rooms { grid-template-columns: 1fr 1fr; gap: 6mm 9mm; }
  .report-list > div { padding: 1.2mm 0; }
  .report-plan img { max-height: 170mm; }
  .report-nearby { grid-template-columns: repeat(3, 1fr); }
  .report-nearby__item { padding: 3mm 3.5mm; }
  .report-table { font-size: 8.5pt; }
  .report-table th, .report-table td { padding: 1.3mm 3mm 1.3mm 0; }
  .report-table tr { break-inside: avoid; }
  .report-places { grid-template-columns: 1fr 1fr; gap: 0 9mm; }
  .report-contact { grid-template-columns: 1fr 1fr; gap: 9mm; margin-bottom: 7mm; }
  .report-people { grid-template-columns: 1fr 1fr; gap: 4mm 9mm; }
  .report-person--card, .report-qr--panel { padding: 4mm; }
  .report-person--card .report-person__photo { width: 12mm; height: 12mm; }
  .report-chapter--many-plans .report-plan img { max-height: 112mm; }
  .report-legal { flex-wrap: nowrap; gap: 7mm; margin-top: 7mm; padding: 4mm 0 0; border-top: 0.75pt solid var(--report-rule); font-size: 6.5pt; line-height: 1.45; break-inside: avoid; }
  .report-legal__text p { margin-bottom: 1.2mm; }
  .report-legal .report-qr { flex: 0 0 62mm; padding: 3mm; font-size: 8pt; }
  .report-legal .report-qr__code { width: 19mm; height: 19mm; }
}
