/* Precious Handyman — the shop ledger.
   Tokens per site plan: paper ground, ink text, safety orange reserved
   for evidence/links, steel-gray rules, zero border radius. */

:root {
  --paper: #F4F1EA;
  --ink: #1C1B18;
  --accent: #E8590C;
  --craft: #2F4538;
  --rule: #5C6670;
  --measure: 68ch;
  --font-display: "Zilla Slab", "Iowan Old Style", Georgia, serif;
  --font-body: "Source Sans 3", "Helvetica Neue", Arial, sans-serif;
  --font-data: "IBM Plex Mono", "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { background: var(--paper); }

body {
  margin: 0;
  color: var(--ink);
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 31px,
      rgba(92, 102, 112, 0.08) 31px,
      rgba(92, 102, 112, 0.08) 32px
    )
    var(--paper);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
}

/* ---- masthead ---- */

.masthead {
  border-bottom: 3px double var(--ink);
  padding: 1.5rem 1.25rem 1rem;
}

.masthead-inner,
.site-main,
.footer-inner {
  max-width: 72rem;
  margin: 0 auto;
}

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  letter-spacing: 0.01em;
  margin: 0;
  text-transform: uppercase;
}

.brand a {
  color: var(--ink);
  text-decoration: none;
}

.tagline {
  font-family: var(--font-data);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rule);
  margin: 0.25rem 0 0;
}

.site-nav {
  border-bottom: 1px solid var(--rule);
  padding: 0 1.25rem;
}

.site-nav ul {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.75rem;
}

.site-nav a {
  display: inline-block;
  padding: 0.6rem 0;
  font-family: var(--font-data);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 3px solid transparent;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  border-bottom-color: var(--accent);
}

/* ---- main column ---- */

.site-main {
  padding: 2.5rem 1.25rem 4rem;
}

article.ledger,
.ledger {
  max-width: var(--measure);
}

h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.2;
  margin: 0 0 0.75rem;
}

h1 { font-size: clamp(1.8rem, 4.5vw, 2.6rem); font-weight: 600; }

h2 {
  font-size: 1.35rem;
  font-weight: 600;
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}

p { margin: 0 0 1.1rem; }

a { color: var(--accent); }

a:hover { color: var(--ink); }

ul, ol { padding-left: 1.4rem; margin: 0 0 1.1rem; }

li { margin-bottom: 0.35rem; }

.kicker {
  font-family: var(--font-data);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.5rem;
}

.meta {
  font-family: var(--font-data);
  font-size: 0.8rem;
  color: var(--rule);
  margin-bottom: 2rem;
}

/* article hero: technical-plate illustration, framed like a ledger figure */
.article-hero {
  margin: 0 0 2rem;
}

.article-hero img {
  display: block;
  width: 100%;
  height: auto;
  border: 2px solid var(--ink);
}

.article-hero figcaption {
  font-family: var(--font-data);
  font-size: 0.75rem;
  color: var(--rule);
  margin-top: 0.5rem;
  letter-spacing: 0.05em;
}

/* the spec plate: bordered monospace callout, riveted-data-plate style */
.spec-plate {
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 rgba(28, 27, 24, 0.15);
  background: var(--paper);
  font-family: var(--font-data);
  font-size: 0.9rem;
  padding: 1rem 1.25rem;
  margin: 1.75rem 0;
}

.spec-plate .plate-source {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--rule);
  letter-spacing: 0.05em;
}

/* rubber-stamp evidence grades */
.stamp {
  display: inline-block;
  font-family: var(--font-data);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  border: 2px solid var(--accent);
  color: var(--accent);
  padding: 0.1rem 0.45rem;
  transform: rotate(-1.5deg);
  text-transform: uppercase;
}

.stamp-list { list-style: none; padding: 0; }

.stamp-list li {
  margin-bottom: 1rem;
  padding-left: 0;
}

.stamp-list .stamp { margin-right: 0.6rem; }

/* data tables */
table {
  border-collapse: collapse;
  font-family: var(--font-data);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  width: 100%;
  margin: 1.5rem 0;
}

th, td {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--rule);
}

th {
  border-bottom: 2px solid var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
}

/* ---- article components (guide anatomy, shared by all guides) ---- */

/* inline citation markers keyed to the sources ledger */
sup.cite {
  font-family: var(--font-data);
  font-size: 0.7rem;
  line-height: 0;
}

sup.cite a {
  text-decoration: none;
  padding: 0 0.05rem;
}

/* stable heading anchors, visible on hover */
.hanchor {
  font-family: var(--font-data);
  font-size: 0.8em;
  margin-left: 0.4rem;
  text-decoration: none;
  opacity: 0;
}

h2:hover .hanchor,
h3:hover .hanchor,
.hanchor:focus {
  opacity: 1;
}

/* the decision box: the fork that decides the purchase */
.decision-box {
  border: 2px solid var(--ink);
  border-left: 8px solid var(--accent);
  padding: 1.25rem 1.5rem 0.5rem;
  margin: 1.75rem 0;
}

.decision-box > ul { list-style: none; padding-left: 0; }

.decision-box > ul > li {
  margin-bottom: 0.9rem;
  padding-left: 1.1rem;
  border-left: 2px solid var(--rule);
}

/* the gaps box: what the evidence doesn't cover */
.gaps {
  border: 2px dashed var(--rule);
  padding: 1.25rem 1.5rem 0.5rem;
  margin: 1.75rem 0;
}

/* the numbered sources ledger */
.sources-ledger {
  font-family: var(--font-data);
  font-size: 0.85rem;
  line-height: 1.55;
}

.sources-ledger li {
  margin-bottom: 0.8rem;
}

/* cite-this line */
.cite-this {
  font-family: var(--font-data);
  font-size: 0.8rem;
  color: var(--rule);
  border-top: 1px solid var(--rule);
  padding-top: 1rem;
  margin-top: 2.5rem;
  overflow-wrap: break-word;
}

/* ---- Craft section: deep green replaces safety orange ---- */
/* Per site plan, the Craft feature swaps the evidence accent to deep
   green. Scoping the override to the article keeps nav/footer house
   orange. */
.ledger.craft { --accent: var(--craft); }

/* ---- footer ---- */

.site-footer {
  background: var(--ink);
  color: var(--paper);
  padding: 2rem 1.25rem;
  border-top: 4px solid var(--accent);
}

.site-footer a { color: var(--paper); }

.site-footer a:hover { color: var(--accent); }

.footer-inner p {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
}

.footer-inner .fine {
  font-family: var(--font-data);
  font-size: 0.75rem;
  color: var(--rule);
}

@media (max-width: 40rem) {
  .site-nav ul { gap: 0 1.1rem; }
}
