/* ============================================================
   Cathedral Security teaching workspace — shared stylesheet
   Used by every lesson and reference document.
   Tufte-inspired: calm serif, restrained ink, wide margins.
   ============================================================ */

:root {
  --ink: #1c1c1a;
  --paper: #fffdf8;
  --accent: #1d3a5f;      /* deep navy */
  --accent-soft: #eef2f7;
  --muted: #6d6d64;
  --rule: #e4e0d3;
  --gold: #9a7b2f;        /* sparse accent */
  --link: #1d3a5f;
  --serif: Georgia, "Times New Roman", "Songti SC", "Noto Serif SC", serif;
  --sans: -apple-system, "Segoe UI", "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.65;
}

.page {
  max-width: 46rem;        /* comfortable reading measure */
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

/* ---------- typography ---------- */

.kicker {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 0.4rem;
}

h1, h2, h3 {
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
  margin: 2.2em 0 0.6em;
}

h1 {
  font-size: 2.15rem;
  margin-top: 0.2em;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 1.4rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--rule);
}

h3 { font-size: 1.1rem; }

p { margin: 0 0 1.05em; }

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: rgba(29, 58, 95, 0.35);
  text-underline-offset: 2px;
}
a:hover { text-decoration-color: var(--link); }

strong { font-weight: 650; }
em { font-style: italic; }

.lede {
  font-size: 1.18rem;
  line-height: 1.6;
  color: #33322d;
}

/* inline term (points to glossary) */
.term {
  border-bottom: 1px dotted var(--muted);
  cursor: help;
}

/* ---------- components ---------- */

.def {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
  padding: 0.9rem 1.15rem;
  margin: 1.2em 0;
}
.def .def__term {
  display: block;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.3rem;
}
.def p { margin: 0; }

.note {
  background: #fbf7ea;
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 0.9rem 1.15rem;
  margin: 1.2em 0;
}
.note .note__label {
  display: block;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.3rem;
}
.note p:last-child { margin-bottom: 0; }

/* key-numbers strip */
.keynums {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 0.75rem;
  margin: 1.4em 0;
}
.keynum {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 0.85rem 1rem;
}
.keynum .keynum__n {
  font-size: 1.5rem;
  font-weight: 650;
  color: var(--accent);
  line-height: 1.1;
}
.keynum .keynum__l {
  font-family: var(--sans);
  font-size: 0.74rem;
  color: var(--muted);
  line-height: 1.35;
  margin-top: 0.25rem;
}

/* tables */
.table-wrap { overflow-x: auto; margin: 1.2em 0; }
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.95rem;
}
th, td {
  text-align: left;
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
th {
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 2px solid var(--accent);
}
tr:last-child td { border-bottom: none; }
td:first-child { font-weight: 600; }

blockquote {
  margin: 1.2em 0;
  padding: 0.2em 0 0.2em 1.1em;
  border-left: 2px solid var(--accent);
  color: #44423b;
  font-style: italic;
}

/* source / citation line */
.src {
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 0.4rem;
}
.src a { color: var(--muted); }
.foot-src {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.7;
}
.foot-src li { margin-bottom: 0.35rem; }

/* table of contents */
.toc {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 0.9rem 1.2rem;
  margin: 1.5em 0;
  font-family: var(--sans);
  font-size: 0.9rem;
}
.toc ol { margin: 0.4rem 0 0; padding-left: 1.3rem; }
.toc li { margin: 0.25rem 0; }
.toc .toc__label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* footer navigation */
.next {
  margin-top: 3rem;
  padding-top: 1.1rem;
  border-top: 2px solid var(--ink);
}
.next .next__label {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.next ul { list-style: none; padding: 0; margin: 0.5rem 0 0; }
.next li { margin: 0.35rem 0; }

hr { border: none; border-top: 1px solid var(--rule); margin: 2em 0; }

/* ---------- print ---------- */

@page { margin: 2.2cm; }

@media print {
  body { font-size: 11.5pt; }
  .page { max-width: none; padding: 0; }
  a { color: inherit; text-decoration: none; }
  .def, .note, .keynum { break-inside: avoid; }
  h2 { break-after: avoid; }
}
