/* Fresno County Health Cost Watch — clean civic style */
:root {
  --navy: #173f5f;
  --navy-dark: #102c44;
  --ink: #1c2733;
  --muted: #55636f;
  --line: #d7dde3;
  --bg: #ffffff;
  --bg-alt: #f4f6f8;
  --accent: #b07d10; /* restrained gold, used sparingly */
  --accent-soft: #fdf6e0;
  --radius: 8px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  font-size: 17px;
}

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

h1, h2, h3, .brand-name, .stat-num, .t-date {
  font-family: Georgia, "Times New Roman", Times, serif;
  color: var(--navy-dark);
}

h1 { font-size: 2rem; line-height: 1.2; margin: 0 0 14px; }
h2 { font-size: 1.55rem; margin: 0 0 12px; border-bottom: 3px solid var(--accent); padding-bottom: 8px; }
h3 { font-size: 1.15rem; margin: 30px 0 10px; }

a { color: var(--navy); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 2px;
}

/* Header */
.site-header {
  background: var(--navy);
  color: #fff;
  position: sticky; top: 0; z-index: 10;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  font-family: Georgia, serif; font-size: 1.8rem; line-height: 1;
  background: #fff; color: var(--navy); border-radius: 6px;
  width: 42px; height: 42px; display: grid; place-items: center;
}
.brand-name { color: #fff; font-size: 1.12rem; margin: 0; font-weight: 700; }
.brand-sub { margin: 0; font-size: 0.82rem; color: #c9d6e2; letter-spacing: 0.04em; text-transform: uppercase; }
.main-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.main-nav a {
  color: #eaf1f7; text-decoration: none; font-size: 0.92rem;
  padding: 6px 10px; border-radius: 6px;
}
.main-nav a:hover { background: rgba(255,255,255,0.14); }

/* Hero */
.hero { background: linear-gradient(180deg, #eef3f7, #ffffff); padding: 38px 0 8px; }
.lede { font-size: 1.08rem; max-width: 46rem; }
.updated { color: var(--muted); font-size: 0.92rem; }
.stat-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 22px 0 10px;
}
.stat {
  background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--navy);
  border-radius: var(--radius); padding: 16px;
}
.stat-num { font-size: 2rem; margin: 0 0 6px; }
.stat-label { margin: 0; font-size: 0.93rem; color: var(--ink); }

/* Sections */
.section { padding: 34px 0 10px; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* Stamps */
.stamp {
  display: inline-block; font-weight: 700; font-size: 0.8rem; letter-spacing: 0.05em;
  color: #7a2d0e; background: #fdeee2; border: 1.5px solid #c65a21;
  padding: 3px 9px; border-radius: 4px; transform: rotate(-0.6deg);
}
.stamp-inline {
  display: inline-block; font-weight: 700; font-size: 0.7rem; letter-spacing: 0.04em;
  color: #7a2d0e; background: #fdeee2; border: 1px solid #c65a21;
  padding: 1px 6px; border-radius: 4px; vertical-align: middle;
}

/* Tables */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 10px 0 4px; }
table {
  border-collapse: collapse; width: 100%; background: #fff;
  border: 1px solid var(--line); font-size: 0.97rem;
}
caption { text-align: left; font-weight: 600; padding: 8px 2px; color: var(--navy-dark); }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; }
thead th { background: var(--navy); color: #fff; font-weight: 600; }
tbody th[scope="row"] { font-weight: 600; }
tbody tr:nth-child(even) { background: #f8fafc; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.source-line { color: var(--muted); font-size: 0.87rem; margin: 6px 0 0; }
.fact-list { padding-left: 1.2rem; }
.fact-list li { margin-bottom: 8px; }

/* Forms */
.calc-form {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 16px 0;
}
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.calc-form .field { margin-bottom: 0; }
.field-wide { grid-column: 1 / -1; }
label { font-weight: 600; font-size: 0.93rem; }
select, input[type="text"], input[type="number"], textarea {
  font: inherit; padding: 9px 10px; border: 1px solid #a9b6c0; border-radius: 6px;
  background: #fff; color: var(--ink); width: 100%;
}
textarea { line-height: 1.5; resize: vertical; }

/* Results */
.results {
  background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--navy);
  border-radius: var(--radius); padding: 8px 18px 14px; margin: 18px 0 26px;
}
.result-row {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 9px 0; border-bottom: 1px dashed var(--line);
}
.result-row:last-of-type { border-bottom: none; }
.result-row strong { font-variant-numeric: tabular-nums; white-space: nowrap; }
.flag {
  background: var(--accent-soft); border: 1px solid var(--accent); border-radius: 6px;
  padding: 10px 12px; font-weight: 600;
}
.fineprint { color: var(--muted); font-size: 0.85rem; }

/* Buttons */
.btn {
  display: inline-block; font: inherit; font-weight: 600; cursor: pointer;
  background: var(--navy); color: #fff; border: 1px solid var(--navy);
  padding: 10px 18px; border-radius: 6px; text-decoration: none;
}
.btn:hover { background: var(--navy-dark); }
.btn-secondary { background: #fff; color: var(--navy); }
.btn-secondary:hover { background: #eef3f7; }
.actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 6px 0 10px; }
.copied { color: #1d6b1d; font-weight: 600; }

/* Timeline */
.timeline { list-style: none; margin: 10px 0 26px; padding: 0; }
.timeline li {
  border-left: 3px solid var(--navy); padding: 2px 0 14px 16px; position: relative;
}
.timeline li::before {
  content: ""; position: absolute; left: -7px; top: 8px;
  width: 11px; height: 11px; border-radius: 50%; background: var(--accent);
}
.t-date { font-size: 1.05rem; font-weight: 700; margin: 0 0 2px; }
.t-text { margin: 0; max-width: 44rem; }

/* Footer */
.site-footer { background: var(--navy-dark); color: #dbe5ee; padding: 30px 0 34px; margin-top: 30px; }
.site-footer .footer-h { color: #fff; border-bottom-color: var(--accent); font-size: 1.2rem; }
.site-footer a { color: #bcd2e6; }
.source-list { padding-left: 1.2rem; }
.source-list li { margin-bottom: 6px; }
.footer-note { color: #9db4c8; font-size: 0.88rem; margin-top: 18px; }

/* Responsive */
@media (max-width: 720px) {
  body { font-size: 16px; }
  h1 { font-size: 1.55rem; }
  .stat-grid { grid-template-columns: 1fr; }
  .calc-form { grid-template-columns: 1fr; }
  .header-inner { flex-direction: column; align-items: flex-start; }
  .result-row { flex-direction: column; gap: 2px; }
  .result-row strong { white-space: normal; }
  .site-header { position: static; }
}

/* Print: tables and text first, interactive chrome trimmed */
@media print {
  .site-header, .main-nav, .actions, #em-sync, form.calc-form { display: none !important; }
  body { font-size: 11.5pt; }
  .section, .hero { padding: 10px 0; }
  .section-alt { background: #fff; border: none; }
  table { font-size: 10pt; }
  thead th { background: #fff; color: #000; border-bottom: 2px solid #000; }
  a { color: #000; text-decoration: none; }
  .site-footer { background: #fff; color: #000; }
  .site-footer .footer-h, .footer-note { color: #000; }
}
