/* =============================================================
   library.css — Lytton Studio
   Lytton Library: essays and frameworks (library.php and library-*.php)
   Plain text surfaces only: no pattern or gradient behind words.
   Mobile-first · WCAG 2.2 AA
   Created 24-Nov-2026
   ============================================================= */

/* ── Reading width ─────────────────────────────────────────── */
/* No fixed width: the article fills <main> and flexes with the window,
   like every other page (layout.css sets the page padding). 24-Nov-2026,
   Kate: a fixed reading column looked like a 1990s layout. */
/* Text, tables and boxes all share one edge (Kate: sections above and below
   the table must match it). A generous cap stops lines running edge to edge
   on very wide monitors only. */
.library-article {
  width: 100%;
  max-width: 90rem;
}

.library-article p,
.library-article li {
  line-height: 1.7;
}

.library-article h2 {
  margin-top: 2.5rem;
}

.library-meta {
  font-size: 0.9rem;
  color: var(--ls-text-muted);
  margin: 0 0 1.5rem;
}

.library-lead {
  font-size: clamp(1.05rem, 0.5vw + 1rem, 1.2rem);
  color: var(--ls-text);
  margin-bottom: 1.25rem;
}

/* ── Key question: plain surface, rule on the left ─────────── */
.library-question {
  margin: 1.75rem 0;
  padding: 0.25rem 0 0.25rem 1.25rem;
  border-left: 3px solid var(--ls-sage-deep);
  background: var(--ls-bg);
}

.library-question p {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ls-sage-deep);
  margin: 0;
}

.library-question p + p {
  margin-top: 0.4rem;
}

/* ── Signal model: five layers ─────────────────────────────── */
.signal-layers {
  list-style: none;
  counter-reset: layer;
  padding: 0;
  margin: 1.5rem 0;
  display: grid;
  gap: 1rem;
}

.signal-layer {
  counter-increment: layer;
  background: #fff;
  border: 1px solid var(--ls-border);
  border-top: 4px solid var(--ls-sage-deep);
  border-radius: var(--ls-radius);
  padding: 1rem 1.25rem;
}

.signal-layer h3 {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
  color: var(--ls-sage-deep);
}

.signal-layer h3::before {
  content: counter(layer) ". ";
}

.signal-layer .signal-question {
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.signal-layer ul {
  margin: 0;
  padding-left: 1.25rem;
}

/* ── Two-column does / does not ────────────────────────────── */
.library-pair {
  display: grid;
  gap: 1rem;
  margin: 1.25rem 0;
}

.library-pair > div {
  background: #fff;
  border: 1px solid var(--ls-border);
  border-radius: var(--ls-radius);
  padding: 1rem 1.25rem;
}

.library-pair h3 {
  margin-top: 0;
  font-size: 1.05rem;
}

@media (min-width: 40rem) {
  .library-pair {
    grid-template-columns: 1fr 1fr;
  }
}

/* ── Closing line ──────────────────────────────────────────── */
.library-closing {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--ls-border);
  font-size: 1.1rem;
}

/* ── Library index: essay list ───────────────────────────────── */
.library-article .library-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
  display: grid;
  gap: 1rem;
}

.library-list li {
  background: #fff;
  border: 1px solid var(--ls-border);
  border-radius: var(--ls-radius);
  padding: 1rem 1.25rem;
}

.library-list h2 {
  font-size: 1.2rem;
  margin: 0 0 0.35rem;
}

.library-list p {
  margin: 0 0 0.35rem;
}

/* ── Series navigation (assessment series, added 24-Nov-2026) ── */
.library-series {
  margin: 2.5rem 0 1rem;
  padding: 1rem 1.25rem;
  background: #fff;
  border: 1px solid var(--ls-border);
  border-radius: var(--ls-radius);
}

.library-series h2 {
  font-size: 1rem;
  margin: 0 0 0.5rem;
}

.library-series ol {
  margin: 0;
  padding-left: 1.25rem;
}

.library-series [aria-current="page"] {
  font-weight: 600;
}

/* ── Comparison table ───────────────────────────────────────── */
.library-table-wrap {
  overflow-x: auto;
  margin: 1.25rem 0;
}

.library-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.library-table th,
.library-table td {
  border: 1px solid var(--ls-border);
  padding: 0.6rem 0.75rem;
  text-align: left;
  vertical-align: top;
}

.library-table thead th {
  background: var(--ls-sage-tint);
  color: var(--ls-ink);
}

/* ── Sources list ───────────────────────────────────────────── */
.library-sources {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--ls-border);
  font-size: 0.92rem;
}

.library-sources h2 {
  font-size: 1.1rem;
  margin-top: 0;
}

.library-sources li {
  margin-bottom: 0.4rem;
}
