/* pages.css — shared styles for the content pages (about, privacy, terms,
   how-a-bill-becomes-law). Same locked palette as the app: teal → purple,
   never red/blue (CLAUDE.md §5.3). Light + dark. */

/* Always light — the site is intentionally single-theme (no dark mode). */
:root {
  color-scheme: light;
  --teal: #1D9E75;
  --mid-purple: #7F77DD;
  --deep-purple: #534AB7;

  --bg: #f4f4f8;
  --surface: #ffffff;
  --ink: #1c1e26;
  --ink-soft: #565b68;
  --line: #e6e7ec;
  --chip-bg: #eeeef4;
  --shadow: 0 1px 2px rgba(28, 26, 51, 0.05), 0 6px 18px rgba(28, 26, 51, 0.05);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }

/* Header with logo (links home) */
.page-header { display: flex; justify-content: center; padding: 22px 16px 4px; }
.page-header a { display: inline-flex; }
.page-logo { height: 132px; width: auto; }
.page-logo-fallback { font-weight: 800; font-size: 20px; color: var(--ink); text-decoration: none; }

/* Top nav — same on every page, sits directly under the logo */
.top-nav { display: flex; justify-content: center; gap: 24px; padding: 2px 16px 16px; }
.top-nav a {
  color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 700;
  padding: 4px 2px; border-bottom: 2px solid transparent;
}
.top-nav a:hover, .top-nav a:focus-visible { color: var(--deep-purple); border-bottom-color: var(--teal); }
.top-nav a[aria-current="page"] { border-bottom-color: var(--deep-purple); }

/* Content column — comfortable reading width */
.page { max-width: 680px; margin: 0 auto; padding: 8px 20px 24px; }
.page h1 { font-size: 27px; line-height: 1.2; margin: 18px 0 6px; text-wrap: balance; }
.page .lede { font-size: 16px; color: var(--ink-soft); margin: 0 0 8px; }
.page h2 { font-size: 19px; margin: 30px 0 8px; }
.page h3 { font-size: 16px; margin: 22px 0 6px; }
.page p { margin: 0 0 14px; }
.page ul { margin: 0 0 14px; padding-left: 20px; }
.page li { margin: 0 0 8px; }
.page a { color: var(--deep-purple); text-decoration: underline; }
.page strong { font-weight: 700; }
.updated { font-size: 13px; color: var(--ink-soft); }

/* A teal accent rule under section headings, tying to the palette */
.page h2 { border-bottom: 2px solid var(--teal); padding-bottom: 6px; }

/* Callout / principle cards */
.callout {
  background: var(--surface); border: 1px solid var(--line);
  border-left: 4px solid var(--deep-purple);
  border-radius: 10px; padding: 14px 16px; margin: 0 0 14px; box-shadow: var(--shadow);
}
.callout h3 { margin: 0 0 4px; font-size: 15px; }
.callout p { margin: 0; font-size: 14px; color: var(--ink-soft); }

/* Draft banner for legal pages */
.draft-banner {
  background: color-mix(in srgb, var(--mid-purple) 16%, transparent);
  border: 1px solid var(--mid-purple);
  color: var(--ink); border-radius: 10px; padding: 10px 14px; margin: 8px 0 4px;
  font-size: 13px;
}

/* ---------- "How a bill becomes law" explainer ---------- */
.gauge-legend {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px; margin: 8px 0 24px; box-shadow: var(--shadow);
}
.gauge-legend .bar {
  height: 10px; border-radius: 999px; margin: 4px 0 8px;
  background: linear-gradient(90deg, var(--teal), var(--mid-purple), var(--deep-purple));
}
.gauge-legend .marks { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-soft); }
.gauge-legend p { font-size: 13px; color: var(--ink-soft); margin: 10px 0 0; }

.stages { display: flex; flex-direction: column; gap: 10px; }
.stage {
  background: var(--surface); border: 1px solid var(--line);
  border-left: 5px solid var(--c, var(--deep-purple));
  border-radius: 12px; box-shadow: var(--shadow); overflow: hidden;
}
.stage-btn {
  width: 100%; display: flex; align-items: center; gap: 12px;
  background: none; border: none; cursor: pointer; text-align: left;
  padding: 14px 16px; color: var(--ink); font: inherit;
}
.stage-num {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%;
  background: var(--c, var(--deep-purple)); color: #fff;
  font-size: 13px; font-weight: 800; display: grid; place-items: center;
}
.stage-title { flex: 1; font-size: 16px; font-weight: 700; }
.stage-caret { color: var(--ink-soft); transition: transform .18s; }
.stage-btn[aria-expanded="true"] .stage-caret { transform: rotate(90deg); }
.stage-detail { padding: 0 16px 16px 54px; }
.stage-detail p { font-size: 14.5px; margin: 0 0 10px; }
.stage-detail .timing { font-size: 12.5px; color: var(--ink-soft); font-style: italic; }

/* Branch "what if" toggles */
.branches { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 2px; }
.branch-btn {
  font-size: 13px; font-weight: 600; cursor: pointer;
  padding: 6px 12px; border-radius: 999px;
  background: var(--chip-bg); color: var(--ink); border: 1px solid var(--line);
}
.branch-btn[aria-expanded="true"] { background: var(--deep-purple); color: #fff; border-color: transparent; }
.branch-detail {
  margin-top: 8px; padding: 12px 14px; border-radius: 10px;
  background: color-mix(in srgb, var(--deep-purple) 8%, transparent);
  font-size: 14px;
}
.branch-detail p { margin: 0; }

/* ---------- Following view ---------- */
.following-loading, .following-empty { color: var(--ink-soft); font-size: 15px; }
.follow-section {
  font-size: 13px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--ink-soft); border-bottom: 2px solid var(--teal); padding-bottom: 6px; margin: 26px 0 12px;
}
.follow-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; margin: 0 0 10px; box-shadow: var(--shadow);
}
.follow-item.is-updated { border-left: 4px solid var(--teal); }
.follow-item-main { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.follow-tag {
  align-self: flex-start; font-size: 10px; font-weight: 800; letter-spacing: 0.03em;
  text-transform: uppercase; color: #fff; background: var(--deep-purple);
  padding: 2px 8px; border-radius: 999px;
}
.follow-title { font-size: 15px; font-weight: 700; color: var(--ink); text-decoration: none; }
.follow-title:hover { text-decoration: underline; }
.follow-status { font-size: 12px; color: var(--ink-soft); }
.follow-updated { font-size: 12px; font-weight: 700; color: var(--teal); }
.follow-position { font-size: 12px; font-weight: 700; }
.follow-position.support { color: var(--teal); }
.follow-position.oppose { color: var(--deep-purple); }
.follow-remove {
  flex: 0 0 auto; font-size: 12px; font-weight: 600; cursor: pointer;
  background: none; border: 1px solid var(--line); color: var(--ink-soft);
  padding: 6px 10px; border-radius: 999px;
}
.follow-remove:hover { border-color: var(--deep-purple); color: var(--deep-purple); }

/* Profile page */
.profile-block { margin: 8px 0 18px; }
.field-hint { font-size: 12px; color: var(--ink-soft); margin: 6px 0 0; }
.profile-saved { font-size: 12px; font-weight: 700; color: var(--teal); margin: 8px 0 0; }
.profile-status { font-size: 13px; font-weight: 600; margin: 10px 0 0; }
.profile-status.ok { color: var(--teal); }
.profile-status.err { color: var(--deep-purple); }
.profile-status.warn { color: var(--ink-soft); font-weight: 500; }
.pref-row { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink); margin: 0 0 8px; cursor: pointer; }
.pref-row input { width: 16px; height: 16px; }
.member-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; margin: 0 0 8px; box-shadow: var(--shadow);
}
.member-name { font-size: 15px; font-weight: 700; color: var(--deep-purple); text-decoration: none; }
.member-name:hover { text-decoration: underline; }
.member-role { font-size: 12px; color: var(--ink-soft); white-space: nowrap; }
/* "Look it up" inline link + ephemeral ZIP modal */
.link-inline {
  display: inline-block; margin-top: 8px; background: none; border: none; padding: 0;
  color: var(--deep-purple); font-size: 13px; font-weight: 600; text-decoration: underline; cursor: pointer;
}
.modal-overlay {
  position: fixed; inset: 0; background: rgba(20, 21, 26, 0.5);
  display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 100;
}
.modal {
  position: relative; background: var(--surface); border-radius: 16px;
  padding: 22px; width: 100%; max-width: 360px; box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}
.modal-close {
  position: absolute; top: 10px; right: 12px; background: none; border: none;
  font-size: 24px; line-height: 1; color: var(--ink-soft); cursor: pointer;
}
.modal-title { font-size: 18px; margin: 0 6px 8px 0; }
.modal-intro { font-size: 13px; color: var(--ink-soft); margin: 0 0 14px; }

.zip-row { display: flex; gap: 8px; align-items: stretch; }
.zip-row .field { flex: 1; }
.zip-row .btn-follow { width: auto; margin-top: 0; padding: 0 18px; white-space: nowrap; }
.zip-result { margin-top: 10px; }
.zip-msg { font-size: 13px; color: var(--ink-soft); margin: 6px 0; }
.zip-found { font-size: 14px; font-weight: 700; color: var(--teal); margin: 6px 0; }
.zip-choices { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0; }
.zip-choice {
  font-size: 13px; font-weight: 600; cursor: pointer; padding: 6px 12px;
  border-radius: 999px; background: var(--chip-bg); color: var(--ink); border: 1px solid var(--line);
}
.zip-choice:hover { border-color: var(--deep-purple); }
.zip-official { font-size: 12px; margin: 10px 0 0; }
.zip-official a { color: var(--deep-purple); font-weight: 600; }
.zip-asof { color: var(--ink-soft); }

.profile-admin { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 16px; }
.btn-link-plain {
  background: none; border: 1px solid var(--line); color: var(--ink-soft);
  font-size: 14px; font-weight: 600; padding: 8px 16px; border-radius: 999px; cursor: pointer;
}
.btn-link-plain:hover { border-color: var(--deep-purple); color: var(--deep-purple); }

/* Inline verify on the Following page */
.verify-block { margin: 14px 0; }
.field-label { display: block; font-size: 13px; font-weight: 600; margin: 10px 0 6px; }
.field {
  width: 100%; padding: 12px; font-size: 16px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
.field:focus { outline: 2px solid var(--mid-purple); border-color: var(--mid-purple); }
.btn-follow {
  margin-top: 10px; width: 100%; padding: 12px; border: none; border-radius: 10px;
  background: var(--deep-purple); color: #fff; font-size: 15px; font-weight: 700; cursor: pointer;
}
.follow-error { color: var(--deep-purple); font-size: 13px; font-weight: 600; margin-top: 10px; }

/* ---------- Member page (a congressperson's recent bills — §2 factual) ---------- */
.member-sub { font-size: 14px; font-weight: 700; color: var(--ink-soft); margin: -2px 0 12px; }
.member-count { font-size: 13px; color: var(--ink-soft); margin: 14px 0 0; }
.member-fullrecord { margin: 16px 0 0; }
.member-fullrecord a { color: var(--deep-purple); font-size: 14px; font-weight: 600; text-decoration: none; }
.member-fullrecord a:hover { text-decoration: underline; }
.member-bills { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.member-bill {
  display: flex; flex-direction: column; gap: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; box-shadow: var(--shadow);
}
.member-bill-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.role-badge {
  font-size: 10px; font-weight: 800; letter-spacing: 0.03em; text-transform: uppercase;
  color: #fff; padding: 2px 8px; border-radius: 999px;
}
.role-sponsored { background: var(--deep-purple); }
.role-cosponsored { background: var(--teal); }
.member-bill-id { font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.member-bill-date { font-size: 12px; color: var(--ink-soft); margin-left: auto; }
.member-bill-title { font-size: 15px; font-weight: 700; color: var(--ink); text-decoration: none; }
.member-bill-title:hover { text-decoration: underline; color: var(--deep-purple); }
.member-bill-area { font-size: 12px; color: var(--ink-soft); }

/* ---------- Shared site footer ---------- */
.site-footer {
  border-top: 1px solid var(--line); margin-top: 30px;
  padding: 22px 16px 34px; text-align: center;
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: center; margin-bottom: 10px; }
.site-footer a { color: var(--deep-purple); text-decoration: none; font-size: 14px; font-weight: 600; }
.site-footer a:hover { text-decoration: underline; }
.site-footer p { font-size: 12px; color: var(--ink-soft); margin: 0; }

a:focus-visible, button:focus-visible { outline: 2px solid var(--mid-purple); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
