/* ============================================================
   WoodStoveCode — styles.css
   Aesthetic: Warm editorial. Dark charcoal + ember amber +
   cream parchment. Evokes hearth warmth, not clinical tech.
   Fonts: Playfair Display (display) + Source Serif 4 (body)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;0,900;1,400&family=Source+Serif+4:ital,opsz,wght@0,8..60,300;0,8..60,400;0,8..60,600;1,8..60,400&family=JetBrains+Mono:wght@400;600&display=swap');

/* ── TOKENS ── */
:root {
  --charcoal:    #1c1917;
  --charcoal-2:  #292524;
  --charcoal-3:  #44403c;
  --ember:       #c2410c;
  --ember-light: #ea580c;
  --amber:       #d97706;
  --amber-light: #fbbf24;
  --cream:       #fdf6e3;
  --cream-2:     #f5ead0;
  --cream-3:     #e8d9bb;
  --slate:       #78716c;
  --slate-light: #a8a29e;
  --white:       #ffffff;

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Source Serif 4', Georgia, serif;
  --font-mono:    'JetBrains Mono', monospace;

  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  16px;

  --shadow-sm:  0 1px 3px rgba(28,25,23,.15);
  --shadow-md:  0 4px 12px rgba(28,25,23,.18);
  --shadow-lg:  0 12px 40px rgba(28,25,23,.22);

  --max-w:      1100px;
  --max-w-text: 740px;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 17px; }
body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--charcoal);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--ember); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--ember-light); }

/* ── SKIP LINK ── */
.skip-link {
  position: absolute; left: -9999px; top: 8px;
  background: var(--ember); color: var(--white);
  padding: 8px 16px; border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: .9rem;
  z-index: 9999;
}
.skip-link:focus { left: 8px; }

/* ── SITE HEADER ── */
.site-header {
  background: var(--charcoal);
  border-bottom: 3px solid var(--ember);
  position: sticky; top: 0; z-index: 100;
}
.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.site-logo {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--cream);
  text-decoration: none;
  letter-spacing: -.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.site-logo .flame-icon {
  color: var(--amber-light);
  font-size: 1.3rem;
}
.site-logo:hover { color: var(--amber-light); }

.site-nav { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.site-nav a {
  color: var(--slate-light);
  text-decoration: none;
  font-size: .88rem;
  font-family: var(--font-body);
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: background .15s, color .15s;
  letter-spacing: .02em;
}
.site-nav a:hover {
  background: rgba(255,255,255,.08);
  color: var(--amber-light);
}
.site-nav a.nav-cta {
  background: var(--ember);
  color: var(--white);
  padding: 6px 14px;
}
.site-nav a.nav-cta:hover { background: var(--ember-light); color: var(--white); }

/* ── HERO ── */
.hero {
  background: var(--charcoal-2);
  color: var(--cream);
  padding: 72px 24px 60px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(ellipse 60% 80% at 80% 50%, rgba(194,65,12,.18) 0%, transparent 70%),
    radial-gradient(ellipse 40% 60% at 20% 80%, rgba(217,119,6,.10) 0%, transparent 60%);
  pointer-events: none;
}
.hero-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  position: relative;
}
.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 18px;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 900;
  line-height: 1.12;
  max-width: 700px;
  margin-bottom: 22px;
  letter-spacing: -.03em;
}
.hero h1 em {
  font-style: italic;
  color: var(--amber-light);
}
.hero p {
  font-size: 1.08rem;
  max-width: 560px;
  color: var(--cream-3);
  margin-bottom: 36px;
  line-height: 1.7;
}
.hero-buttons { display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
  display: inline-block;
  padding: 13px 26px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: .95rem;
  text-decoration: none;
  transition: transform .15s, box-shadow .15s, background .15s;
  cursor: pointer;
  border: none;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-primary { background: var(--ember); color: var(--white); }
.btn-primary:hover { background: var(--ember-light); color: var(--white); }
.btn-outline { background: transparent; color: var(--cream); border: 2px solid rgba(255,255,255,.3); }
.btn-outline:hover { border-color: var(--amber-light); color: var(--amber-light); }
.btn-amber { background: var(--amber); color: var(--charcoal); }
.btn-amber:hover { background: var(--amber-light); color: var(--charcoal); }

/* ── MAIN LAYOUT ── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}
.page-body {
  max-width: var(--max-w-text);
  margin: 0 auto;
  padding: 0 24px;
}
main { padding: 56px 0 80px; }

/* ── SECTION LABELS ── */
.section-label {
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--ember);
  display: block;
  margin-bottom: 10px;
}

/* ── TYPOGRAPHY ── */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.25;
  letter-spacing: -.02em;
}
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); margin-bottom: 20px; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); margin: 48px 0 18px; color: var(--charcoal); }
h2:first-child { margin-top: 0; }
h3 { font-size: 1.2rem; margin: 32px 0 12px; color: var(--charcoal-3); }
h4 { font-size: 1rem; margin: 24px 0 8px; color: var(--charcoal-3); }
p { margin-bottom: 18px; }
p:last-child { margin-bottom: 0; }
ul, ol { padding-left: 1.5em; margin-bottom: 18px; }
li { margin-bottom: 6px; }
strong { font-weight: 600; }

/* ── ARTICLE INTRO ── */
.article-intro {
  font-size: 1.15rem;
  color: var(--charcoal-3);
  line-height: 1.8;
  border-left: 4px solid var(--ember);
  padding-left: 20px;
  margin-bottom: 36px;
}

/* ── CARD GRIDS ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin: 32px 0;
}
.card {
  background: var(--white);
  border: 1px solid var(--cream-3);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--amber);
  color: inherit;
}
.card-tag {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ember);
  display: block;
  margin-bottom: 8px;
}
.card h3 {
  font-size: 1.08rem;
  margin: 0 0 10px;
  color: var(--charcoal);
}
.card p {
  font-size: .9rem;
  color: var(--slate);
  margin: 0;
  line-height: 1.6;
}
.card-arrow {
  display: block;
  margin-top: 14px;
  font-size: .85rem;
  color: var(--ember);
  font-weight: 600;
}

/* ── STATE GRID ── */
.state-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin: 28px 0;
}
.state-card {
  background: var(--white);
  border: 1px solid var(--cream-3);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  text-decoration: none;
  color: var(--charcoal);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .92rem;
  font-weight: 600;
  transition: background .15s, border-color .15s;
}
.state-card:hover {
  background: var(--cream-2);
  border-color: var(--ember);
  color: var(--charcoal);
}
.state-card .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--ember);
  flex-shrink: 0;
}

/* ── CALLOUT / ALERT BOX ── */
.callout {
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin: 28px 0;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.callout-icon { font-size: 1.3rem; flex-shrink: 0; margin-top: 2px; }
.callout-body p:last-child { margin-bottom: 0; }
.callout-warn {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-left: 4px solid var(--amber);
}
.callout-info {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-left: 4px solid #0284c7;
}
.callout-tip {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-left: 4px solid #16a34a;
}
.callout-danger {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-left: 4px solid #dc2626;
}

/* ── TABLE ── */
.table-wrap { overflow-x: auto; margin: 28px 0; border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: .92rem;
  background: var(--white);
}
thead { background: var(--charcoal); color: var(--cream); }
thead th {
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 14px 16px;
  text-align: left;
  font-weight: 600;
}
tbody tr { border-bottom: 1px solid var(--cream-3); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--cream); }
tbody td { padding: 12px 16px; vertical-align: top; }
tbody td:first-child { font-weight: 600; color: var(--charcoal); }
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 99px;
  font-family: var(--font-mono);
  font-size: .72rem;
  font-weight: 600;
}
.badge-yes { background: #dcfce7; color: #15803d; }
.badge-no { background: #fee2e2; color: #b91c1c; }
.badge-varies { background: #fef9c3; color: #854d0e; }

/* ── CHECKLIST ── */
.checklist { list-style: none; padding: 0; }
.checklist li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--cream-3);
  font-size: .97rem;
}
.checklist li:last-child { border-bottom: none; }
.checklist li::before {
  content: '☐';
  color: var(--ember);
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── FAQ ── */
.faq-list { margin: 32px 0; }
.faq-item {
  border: 1px solid var(--cream-3);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  background: var(--white);
  overflow: hidden;
}
.faq-q {
  width: 100%;
  background: none;
  border: none;
  padding: 18px 20px;
  text-align: left;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--charcoal);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  transition: background .15s;
}
.faq-q:hover { background: var(--cream); }
.faq-q::after { content: '+'; font-size: 1.4rem; color: var(--ember); flex-shrink: 0; transition: transform .2s; }
.faq-item.open .faq-q::after { transform: rotate(45deg); }
.faq-a {
  display: none;
  padding: 0 20px 18px;
  font-size: .95rem;
  color: var(--charcoal-3);
  line-height: 1.75;
  border-top: 1px solid var(--cream-3);
}
.faq-a p:first-child { margin-top: 14px; }
.faq-item.open .faq-a { display: block; }

/* ── TOOL PANEL ── */
.tool-panel {
  background: var(--charcoal-2);
  color: var(--cream);
  border-radius: var(--radius-lg);
  padding: 36px;
  margin: 40px 0;
}
.tool-panel h2 { color: var(--amber-light); margin-top: 0; }
.tool-panel label {
  display: block;
  font-size: .88rem;
  font-weight: 600;
  color: var(--cream-3);
  margin-bottom: 6px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.tool-panel select,
.tool-panel input[type="number"] {
  width: 100%;
  padding: 11px 14px;
  background: var(--charcoal);
  border: 1px solid var(--charcoal-3);
  border-radius: var(--radius-sm);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: .97rem;
  margin-bottom: 20px;
  appearance: none;
  -webkit-appearance: none;
}
.tool-panel select:focus,
.tool-panel input:focus {
  outline: 2px solid var(--amber);
  border-color: var(--amber);
}
.tool-result {
  background: var(--charcoal);
  border: 1px solid var(--charcoal-3);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-top: 24px;
  display: none;
}
.tool-result.visible { display: block; }
.tool-result h3 { color: var(--amber-light); margin-top: 0; font-size: 1.05rem; }
.clearance-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--charcoal-3);
  font-size: .93rem;
}
.clearance-row:last-child { border-bottom: none; }
.clearance-label { color: var(--slate-light); }
.clearance-value { font-weight: 700; color: var(--amber-light); font-family: var(--font-mono); font-size: 1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

/* ── BREADCRUMB ── */
.breadcrumb {
  font-size: .84rem;
  color: var(--slate);
  margin-bottom: 28px;
  font-family: var(--font-mono);
}
.breadcrumb a { color: var(--slate); text-decoration: none; }
.breadcrumb a:hover { color: var(--ember); }
.breadcrumb span { margin: 0 6px; }

/* ── PAGE HEADER (inside article) ── */
.page-header {
  padding: 52px 0 40px;
  border-bottom: 1px solid var(--cream-3);
  margin-bottom: 48px;
}
.page-header .section-label { margin-bottom: 12px; }
.page-header h1 { margin-bottom: 16px; }
.page-header .subtitle {
  font-size: 1.08rem;
  color: var(--slate);
  max-width: 640px;
  line-height: 1.7;
}
.page-header .meta {
  margin-top: 18px;
  font-size: .82rem;
  color: var(--slate-light);
  font-family: var(--font-mono);
}

/* ── SPLIT LAYOUT (sidebar) ── */
.split-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 48px;
  align-items: start;
}
@media (max-width: 900px) {
  .split-layout { grid-template-columns: 1fr; }
}
.sidebar-card {
  background: var(--white);
  border: 1px solid var(--cream-3);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 90px;
}
.sidebar-card h3 {
  font-size: 1rem;
  margin-top: 0;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--ember);
  margin-bottom: 16px;
}
.sidebar-list { list-style: none; padding: 0; }
.sidebar-list li { border-bottom: 1px solid var(--cream-3); }
.sidebar-list li:last-child { border-bottom: none; }
.sidebar-list a {
  display: block;
  padding: 9px 0;
  font-size: .9rem;
  color: var(--charcoal-3);
  text-decoration: none;
  transition: color .15s;
}
.sidebar-list a:hover { color: var(--ember); }

/* ── DOWNLOAD BOX ── */
.download-box {
  background: linear-gradient(135deg, var(--charcoal-2) 0%, var(--charcoal) 100%);
  border-radius: var(--radius-lg);
  padding: 32px 36px;
  display: flex;
  align-items: center;
  gap: 24px;
  margin: 36px 0;
  color: var(--cream);
}
.download-icon { font-size: 2.5rem; flex-shrink: 0; }
.download-text h3 { color: var(--amber-light); margin: 0 0 6px; font-size: 1.05rem; }
.download-text p { margin: 0 0 16px; font-size: .9rem; color: var(--cream-3); }
@media (max-width: 600px) {
  .download-box { flex-direction: column; padding: 24px; }
}

/* ── HIGHLIGHT BAR ── */
.highlight-bar {
  background: var(--cream-2);
  border-left: 5px solid var(--ember);
  padding: 20px 24px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 28px 0;
}
.highlight-bar p { margin: 0; font-size: 1.02rem; }

/* ── STAT ROW ── */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin: 36px 0;
}
.stat-box {
  background: var(--white);
  border: 1px solid var(--cream-3);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.stat-number {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 900;
  color: var(--ember);
  line-height: 1;
  display: block;
}
.stat-label {
  font-size: .82rem;
  color: var(--slate);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-top: 6px;
  display: block;
}

/* ── DISCLAIMER ── */
.disclaimer {
  background: var(--cream-2);
  border: 1px solid var(--cream-3);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  font-size: .84rem;
  color: var(--slate);
  line-height: 1.65;
  margin: 40px 0 24px;
}
.disclaimer strong { color: var(--charcoal-3); }

/* ── FOOTER ── */
.site-footer {
  background: var(--charcoal);
  color: var(--slate-light);
  padding: 56px 24px 36px;
  border-top: 3px solid var(--ember);
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 48px;
}
@media (max-width: 800px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 500px) {
  .footer-inner { grid-template-columns: 1fr; }
}
.footer-brand .site-logo { margin-bottom: 14px; display: inline-block; font-size: 1.2rem; }
.footer-brand p { font-size: .88rem; line-height: 1.7; max-width: 280px; }
.footer-col h4 {
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--slate-light);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--charcoal-3);
}
.footer-col ul { list-style: none; padding: 0; }
.footer-col li { margin-bottom: 8px; }
.footer-col a {
  color: var(--slate-light);
  text-decoration: none;
  font-size: .88rem;
  transition: color .15s;
}
.footer-col a:hover { color: var(--amber-light); }
.footer-bottom {
  max-width: var(--max-w);
  margin: 0 auto;
  padding-top: 24px;
  border-top: 1px solid var(--charcoal-3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: .82rem;
  color: var(--charcoal-3);
}
.footer-bottom a { color: var(--charcoal-3); }
.footer-bottom a:hover { color: var(--amber-light); }

/* ── ANALYTICS PLACEHOLDER ── */
/* GA4 + Clarity: activate in Phase 3 */

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  html { font-size: 16px; }
  .hero { padding: 48px 20px 44px; }
  .site-nav { display: none; }
  .container { padding: 0 16px; }
  .page-body { padding: 0 16px; }
  main { padding: 36px 0 60px; }
  .tool-panel { padding: 24px; }
  .download-box { gap: 16px; }
  h2 { margin-top: 36px; }
  thead th { font-size: .72rem; padding: 12px; }
  tbody td { padding: 10px 12px; }
}
