/* Midterms26.org — shared styles: tokens, nav, flag band, footer, cursor.
   Used by every site page. */

/* Patriotic palette — hues sampled from assets/voteelection.jpg:
   "VOTE" coral-red, flag-canton blue, canton-shadow navy, sky white */
:root {
  --red: #d22c42;
  --blue: #00349c;
  --bg: #eef2f8;
  --fg: #041b5e;
  --rule: #bdc9dc;
  --mute: #5d6b88;
  --nav-h: 61px;
  --stripe-h: 6px;    /* white 2 · red 2 · white 2 under the nav */
  --band-h: clamp(96px, 19vh, 230px);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}
* { box-sizing: border-box; }
body { overflow-x: hidden; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 16px/1.5 "Archivo", system-ui, sans-serif; font-variation-settings: "wdth" 100;
}
a { color: inherit; text-decoration: none; }
.mono { font-family: "DM Mono", monospace; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }

/* ---------- Cursor ---------- */
.cursor {
  position: fixed; left: 0; top: 0; z-index: 90; width: 14px; height: 14px; margin: -7px 0 0 -7px;
  border-radius: 50%; background: #fff; mix-blend-mode: difference; pointer-events: none;
  transition: width .35s var(--ease-out), height .35s var(--ease-out), margin .35s var(--ease-out);
}
.cursor.big { width: 80px; height: 80px; margin: -40px 0 0 -40px; }
@media (hover: none) { .cursor { display: none; } }

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 50; height: var(--nav-h); display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; background: var(--fg);
}
.nav::after {
  content: ""; position: absolute; left: 0; right: 0; top: 100%; height: var(--stripe-h);
  background: linear-gradient(#fff 0 2px, var(--red) 2px 4px, #fff 4px 6px);
}
.nav-links { display: flex; gap: 26px; color: #fff; }
.nav-links a { position: relative; overflow: hidden; display: inline-block; height: 1.3em; line-height: 1.3; white-space: nowrap; flex: none; }
.nav-links a span { display: block; transition: transform .45s cubic-bezier(.76, 0, .24, 1); }
.nav-links a span + span { position: absolute; top: 100%; left: 0; color: #9fb7d6; }
.nav-links a:hover span, .nav-links a:focus-visible span { transform: translateY(-100%); }
.nav-links a:focus-visible { outline: 2px solid #9fb7d6; outline-offset: 4px; }
/* Current page: red underline, drawn inside the link box so the hover copy stays clipped */
.nav-links a[aria-current="page"] { height: calc(1.3em + 6px); box-shadow: inset 0 -2px var(--red); }
.logo { font-weight: 800; font-size: 19px; letter-spacing: -.01em; font-variation-settings: "wdth" 80; text-transform: uppercase; }
.logo-name { color: var(--blue); }
.logo-num { color: var(--red); }
.logo-tld { color: #000; }
/* On the navy nav: MIDTERMS white, 26 red, .ORG white */
.nav .logo-name, .nav .logo-tld { color: #fff; }

/* ---------- Draped flag under the nav ---------- */
.flag-band {
  position: absolute; left: 0; right: 0; top: calc(var(--nav-h) + var(--stripe-h)); height: var(--band-h); overflow: hidden; pointer-events: none;
  -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent);
}
.flag-band i {
  position: absolute; inset: -6% -2%; display: block;
  background: url("assets/flag-band.jpg") center 22% / cover no-repeat;
  transform-origin: 50% 0; animation: flag-in 1.1s var(--ease-out) both, flag-wave 7s ease-in-out 1.1s infinite alternate;
}
@keyframes flag-in { from { transform: translateY(-100%); } }
@keyframes flag-wave { from { transform: scale(1.02) skewY(-.4deg); } to { transform: scale(1.05) skewY(.4deg) translateX(-1%); } }

/* ---------- Footer (270toWin-style: brand + signup, link columns, social, legal bar) ---------- */
.site-footer { background: var(--fg); color: #dfe6f3; font-size: 15px; }
.site-footer a { color: #dfe6f3; transition: color .2s; }
.site-footer a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.foot-main {
  display: grid; grid-template-columns: minmax(260px, 1.4fr) repeat(4, minmax(0, 1fr)); gap: 40px 32px;
  padding: 56px 28px 44px; max-width: 1440px; margin: 0 auto;
}
.foot-brand .logo { font-size: 22px; }
.site-footer .logo-name, .site-footer .logo-tld { color: #fff; }
.foot-brand p { margin: 10px 0 22px; color: #aebbd6; max-width: 34ch; }
.site-footer h2 {
  margin: 0 0 14px; font: 500 12px/1.2 "DM Mono", monospace; letter-spacing: .08em; text-transform: uppercase; color: #9fb7d6;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.signup { display: grid; gap: 10px; max-width: 360px; }
.signup-row { display: flex; gap: 8px; }
.signup input[type="email"] {
  flex: 1; min-width: 0; height: 42px; padding: 0 14px; border-radius: 6px; border: 1px solid #2c4a8a;
  background: #0b2a72; color: #fff; font: inherit;
}
.signup input[type="email"]::placeholder { color: #8aa0c8; }
.signup input:focus-visible, .signup button:focus-visible { outline: 2px solid #9fb7d6; outline-offset: 2px; }
.signup button {
  height: 42px; padding: 0 18px; border: 0; border-radius: 6px; background: var(--red); color: #fff;
  font: 700 14px "Archivo", sans-serif; text-transform: uppercase; letter-spacing: .02em; cursor: pointer;
}
.signup button:hover { background: #b8213a; }
.signup label { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: #aebbd6; }
.signup input[type="checkbox"] { accent-color: var(--red); margin: 2px 0 0; }
.signup-msg { min-height: 1.2em; margin: 0; font-size: 13px; color: #9fb7d6; }
.social { display: flex; gap: 10px; margin-top: 4px; }
.social a {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; border: 1px solid #2c4a8a;
}
.social a:hover { background: var(--red); border-color: var(--red); }
.social svg { width: 17px; height: 17px; fill: currentColor; }
.foot-legal {
  border-top: 1px solid #1d3a78; padding: 18px 28px; max-width: 1440px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center; gap: 12px 24px; flex-wrap: wrap;
  font-size: 13px; color: #8aa0c8;
}
.foot-legal nav { display: flex; gap: 22px; }
.foot-legal nav a { font: 500 12px "DM Mono", monospace; letter-spacing: .08em; text-transform: uppercase; color: #aebbd6; }

@media (max-width: 1000px) {
  .foot-main { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot-brand { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  .foot-main { padding: 40px 16px 32px; gap: 32px 20px; }
  .foot-legal { padding: 18px 16px; }
  .nav { padding: 0 16px; }
  .nav-links { gap: 18px; }
}
/* Too narrow for one row: logo on the first row, links on the second (pages offset by --nav-h, so they follow).
   When the links are wider than the screen, they scroll sideways. */
@media (max-width: 1120px) {
  :root { --nav-h: 86px; }
  .nav { flex-direction: column; justify-content: center; align-items: flex-start; gap: 10px; }
  .nav-links { gap: 18px; max-width: 100%; overflow-x: auto; scrollbar-width: none; padding-bottom: 6px; margin-bottom: -6px; }
  .nav-links::-webkit-scrollbar { display: none; }
}
@media (max-width: 560px) {
  .nav-links { font-size: 11.5px; letter-spacing: .04em; }
}
@media (max-height: 700px) {
  :root { --band-h: clamp(72px, 13vh, 230px); }
}
@media (prefers-reduced-motion: reduce) {
  .flag-band i { animation: none; }
}

/* Spam trap in the newsletter form: hidden from people, filled in by bots */
.signup .hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.signup button[aria-busy="true"] { opacity: .6; cursor: progress; }
