/* Shared theme for the three independent cookbooks.
   Accent color is set per site via --accent on :root in a tiny override. */
:root {
  --bg: #f6f3ec;
  --bg-elev: #fffdf8;
  --ink: #1c1917;
  --muted: #57534e;
  --line: #e7e0d4;
  --code-bg: #1c1917;
  --code-ink: #f5f0e6;
  --accent: #1f4e79;
  --accent-ink: #fff;
  --warn-bg: #f8efe2;
  --warn-ink: #7c4a12;
  --ok-bg: #e8f0ea;
  --ok-ink: #1e4d32;
  --info-bg: #e8eef4;
  --info-ink: #1f3a56;
  --max: 72rem;
  --read: 46rem;
  --sans: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", "ui-monospace", "SFMono-Regular", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.05rem;
  line-height: 1.65;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }

header.site {
  border-bottom: 1px solid var(--line);
  background: var(--bg-elev);
  position: sticky; top: 0; z-index: 10;
}
header.site .bar {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; padding-block: 0.85rem;
}
header.site .brand {
  font-weight: 650; letter-spacing: -0.02em; color: var(--ink);
  text-decoration: none; font-size: 1.05rem;
}
header.site .brand span { color: var(--accent); font-weight: 700; }
header.site nav { display: flex; gap: 1rem; flex-wrap: wrap; font-size: 0.92rem; }
header.site nav a { color: var(--muted); text-decoration: none; }
header.site nav a:hover, header.site nav a[aria-current="page"] { color: var(--ink); }

.hero {
  padding-top: 2.4rem; padding-bottom: 1.6rem;
  border-bottom: 1px solid var(--line);
}
.hero h1 { margin: 0 0 0.4rem; font-size: 2.05rem; letter-spacing: -0.03em; line-height: 1.2; }
.hero p.lead { margin: 0; max-width: 42rem; color: var(--muted); font-size: 1.1rem; }
.kicker {
  display: inline-block; font-size: 0.75rem; font-weight: 650;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent);
  margin-bottom: 0.35rem;
}

.layout {
  display: grid;
  grid-template-columns: 15.5rem 1fr;
  gap: 2.25rem;
  padding-top: 2rem; padding-bottom: 3.5rem;
}
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
}

.sidebar { font-size: 0.92rem; }
.sidebar h2 {
  margin: 0 0 0.5rem; font-size: 0.72rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted); font-weight: 650;
}
.sidebar ol, .sidebar ul { margin: 0 0 1.4rem; padding: 0; list-style: none; }
.sidebar li { margin: 0 0 0.35rem; }
.sidebar a { color: var(--ink); text-decoration: none; }
.sidebar a:hover, .sidebar a[aria-current="page"] { color: var(--accent); }
.sidebar .note { color: var(--muted); font-size: 0.85rem; }

article { max-width: var(--read); }
article h1 { margin: 0 0 0.6rem; font-size: 1.85rem; letter-spacing: -0.03em; line-height: 1.2; }
article h2 { margin: 2rem 0 0.6rem; font-size: 1.25rem; letter-spacing: -0.02em; }
article h3 { margin: 1.4rem 0 0.4rem; font-size: 1.05rem; }
article p { margin: 0.7rem 0; }
article ul, article ol { margin: 0.5rem 0 0.9rem; padding-left: 1.3rem; }
article li { margin: 0.25rem 0; }
article hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }

.meta { color: var(--muted); font-size: 0.9rem; margin-bottom: 1.2rem; }

pre, code { font-family: var(--mono); font-size: 0.88em; }
code {
  background: #efeae0; padding: 0.1em 0.35em; border-radius: 0.25rem;
}
pre {
  background: var(--code-bg); color: var(--code-ink);
  padding: 1rem 1.1rem; border-radius: 0.45rem; overflow-x: auto;
  line-height: 1.5;
}
pre code { background: transparent; color: inherit; padding: 0; font-size: 0.86rem; }

table {
  border-collapse: collapse; width: 100%; font-size: 0.95rem;
  margin: 1rem 0 1.3rem; background: var(--bg-elev);
}
th, td { border: 1px solid var(--line); padding: 0.45rem 0.65rem; text-align: left; vertical-align: top; }
th { background: #efe8da; font-weight: 650; }

.callout {
  border: 1px solid var(--line); border-left-width: 4px;
  border-radius: 0.35rem; padding: 0.7rem 0.95rem; margin: 1.1rem 0;
  background: var(--bg-elev);
}
.callout strong.label { display: block; font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 0.2rem; }
.callout.verify { border-left-color: var(--accent); background: var(--info-bg); }
.callout.verify .label { color: var(--info-ink); }
.callout.gotcha { border-left-color: #b45309; background: var(--warn-bg); }
.callout.gotcha .label { color: var(--warn-ink); }
.callout.ok { border-left-color: #2f6b45; background: var(--ok-bg); }
.callout.ok .label { color: var(--ok-ink); }
.callout.legal { border-left-color: #57534e; }

.card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(16.5rem, 1fr));
  gap: 0.9rem; margin: 1.2rem 0 2rem;
}
.card {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: 0.45rem;
  padding: 0.95rem 1rem; text-decoration: none; color: inherit; display: block;
}
.card:hover { border-color: var(--accent); }
.card h2, .card h3 { margin: 0 0 0.35rem; font-size: 1.05rem; }
.card p { margin: 0; color: var(--muted); font-size: 0.92rem; }

.related { margin-top: 2.2rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.related ul { padding-left: 1.1rem; }

footer.site {
  border-top: 1px solid var(--line); padding-block: 1.4rem 2rem;
  color: var(--muted); font-size: 0.88rem;
}
footer.site p { margin: 0.3rem 0; max-width: 46rem; }

.toc { background: var(--bg-elev); border: 1px solid var(--line); padding: 0.8rem 1rem; border-radius: 0.4rem; margin: 0 0 1.4rem; font-size: 0.92rem; }
.toc p { margin: 0 0 0.3rem; font-weight: 650; }

@media print {
  header.site, .sidebar, footer.site { position: static; }
  .layout { display: block; }
  a { color: inherit; }
  pre { white-space: pre-wrap; }
}

/* Mobile: keep side gutters, wrap long code/tables inside the column */
@media (max-width: 600px) {
  .wrap { padding-left: max(1.1rem, env(safe-area-inset-left)); padding-right: max(1.1rem, env(safe-area-inset-right)); }
  body { font-size: 1rem; }
  .hero h1 { font-size: 1.7rem; }
  article h1 { font-size: 1.55rem; }
  .layout { gap: 1.5rem; padding-top: 1.25rem; }
  pre { margin-left: 0; margin-right: 0; font-size: 0.82rem; }
  table { display: block; overflow-x: auto; max-width: 100%; }
}
article, .sidebar { min-width: 0; overflow-wrap: anywhere; }
