/* soap.brian.staruk.net — one hand-written stylesheet, no JS anywhere on the site.
   System fonts, light/dark via prefers-color-scheme, and a print layer that turns a
   recipe page into the kitchen sheet it already is. */

:root {
  --bg: #faf8f4;
  --fg: #2b2722;
  --muted: #6f6659;
  --line: #ddd5c7;
  --card: #f1ece2;
  --link: #7a4a21;
  --ok: #3d7a3d;
  --warn: #a03d2e;
  --badge-draft: #8a8272;
  --badge-ready: #33628a;
  --badge-curing: #a8742a;
  --badge-cured: #3d7a3d;
  --badge-failed: #a03d2e;
  --badge-abandoned: #8a8272;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1d1b18;
    --fg: #e8e2d6;
    --muted: #a2988a;
    --line: #3c372f;
    --card: #26231e;
    --link: #d9a05f;
    --ok: #7fbf7f;
    --warn: #e08070;
    --badge-draft: #7a7264;
    --badge-ready: #4a7ba6;
    --badge-curing: #c08a3a;
    --badge-cured: #4e9a4e;
    --badge-failed: #bf5a48;
    --badge-abandoned: #7a7264;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0 auto;
  padding: 0 1rem 3rem;
  max-width: 44rem;
  background: var(--bg);
  color: var(--fg);
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-size: 1.0625rem;
  line-height: 1.6;
}

h1, h2, h3, h4, .site-header, .badge, .batch-no, dt, th, .meta, .card-status {
  font-family: ui-sans-serif, system-ui, -apple-system, sans-serif;
}

h1 { font-size: 1.6rem; line-height: 1.25; margin: 1.5rem 0 0.5rem; }
h2 { font-size: 1.2rem; margin: 2rem 0 0.5rem; }
h3 { font-size: 1rem; margin: 1.5rem 0 0.25rem; }
h1 + h3, h3 + h3 { margin-top: 0.25rem; color: var(--muted); font-weight: 500; }

a { color: var(--link); }
a:hover { text-decoration-thickness: 2px; }

hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }

code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; }

/* header / footer */

.site-header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  align-items: baseline;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}

.site-title {
  font-weight: 700;
  font-size: 1.15rem;
  text-decoration: none;
  color: var(--fg);
}

.site-header nav { display: flex; gap: 0.9rem; flex-wrap: wrap; }
.site-header nav a { text-decoration: none; color: var(--muted); font-size: 0.95rem; }
.site-header nav a[aria-current], .site-header nav a:hover { color: var(--link); }

.site-footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.intro { color: var(--muted); }
.muted { color: var(--muted); }
.ok { color: var(--ok); font-size: 0.9em; }
.warn { color: var(--warn); font-size: 0.9em; }

/* badges */

.badge {
  display: inline-block;
  padding: 0.05rem 0.5rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #fff;
  vertical-align: 0.1em;
}

.badge-draft { background: var(--badge-draft); }
.badge-ready { background: var(--badge-ready); }
.badge-curing { background: var(--badge-curing); }
.badge-cured { background: var(--badge-cured); }
.badge-failed { background: var(--badge-failed); }
.badge-abandoned { background: var(--badge-abandoned); }

/* batch index */

.batches { list-style: none; padding: 0; margin: 0.5rem 0 0; }

.batches li {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
}

.batches .batch-no {
  display: inline-block;
  min-width: 2.2rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.batches a { font-weight: 600; text-decoration: none; }
.batches a:hover { text-decoration: underline; }
.batches .meta { display: block; margin-left: 2.2rem; font-size: 0.85rem; }

/* recipe data card */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.9rem 1.1rem;
  margin: 1rem 0 1.5rem;
  font-size: 0.95rem;
}

.card-status { margin: 0 0 0.5rem; }

.card dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.2rem 1rem;
  margin: 0;
}

.card dt { color: var(--muted); font-size: 0.8rem; font-weight: 600; align-self: baseline; }
.card dd { margin: 0; }

/* tables (recipe ingredient tables, inventory) */

.table-scroll { overflow-x: auto; }

table { border-collapse: collapse; width: 100%; margin: 0.75rem 0; font-size: 0.95rem; }

th, td {
  text-align: left;
  vertical-align: top;
  padding: 0.45rem 0.75rem 0.45rem 0;
  border-bottom: 1px solid var(--line);
}

th { font-size: 0.8rem; color: var(--muted); }
td.num { font-variant-numeric: tabular-nums; }

/* recipe body niceties */

.recipe blockquote, .doc blockquote {
  margin: 1rem 0;
  padding: 0.1rem 1rem;
  border-left: 3px solid var(--line);
  color: var(--muted);
}

.recipe blockquote strong, .doc blockquote strong { color: var(--fg); }

details { margin: 1rem 0; }
summary { cursor: pointer; color: var(--muted); }

/* shared lye-safety disclaimer, collapsed on every recipe page */

.safety {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.4rem 0.9rem;
  font-size: 0.9rem;
}

.safety summary { font-family: ui-sans-serif, system-ui, -apple-system, sans-serif; }
.safety ul { margin: 0.5rem 0; }
.safety-print { display: none; }

/* print: the recipe page IS the kitchen sheet */

@media print {
  body { max-width: none; font-size: 11pt; background: #fff; color: #000; }
  .site-header, .site-footer { display: none; }
  a { color: #000; text-decoration: none; }
  .card { border: 1px solid #999; background: #fff; break-inside: avoid; }
  .badge { border: 1px solid #000; color: #000; background: #fff !important; }
  table, blockquote { break-inside: avoid; }
  h2 { break-after: avoid; }
  /* a closed <details> doesn't print its contents, so the kitchen sheet gets the one-liner */
  .safety { display: none; }
  .safety-print { display: block; font-size: 9pt; }
}
