:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #1a2332;
  --muted: #5b6472;
  --border: #e3e7ee;
  --primary: #0d6e5f;
  --primary-dark: #0a564a;
  --primary-soft: #e6f4f1;
  --accent: #f5a623;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.07), 0 8px 24px rgba(16, 24, 40, 0.05);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 880px; margin: 0 auto; padding: 0 20px; }

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

/* ---------- Header / Footer ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
}
.brand {
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--text);
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.brand span { color: var(--primary); }
.site-nav { display: flex; flex-wrap: nowrap; gap: 4px; }
.site-nav > a { color: var(--muted); font-size: 0.92rem; font-weight: 500; white-space: nowrap; }
.site-nav > a:hover { color: var(--primary); text-decoration: none; }

/* ---------- Nav dropdowns ---------- */
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  height: 60px; /* full header height → hover area is continuous from link to dropdown */
  padding: 0 8px;
}
.nav-link { display: inline-flex; align-items: center; gap: 5px; font-size: 0.9rem; white-space: nowrap; }
.dropdown-head {
  padding: 6px 12px 8px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #9aa2af;
  white-space: nowrap;
}
.caret { font-size: 0.55rem; color: #9aa2af; transition: transform 0.15s ease; }
.nav-item:hover .caret, .nav-item:focus-within .caret { transform: rotate(180deg); color: var(--primary); }
.nav-item .dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  min-width: 250px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 2px solid var(--primary);
  border-radius: 0 0 10px 10px;
  box-shadow: var(--shadow);
  padding: 8px;
  z-index: 50;
}
/* invisible bridge so the pointer can travel from link into the panel */
.nav-item .dropdown::before { content: ""; position: absolute; top: -10px; left: 0; right: 0; height: 10px; }
.nav-item:hover .dropdown, .nav-item:focus-within .dropdown { display: block; }
.nav-item .dropdown a {
  display: block;
  padding: 9px 12px;
  border-radius: 6px;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
}
.nav-item .dropdown a:hover {
  background: var(--primary-soft);
  color: var(--primary-dark);
  text-decoration: none;
}
.nav-item .dropdown a:last-child { margin-bottom: 0; }

/* ---------- Blog nav item (same dropdown UI as categories) ---------- */
.nav-count {
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 0.68rem;
  font-weight: 700;
  border-radius: 99px;
  padding: 1px 7px;
  line-height: 1.4;
}
.nav-item:hover .nav-count, .nav-item:focus-within .nav-count { background: var(--primary); color: #fff; }
.nav-item-blog .dropdown { min-width: 460px; }
.dropdown-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 10px;
}
.dropdown-grid a {
  white-space: normal;
  line-height: 1.35;
  font-size: 0.84rem;
}
.dropdown-all {
  display: block;
  margin-top: 6px;
  padding: 10px 12px 4px;
  border-top: 1px solid var(--border);
  color: var(--primary-dark);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}
.dropdown-all:hover { background: var(--primary-soft); text-decoration: none; border-radius: 6px; }

.site-footer {
  margin-top: 64px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 32px 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.site-footer .cols {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
  justify-content: space-between;
}
.site-footer h4 { margin: 0 0 8px; color: var(--text); font-size: 0.95rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 4px 0; }
.disclaimer { margin-top: 24px; font-size: 0.8rem; color: #8a92a0; }

/* ---------- Hero ---------- */
.hero { padding: 48px 0 8px; }
.hero h1 {
  font-size: 2.1rem;
  letter-spacing: -0.03em;
  margin: 0 0 12px;
  line-height: 1.2;
}
.hero p.lede { font-size: 1.08rem; color: var(--muted); max-width: 720px; margin: 0; }
.breadcrumb { font-size: 0.85rem; color: var(--muted); margin: 24px 0 -8px; }
.breadcrumb a { color: var(--muted); }

/* ---------- Calculator card ---------- */
.calc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  margin: 28px 0 16px;
}
.calc-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.field label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field input, .field select {
  width: 100%;
  padding: 10px 12px;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfcfd;
  color: var(--text);
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
  background: #fff;
}

.result-card {
  background: var(--primary-dark);
  color: #fff;
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 40px;
  box-shadow: var(--shadow);
}
.result-card table { width: 100%; border-collapse: collapse; }
.result-card td { padding: 9px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.14); font-size: 1rem; }
.result-card tr:last-child td { border-bottom: none; }
.result-card td:last-child { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.result-card tr.primary-row td { font-size: 1.15rem; }
.result-card .note { color: #bcd9d2; font-size: 0.82rem; margin: 12px 0 0; }

/* ---------- Content sections ---------- */
.section { margin: 40px 0; }
.section h2 {
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
}
.section p { margin: 0 0 14px; color: #333c4a; }
.section ol { color: #333c4a; padding-left: 22px; }
.section ol li { margin-bottom: 8px; }
.formula-box {
  background: var(--primary-soft);
  border: 1px solid #cfe8e2;
  border-radius: 8px;
  padding: 14px 18px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92rem;
  overflow-x: auto;
}
details.faq {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 10px;
}
details.faq summary { font-weight: 600; cursor: pointer; }
details.faq p { margin: 10px 0 0; color: var(--muted); }

/* ---------- GEO quick answer ---------- */
.quick-answer {
  background: #fff8e8;
  border: 1px solid #f2e3bb;
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 14px 18px;
  margin: 0 0 20px;
  font-size: 0.95rem;
  color: #4a3f22;
}
.quick-answer ul.takeaways { margin: 8px 0 0; padding-left: 20px; }
.quick-answer ul.takeaways li { margin-bottom: 6px; }
.qa-badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 4px;
  padding: 2px 8px;
  margin-right: 10px;
  vertical-align: 2px;
}

/* ---------- Blog ---------- */
.article-meta { font-size: 0.85rem; color: var(--muted); margin: 0 0 6px; }
.tools-box {
  background: var(--primary-soft);
  border: 1px solid #cfe8e2;
  border-radius: var(--radius);
  padding: 22px 24px;
}
.tools-box .tool-card { background: var(--surface); }

/* ---------- SEO search chips ---------- */
.search-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.search-chips span {
  background: #eef1f5;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 0.82rem;
}

/* ---------- Ad placeholder ---------- */
.ad-slot {
  margin: 24px 0;
  min-height: 90px;
  border: 1px dashed #c6ccd6;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a7aeb9;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: repeating-linear-gradient(45deg, #fafbfc, #fafbfc 12px, #f4f6f8 12px, #f4f6f8 24px);
}
.ad-slot::before { content: "Advertisement"; }

/* ---------- Home ---------- */
.cat-section { margin: 44px 0; }
.cat-section h2 { font-size: 1.4rem; letter-spacing: -0.02em; margin-bottom: 4px; }
.cat-section .cat-blurb { color: var(--muted); margin: 0 0 16px; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: block;
  color: var(--text);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.tool-card:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: #cfe8e2;
}
.tool-card h3 { margin: 0 0 6px; font-size: 1.02rem; color: var(--primary-dark); }
.tool-card p { margin: 0; font-size: 0.86rem; color: var(--muted); }

.static-page h1 { font-size: 1.9rem; letter-spacing: -0.02em; margin: 48px 0 16px; }
.static-page h2 { font-size: 1.25rem; margin-top: 32px; }

.related-list { display: flex; flex-wrap: wrap; gap: 10px; }
.related-list a {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 0.88rem;
  color: var(--text);
}
.related-list a:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }

@media (max-width: 760px) {
  .hero h1 { font-size: 1.6rem; }
  .site-nav { display: none; }
  .calc-card { padding: 20px; }
}
