/* ============================================================
   Finance Calculator Hub — shared stylesheet
   Palette: deep ledger-navy + brass accent (not the default
   cream/terracotta look). Serif display for authority,
   grotesque sans for numbers and UI.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --navy: #10233F;
  --navy-deep: #0B1A30;
  --navy-mid: #1C3358;
  --brass: #B8923F;
  --brass-dark: #93712C;
  --bg: #F6F5F1;
  --card: #FFFFFF;
  --ink: #16202C;
  --muted: #5E6B7A;
  --border: #E2E0D8;
  --good: #1E7A4C;
  --bad: #B23A2E;
  --radius: 10px;
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

body { line-height: 1.5; }

a { color: inherit; }

img { max-width: 100%; }

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Top bar ---------- */
.topbar {
  background: var(--navy-deep);
  color: #EDE9DD;
  border-bottom: 1px solid var(--navy-mid);
}
.topbar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.2px;
  text-decoration: none;
  color: #FFFFFF;
}
.brand span { color: var(--brass); }
.topnav {
  display: flex;
  gap: 22px;
  list-style: none;
  margin: 0; padding: 0;
  font-size: 0.92rem;
}
.topnav a { text-decoration: none; color: #C7CEDB; transition: color .15s; }
.topnav a:hover { color: #fff; }

/* ---------- Hero ---------- */
.hero {
  background: var(--navy);
  color: #F3F1E9;
  padding: 56px 0 64px;
}
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 2.9rem);
  font-weight: 500;
  line-height: 1.15;
  max-width: 18ch;
  margin: 0 0 16px;
}
.hero p {
  color: #C7CEDB;
  font-size: 1.08rem;
  max-width: 56ch;
  margin: 0;
}

/* ---------- Calculator grid on homepage ---------- */
.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin: -34px 0 48px;
  position: relative;
  z-index: 2;
}
.calc-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  text-decoration: none;
  color: var(--ink);
  display: block;
  transition: border-color .15s, transform .15s;
}
.calc-card:hover { border-color: var(--brass); transform: translateY(-2px); }
.calc-card .tag {
  font-size: 0.75rem;
  color: var(--brass-dark);
  font-weight: 600;
  margin-bottom: 8px;
}
.calc-card h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.15rem;
  margin: 0 0 8px;
}
.calc-card p { color: var(--muted); font-size: 0.92rem; margin: 0; }

/* ---------- Section copy on homepage ---------- */
.section { padding: 44px 0; }
.section h2 {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 600;
  margin: 0 0 14px;
}
.section p { color: var(--muted); max-width: 68ch; }
.section-alt { background: #EFEDE5; }

/* ---------- Calculator page layout ---------- */
.calc-header {
  background: var(--navy);
  color: #F3F1E9;
  padding: 40px 0 34px;
}
.calc-header .kicker {
  color: var(--brass);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.calc-header h1 {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 500;
  margin: 0 0 10px;
}
.calc-header p { color: #C7CEDB; max-width: 60ch; margin: 0; }

.calc-body { padding: 32px 0 56px; }

.calc-card-main {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.calc-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}
@media (min-width: 800px) {
  .calc-layout { grid-template-columns: 1.1fr 1fr; }
  .calc-layout .inputs { border-right: 1px solid var(--border); }
}

.inputs, .results { padding: 28px; }

.field-title {
  font-size: 0.78rem;
  text-transform: none;
  font-weight: 600;
  color: var(--muted);
  margin: 22px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.field-title:first-child { margin-top: 0; }

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--ink);
}
.field .input-wrap { position: relative; }
.field input, .field select {
  width: 100%;
  padding: 11px 14px;
  font-size: 1rem;
  font-family: var(--sans);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #FDFDFC;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus {
  border-color: var(--brass);
  box-shadow: 0 0 0 3px rgba(184,146,63,0.15);
}
.field .unit {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 0.85rem;
  pointer-events: none;
}
.field.prefix input { padding-left: 26px; }
.field .prefix-sym {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}

.results { background: #FAF9F5; }
.metric {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 18px;
  margin-bottom: 12px;
}
.metric.lead { border-left: 4px solid var(--brass); }
.metric.good { border-left: 4px solid var(--good); }
.metric-label { font-size: 0.82rem; color: var(--muted); margin-bottom: 4px; }
.metric-value { font-size: 1.5rem; font-weight: 700; font-family: var(--serif); }

.breakdown {
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
  font-size: 0.88rem;
}
.brk-row { display: flex; justify-content: space-between; padding: 5px 0; color: var(--muted); }
.brk-row.total { color: var(--ink); font-weight: 600; border-top: 1px solid var(--border); margin-top: 4px; padding-top: 9px; }

/* ---------- Ad slots ---------- */
/* Hidden until AdSense is approved. To show ads: delete the next line. */
.ad-slot { display: none !important; }
.ad-slot {
  background: #EFEDE5;
  border: 1px dashed #C9C6B8;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
  padding: 14px;
  margin: 24px 0;
}

/* ---------- Related calculators ---------- */
.related { margin-top: 40px; }
.related h2 { font-family: var(--serif); font-size: 1.3rem; margin-bottom: 16px; }

/* ---------- Footer ---------- */
footer {
  background: var(--navy-deep);
  color: #9AA6B8;
  padding: 34px 0;
  font-size: 0.85rem;
}
footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
footer a { color: #C7CEDB; text-decoration: none; }
footer a:hover { text-decoration: underline; }
.disclaimer { max-width: 900px; margin: 0 auto 18px; padding: 0 24px; color: #7C879A; font-size: 0.78rem; }

@media (max-width: 700px) {
  .topnav { display: none; }
}

/* ---------- Articles ---------- */
.article { max-width: 760px; padding-top: 36px; padding-bottom: 56px; }
.article h2 { font-family: var(--serif); font-size: 1.4rem; margin: 32px 0 12px; }
.article p, .article li { line-height: 1.7; }
.article p { margin-bottom: 14px; }
.article ul, .article ol { margin: 0 0 16px 0; padding-left: 20px; }
.article li { margin-bottom: 6px; }
.article .tbl-wrap { overflow-x: auto; margin: 16px 0 22px; }
.article table { width: 100%; border-collapse: collapse; font-size: 0.92rem; background: #fff; border: 1px solid var(--border); border-radius: 8px; }
.article th, .article td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.article td:not(:first-child) { white-space: nowrap; }
.article td:first-child { min-width: 150px; }
.article th { font-weight: 600; background: #F6F4EE; }
.article .callout { background: #fff; border-left: 4px solid #B08D4A; border-radius: 6px; padding: 14px 18px; margin: 20px 0; }
.article .updated { color: var(--muted); font-size: 0.85rem; margin-bottom: 18px; }
