:root {
  --bg: #faf7f0;
  --surface: #ffffff;
  --text: #24312a;
  --muted: #5b6a60;
  --border: #e4ddc9;
  --blue: #1b4965;
  --green: #3f7a3c;
  --gold: #c9932e;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
header {
  background: var(--surface);
  border-bottom: 3px solid var(--gold);
}
.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px;
}
header .wrap {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.brand {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--blue);
  text-decoration: none;
}
.brand span { color: var(--green); }
.tagline {
  color: var(--muted);
  font-size: 0.95rem;
}
/* Site nav (stamped by scripts/build-tracker.py from 05-content/site-nav.json) */
.site-nav { border-top: 1px solid var(--border); background: var(--surface); }
.site-nav .wrap { padding: 0 20px; }
.site-nav .nav-links { display: flex; gap: 22px; }
.site-nav a, .site-nav .nav-drop-label {
  display: inline-block; padding: 10px 0;
  color: var(--blue); font-weight: 600; font-size: 0.92rem;
  text-decoration: none; cursor: pointer;
}
.site-nav a:hover { color: var(--green); }
.site-nav .nav-open, .site-nav .nav-burger { display: none; }
.nav-drop { position: relative; }
.nav-drop-menu {
  display: none; position: absolute; left: 0; top: 100%; z-index: 10;
  min-width: 180px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 0 0 8px 8px;
  box-shadow: 0 4px 10px rgba(36, 49, 42, 0.08);
}
.nav-drop:hover .nav-drop-menu, .nav-drop:focus-within .nav-drop-menu { display: block; }
.nav-drop-menu a { display: block; padding: 8px 14px; }
@media (max-width: 600px) {
  .site-nav .nav-burger {
    display: block; padding: 8px 0; font-size: 1.2rem;
    color: var(--blue); cursor: pointer;
  }
  /* Full-width so the open menu wraps onto its own line BELOW the burger, instead of
     landing to the far right (the nav .wrap is a flex row with justify-content:
     space-between, inherited from header .wrap). */
  .site-nav .nav-links {
    display: none; flex-direction: column; gap: 0; width: 100%;
    padding-bottom: 8px; border-top: 1px solid var(--border); margin-top: 4px;
  }
  .site-nav .nav-open:checked ~ .nav-links { display: flex; }
  .site-nav a, .site-nav .nav-drop-label { padding: 8px 0; }
  .nav-drop-menu {
    display: block; position: static; border: none; box-shadow: none;
    min-width: 0; padding-left: 14px;
  }
}

main { padding: 40px 0 60px; }
.hero {
  background:
    linear-gradient(135deg, rgba(27,73,101,.88), rgba(36,90,128,.75)),
    url("/assets/brand/hero-construction-worker.jpg") center / cover no-repeat;
  color: #fff;
  border-radius: 10px;
  padding: 32px;
  margin-bottom: 40px;
}
.hero .eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  color: #cfe3ee;
  margin: 0 0 8px;
}
.hero h1 { margin: 0 0 12px; font-size: 1.8rem; }
.hero p { margin: 0; color: #e6f0f5; }

article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 32px;
  margin-bottom: 32px;
}
article .post-date {
  color: var(--gold);
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 4px;
}
article h1, article h2 { margin: 0 0 16px; color: var(--blue); }
article p { margin: 0 0 16px; }
article p:last-child { margin-bottom: 0; }
article ul { margin: 0 0 16px; padding-left: 22px; }
article li { margin: 0 0 8px; }
article a { color: var(--blue); }
article .post-figure { margin: 0 0 24px; }
article .post-figure svg,
article .post-figure img { width: 100%; height: auto; border-radius: 8px; display: block; }
article .fine { font-size: 0.82rem; color: var(--muted); }
article .status-banner {
  background: #f5efdf;
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.9rem;
  margin: 0 0 20px;
}
.byline { color: var(--muted); font-size: 0.9rem; margin-bottom: 24px; }

/* Category badge in the upper-right of a post's content area (Build / Why?). */
.post-badge {
  float: right;
  display: inline-block;
  margin: 2px 0 8px 14px;
  padding: 3px 13px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  color: #fff;
}
.post-badge-build { background: #1b4965; }
.post-badge-why { background: #3f7a3c; }
.post-badge:hover { opacity: 0.9; }

/* Home-page list of recent posts */
.posts-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 0 0 16px;
}
.posts-head h2 { color: var(--blue); margin: 0; font-size: 1.2rem; }
.posts-head a { color: var(--blue); font-size: 0.9rem; }
.post-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 16px;
  text-decoration: none;
  color: inherit;
}
.post-card:hover { border-color: var(--gold); }
.post-thumb {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  flex: none;
}
.post-card-body { flex: 1; min-width: 0; }
.post-card .post-date {
  color: var(--gold); font-weight: 600; font-size: 0.85rem;
  text-transform: uppercase; letter-spacing: 0.05em; margin: 0 0 6px;
}
.post-card h3 { margin: 0 0 8px; color: var(--blue); }
.post-card p { margin: 0; color: var(--muted); }
/* Category pill on a post-card (top-right of the body), so post types are scannable in lists. */
.card-badge {
  float: right;
  display: inline-block;
  margin: 0 0 4px 10px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
}
.card-badge-build { background: #1b4965; }
.card-badge-why { background: #3f7a3c; }
/* First-party newsletter form (replaces the ad-blockable MailerLite JS widget). */
.ml-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.ml-msg { margin-top: 10px; font-size: 0.9rem; color: var(--body); }
@media (max-width: 480px) {
  .post-card { flex-wrap: wrap; }
  .post-thumb { width: 64px; height: 64px; }
}

.back-link { display: inline-block; margin-bottom: 20px; color: var(--blue); font-size: 0.9rem; }

/* Build-tracker pages (generated by scripts/build-tracker.py) */
.tracker-bar {
  display: flex; height: 14px; border-radius: 7px; overflow: hidden;
  background: var(--border); margin: 8px 0 4px;
}
.tracker-bar .seg-answered { background: var(--green); }
.tracker-bar .seg-partial { background: var(--gold); }
.tracker-bar-caption { font-size: 0.82rem; color: var(--muted); margin: 0 0 4px; }
.tracker-section { margin-top: 28px; }
.tracker-section h2 { font-size: 1.15rem; }
.tracker-q {
  border-top: 1px solid var(--border);
  padding: 14px 0 12px;
}
.tracker-q:last-child { padding-bottom: 0; }
.tracker-q .q { margin: 0 0 6px; font-weight: 600; }
.tracker-q .a { margin: 0 0 6px; }
.tracker-q .verdict { font-weight: 700; }
.verdict-answered { color: var(--green); }
.verdict-partial { color: var(--gold); }
.verdict-open { color: var(--muted); }
.tracker-q .src { font-size: 0.82rem; color: var(--muted); margin: 0; }
.chip {
  display: inline-block; font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  padding: 2px 9px; border-radius: 10px; margin-right: 8px;
  vertical-align: 2px; color: #fff;
}
.chip-answered { background: var(--green); }
.chip-partial { background: var(--gold); }
.chip-open { background: var(--muted); }
.ledger { width: 100%; border-collapse: collapse; margin: 12px 0 4px; font-size: 0.95rem; }
.ledger th, .ledger td {
  text-align: left; padding: 8px 10px;
  border-bottom: 1px solid var(--border); vertical-align: top;
}
.ledger th { color: var(--blue); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.05em; }
.ledger td.num, .ledger th.num { text-align: right; white-space: nowrap; }
.ledger .unpriced td { color: var(--muted); }
.ledger tr.total td { font-weight: 700; border-top: 2px solid var(--blue); border-bottom: none; }
.ledger-wrap { overflow-x: auto; }
.ledger .src { font-size: 0.8rem; color: var(--muted); display: block; }
@media (max-width: 480px) { .ledger { font-size: 0.85rem; } .ledger th, .ledger td { padding: 6px 6px; } }

/* Time ledger (Gantt-style lanes; sequence + overlap, widths not to scale until
   durations are known) */
.timeline-wrap { overflow-x: auto; margin: 12px 0 4px; }
.timeline { min-width: 560px; }
.timeline-head { display: flex; margin-left: 180px; }
.timeline-head span {
  flex: 1; font-size: 0.72rem; font-weight: 700; color: var(--blue);
  text-transform: uppercase; letter-spacing: 0.05em;
  border-left: 1px dashed var(--border); padding: 0 0 4px 6px;
}
.timeline-row { display: flex; align-items: center; padding: 5px 0; }
.timeline-row .step-name {
  width: 180px; flex: none; font-size: 0.88rem; padding-right: 10px;
  line-height: 1.3;
}
.timeline-row .track {
  flex: 1; position: relative; height: 26px;
  /* phase gridlines are set inline by build-tracker.py (column count varies) */
}
.timeline-row .bar {
  position: absolute; top: 2px; bottom: 2px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700; color: #fff; white-space: nowrap;
}
.bar-done { background: var(--green); }
.bar-in-progress { background: var(--gold); }
.bar-not-started { background: var(--border); color: var(--muted); }
.timeline-note { font-size: 0.82rem; color: var(--muted); margin: 8px 0 0; }

/* Law-and-codes index (collapsible jurisdiction tree) */
.law-tree details {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 0 0 10px;
  background: var(--surface);
}
.law-tree summary {
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 600;
  color: var(--blue);
}
.law-tree summary:hover { color: var(--green); }
.law-tree details[open] > summary { border-bottom: 1px solid var(--border); }
.law-tree .law-body { padding: 12px 16px 4px; }
.law-tree .law-body > p, .law-tree .law-body > ul { margin-bottom: 12px; }
.law-tree details details {
  background: var(--bg);
  margin: 0 0 8px;
}
.law-tree details details summary { padding: 10px 14px; font-size: 0.95rem; }
.law-verdict { font-weight: 400; color: var(--muted); }
.law-tree .fine { margin: 0 0 12px; }
.law-tree summary .chip { margin-right: 4px; margin-left: 2px; vertical-align: 1px; }
.chip-conflict { background: var(--gold); }
.chip-clear { background: var(--green); }
.chip-open { background: var(--blue); }
.chip-partial { background: var(--surface); color: var(--gold); border: 1px solid var(--gold); }
.chip-none { background: var(--muted); }
.law-key {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 0.9rem;
  margin: 0 0 16px;
}
.law-key p { margin: 0 0 6px; }
.law-key p:last-child { margin: 0; }
.law-mark { font-weight: 700; margin-right: 2px; }
.law-mark-conflict { color: var(--gold); }
.law-mark-open { color: var(--blue); }
.law-picker {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  margin: 0 0 20px;
}
.law-picker label { font-weight: 600; color: var(--blue); display: block; margin: 0 0 8px; }
.law-picker select {
  font: inherit; padding: 8px 10px; max-width: 100%;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--bg); color: var(--text);
}
.law-picker .law-reset { margin-left: 10px; display: none; }
.law-picker .note { margin-top: 8px; }
.law-tree .jx-hidden { display: none; }

section.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 28px;
  margin-bottom: 24px;
}
section.panel h3 { margin: 0 0 6px; color: var(--green); }
section.panel .sub { color: var(--muted); margin: 0 0 18px; font-size: 0.95rem; }
section.comments { margin: 32px 0 24px; }
section.comments > h3 { margin: 0 0 12px; color: var(--green); }
form { display: flex; gap: 10px; flex-wrap: wrap; }
form.stacked { flex-direction: column; }
input, textarea {
  font: inherit; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--bg); color: var(--text);
}
form:not(.stacked) input[type="email"] { flex: 1; min-width: 200px; }
textarea { resize: vertical; min-height: 100px; }
button {
  font: inherit; font-weight: 600; padding: 10px 20px;
  border: none; border-radius: 6px; background: var(--green);
  color: #fff; cursor: pointer;
}
button:hover { background: #336333; }
.note { font-size: 0.82rem; color: var(--muted); margin-top: 10px; }
footer {
  text-align: center; padding: 30px 20px;
  color: var(--muted); font-size: 0.9rem;
}
footer a { color: var(--blue); }
footer .footer-nav { margin: 0 0 10px; }
footer .footer-nav a { font-weight: 600; text-decoration: none; }
footer .footer-nav a:hover { text-decoration: underline; }
footer .footer-legal { margin: 0 0 10px; font-size: 0.85rem; }
footer .footer-legal a { text-decoration: none; }
footer .footer-legal a:hover { text-decoration: underline; }

/* Print (used by /print-packet/; harmless everywhere else) */
@media print {
  header, footer, section.panel, .no-print { display: none !important; }
  body { background: #fff; }
  main { padding: 0; }
  article { border: none; padding: 0; box-shadow: none; }
  article a { color: inherit; }
  #pk-out a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.78em;
    color: var(--muted);
    word-break: break-all;
  }
}
