/* Shared site theme — mirrors pick-a-pol/public/css/styles.css so every page
   (home, about, matcher, full app) shares one visual language. */
:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --ink: #16202b;
  --muted: #5a6472;
  --line: #dfe3e8;
  --brand: #1f5fa8;
  --brand-ink: #ffffff;
  --agree: #1f7a4d;
  --disagree: #b4402a;
  --focus: #ffbf47;
  --radius: 10px;
  /* Old Glory palette — decorative accents only. */
  --flag-red: #b22234;
  --flag-blue: #0a3161;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh; display: flex; flex-direction: column;
}
.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }
a { color: var(--brand); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff;
  padding: 8px 12px; z-index: 100;
}
.skip-link:focus { left: 8px; top: 8px; }

/* Stars-and-stripes ribbon across the very top of the page. */
.us-ribbon { height: 5px; background:
    linear-gradient(90deg, var(--flag-red) 0 34%, #eef1f6 34% 66%, var(--flag-blue) 66% 100%);
  position: sticky; top: 0; z-index: 200; }

.site-header { background: var(--surface); border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(10, 49, 97, .04), 0 6px 18px -12px rgba(10, 49, 97, .25); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 1.2rem; text-decoration: none; color: var(--ink);
  display: inline-flex; align-items: center; gap: 10px; }
.site-header nav a { margin-left: 16px; text-decoration: none; }

/* Gently fluttering flag beside the wordmark. */
.flag { display: inline-block; width: 34px; height: 22px; border-radius: 2px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transform-origin: left center;
  animation: flagwave 3.6s ease-in-out infinite; }
.flag svg { display: block; width: 100%; height: 100%; }

@keyframes flagwave {
  0%, 100% { transform: perspective(90px) rotateY(0deg) skewY(0deg); }
  25%      { transform: perspective(90px) rotateY(-7deg) skewY(-1.3deg); }
  75%      { transform: perspective(90px) rotateY(7deg) skewY(1.3deg); }
}

main { flex: 1; padding: 28px 0 40px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px;
  margin-bottom: 20px; animation: rise .4s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
h1 { font-size: 1.8rem; margin: 0 0 8px; }
h2 { font-size: 1.25rem; margin: 0 0 8px; }
.lead { color: var(--muted); font-size: 1.05rem; }
p { line-height: 1.65; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--brand); color: var(--brand-ink); border: 1px solid var(--brand);
  padding: 10px 22px; border-radius: 999px; font-size: 1rem; font-weight: 600; cursor: pointer;
  text-decoration: none; transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.btn:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 6px 16px -8px rgba(10, 49, 97, .55); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn.secondary { background: transparent; color: var(--brand); }

label { display: block; font-weight: 600; margin-bottom: 6px; }
input[type="text"] {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 1rem; background: var(--surface); color: var(--ink);
}
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.hint { color: var(--muted); font-size: .9rem; }

.ad-slot { background: repeating-linear-gradient(45deg, #eee, #eee 10px, #f5f5f5 10px, #f5f5f5 20px);
  color: var(--muted); text-align: center; padding: 22px; border-radius: 8px; margin: 0 0 20px; font-weight: 700;
  font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; }

.pill-row { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; background: var(--bg);
  border: 1px solid var(--line); border-radius: 999px; font-size: .85rem; color: var(--muted); font-weight: 600; }

/* Ballot roster: candidates resolved from the visitor's address (all 50 states). */
.roster { margin-top: 18px; }
.roster h3 { margin: 18px 0 8px; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); }
.roster ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.roster li { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  background: var(--bg); border: 1px solid var(--line); border-left: 4px solid var(--brand);
  border-radius: 8px; padding: 8px 12px; font-size: .92rem; }
.roster .cand-name { font-weight: 700; color: var(--ink); }
.roster .cand-party { color: var(--muted); font-size: .82rem; }
.roster .cand-tag { font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--flag-blue); background: #e7eefa; border-radius: 999px; padding: 2px 8px; }
.roster li[data-party="Democratic"], .roster li[data-party="DFL"] { border-left-color: var(--flag-blue); }
.roster li[data-party="Republican"] { border-left-color: var(--flag-red); }

.site-footer { background: var(--surface); border-top: 1px solid var(--line); margin-top: auto; padding: 20px 0;
  color: var(--muted); font-size: .9rem; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
}
