/* ============================================================
   BrickCrunch /guides static-post stylesheet.
   Used by /guides/post-template.html and every published post.
   Deliberately self-contained and UNHASHED so published posts
   never break when the React bundle is rebuilt. Mirrors the
   core look of src/index.css — if you restyle the site, update
   the shared tokens here too.
   ============================================================ */

:root {
  --bg: #f6f8f7;
  --surface: #ffffff;
  --ink: #16241f;
  --ink-soft: #4b5d57;
  --muted: #76867f;
  --line: #e2e9e6;
  --primary: #0f3d3e;
  --primary-2: #155e5b;
  --accent: #f4b740;
  --accent-ink: #5a4400;
  --good: #157a52;
  --good-bg: #e6f5ee;
  --bad: #b4423a;
  --bad-bg: #fbecea;
  --info-bg: #eef4f3;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16, 40, 34, 0.05), 0 8px 24px rgba(16, 40, 34, 0.06);
  --maxw: 1080px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary-2); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.25; color: var(--ink); }
h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); margin: 0 0 0.5rem; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.25rem, 3vw, 1.55rem); margin: 2rem 0 0.75rem; letter-spacing: -0.01em; }
h3 { font-size: 1.1rem; margin: 1.4rem 0 0.5rem; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 1.1rem; }

/* ---------- Header ---------- */
.site-header {
  background: var(--primary);
  color: #eafff7;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 62px;
}
.brand { display: flex; align-items: center; gap: 0.55rem; font-weight: 800; font-size: 1.2rem; color: #fff; letter-spacing: -0.02em; }
.brand:hover { text-decoration: none; }
.brand .crunch { color: var(--accent); }
.brand img { width: 28px; height: 28px; }
.nav { display: flex; gap: 0.3rem; align-items: center; flex-wrap: wrap; }
.nav a {
  color: #d6efe7;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
}
.nav a:hover { background: rgba(255, 255, 255, 0.12); color: #fff; text-decoration: none; }
.nav a.active { background: rgba(244, 183, 64, 0.18); color: #fff; }

.menu-toggle { display: none; background: transparent; border: 1px solid rgba(255,255,255,.3); color: #fff; border-radius: 8px; padding: .35rem .6rem; font-size: 1.1rem; cursor: pointer; }
@media (max-width: 760px) {
  .menu-toggle { display: inline-block; }
  .nav { display: none; position: absolute; top: 62px; left: 0; right: 0; background: var(--primary-2); flex-direction: column; padding: 0.5rem 1rem 1rem; gap: 0.1rem; }
  .nav.open { display: flex; }
  .nav a { width: 100%; }
}

/* ---------- Page / article ---------- */
.page { padding: 1.6rem 0 3rem; }
.crumbs { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.6rem; }
.crumbs a { color: var(--muted); }
.lede { font-size: 1.08rem; color: var(--ink-soft); max-width: 70ch; }

.article { max-width: 75ch; }
.article p, .article li { color: var(--ink-soft); }
.article ul, .article ol { padding-left: 1.2rem; }
.article li { margin: 0.3rem 0; }

.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.9rem; color: var(--muted); font-size: 0.85rem; margin: 0.2rem 0 1.2rem; }
.post-meta .tags { display: inline-flex; flex-wrap: wrap; gap: 0.35rem; }
.post-meta .tags span, .tag-chip {
  background: var(--info-bg); color: var(--primary-2); font-weight: 600; font-size: 0.75rem;
  padding: 0.15rem 0.55rem; border-radius: 999px;
}

.worked-example {
  background: var(--info-bg);
  border-left: 4px solid var(--primary-2);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1.1rem;
  margin: 1rem 0;
}
.worked-example h3 { margin-top: 0; }

table.bands { width: 100%; border-collapse: collapse; font-size: 0.88rem; margin-top: 0.6rem; }
table.bands th, table.bands td { text-align: right; padding: 0.45rem 0.5rem; border-bottom: 1px solid var(--line); }
table.bands th:first-child, table.bands td:first-child { text-align: left; }
table.bands th { color: var(--muted); font-weight: 600; }

.rates-line {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--info-bg); color: var(--ink-soft);
  border-radius: 999px; padding: 0.3rem 0.8rem; font-size: 0.82rem; margin-bottom: 1rem;
}
.rates-line .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); }

.callout { border-radius: var(--radius-sm); padding: 0.8rem 0.95rem; font-size: 0.9rem; margin-top: 1rem; }
.callout.info { background: var(--info-bg); color: var(--ink-soft); }
.callout.good { background: var(--good-bg); color: #0d5a3c; }
.callout.bad { background: var(--bad-bg); color: #8a322b; }

.inline-links { list-style: none; margin: 0.8rem 0 1.2rem; padding: 0.8rem 1rem; background: var(--info-bg); border-radius: var(--radius-sm); }
.inline-links li { margin: 0.3rem 0; padding-left: 1.1rem; position: relative; }
.inline-links li::before { content: "→"; position: absolute; left: 0; color: var(--primary-2); font-weight: 700; }
.inline-links a { font-weight: 600; }

/* ---------- "Run your own numbers" callout ----------
   The publishing engine (and hand-written posts) drop this block
   inside {{BODY_HTML}}:
     <aside class="run-numbers">
       <h3>Run your own numbers</h3>
       <p>Optional one-liner.</p>
       <ul>
         <li><a href="/uk-brr-calculator">UK BRR calculator</a></li>
       </ul>
     </aside>
   1–3 calculator links. Style below. */
.run-numbers {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #eafff7;
  border-radius: var(--radius);
  padding: 1.15rem 1.3rem;
  margin: 1.8rem 0;
  box-shadow: var(--shadow);
}
.run-numbers h3 { color: #fff; margin: 0 0 0.35rem; font-size: 1.05rem; }
.run-numbers h3::before { content: "⌁ "; color: var(--accent); }
.run-numbers p { color: #d3ece5; margin: 0 0 0.6rem; font-size: 0.92rem; }
.run-numbers ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.run-numbers li { margin: 0; }
.run-numbers a {
  display: inline-block; background: var(--accent); color: var(--accent-ink);
  font-weight: 700; font-size: 0.92rem; padding: 0.5rem 0.9rem; border-radius: 10px;
}
.run-numbers a:hover { filter: brightness(1.04); text-decoration: none; }

.disclaimer { font-size: 0.82rem; color: var(--muted); border-top: 1px solid var(--line); margin-top: 2.5rem; padding-top: 1rem; }

/* ---------- Footer ---------- */
.site-footer { background: #0c2e2f; color: #bcd6cf; margin-top: 3rem; padding: 2.2rem 0 2rem; font-size: 0.9rem; }
.site-footer a { color: #d9efe7; }
.footer-grid { display: grid; gap: 1.4rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.footer-grid h4 { color: #fff; font-size: 0.95rem; margin: 0 0 0.6rem; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.3rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.12); margin-top: 1.6rem; padding-top: 1rem; color: #8fb3aa; font-size: 0.82rem; }

.skip-link { position: absolute; left: -999px; background: #fff; padding: .5rem .8rem; z-index: 100; }
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

@media print {
  .site-header, .site-footer, .menu-toggle, .crumbs, .skip-link, .run-numbers { display: none !important; }
  body { background: #fff; }
  a { color: #000; text-decoration: none; }
}
