/* SPDX-License-Identifier: AGPL-3.0-or-later · Copyright (C) 2026 Nicholas Gardella */
/*
 * doc.css — layout for long-form help pages (canvas-import.html).
 * Normal document flow: the page scrolls, and line length is capped at a
 * comfortable reading measure (~70 characters).
 */

.site-header .site-header__title {  /* beats `.site-header p` in theme.css */
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 700;
}

.site-header__title a {
  text-decoration: none;
}

.doc {
  max-width: 44rem;
  margin-inline: auto;
  padding: var(--space-6) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  font-size: 1.0625rem;
  line-height: 1.6;
}

.doc h1 {
  font-size: 2rem;
  color: var(--wl-blue);
}

.doc h2 {
  font-size: 1.375rem;
  color: var(--wl-blue);
  margin-bottom: var(--space-2);
  /* Keep headings clear of the top edge when jumped to from the TOC. */
  scroll-margin-top: var(--space-4);
}

.doc section > * + * {
  margin-top: var(--space-3);
}

.doc ol,
.doc ul {
  padding-left: 1.5rem;
}

.doc li + li {
  margin-top: var(--space-2);
}

.doc__lede {
  font-size: var(--text-lg);
}

.doc__toc {
  border-left: 4px solid var(--wl-blue-sky);
  padding-left: var(--space-4);
}

.doc__toc h2 {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
}

.doc__note {
  color: var(--color-text-muted);
  font-size: var(--text-base);
}

.doc .button {
  display: inline-block;
  text-decoration: none;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* ---------- Pages rendered from repository text (license.html, history.html) ---------- */
/* Flow spacing for content injected by js/render-text.js (at any depth,
   since the license text sits inside a wrapper <div>). */
.rendered :where(h1, h2, h3, h4, p, ul, ol, pre, details, div) + * {
  margin-top: var(--space-3);
}

.rendered h2,
.rendered h3 {
  margin-top: var(--space-6);
}

.rendered h3 {
  font-size: var(--text-lg);
  color: var(--wl-blue);
}

.rendered h4 {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  color: var(--wl-blue);
  margin-top: var(--space-5);
  scroll-margin-top: var(--space-4);
}

/* License clauses like "a) ..." and sample notices are indented in the source. */
.rendered .indented {
  margin-left: var(--space-5);
  padding-left: var(--space-3);
  border-left: 2px solid var(--color-border);
}

.license-toc {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
}

.license-toc summary {
  cursor: pointer;
  font-weight: 700;
}

.license-toc ol {
  list-style: none;
  padding-left: 0;
  margin-top: var(--space-2);
}

/* Long license lines wrap rather than forcing sideways scrolling. */
.rendered pre {
  white-space: pre-wrap;
}

/* ---------- Skimmable point grids (agents.html) ---------- */
.points {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: var(--space-3);
}

.doc .points li + li {
  margin-top: 0;   /* the grid gap handles spacing */
}

.points dt {
  font-weight: 700;
}

.points dd {
  margin: var(--space-1) 0 0;
}
