/* SiteRepairManual — light editorial field manual.
   Theme study 2026-11-09: Smashing Magazine red #d33a2c + Elena serif +
   cream #fff2cc highlights; Real Python header band; freeCodeCamp
   centered column. Warm paper page, serif body, one loud red accent,
   slim top masthead — no banner, no rail. */
:root {
  --paper: #f7f4ec;
  --card: #fffdf8;
  --ink: #201d18;
  --muted: #6b655a;
  --faint: #8a8378;
  --red: #d33a2c;
  --red-dark: #811d15;
  --green: #166534;
  --green-bg: #eef6ef;
  --bad: #b91c1c;
  --bad-bg: #fdf0f0;
  --rule: #ddd5c2;
  --code-bg: #f5f1e6;
  --cream: #fff2cc;
  --warn-bg: #fdf6e3;
  --warn-border: #92600a;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  line-height: 1.85;
}

/* ---------- slim masthead: wordmark + nav, red rule underneath ---------- */
.fx-masthead {
  background: var(--paper);
  border-bottom: 2px solid var(--red);
  padding: 26px 0 20px;
  margin-bottom: 10px;
}

.fx-page {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 28px;
}

.fx-masthead .fx-page {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 24px;
}

.fx-brand {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
}
.fx-brand a { color: var(--ink); text-decoration: none; }
.fx-brand a:hover { color: var(--red); }

.fx-dek {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  font-style: italic;
  order: 3;
  flex-basis: 100%;
}

.fx-nav {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}
.fx-nav a {
  color: var(--ink);
  text-decoration: none;
  margin-left: 26px;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}
.fx-nav a:first-child { margin-left: 0; }
.fx-nav a:hover { color: var(--red); border-bottom-color: var(--red); }

/* ---------- headings: bold sans, uppercase, tracked ---------- */
.fx-main h1, .fx-title {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 34px;
  font-weight: 800;
  line-height: 1.25;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 48px 0 18px;
}
.fx-main h2 {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 19px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 64px 0 14px;
  padding-top: 22px;
  border-top: 1px solid var(--rule);
}
.fx-main h3 {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 40px 0 10px;
}
.fx-main p { margin: 0 0 22px; }
.fx-main ul, .fx-main ol { margin: 0 0 22px; padding-left: 24px; }
.fx-main li { margin-bottom: 10px; }
.fx-main a { color: var(--red); }
.fx-main a:hover { color: var(--ink); }

/* drop cap on the first section's opening paragraph — the editorial mark */
.fx-main h2:first-of-type + p::first-letter {
  font-size: 3.2em;
  float: left;
  line-height: 0.85;
  padding: 8px 10px 0 0;
  font-weight: 700;
  color: var(--red);
}

.fx-kicker {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red);
  margin: 0 0 6px;
}

.fx-lede { font-size: 21px; line-height: 1.75; margin-bottom: 28px; }
.fx-meta {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.02em;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 18px;
  margin: 0 0 30px;
}

/* ---------- margin note (guides): Tufte-style sidenote on wide screens,
   an inline cream field note below that ---------- */
.fx-margin {
  margin: 0 0 28px;
  padding: 14px 16px;
  background: var(--cream);
  border-left: 3px solid var(--red);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink);
}
.fx-margin p { margin: 0; }
.fx-margin strong {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11.5px;
  color: var(--red-dark);
}

/* ---------- guide cards (index): dated journal entries ---------- */
.fx-cards { list-style: none; padding: 0; margin: 8px 0 40px; }
.fx-card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-left: 5px solid var(--red);
  padding: 28px 30px 24px;
  margin-bottom: 38px;
}
.fx-logdate {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red);
  margin: 0 0 8px;
}
.fx-card h3 {
  margin: 0 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  border-top: 0;
  padding-top: 0;
}
.fx-card h3 a { color: var(--ink); text-decoration: none; }
.fx-card h3 a:hover { color: var(--red); text-decoration: underline; }
.fx-card p { margin: 0 0 12px; }

.fx-chips { margin: 0 0 12px; }
.fx-chip {
  display: inline-block;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 3px 9px;
  margin: 0 8px 6px 0;
  border: 1px solid;
  border-radius: 3px;
}
.fx-chip-bad { color: var(--bad); border-color: var(--bad); background: var(--bad-bg); }
.fx-chip-ok { color: var(--green); border-color: var(--green); background: var(--green-bg); }

/* ---------- archive list ---------- */
.fx-archivelist { list-style: none; padding: 0; margin: 10px 0 30px; }
.fx-archivelist li {
  padding: 28px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 17px;
}
.fx-archivelist li a { color: var(--ink); text-decoration: none; font-weight: 700; }
.fx-archivelist li a:hover { color: var(--red); }
.fx-date {
  display: block;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--red);
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin: 0 0 6px;
  font-variant-numeric: tabular-nums;
}
.fx-tags { color: var(--faint); font-size: 14px; display: block; margin-top: 4px; }

/* ---------- case-file card (guides): white card, red top rule ---------- */
.fx-casefile {
  border-top: 3px solid var(--red);
  border-bottom: 1px solid var(--rule);
  background: var(--card);
  padding: 22px 26px 8px;
  margin: 0 0 40px;
}
.fx-casefile-kicker {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--red);
  margin: 0 0 14px;
}
.fx-casefile dl {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px 28px;
  margin: 0;
}
.fx-casefile dt {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 0 0 4px;
}
.fx-casefile dd { margin: 0 0 16px; font-size: 16.5px; line-height: 1.6; }
.fx-casefile .fx-bad { color: var(--bad); font-weight: 700; }
.fx-casefile .fx-ok { color: var(--green); font-weight: 700; }

/* ---------- quiet inline trail (replaces the boxed contents nav) ---------- */
.fx-trail {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.9;
  margin: 0 0 44px;
}
.fx-trail a { color: var(--muted); text-decoration: none; border-bottom: 1px dotted var(--faint); }
.fx-trail a:hover { color: var(--red); border-bottom-color: var(--red); }

/* ---------- result / warning notes ---------- */
.fx-verdict {
  border-top: 2px solid var(--green);
  padding: 18px 0 0;
  margin: 34px 0;
}
.fx-verdict p { margin: 0; }
.fx-verdict strong { color: var(--green); }

.fx-warning {
  border-top: 2px solid var(--warn-border);
  padding: 18px 0 0;
  margin: 34px 0;
}
.fx-warning p { margin: 0; }
.fx-warning strong { color: #6b4503; }

/* ---------- code blocks: paper, not terminal ---------- */
.fx-codelabel {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 28px 0 0;
}
.fx-codelabel + pre { margin-top: 5px; }
pre {
  background: var(--code-bg);
  border: 1px solid var(--rule);
  padding: 14px 16px;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14.5px;
  line-height: 1.55;
  margin: 0 0 22px;
}
pre code { overflow-wrap: normal; white-space: pre; background: transparent; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  overflow-wrap: break-word;
  background: var(--code-bg);
  padding: 1px 4px;
  border-radius: 3px;
}
p, li { overflow-wrap: break-word; }

/* ---------- results table: cream header ---------- */
table.fx-results {
  border-collapse: collapse;
  width: 100%;
  font-size: 15px;
  margin: 0 0 22px;
}
table.fx-results th, table.fx-results td {
  border: 1px solid var(--rule);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}
table.fx-results th {
  background: var(--cream);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.fx-ok { color: var(--green); font-weight: 700; }
.fx-bad { color: var(--bad); font-weight: 700; }

/* ---------- sources ---------- */
.fx-sources li { margin-bottom: 14px; }

/* ---------- skip link / focus ---------- */
.fx-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 8px 14px;
  z-index: 10;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
}
.fx-skip:focus { left: 0; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

/* ---------- footer ---------- */
.fx-foot {
  border-top: 2px solid var(--red);
  margin-top: 72px;
  padding: 20px 0 64px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 13.5px;
  color: var(--muted);
}
.fx-foot a { color: var(--muted); }
.fx-foot a:hover { color: var(--red); }

/* ---------- wide screens: margin notes move to the right margin ---------- */
@media (min-width: 1240px) {
  .fx-main { position: relative; }
  .fx-margin {
    float: right;
    width: 210px;
    margin: 6px -240px 12px 24px;
    background: transparent;
    border-left: 2px solid var(--red);
    padding: 2px 0 2px 14px;
  }
}

/* ---------- narrow viewports: the manual stays a manual ----------
   Everything reflows; nothing scrolls sideways. Type stays big,
   sections keep their air, the case file bleeds full-width. */
@media (max-width: 760px) {
  body { font-size: 19px; line-height: 1.9; }
  .fx-masthead { padding: 22px 0 16px; margin-bottom: 0; }
  .fx-masthead .fx-page { flex-direction: column; align-items: flex-start; gap: 2px; }
  .fx-brand { font-size: 26px; }
  .fx-dek { font-size: 15px; margin: 2px 0 10px; }
  .fx-nav { font-size: 13px; }
  .fx-nav a { margin-left: 0; margin-right: 20px; }
  .fx-page { padding: 0 20px; }
  .fx-kicker { font-size: 13px; margin: 28px 0 8px; }
  .fx-main h1, .fx-title { font-size: 28px; margin: 12px 0 16px; }
  .fx-lede { font-size: 20px; line-height: 1.7; margin-bottom: 30px; }
  .fx-main h2 { font-size: 20px; margin: 56px 0 14px; padding-top: 24px; }
  .fx-main h3 { font-size: 18px; margin: 44px 0 10px; }
  .fx-main p { margin: 0 0 24px; }
  .fx-main ul, .fx-main ol { margin: 0 0 24px; }
  .fx-main li { margin-bottom: 12px; }
  .fx-meta { padding-bottom: 20px; margin: 0 0 28px; }
  /* case file bleeds to the screen edges: one full-width card */
  .fx-casefile { margin-left: -20px; margin-right: -20px; padding: 24px 20px 10px; border-top-width: 4px; }
  .fx-casefile dl { grid-template-columns: 1fr; gap: 0; }
  .fx-casefile dd { font-size: 17px; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--rule); }
  .fx-casefile dl > div:last-child dd { border-bottom: none; margin-bottom: 6px; }
  .fx-trail { margin: 0 0 48px; line-height: 2.1; }
  .fx-card { padding: 26px 24px 22px; margin-bottom: 44px; }
  .fx-card h3 { font-size: 21px; }
  .fx-archivelist li { padding: 30px 0; }
  /* results table stacks into cards instead of scrolling sideways */
  table.fx-results, table.fx-results tbody, table.fx-results tr, table.fx-results th, table.fx-results td { display: block; width: auto; }
  table.fx-results tr:first-child { display: none; }
  table.fx-results tr { margin-bottom: 18px; border: 1px solid var(--rule); border-left: 5px solid var(--red); background: var(--card); padding: 12px 14px; }
  table.fx-results td { border: none; padding: 2px 0; font-size: 16px; }
  .fx-foot { margin-top: 64px; }
}
