/* =========================================================
   TaxNova — Core Stylesheet
   Design tokens: white base, trust blue + growth green accents
   ========================================================= */

:root {
  /* Colors */
  --white: #FFFFFF;
  --ink: #0F172A;
  --ink-soft: #1E293B;
  --slate: #64748B;
  --slate-light: #94A3B8;
  --border: #E5E9F0;
  --border-soft: #EEF1F6;

  --blue: #1A56DB;
  --blue-dark: #123F9E;
  --blue-tint: #EFF6FF;
  --blue-tint-strong: #DBEAFE;

  --green: #0F9D58;
  --green-dark: #0B7C44;
  --green-tint: #ECFDF5;
  --green-tint-strong: #D1FAE5;

  --amber: #B45309;
  --amber-tint: #FFFBEB;
  --red: #B91C1C;
  --red-tint: #FEF2F2;

  /* Type */
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', 'SF Mono', Consolas, monospace;

  /* Spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  /* Shadow */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.10);

  --max-width: 1180px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--white);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
}
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--ink);
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
p { margin: 0; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { margin: 0; padding: 0; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 16px; }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* Visible keyboard focus everywhere */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 4px;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-5);
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap;
}

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--blue); color: white; padding: 10px 16px; z-index: 200;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(255,255,255,0.97);
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px var(--space-5);
  max-width: var(--max-width);
  margin: 0 auto;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--ink);
}
.logo-mark {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--blue) 0%, var(--green) 100%);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 0.85rem; font-weight: 800;
  flex-shrink: 0;
}
.logo span.accent { color: var(--green); }

.main-nav {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}
.main-nav ul { display: flex; gap: var(--space-5); list-style: none; }
.main-nav a {
  color: var(--ink-soft);
  font-weight: 500;
  font-size: 0.95rem;
}
.main-nav a:hover { color: var(--blue); text-decoration: none; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 40px; height: 40px;
  align-items: center;
  justify-content: center;
}
.nav-toggle svg { width: 20px; height: 20px; }

@media (max-width: 860px) {
  .main-nav ul { display: none; }
  .nav-toggle { display: flex; }
  .main-nav.open ul {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px; left: 0; right: 0;
    background: white;
    border-bottom: 1px solid var(--border);
    padding: var(--space-4) var(--space-5);
    gap: var(--space-4);
    box-shadow: var(--shadow-md);
  }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--blue); color: white; }
.btn-primary:hover { background: var(--blue-dark); text-decoration: none; }
.btn-secondary { background: var(--green); color: white; }
.btn-secondary:hover { background: var(--green-dark); text-decoration: none; }
.btn-outline { background: white; color: var(--ink); border-color: var(--border); }
.btn-outline:hover { border-color: var(--blue); color: var(--blue); text-decoration: none; }
.btn-block { width: 100%; }
.btn-lg { padding: 14px 28px; font-size: 1.02rem; }

/* ---------- Hero ---------- */
.hero {
  padding: var(--space-8) 0 var(--space-7);
  background: linear-gradient(180deg, var(--blue-tint) 0%, var(--white) 100%);
  border-bottom: 1px solid var(--border-soft);
}
.hero-inner { max-width: 760px; margin: 0 auto; text-align: center; }
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--green-tint);
  color: var(--green-dark);
  font-weight: 600;
  font-size: 0.82rem;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: var(--space-5);
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  margin-bottom: var(--space-4);
}
.hero h1 .accent { color: var(--blue); }
.hero-desc {
  font-size: 1.125rem;
  color: var(--slate);
  max-width: 600px;
  margin: 0 auto var(--space-6);
}

/* Search */
.calc-search {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
}
.calc-search input {
  width: 100%;
  padding: 15px 18px 15px 48px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 1rem;
  background: white;
  box-shadow: var(--shadow-sm);
}
.calc-search input:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px var(--blue-tint-strong); }
.calc-search svg {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--slate-light);
}
.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  text-align: left;
  overflow: hidden;
  z-index: 10;
  display: none;
}
.search-results.show { display: block; }
.search-results a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  color: var(--ink);
  border-bottom: 1px solid var(--border-soft);
  font-size: 0.95rem;
}
.search-results a:last-child { border-bottom: none; }
.search-results a:hover { background: var(--blue-tint); text-decoration: none; }
.search-results .tag { font-size: 0.75rem; color: var(--slate); }
.search-empty { padding: 14px 16px; color: var(--slate); font-size: 0.9rem; }

/* ---------- Sections generic ---------- */
.section { padding: var(--space-8) 0; }
.section-tight { padding: var(--space-7) 0; }
.section-alt { background: #FAFBFD; border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); }
.section-head { margin-bottom: var(--space-6); }
.section-head h2 {
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  font-weight: 800;
  margin-bottom: var(--space-2);
}
.section-head p { color: var(--slate); font-size: 1.02rem; max-width: 620px; }
.section-head.center { text-align: center; }
.section-head.center p { margin: 0 auto; }
.section-foot { margin-top: var(--space-6); text-align: center; }

/* ---------- Calculator Grid (homepage featured) ---------- */
.calc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}
@media (max-width: 900px) { .calc-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .calc-grid { grid-template-columns: 1fr; } }

.calc-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  background: white;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.calc-card:hover { border-color: var(--blue); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.calc-card-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: var(--space-4);
  font-size: 1.3rem;
}
.calc-card-icon.blue { background: var(--blue-tint); color: var(--blue); }
.calc-card-icon.green { background: var(--green-tint); color: var(--green-dark); }
.calc-card h3 { font-size: 1.05rem; margin-bottom: 6px; }
.calc-card p { color: var(--slate); font-size: 0.92rem; flex-grow: 1; margin-bottom: var(--space-4); }
.calc-card .card-link { font-weight: 600; font-size: 0.9rem; display: inline-flex; align-items: center; gap: 4px; }
.calc-card.disabled { opacity: 0.55; }
.calc-card .badge-soon {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--border-soft);
  color: var(--slate);
  padding: 3px 8px;
  border-radius: 999px;
  margin-bottom: var(--space-3);
  width: fit-content;
}

/* ---------- Articles ---------- */
.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}
@media (max-width: 900px) { .article-grid { grid-template-columns: 1fr; } }
.article-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: white;
}
.article-card .article-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--blue);
  background: var(--blue-tint);
  padding: 4px 10px;
  border-radius: 999px;
  margin: var(--space-4) var(--space-4) 0;
}
.article-card-body { padding: var(--space-4); }
.article-card h3 { font-size: 1.05rem; margin: var(--space-2) 0 var(--space-2); }
.article-card p { color: var(--slate); font-size: 0.9rem; }
.article-card .article-meta { color: var(--slate-light); font-size: 0.8rem; margin-top: var(--space-3); }

/* ---------- FAQ ---------- */
.faq-list { max-width: 760px; margin: 0 auto; }
.faq-item {
  border-bottom: 1px solid var(--border);
}
.faq-item summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5) 0;
  font-weight: 600;
  font-size: 1.02rem;
  cursor: pointer;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .plus {
  flex-shrink: 0;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--blue-tint);
  color: var(--blue);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  font-weight: 400;
}
.faq-item[open] summary .plus { background: var(--green-tint); color: var(--green-dark); }
.faq-item[open] summary .plus::before { content: "−"; }
.faq-item summary .plus::before { content: "+"; }
.faq-item .faq-answer { color: var(--slate); padding-bottom: var(--space-5); padding-right: var(--space-7); font-size: 0.97rem; }

/* ---------- Ad slots ---------- */
.ad-slot {
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  background: #FAFBFD;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--slate-light);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-weight: 600;
  min-height: 100px;
  margin: var(--space-6) 0;
}
.ad-slot.ad-leaderboard { min-height: 90px; }
.ad-slot.ad-rectangle { min-height: 250px; max-width: 336px; margin: var(--space-6) auto; }
.ad-slot.ad-inline { min-height: 90px; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: #CBD5E1;
  padding: var(--space-8) 0 var(--space-6);
  margin-top: var(--space-8);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-6);
  margin-bottom: var(--space-7);
}
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-brand .logo { color: white; }
.footer-brand p { color: #94A3B8; font-size: 0.9rem; margin-top: var(--space-4); max-width: 300px; }
.footer-col h4 { color: white; font-size: 0.9rem; margin-bottom: var(--space-4); }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-col a { color: #94A3B8; font-size: 0.9rem; }
.footer-col a:hover { color: white; }
.footer-bottom {
  border-top: 1px solid #1E293B;
  padding-top: var(--space-5);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  color: #64748B;
  font-size: 0.85rem;
}
.footer-disclaimer {
  background: #1E293B;
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  font-size: 0.85rem;
  color: #94A3B8;
  margin-bottom: var(--space-6);
}
.footer-disclaimer strong { color: #CBD5E1; }

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  font-size: 0.85rem;
  color: var(--slate);
  padding: var(--space-4) 0;
}
.breadcrumb a { color: var(--slate); }
.breadcrumb a:hover { color: var(--blue); }
.breadcrumb .sep { margin: 0 6px; color: var(--slate-light); }
.breadcrumb .current { color: var(--ink); font-weight: 500; }

/* ---------- Trust strip ---------- */
.trust-strip {
  display: flex;
  justify-content: center;
  gap: var(--space-7);
  flex-wrap: wrap;
  padding: var(--space-5) 0;
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
}
.trust-item { display: flex; align-items: center; gap: 8px; color: var(--slate); font-size: 0.88rem; font-weight: 500; }
.trust-item svg { width: 18px; height: 18px; color: var(--green); flex-shrink: 0; }

/* Utility */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
