/* Sample-report reader (/samples).
 *
 * A single reading column rather than the workbench grid: there is no run
 * history, composer or capacity to show, only a list and one report. The
 * workbench stylesheet is not loaded, so the few pieces shared with it (brand,
 * language select) are restated here at the same token values. */

.samples {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: var(--space-6) var(--space-5) var(--space-16);
}

.samples__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-12);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
}
.samples .brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--text-primary);
}
.samples .brand__mark { width: 24px; height: 24px; display: block; }
.samples .brand__name {
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.samples__nav { display: flex; align-items: center; gap: var(--space-4); }
.samples__back { font-size: var(--text-sm); font-weight: 500; color: var(--text-secondary); }
.samples__back:hover { color: var(--accent); }
.samples .bare-select {
  padding: 3px var(--space-2);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-tertiary);
  font-size: var(--text-xs);
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.samples .bare-select:hover { color: var(--text-primary); background: var(--bg-hover); }
.samples .bare-select option { background: var(--bg-raised); color: var(--text-primary); }

.samples__intro h1 {
  font-size: var(--text-3xl);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-3);
}
.samples__intro p {
  max-width: 56ch;
  color: var(--text-secondary);
  font-size: var(--text-md);
  line-height: var(--leading-normal);
  margin-bottom: var(--space-8);
}

.samples__list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-10);
}
.sample-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--bg-raised);
  box-shadow: var(--shadow-sm);
  color: var(--text-primary);
  text-align: left;
  transition: border-color var(--duration-fast) var(--ease),
              box-shadow var(--duration-fast) var(--ease);
}
.sample-card:hover { border-color: var(--accent-border); box-shadow: var(--shadow-md); color: var(--text-primary); }
.sample-card[aria-current="page"] {
  border-color: var(--accent);
  background: var(--accent-subtle);
  box-shadow: none;
}
.sample-card__title {
  font-family: var(--font-serif);
  font-size: var(--text-md);
  font-weight: 600;
  line-height: var(--leading-tight);
}
.sample-card__meta { font-size: var(--text-xs); color: var(--text-tertiary); }

.samples__notice {
  margin-bottom: var(--space-6);
  padding: var(--space-3) var(--space-4);
  border-left: 3px solid var(--warning);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: var(--warning-subtle);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

.samples__download {
  display: inline-block;
  margin-bottom: var(--space-6);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
}
.samples__download:hover { color: var(--accent); }

/* Wide report tables scroll inside their own box, never the page. */
.samples .table-wrap { overflow-x: auto; }

/* Contents of the open report: a collapsible block above it, or, from the
 * width where the margin can hold it, a sticky column in the margin beside
 * it. The margin rather than a narrower report column, so the report keeps
 * the measure and table width it has without contents. samples.js opens the
 * block at the same width. */
.samples__toc {
  margin-bottom: var(--space-6);
  font-size: var(--text-sm);
}
.samples__toc details {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-raised);
}
.samples__toc summary {
  padding: var(--space-3) var(--space-4);
  color: var(--text-secondary);
  font-weight: 600;
  cursor: pointer;
}
.samples__toc ol {
  margin: 0;
  padding: 0 var(--space-4) var(--space-3);
  list-style: none;
}
.samples__toc a {
  display: block;
  padding: var(--space-1) 0;
  color: var(--text-secondary);
  line-height: var(--leading-tight);
}
.samples__toc a:hover { color: var(--accent); }
.samples__reader .prose h2 { scroll-margin-top: var(--space-6); }

/* 1280px leaves 840px for the reader and, beside it, 24px of gap and 176px of
 * contents with a classic 15px scrollbar still inside the window. */
@media (min-width: 1280px) {
  .samples__reader { position: relative; }
  .samples__toc {
    position: absolute;
    top: 0;
    bottom: 0;
    left: calc(100% + var(--space-6));
    width: 176px;
    margin: 0;
  }
  .samples__toc details {
    position: sticky;
    top: var(--space-6);
    max-height: calc(100vh - 2 * var(--space-6));
    overflow-y: auto;
    border: 0;
    background: none;
  }
  .samples__toc summary { padding: 0 0 var(--space-2); }
  .samples__toc ol { padding: 0; }
}

/* Paper should contain the selected report, not the reader's controls or theme.
 * Literal black/white instead of the colour tokens on purpose: the tokens are
 * swapped by the dark-mode block, and a printed report must stay dark-on-white
 * even when the system is in dark mode. The colour rule reaches every
 * descendant so a nested code, quote or table style cannot reintroduce a
 * themed colour inside the report. */
@media print {
  :root { color-scheme: light; }

  body {
    min-height: auto;
    background: white;
    color: black;
  }

  .samples {
    max-width: none;
    margin: 0;
    padding: 0;
  }

  .samples__head,
  .samples__intro,
  .samples__list,
  .samples__reader > .empty-note,
  .samples__reader > .skeleton,
  .samples__toc,
  .samples__download,
  .cite-card {
    display: none;
  }

  .samples__notice {
    background: white;
    border-left-color: black;
    color: black;
  }

  .samples__reader .prose,
  .samples__reader .prose * {
    background: white;
    color: black;
  }

  .samples__reader .prose {
    width: 100%;
    max-width: none;
  }

  .samples .table-wrap {
    overflow: visible;
    border-color: black;
    background: white;
  }

  .samples__reader .prose th { white-space: normal; }
  .samples__reader .prose ::marker { color: black; }

  .samples__reader .prose h1,
  .samples__reader .prose h2,
  .samples__reader .prose h3,
  .samples__reader .prose h4 {
    break-inside: avoid;
    break-after: avoid-page;
    page-break-inside: avoid;
    page-break-after: avoid;
  }

  .samples__reader .prose thead { display: table-header-group; }

  .samples__reader .prose tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}

/* ── Privacy and terms ──────────────────────────────────────────────── */
.legal__body {
  max-width: 46rem;
  margin: var(--space-6) auto var(--space-8);
}
.legal__body[hidden] { display: none; }
.legal__updated {
  color: var(--text-secondary);
  font-size: var(--text-sm);
}
