/* ==========================================================================
   Texas Child Support Calculator — design system
   Tool-first. Light by default, follows the OS color scheme, and respects a
   manual override via <html data-theme="light|dark">.
   ========================================================================== */

:root {
  /* ---- light theme (default) ---- */
  --bg:        #ffffff;
  --bg-2:      #f6f8fa;   /* page section tint */
  --surface:   #ffffff;   /* cards */
  --surface-2: #f3f5f8;   /* inputs / nested */
  --surface-3: #e9edf2;   /* hover */
  --border:    #e3e7ec;
  --border-2:  #d2d9e1;

  --text:    #16202e;
  --muted:   #56616f;
  --faint:   #828d9b;
  --heading: #0f1722;

  --accent:    #b6890f;   /* gold, darkened for light-bg contrast */
  --accent-2:  #caa028;
  --accent-ink:#231900;   /* text on gold */
  --link:      #1f6feb;

  --result-bg: #f7f9fb;
  --calc-1:    #ffffff;
  --calc-2:    #f7f9fb;
  --band-1:    #f6f8fa;
  --band-2:    #eef2f6;
  --sheen:     rgba(182,137,15,.08);
  --warn-bg:   rgba(184,138,15,.10);
  --warn-br:   rgba(184,138,15,.35);
  --warn-tx:   #8a6608;

  --radius: 14px; --radius-sm: 9px;
  --shadow:    0 6px 22px rgba(20,30,50,.08);
  --shadow-lg: 0 18px 50px rgba(20,30,50,.12);

  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, "Times New Roman", serif;
  --sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --maxw: 1080px;
}

/* ---- dark theme: follow the OS unless a manual override is set ---- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:#0d1117; --bg-2:#0f141a; --surface:#161b22; --surface-2:#1c232c; --surface-3:#232c38;
    --border:#2a323d; --border-2:#38424f;
    --text:#e6edf3; --muted:#9aa7b4; --faint:#6b7785; --heading:#f4f7fb;
    --accent:#c9a227; --accent-2:#e0bd4a; --accent-ink:#1a1300; --link:#7cb0ff;
    --result-bg:#0f141a; --calc-1:#161b22; --calc-2:#12171e; --band-1:#1a2230; --band-2:#12171e;
    --sheen: rgba(201,162,39,.10);
    --warn-bg: rgba(210,153,34,.12); --warn-br: rgba(210,153,34,.35); --warn-tx:#f0cd72;
    --shadow: 0 10px 30px rgba(0,0,0,.35); --shadow-lg: 0 24px 60px rgba(0,0,0,.45);
  }
}
/* ---- manual override ---- */
:root[data-theme="dark"] {
  --bg:#0d1117; --bg-2:#0f141a; --surface:#161b22; --surface-2:#1c232c; --surface-3:#232c38;
  --border:#2a323d; --border-2:#38424f;
  --text:#e6edf3; --muted:#9aa7b4; --faint:#6b7785; --heading:#f4f7fb;
  --accent:#c9a227; --accent-2:#e0bd4a; --accent-ink:#1a1300; --link:#7cb0ff;
  --result-bg:#0f141a; --calc-1:#161b22; --calc-2:#12171e; --band-1:#1a2230; --band-2:#12171e;
  --sheen: rgba(201,162,39,.10);
  --warn-bg: rgba(210,153,34,.12); --warn-br: rgba(210,153,34,.35); --warn-tx:#f0cd72;
  --shadow: 0 10px 30px rgba(0,0,0,.35); --shadow-lg: 0 24px 60px rgba(0,0,0,.45);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--sans); font-size: 17px; line-height: 1.65;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
body::before {
  content: ""; position: fixed; inset: 0 0 auto 0; height: 360px;
  background: radial-gradient(900px 360px at 50% -140px, var(--sheen), transparent 70%);
  pointer-events: none; z-index: 0;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; position: relative; z-index: 1; }
.narrow { max-width: 760px; }

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

h1, h2, h3, h4 { font-family: var(--serif); line-height: 1.2; color: var(--heading); font-weight: 600; }
h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); margin-top: 2.2em; }
h3 { font-size: 1.2rem; margin-top: 1.8em; }
p { margin: 0 0 1.05em; }
.muted { color: var(--muted); } .small { font-size: .9rem; }

/* ---------- header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; gap: 16px; height: 62px; }
.brand { display: flex; align-items: center; gap: 11px; font-family: var(--serif); font-weight: 600; font-size: 1.06rem; color: var(--heading); }
.brand:hover { text-decoration: none; }
.brand .mark { width: 30px; height: 30px; flex: 0 0 auto; }
.brand .sub { color: var(--accent); }
.nav .spacer { flex: 1; }
.nav-links { display: flex; gap: 20px; align-items: center; }
.nav-links a { color: var(--muted); font-size: .95rem; font-weight: 500; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.icon-btn {
  width: 38px; height: 38px; display: inline-grid; place-items: center;
  border: 1px solid var(--border-2); background: var(--surface-2); color: var(--text);
  border-radius: 10px; cursor: pointer;
}
.icon-btn:hover { background: var(--surface-3); }
/* show the icon for the mode you'll switch TO */
.icon-btn .sun { display: none; } .icon-btn .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-btn .moon { display: none; }
  :root:not([data-theme="light"]) .icon-btn .sun { display: block; }
}
:root[data-theme="dark"] .icon-btn .moon { display: none; }
:root[data-theme="dark"] .icon-btn .sun { display: block; }
:root[data-theme="light"] .icon-btn .moon { display: block; }
:root[data-theme="light"] .icon-btn .sun { display: none; }
.nav .nav-cta { color: var(--text); font-weight: 600; font-size: .92rem; border: 1px solid var(--border-2); padding: 8px 14px; border-radius: 999px; }
.nav .nav-cta:hover { background: var(--surface-2); text-decoration: none; }
@media (max-width: 700px) { .nav-links { display: none; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 999px; font-weight: 650; font-size: 1rem; font-family: var(--sans);
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: transform .06s ease, box-shadow .2s ease, background .2s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: linear-gradient(180deg, var(--accent-2), var(--accent)); color: var(--accent-ink); box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 30%, transparent); }
.btn-ghost { background: var(--surface-2); color: var(--text); border-color: var(--border-2); }
.btn-ghost:hover { background: var(--surface-3); }
.btn-block { width: 100%; }

/* ---------- hero (slim, tool-first) ---------- */
.hero { padding: 34px 0 6px; text-align: center; }
.eyebrow { display: inline-block; font-size: .76rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); font-weight: 700; margin-bottom: 10px; }
.hero h1 { margin: 0 auto .35em; max-width: 18ch; }
.hero .lede { font-size: 1.08rem; color: var(--muted); max-width: 56ch; margin: 0 auto; }
.trust { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; color: var(--faint); font-size: .85rem; margin-top: 16px; }
.trust span { display: inline-flex; align-items: center; gap: 6px; }
.trust svg { color: var(--accent); }

/* ---------- calculator ---------- */
.calc {
  background: linear-gradient(180deg, var(--calc-1), var(--calc-2));
  border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg);
  margin: 22px auto 8px; overflow: hidden;
}
.calc-head { padding: 22px 26px 0; }
.calc-head h2 { margin: 0; font-size: 1.35rem; }
.calc-head p { color: var(--muted); margin: .4em 0 0; font-size: .95rem; }
.calc-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 0; }
@media (max-width: 880px) { .calc-grid { grid-template-columns: 1fr; } }
.calc-inputs { padding: 20px 26px 24px; }
.calc-result { background: var(--result-bg); border-left: 1px solid var(--border); padding: 26px; }
@media (max-width: 880px) { .calc-result { border-left: none; border-top: 1px solid var(--border); } }

.field { margin-bottom: 16px; }
.field > label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 7px; }
.field .hint { color: var(--faint); font-size: .82rem; font-weight: 400; margin-top: 5px; }

.control { position: relative; }
input[type="number"], input[type="text"], select {
  width: 100%; background: var(--surface-2); border: 1px solid var(--border-2); color: var(--text);
  padding: 12px 14px; border-radius: var(--radius-sm); font-size: 1rem; font-family: var(--sans); appearance: none;
}
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.control.money input { padding-left: 28px; }
.control.money::before { content: "$"; position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); }
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238a94a3' d='M1 1l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 520px) { .row2 { grid-template-columns: 1fr; } }

/* segmented toggle */
.segment { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 999px; padding: 4px; gap: 4px; }
.segment button { border: 0; background: transparent; color: var(--muted); padding: 8px 16px; border-radius: 999px; font-size: .9rem; font-weight: 600; cursor: pointer; }
.segment button.active { background: var(--accent); color: var(--accent-ink); }
.segment-wide { display: flex; width: 100%; }
.segment-wide button { flex: 1; }

.advanced-toggle { background: none; border: 0; color: var(--link); cursor: pointer; font-size: .9rem; padding: 4px 0; font-weight: 600; }
.advanced { display: none; padding-top: 4px; }
.advanced.open { display: block; }
.checkrow { display: flex; align-items: center; gap: 9px; margin-top: 6px; }
.checkrow input { width: auto; }

/* result panel */
.result-label { color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; }
.result-amount { font-family: var(--serif); font-size: 2.9rem; font-weight: 700; color: var(--heading); line-height: 1.05; margin: 4px 0 2px; }
.result-amount .per { font-family: var(--sans); font-size: 1rem; font-weight: 500; color: var(--muted); }
.result-sub { color: var(--accent); font-weight: 600; font-size: .92rem; margin-bottom: 16px; }
.breakdown { border-top: 1px solid var(--border); margin-top: 10px; }
.breakdown .line { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: .92rem; }
.breakdown .line span:first-child { color: var(--muted); }
.breakdown .line span:last-child { font-variant-numeric: tabular-nums; font-weight: 600; }
.flag, .note { border-radius: var(--radius-sm); padding: 10px 12px; font-size: .82rem; margin-top: 12px; }
.flag { background: var(--warn-bg); border: 1px solid var(--warn-br); color: var(--warn-tx); }
.note { background: var(--surface-2); border: 1px solid var(--border-2); color: var(--muted); }
.result-link { display: inline-block; margin-top: 16px; font-size: .9rem; font-weight: 600; }
.result-empty { color: var(--faint); font-size: .95rem; }

/* ---------- sections ---------- */
section.block { padding: 38px 0; }
.section-title { text-align: center; margin-bottom: 6px; }
.section-intro { text-align: center; color: var(--muted); max-width: 60ch; margin: 0 auto 24px; }

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 820px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .steps { grid-template-columns: 1fr; } }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.step .num { width: 30px; height: 30px; border-radius: 8px; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-family: var(--serif); margin-bottom: 10px; }
.step h3 { margin: 0 0 6px; font-size: 1.02rem; }
.step p { margin: 0; color: var(--muted); font-size: .92rem; }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 820px) { .cards { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .cards { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; transition: border-color .2s, transform .08s; }
.card:hover { border-color: var(--border-2); transform: translateY(-2px); }
.card a { color: var(--heading); font-weight: 600; }
.card p { color: var(--muted); font-size: .9rem; margin: 6px 0 0; }

/* tables in content */
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin: 1.2em 0; font-size: .95rem; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); }
thead th { background: var(--surface-2); color: var(--text); font-weight: 600; border-bottom: 1px solid var(--border-2); }
tbody tr:hover { background: var(--surface-2); }

/* FAQ */
.faq details { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 4px 18px; margin-bottom: 10px; background: var(--surface); }
.faq summary { cursor: pointer; font-weight: 600; padding: 12px 0; list-style: none; color: var(--heading); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; color: var(--accent); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "\2013"; }
.faq details[open] summary { border-bottom: 1px solid var(--border); }
.faq p { color: var(--muted); padding: 12px 0 4px; margin: 0; }

/* CTA band (single, calm) */
.cta-band { background: linear-gradient(135deg, var(--band-1), var(--band-2)); border: 1px solid var(--border); border-radius: 16px; padding: 30px; text-align: center; margin: 10px 0; box-shadow: var(--shadow); }
.cta-band h2 { margin: 0 0 8px; font-size: 1.3rem; }
.cta-band p { color: var(--muted); max-width: 54ch; margin: 0 auto 18px; }
.cta-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* article */
.article { padding: 28px 0 10px; }
.breadcrumb { color: var(--faint); font-size: .88rem; margin: 8px 0 18px; }
.breadcrumb a { color: var(--muted); }

/* footer */
.site-footer { border-top: 1px solid var(--border); margin-top: 56px; padding: 34px 0; color: var(--muted); font-size: .9rem; background: var(--bg-2); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 26px; }
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr; gap: 18px; } }
.site-footer h4 { font-family: var(--sans); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin: 0 0 12px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 7px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }
.footer-legal { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--border); color: var(--faint); font-size: .82rem; }

/* ── attorney byline (E-E-A-T) ─────────────────────────────────────────── */
.byline { color: var(--faint); font-size: .87rem; line-height: 1.55; max-width: 68ch; margin: 14px auto 0; }
.hero .byline { text-align: center; }
.article .byline { margin: 0 0 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.byline a { color: var(--muted); }
.byline a:hover { color: var(--text); }

/* ── inline nudge back to the calculator ───────────────────────────────── */
.inline-calc-cta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-left: 3px solid var(--accent); border-radius: var(--radius-sm);
  padding: 13px 16px; margin: 0 0 26px; font-size: .94rem;
}
.inline-calc-cta strong { color: var(--heading); }
.inline-calc-cta a { font-weight: 600; }

/* ── related guides (internal linking) ─────────────────────────────────── */
.related { margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--border); }
.related h2 { font-size: 1.05rem; margin: 0 0 14px; }
.related ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 9px 22px; }
@media (max-width: 640px) { .related ul { grid-template-columns: 1fr; } }
.related li a { color: var(--link); font-size: .94rem; }

/* ── the firm's offer band (attorney advertising) ──────────────────────── */
.offer-band {
  background: linear-gradient(135deg, var(--band-1), var(--band-2));
  border: 1px solid var(--border-2); border-top: 3px solid var(--accent);
  border-radius: 16px; padding: 30px 30px 24px; margin: 34px 0 10px;
  box-shadow: var(--shadow);
}
.offer-head { text-align: center; }
.offer-head .eyebrow { color: var(--faint); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; }
.offer-band h2 { margin: 8px 0 8px; font-size: 1.42rem; }
.offer-head p { color: var(--muted); max-width: 56ch; margin: 0 auto; }
.offer-points {
  list-style: none; padding: 0; margin: 24px 0 22px;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 26px;
}
@media (max-width: 680px) { .offer-points { grid-template-columns: 1fr; } }
.offer-points li { position: relative; padding-left: 26px; }
.offer-points li::before {
  content: ""; position: absolute; left: 0; top: .42em; width: 13px; height: 8px;
  border-left: 2.5px solid var(--accent); border-bottom: 2.5px solid var(--accent);
  transform: rotate(-45deg);
}
.offer-points strong { display: block; color: var(--heading); font-size: .97rem; }
.offer-points span { color: var(--muted); font-size: .89rem; }
.offer-actions { display: flex; gap: 12px; justify-content: center; align-items: center; flex-wrap: wrap; }
.offer-more { font-size: .9rem; color: var(--muted); }
.offer-fine {
  margin: 20px 0 0; padding-top: 15px; border-top: 1px solid var(--border);
  color: var(--faint); font-size: .78rem; line-height: 1.5; text-align: center;
}
