/* ============================================================
   Meshcast guide-article stylesheet — the ONE shared style for
   every /guides/<slug> article page. Loaded via
   <link rel="stylesheet" href="/guides.css"> so all articles
   stay visually identical by construction. The /guides index
   page keeps its own inline styles (different layout).

   Article skeleton this expects:
   .guide-layout > aside.guide-side + article.guide
   Sidebar: "On this page" TOC (anchors to h2 ids) + all-guides
   link + mini CTA. Hidden below 920px — articles are compact
   enough to scroll on mobile.
   ============================================================ */

:root {
  --bg: #fbf6ee;
  --bg-2: #f3ece0;
  --line: #e6dfd1;
  --line-strong: #d6cdba;
  --text: #181818;
  --muted: #6b6356;
  --accent: #ee5a2c;
  --accent-hover: #d44d22;
  --accent-tint: #fde8df;
  --ink: #16181d;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
html, body {
  margin: 0;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}
a { color: var(--accent); }
img { max-width: 100%; display: block; }

/* ── Layout: sticky sidebar + article ── */
.guide-layout {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 22px 80px;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}
article.guide { min-width: 0; max-width: 720px; }
@media (max-width: 920px) {
  .guide-layout { grid-template-columns: 1fr; gap: 0; padding-top: 20px; }
  .guide-side { display: none; }
}

/* ── Sidebar: on-this-page TOC ── */
.guide-side { position: sticky; top: 76px; font-size: 13.5px; }
.guide-side h4 {
  font-family: 'Anton', sans-serif; font-weight: 400;
  font-size: 12px; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 8px; padding: 0 8px;
}
.guide-toc { list-style: none; margin: 0 0 20px; padding: 0; }
.guide-toc a {
  display: block; color: var(--text); text-decoration: none;
  padding: 6px 8px; border-radius: 6px; line-height: 1.35;
}
.guide-toc a:hover { background: var(--bg-2); color: var(--accent); }
.guide-side-all {
  display: inline-block; color: var(--muted); text-decoration: none;
  font-weight: 600; font-size: 13px; padding: 6px 8px; border-radius: 6px;
}
.guide-side-all:hover { color: var(--accent); background: var(--bg-2); }
.guide-side-cta {
  margin-top: 18px; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; padding: 14px;
}
.guide-side-cta p { font-size: 12.5px; color: var(--muted); margin: 0 0 10px; line-height: 1.45; }
.guide-side-cta a {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--accent); color: #fff; text-decoration: none;
  font-size: 12.5px; font-weight: 700; padding: 7px 13px; border-radius: 8px;
}
.guide-side-cta a:hover { background: var(--accent-hover); }

/* ── Article header ── */
.guide-breadcrumb { font-size: 12px; color: var(--muted); margin-bottom: 16px; }
.guide-breadcrumb a { color: var(--muted); text-decoration: none; }
.guide-breadcrumb a:hover { color: var(--accent); }
.guide-eyebrow {
  display: inline-block; background: var(--accent-tint); color: var(--accent);
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; margin-bottom: 16px;
}
article.guide h1 {
  font-family: 'Anton', sans-serif; font-weight: 400;
  font-size: clamp(30px, 5vw, 42px); line-height: 1.08;
  letter-spacing: 0.01em; text-transform: uppercase;
  margin: 0 0 12px;
}
article.guide h1 .accent { color: var(--accent); }
.guide-meta { color: var(--muted); font-size: 13.5px; margin: 0 0 24px; }
.guide-meta a { color: var(--accent); text-decoration: none; }
.guide-hero-img {
  width: 100%; height: 300px; object-fit: cover; border-radius: 14px;
  display: block; margin: 0 0 28px; background: var(--bg-2);
}
@media (max-width: 640px) { .guide-hero-img { height: 190px; border-radius: 10px; } }

/* ── TL;DR / quick-answer box ── */
.tldr {
  background: #fff; border: 1px solid var(--line-strong); border-left: 4px solid var(--accent);
  border-radius: 12px; padding: 16px 18px; margin: 0 0 30px;
}
.tldr-label {
  display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 6px;
}
.tldr p { margin: 0; font-size: 15px; line-height: 1.6; }
.tldr ul { margin: 0; padding-left: 20px; font-size: 15px; }
.tldr li { margin: 3px 0; }

/* ── Body text: compact ── */
article.guide h2 {
  font-family: 'Anton', sans-serif; font-weight: 400; font-size: 24px;
  letter-spacing: 0.01em; text-transform: uppercase;
  margin: 38px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line);
  scroll-margin-top: 90px;
}
article.guide h3 { font-size: 17px; font-weight: 700; margin: 22px 0 8px; }
article.guide p, article.guide ul, article.guide ol {
  font-size: 15.5px; line-height: 1.65; margin: 0 0 0.95em;
}
article.guide ul, article.guide ol { padding-left: 22px; }
article.guide li { margin-bottom: 5px; }
strong { color: var(--text); }

/* ── Numbered step cards ── */
.step { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; margin: 18px 0; }
.step-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.step-num {
  width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.step-head h3 { margin: 0; font-size: 17px; }
.step img { border-radius: 10px; margin: 10px 0; }
.step p:last-child, .step table:last-child { margin-bottom: 0; }

/* ── Tables ── */
.cmp-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 16px 0 24px; }
.cmp-table {
  width: 100%; border-collapse: collapse; font-size: 13.5px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
}
.cmp-table th, .cmp-table td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.cmp-table thead th, .cmp-table tr th { background: var(--bg-2); font-weight: 700; font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; }
.cmp-table tr:last-child td { border-bottom: 0; }

/* ── Callouts ── */
.tip {
  background: var(--accent-tint); border-radius: 8px;
  padding: 10px 14px; margin: 14px 0; font-size: 13.5px; line-height: 1.55;
}
.warn {
  background: #fef3e7; border-left: 3px solid var(--accent); border-radius: 8px;
  padding: 10px 14px; margin: 14px 0; font-size: 13.5px; line-height: 1.55;
}

/* ── "What you'll need" compact list ── */
.need-box { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 20px; margin: 20px 0 28px; }
.need-box h3 { margin: 0 0 10px; font-size: 16px; }
.need-box ul { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.need-box li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--line); margin: 0; }
.need-box li:last-child { border-bottom: 0; }
.need-box .need-price { color: var(--muted); font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.need-box .need-note { font-size: 12px; color: var(--muted); margin: 10px 0 0; }

/* ── FAQ / troubleshooting accordions ── */
details.faq-item { background: #fff; border: 1px solid var(--line); border-radius: 12px; margin: 0 0 8px; }
details.faq-item summary {
  cursor: pointer; padding: 13px 16px; font-weight: 600; font-size: 14.5px;
  list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
details.faq-item summary::-webkit-details-marker { display: none; }
details.faq-item summary::after { content: '+'; color: var(--accent); font-weight: 400; font-size: 20px; line-height: 1; flex-shrink: 0; }
details.faq-item[open] summary::after { content: '−'; }
details.faq-item[open] summary { border-bottom: 1px solid var(--line); }
details.faq-item > p { padding: 11px 16px 14px; color: var(--muted); margin: 0; font-size: 14px; line-height: 1.6; }

/* ── CTA banner ── */
.cta-banner {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  color: #fff; border-radius: 14px; padding: 24px 24px 20px; margin: 34px 0; text-align: center;
}
.cta-banner h3 { font-family: 'Anton', sans-serif; font-weight: 400; font-size: 22px; letter-spacing: 0.01em; text-transform: uppercase; margin: 0 0 8px; }
.cta-banner p { color: rgba(255,255,255,0.92); font-size: 14px; margin: 0 0 14px; }
.cta-banner a { display: inline-block; background: #fff; color: var(--accent); padding: 10px 20px; border-radius: 999px; font-weight: 700; text-decoration: none; font-size: 14px; }

/* ── Related links ── */
.related { margin: 36px 0 0; padding: 20px 22px; background: var(--bg-2); border-radius: 14px; }
.related h3 { font-family: 'Anton', sans-serif; font-weight: 400; font-size: 16px; letter-spacing: 0.06em; text-transform: uppercase; margin: 0 0 10px; }
.related ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 7px; font-size: 14.5px; }
.related a { color: var(--text); text-decoration: none; font-weight: 600; }
.related a:hover { color: var(--accent); }

/* ── Footnote ── */
.guide-footnote { font-size: 13px; color: var(--muted); margin-top: 36px; padding-top: 16px; border-top: 1px solid var(--line); }

/* ── Footer ── */
footer.l-footer { background: var(--ink); color: #b8b1a3; padding: 36px 20px 28px; margin-top: 60px; }
.l-footer-inner { max-width: 1080px; margin: 0 auto; }
.l-footer-brand { display: flex; align-items: center; gap: 8px; font-family: 'Anton', sans-serif; font-size: 20px; text-transform: uppercase; color: #fff; margin-bottom: 12px; }
.l-footer-brand .l-brand-logo { width: 28px; height: 28px; border-radius: 7px; background: var(--accent); display: grid; place-items: center; color: #fff; }
.l-footer-brand-cast { color: var(--accent); }
.l-footer-links { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; margin-bottom: 18px; }
.l-footer-links a { color: #b8b1a3; text-decoration: none; }
.l-footer-links a:hover { color: #fff; }
.l-footer-meta { font-size: 11px; color: #6b6356; padding-top: 14px; border-top: 1px solid #2c2c2a; }
.l-footer-meta a { color: #b8b1a3; }
