/* =====================================================================
   assets/css/buyer-review.css  (v5, 2026-10-20)
   Page-specific styles for /services/flipped-renovated-home-inspection/
   (and its future Simplified Chinese version). Loaded only on those
   pages via $extra_head, the same pattern as yt-facade.css, so the
   shared style.css / style.min.css stay untouched.

   Components: the illustrative sample report sheet (title block,
   six-category key, quick overview table, item cards modeled on PCC's
   Site Observation Report, stock photo figures) and the report
   contents list. Built only from the Forensic Blueprint tokens in
   style.css :root. Corner registration marks use the solid-fill
   gradient technique (PROJECT-REFERENCE.md section 7 item 5).
   ===================================================================== */

/* ---------- Report sheet ---------- */
.report-sheet {
  position: relative;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-3);
  margin-top: var(--space-3);
  transform: translateZ(0);
}
.report-sheet::before {
  content: "";
  position: absolute;
  inset: -7px;
  pointer-events: none;
  background:
    linear-gradient(var(--steel), var(--steel)) top left / 18px 3px no-repeat,
    linear-gradient(var(--steel), var(--steel)) top left / 3px 18px no-repeat,
    linear-gradient(var(--steel), var(--steel)) top right / 18px 3px no-repeat,
    linear-gradient(var(--steel), var(--steel)) top right / 3px 18px no-repeat,
    linear-gradient(var(--steel), var(--steel)) bottom left / 18px 3px no-repeat,
    linear-gradient(var(--steel), var(--steel)) bottom left / 3px 18px no-repeat,
    linear-gradient(var(--steel), var(--steel)) bottom right / 18px 3px no-repeat,
    linear-gradient(var(--steel), var(--steel)) bottom right / 3px 18px no-repeat;
}

.report-stamp {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--signal-dark);
  border: 2px solid var(--signal);
  border-radius: var(--radius);
  padding: 0.25rem 0.6rem;
  margin-bottom: var(--space-2);
}

.report-titleblock {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  border: 1px solid var(--ink);
  margin-bottom: var(--space-3);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink);
}
.report-titleblock > div { padding: 0.6rem 0.8rem; border-right: 1px solid var(--ink); min-width: 0; }
.report-titleblock > div:last-child { border-right: none; }
.report-titleblock dl { margin: 0; }
.report-titleblock dt { text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); font-size: 0.7rem; }
.report-titleblock dd { margin: 0.15rem 0 0; font-weight: 600; }

.report-sheet h3 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.05rem;
  margin: var(--space-3) 0 0.6rem;
}
.report-sheet h3 .report-sec { font-family: var(--font-mono); font-weight: 600; color: var(--signal-dark); margin-right: 0.4rem; }
.report-sheet > p,
.report-sheet .report-note { color: var(--ink-soft); font-size: 0.92rem; max-width: 72ch; }

/* ---------- Tables (category key, quick overview) ---------- */
.report-table-wrap { overflow-x: auto; }
.report-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.report-table caption {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  padding-bottom: 0.5rem;
}
.report-table th {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: left;
  color: #fff;
  background: var(--steel-dark);
  padding: 0.55rem 0.7rem;
  vertical-align: bottom;
}
.report-table td { padding: 0.6rem 0.7rem; border-bottom: 1px solid var(--line-soft); vertical-align: top; color: var(--ink); }
.report-table tbody tr:nth-child(even) td { background: var(--paper); }
.report-table .item-no { font-family: var(--font-mono); color: var(--ink-soft); white-space: nowrap; }

/* ---------- Category labels: text carries the meaning, color reinforces it ---------- */
.cat {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: var(--radius);
  padding: 0.2rem 0.45rem;
  border: 1px solid currentColor;
  white-space: nowrap;
}
.cat--safety  { color: var(--signal-dark); background: var(--signal-tint); }
.cat--wip     { color: var(--steel-dark); background: var(--steel-tint); }
.cat--review  { color: var(--steel-dark); }
.cat--work    { color: var(--ink-soft); }
.cat--confirm { color: var(--success); }
.cat--records { color: var(--ink); background: var(--paper); }

/* ---------- Item cards (Observed / Why it may matter / Typical correction / Next step) ---------- */
.report-items { display: grid; gap: var(--space-3); }
.report-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-raised);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
}
.report-item--nophoto { grid-template-columns: minmax(0, 1fr); }
.report-item-head {
  grid-column: 1 / -1;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--line-soft);
  background: var(--paper);
}
.report-item-title { font-family: var(--font-body); font-weight: 700; font-size: 1rem; margin: 0 0 0.35rem; }
.report-item-title .item-no { font-family: var(--font-mono); color: var(--signal-dark); margin-right: 0.4rem; }
.report-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1rem;
  align-items: center;
  font-size: 0.82rem;
  color: var(--ink-soft);
}
.report-item-meta strong { color: var(--ink); font-weight: 600; }
.report-item figure { margin: 0; padding: 0.9rem; min-width: 0; }
.report-item figure img { display: block; width: 100%; height: auto; border: 1px solid var(--line-soft); }
.report-item figcaption { font-size: 0.78rem; color: var(--ink-soft); margin-top: 0.4rem; }
.report-item figcaption .photo-no { font-family: var(--font-mono); font-weight: 600; color: var(--signal-dark); margin-right: 0.35rem; }
.report-item-body { padding: 0.9rem; min-width: 0; }
.report-item-body p { font-size: 0.9rem; color: var(--ink); margin: 0 0 0.55rem; }
.report-item-body p:last-child { margin-bottom: 0; }
.report-item-body p strong { color: var(--steel-dark); }

.report-foot {
  margin-top: var(--space-3);
  padding-top: 0.6rem;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-soft);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
}

/* ---------- Report contents list (numbered like the report's sections) ---------- */
.report-contents {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 var(--space-4);
}
.report-contents li {
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr);
  gap: 0.5rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.94rem;
  color: var(--ink-soft);
}
.report-contents .sec-no { font-family: var(--font-mono); font-weight: 600; color: var(--steel); }
.report-contents strong { color: var(--ink); }

/* Language switch in the page header: English, Simplified Chinese,
   Traditional Chinese, Spanish. The current language is plain text. */
.lang-switch {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.6rem;
  margin: 0.9rem 0 0;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.85);
}
.lang-switch a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.lang-switch a:hover,
.lang-switch a:focus-visible { color: #fff; }
.lang-switch-current { color: #fff; font-weight: 600; }
.lang-switch-sep { color: rgba(255, 255, 255, 0.5); }
.lang-switch + .page-header-jump { margin-top: 1.1rem; }

/* Chinese pages: the self-hosted fonts cover Latin only (unicode-range),
   so Chinese characters fall through to these system fonts. No web font
   download. Taller line height for Chinese headings. */
html:lang(zh-Hans) {
  --font-display: 'Big Shoulders Display', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', 'Noto Sans CJK SC', sans-serif;
  --font-body: 'Source Sans 3', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', 'Noto Sans CJK SC', sans-serif;
  --font-mono: 'IBM Plex Mono', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', monospace;
}
html:lang(zh-Hant) {
  --font-display: 'Big Shoulders Display', 'PingFang TC', 'Microsoft JhengHei', 'Noto Sans TC', 'Noto Sans CJK TC', sans-serif;
  --font-body: 'Source Sans 3', 'PingFang TC', 'Microsoft JhengHei', 'Noto Sans TC', 'Noto Sans CJK TC', sans-serif;
  --font-mono: 'IBM Plex Mono', 'PingFang TC', 'Microsoft JhengHei', 'Noto Sans TC', monospace;
}
html:lang(zh) h1, html:lang(zh) h2, html:lang(zh) h3 { line-height: 1.3; letter-spacing: 0.02em; }
html:lang(zh) .page-header-lede, html:lang(zh) p, html:lang(zh) li { line-height: 1.8; }

/* ---------- Narrow screens ---------- */
@media (max-width: 760px) {
  .report-titleblock { grid-template-columns: 1fr; }
  .report-titleblock > div { border-right: none; border-bottom: 1px solid var(--ink); }
  .report-titleblock > div:last-child { border-bottom: none; }
  .report-item { grid-template-columns: minmax(0, 1fr); }
  .report-contents { grid-template-columns: minmax(0, 1fr); }

  .report-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .report-table, .report-table caption, .report-table tbody, .report-table tr, .report-table td { display: block; width: 100%; }
  .report-table tr { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: var(--space-2); background: var(--paper-raised); }
  .report-table tbody tr:nth-child(even) td { background: transparent; }
  .report-table td:last-child { border-bottom: none; }
  .report-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ink-soft);
    margin-bottom: 0.15rem;
  }
}

/* "Last updated" line under the page header lede (AI answers favor visibly fresh pages). */
/* Portrait site photos in the sample report (v6): keep them from running taller than the card. */
.report-item figure img.is-portrait { max-width: 340px; margin: 0 auto; }
