/* =====================================================================
   The corporate profile report. On screen: a sheet of letter paper on a
   grey desk, with a Download PDF button above it. Printed or saved as PDF:
   the sheet alone, letter size, with page numbers at the foot.
   The paper is white with dark ink in both themes (--doc tokens).
   ===================================================================== */

.report-page .page-pad { padding: 0; }
.report-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3); padding-block: var(--s5); }
.back-link { display: inline-flex; align-items: center; gap: var(--s1); min-height: var(--btn-h); text-decoration: none; font-weight: var(--w-strong); }
.back-link:hover { text-decoration: underline; }
.back-link svg, .report-tools .btn svg { width: var(--icon); height: var(--icon); }

.desk { background: var(--desk); padding: var(--s6) var(--gutter) var(--s8); }
.doc {
  max-width: var(--doc-w); margin: 0 auto; padding: var(--doc-pad);
  background: var(--doc); color: var(--doc-ink); box-shadow: var(--lift);
  font-size: var(--rt-md); line-height: 1.45;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
  /* No joined letters: with them, text copied out of the PDF loses "fi" and "fl" ("filed" pastes as "led"). */
  font-variant-ligatures: none; font-feature-settings: "liga" 0, "clig" 0;
}
@media (max-width: 599px) {
  .desk { padding: var(--s4) var(--s2) var(--s7); }
  .doc { padding: var(--s5) var(--s4); }
}

/* Everything inside the sheet reads paper tokens, whatever the screen theme. */
.doc h1, .doc h2 { color: var(--doc-ink); }
.doc a { color: var(--doc-ink); }
.doc .status[data-tone="ok"] { --tone: var(--doc-ok); --tone-soft: var(--doc-ok-soft); }
.doc .status[data-tone="warn"] { --tone: var(--doc-warn); --tone-soft: var(--doc-warn-soft); }
.doc .status[data-tone="bad"] { --tone: var(--doc-bad); --tone-soft: var(--doc-bad-soft); }

.doc-head {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: var(--s4);
  padding-bottom: var(--s3); border-bottom: var(--doc-band-h) solid var(--doc-band);
}
.doc-brand { display: grid; gap: var(--s0); }
.doc-mark { font-weight: var(--w-brand); font-size: var(--rt-lg); color: var(--doc-brand); }
.doc-kind { font-size: var(--rt-sm); color: var(--doc-ink-2); }
.doc-meta { display: flex; gap: var(--s5); margin: 0; font-size: var(--rt-sm); }
.doc-meta dt { color: var(--doc-ink-2); }
.doc-meta dd { margin: 0; font-weight: var(--w-strong); }

.doc-title { padding: var(--s5) 0 var(--s4); border-bottom: var(--hair) solid var(--doc-rule); }
.doc-title h1 { font-size: var(--rt-xl); line-height: 1.15; overflow-wrap: anywhere; }
.doc-alt { margin: var(--s1) 0 0; color: var(--doc-ink-2); font-size: var(--rt-lg); }
.doc-status { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); margin: var(--s3) 0 0; color: var(--doc-ink-2); font-size: var(--rt-sm); }

.doc-notice { margin-top: var(--s4); padding: var(--s3) var(--s4); background: var(--doc-warn-soft); border: var(--hair) solid var(--doc-warn-line); border-radius: var(--r-md); }
.doc-notice h2 { font-size: var(--rt-md); margin-bottom: var(--s1); }
.doc-notice p { margin: 0; }

.doc-summary { margin: var(--s4) 0 0; font-size: var(--rt-lg); line-height: 1.45; }

.doc-section { margin-top: var(--s5); break-inside: auto; }
.doc-section h2, .doc-about h2 {
  font-size: var(--rt-md); text-transform: uppercase; letter-spacing: var(--doc-track); color: var(--doc-ink-2);
  padding-bottom: var(--s1); margin-bottom: var(--s2); border-bottom: var(--hair) solid var(--doc-rule-strong);
  break-after: avoid-page;
}
.doc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2) var(--s5); margin: 0; }
.doc-grid > div { display: grid; grid-template-columns: var(--doc-label-w) minmax(0, 1fr); gap: var(--s2); padding: var(--s1) 0; border-bottom: var(--hair) solid var(--doc-rule); break-inside: avoid; }
.doc-grid dt { color: var(--doc-ink-2); }
.doc-grid dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 767px) { .doc-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 399px) { .doc-grid > div { grid-template-columns: minmax(0, 1fr); gap: 0; } }
.doc-note { display: block; color: var(--doc-ink-2); font-size: var(--rt-sm); margin-top: var(--s1); }

.doc-table { width: 100%; border-collapse: collapse; margin-top: var(--s3); font-size: var(--rt-md); }
.doc-table th { text-align: left; font-weight: var(--w-strong); font-size: var(--rt-sm); color: var(--doc-ink); background: var(--doc-head); padding: var(--s1) var(--s2); border-bottom: var(--hair) solid var(--doc-rule-strong); }
.doc-table td { padding: var(--s1) var(--s2); border-bottom: var(--hair) solid var(--doc-rule); vertical-align: top; }
.doc-table { break-inside: avoid; }
.doc-table tr { break-inside: avoid; }
.doc-years th, .doc-years td { text-align: center; }
.doc-years th[scope="row"] { text-align: left; white-space: nowrap; }
/* On a narrow screen the row of years scrolls inside its own box; on paper it never needs to. */
.doc-scroll { overflow-x: auto; }
.doc-table + .doc-table { margin-top: var(--s4); }

.doc-about { margin-top: var(--s6); font-size: var(--rt-sm); color: var(--doc-ink-2); break-inside: avoid; }
.doc-about p { margin: 0 0 var(--s2); }
.doc-url { color: var(--doc-ink); overflow-wrap: anywhere; }

/* ---- Printing and saving as PDF ---- */
@page {
  size: letter;
  margin: 0.6in 0.65in 0.7in;
  @bottom-left { content: "Canada Corporation Registry corporate profile report"; font-family: var(--f-body); font-size: var(--rt-xs); color: var(--doc-ink-2); font-variant-ligatures: none; letter-spacing: var(--doc-foot-track); }
  @bottom-right { content: "Page " counter(page) " of " counter(pages); font-family: var(--f-body); font-size: var(--rt-xs); color: var(--doc-ink-2); font-variant-ligatures: none; letter-spacing: var(--doc-foot-track); }
}
@media print {
  /* Paper is white whatever the screen theme, margins included (this must outrank the dark theme rule). */
  :root[data-theme], .report-page { background: var(--doc); color-scheme: light; }
  .doc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-page .review-bar, .report-page .site-head, .report-page .site-foot, .report-page .skip, .no-print { display: none !important; }
  .desk { background: none; padding: 0; }
  .doc { max-width: none; padding: 0; box-shadow: none; }
  .doc-scroll { overflow: visible; }
  .doc-url { white-space: nowrap; }
}
