/* ARCHINEERS report document.
   Type: Fraunces for titles, Figtree for text.
   Fallbacks: Palatino, "Palatino Linotype", Georgia / "Segoe UI", system-ui.
   Scale: 10px labels, 12.5px tables, 15px text, 22px sections, 40px results.
   Colour: ink #1a1814, green #1e3f32, gold #8c6a3d, hairline #e3d9cc. */

.report-doc {
  --ink: #1a1814;
  --muted: #5e584e;
  --line: #e3d9cc;
  --rule: #1a1814;
  --sheet: #fffdf8;
  --green: #1e3f32;
  --gold: #8c6a3d;
  --serif: "Fraunces", Palatino, "Palatino Linotype", Georgia, serif;
  --sans: "Figtree", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
}

body.report-mode {
  background: #F0EDE6;
}

body.report-mode main {
  display: none;
}

.report-doc[hidden] { display: none; }

.report-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  width: min(210mm, calc(100% - 32px));
  margin: 16px auto 0;
}

.report-toolbar button {
  background: transparent;
  border: 1px solid #cfc4b4;
  color: var(--ink);
  padding: 7px 12px;
  font-size: 13px;
  cursor: pointer;
}

.report-sheet {
  width: min(210mm, calc(100% - 32px));
  margin: 12px auto 36px;
  background: var(--sheet);
  padding: 16mm 15mm 14mm;
}

.cover { padding-bottom: 8mm; }

.brand-mark {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.cover h1 {
  margin: 8px 0 0;
  max-width: 16em;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 560;
  letter-spacing: 0.02em;
  line-height: 1.15;
}

.gold-rule {
  width: 56px;
  height: 1px;
  margin: 16px 0 18px;
  background: var(--gold);
}

.cover-place {
  margin: 0;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 560;
  line-height: 1.25;
}

.cover-type {
  margin: 4px 0 18px;
  color: var(--muted);
}

.cover-meta,
.summary-table,
.meta-table,
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.cover-meta th,
.cover-meta td,
.summary-table th,
.summary-table td,
.meta-table th,
.meta-table td {
  padding: 7px 12px 7px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-weight: 500;
}

.cover-meta th,
.summary-table th,
.meta-table th {
  width: 36%;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.disclaimer,
.note,
.prose.quiet {
  color: var(--muted);
  font-size: 13px;
}

.disclaimer {
  margin: 22px 0 0;
  max-width: 62ch;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.notice {
  margin: 16px 0 0;
  padding: 10px 0 10px 12px;
  border-left: 2px solid var(--gold);
  max-width: 68ch;
  font-size: 13.5px;
}

.report-section { margin: 0 0 26px; }

.report-section h2,
.summary-block h2 {
  margin: 0 0 8px;
  padding-top: 2px;
  border-top: 1px solid var(--rule);
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.25;
}

.summary-block { margin-top: 14px; }
.summary-block h2 { border-top: 0; padding-top: 0; }

.sec-no {
  display: inline;
  margin: 0 0.55em 0 0;
  color: var(--gold);
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.report-section h3 {
  margin: 16px 0 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.prose {
  margin: 12px 0 0;
  max-width: 68ch;
}

.result-hero {
  margin: 0 0 8px;
  padding: 4px 0 12px;
}

.result-hero + .result-hero {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.hero-kicker,
.field-label,
.asking-label {
  margin: 0 0 4px;
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-figure,
.strength-word {
  margin: 0;
  font-family: var(--serif);
  font-weight: 560;
  letter-spacing: -0.03em;
  line-height: 0.95;
}

.hero-figure { font-size: 40px; }
.strength-word { font-size: 42px; }

.unit-word {
  margin: 6px 0 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.badge {
  display: inline-block;
  margin-top: 12px;
  padding: 4px 0;
  border-top: 1px solid var(--gold);
  border-bottom: 1px solid var(--gold);
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

.two-col h3 { margin-top: 0; }

.table-wrap { width: 100%; overflow-x: auto; }
.evidence-table th,
.evidence-table td { font-size: 11px; }
.evidence-table th { letter-spacing: 0.01em; text-transform: none; font-size: 9px; }
.group-row th {
  letter-spacing: 0.03em;
  text-transform: none;
  color: var(--ink);
  font-size: 11px;
  background: #f6f1e8;
}
.evidence-table a { color: #1e3f32; text-decoration: underline; }

.data-table th,
.data-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 12px;
  line-height: 1.35;
}

.data-table th {
  border-bottom: 1px solid var(--rule);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.data-table th,
.data-table td {
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
  vertical-align: top;
}
.data-table td:first-child {
  font-variant-numeric: tabular-nums;
}
.evidence-table { table-layout: fixed; width: 100%; }
.evidence-table th,
.evidence-table td {
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: manual;
  font-size: 8.5pt;
  letter-spacing: 0;
  text-transform: none;
  padding: 4px 3px;
}
.data-table.evidence-table th {
  letter-spacing: 0;
  text-transform: none;
  font-size: 7.5pt;
  hyphens: none;
  overflow-wrap: normal;
  word-break: keep-all;
}
.suitability-table { table-layout: fixed; width: 100%; }
.suitability-table th,
.suitability-table td {
  width: auto;
  text-transform: none;
  letter-spacing: 0;
  font-size: 9.5pt;
  hyphens: none;
  overflow-wrap: break-word;
  word-break: normal;
}

.map-figure { margin: 8px 0 16px; }
.report-map {
  height: 68mm;
  margin: 0 0 8px;
  background: #e7e1d6;
  border: 1px solid var(--line);
}
.report-map .maplibregl-map { height: 100%; }
.map-plate { margin: 0 0 8px; }
.map-caption { margin: 0 0 6px; color: var(--muted); font-size: 13px; }
.evidence-detail, .comp-detail { margin: 10px 0 14px; }
.evidence-detail summary, .comp-detail summary { cursor: pointer; font-weight: 600; }

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.swatch {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
}

.swatch.study { background: var(--green); }
.swatch.place { background: #6f6a62; }
.swatch.comp { background: var(--gold); }

.plain-list,
ul.plain-list {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

ol.plain-list {
  margin: 8px 0 0 0;
  padding: 0 0 0 1.3em;
  list-style: decimal;
}

.plain-list li {
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}

.comp-detail {
  border-bottom: 1px solid var(--line);
  padding: 2px 0 8px;
}

.comp-detail summary {
  cursor: pointer;
  padding: 8px 0;
  font-weight: 600;
}

.doc-foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.03em;
}

.doc-foot p { margin: 0; }
.running-head { display: none; }
.print-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.feedback-panel {
  width: min(210mm, calc(100% - 32px));
  margin: 0 auto 40px;
  background: var(--sheet);
  border: 1px solid var(--line);
  padding: 18px 18px 22px;
}

.feedback-panel h2 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 560;
}

.feedback-field {
  display: block;
  margin: 14px 0;
  border: 0;
  padding: 0;
}

.feedback-field legend,
.feedback-field > span:first-child {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 650;
}

.feedback-field label,
.feedback-panel fieldset label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 14px 8px 0;
  min-height: 32px;
}

.check-grid {
  display: flex;
  flex-wrap: wrap;
}

.feedback-panel textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 72px;
  padding: 8px 10px;
  border: 1px solid #cfc4b4;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}

.feedback-panel .hint {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

body.arch .feedback-panel {
  font-family: "Outfit", system-ui, sans-serif;
  border-color: #DEDAD2;
  width: min(210mm, calc(100% - 32px));
}
.feedback-panel button {
  background: #3D7A6F;
  color: #fff;
  border: 0;
  border-radius: 2px;
  min-height: 52px;
  padding: 0 24px;
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
}

.feedback-panel button[disabled] { opacity: 0.55; cursor: default; }

.feedback-status { min-height: 1.3em; margin: 10px 0 0; }
.feedback-ok { color: var(--green); }
.feedback-error { color: #7a2e24; }

@media (max-width: 760px) {
  .feedback-panel { width: auto; margin: 0 12px 28px; }
  body.arch.has-mcta .feedback-panel { margin-bottom: 96px; }
  body.arch.has-mcta .feedback-panel button,
  body.arch.has-mcta .feedback-status { scroll-margin-bottom: 96px; }
  .feedback-panel fieldset label { display: flex; margin-right: 0; }
}

@media (max-width: 760px) {
  .two-col { grid-template-columns: 1fr; }
  .hero-figure { font-size: 32px; }
  .report-sheet { padding: 18px 14px 24px; }
}

@media print {
  body.report-mode { background: white; }
  .arch-site-nav,
  .arch-nav-scrim,
  .site-foot,
  .mcta,
  .skip-link,
  body.arch > main { display: none !important; }
  .screen-only { display: none !important; }
  .report-sheet {
    width: auto;
    margin: 0;
    padding: 0;
  }
  .cover { break-after: auto; }
  .summary-block { break-after: auto; }
  .report-section h3 { margin: 3mm 0 1mm; }
  .prose, .note { margin-top: 1.4mm; margin-bottom: 0; }
  .plain-list { margin: 1mm 0 2mm; }
  .report-section h2,
  .summary-block h2,
  .report-section h3 { break-after: avoid; }
  h2 + p, h2 + table, h2 + .table-wrap, h3 + p, h3 + table, h3 + ol { break-before: avoid; }
  .landmark-block,
  .observation,
  .suitability-table,
  .meta-table { break-inside: avoid; }
  .sources-section { break-inside: auto; margin-top: 3mm; }
  ol.plain-list li { padding: 3px 0; }
  .group-row,
  .group-row + tr { break-after: avoid; page-break-after: avoid; }
  .table-wrap { overflow: visible !important; }
  .prose, .note, .disclaimer { orphans: 3; widows: 3; }
  .observation { break-inside: avoid; }
  .evidence-table { break-inside: auto; font-size: 8pt; }
  .evidence-table th,
  .evidence-table td { padding: 1.1mm 1.1mm; hyphens: none; overflow-wrap: break-word; word-break: normal; font-size: 7.5pt; }
  .data-table.evidence-table th { overflow-wrap: break-word; word-break: break-word; letter-spacing: 0; text-transform: none; }
  .evidence-table tr { break-inside: avoid; page-break-inside: avoid; }
  .evidence-table td.nowrap,
  .evidence-table .nowrap,
  .evidence-table .nowrap * { white-space: normal !important; overflow-wrap: break-word; word-break: normal; }
  .evidence-table a { color: #1e3f32; }
  .keep,
  .result-hero,
  .comp-detail,
  .notice { break-inside: avoid; }
  .data-table tr,
  .summary-table tr,
  .cover-meta tr,
  .meta-table tr { break-inside: avoid; }
  .report-map { display: none !important; }
  .map-plate { display: block !important; break-inside: avoid; }
  details.evidence-detail,
  details.comp-detail { break-inside: auto; }
  .running-head { display: flex; }
  .running-head {
    position: static;
    justify-content: space-between;
    gap: 8mm;
    margin: 0 0 4mm;
    color: var(--muted);
    font-size: 8pt;
    letter-spacing: 0.04em;
  }
  .doc-foot { display: flex; break-inside: avoid; margin-top: 6mm; }
  @page {
    size: A4 portrait;
    margin: 14mm 12mm 16mm;
    @top-left { content: none; }
    @top-center { content: none; }
    @top-right { content: none; }
    @bottom-left { content: none; }
    @bottom-center { content: none; }
    @bottom-right {
      content: "Page " counter(page);
      font-family: "Segoe UI", sans-serif;
      font-size: 8pt;
      color: #5e584e;
    }
  }
}
