/* Styled to match richmondsda.com: navy + sky blue + gold, Open Sans,
   uppercase letter-spaced headings, pill buttons. Fonts are self-hosted. */
@font-face { font-family: "Open Sans"; font-weight: 400; font-display: swap; src: url(/fonts/open-sans-400.woff2) format("woff2"); }
@font-face { font-family: "Open Sans"; font-weight: 600; font-display: swap; src: url(/fonts/open-sans-600.woff2) format("woff2"); }
@font-face { font-family: "Open Sans"; font-weight: 700; font-display: swap; src: url(/fonts/open-sans-700.woff2) format("woff2"); }
:root {
  --navy: #284665;
  --navy-deep: #1e3650;
  --sky: #54a6cb;
  --gold: #fdb020;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #eef1f4;
  --ink: #333a42;
  --muted: #6b7178;
  --line: #dde1e6;
  --accent: #284665;
  --accent-ink: #ffffff;
  --accent-soft: #e6f1f7;
  --link: #2c7ba3;
  --good: #2d6a3e;
  --good-soft: #e3f1e6;
  --warn: #7a5200;
  --warn-soft: #fff3da;
  --bad: #a3322b;
  --bad-soft: #f9e3e1;
  --radius: 6px;
  --shadow: 0 1px 3px rgba(40,70,101,.08);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); min-height: 100vh; display: flex; flex-direction: column;
  font: 17px/1.6 "Open Sans", "Helvetica Neue", Arial, sans-serif;
}
main { flex: 1; }
h1, h2, h3 { font-weight: 600; line-height: 1.25; margin: 0 0 .5em; color: var(--navy); }
h1 { font-size: 1.65rem; }
h2 { font-size: 1rem; text-transform: uppercase; letter-spacing: 2px; color: #777; font-weight: 600; }
h3 { font-size: .85rem; text-transform: uppercase; letter-spacing: 1.5px; color: #777; font-weight: 600; }
p { margin: 0 0 1em; }
a { color: var(--link); }
.wrap { max-width: 680px; margin: 0 auto; padding: 28px 16px 64px; }
.wrap.wide { max-width: 1100px; }

/* header band, like the site's navigation bar */
.site-head { background: var(--navy); color: #fff; border-bottom: 3px solid var(--gold); }
.site-head-in { max-width: 1100px; margin: 0 auto; padding: 14px 16px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.site-tag { margin-left: auto; font-weight: 600; text-transform: uppercase; letter-spacing: 1.5px; font-size: .85rem; color: #fff; }
.site-foot { background: var(--navy); color: rgba(255,255,255,.75); text-align: center; padding: 34px 16px; font-size: .85rem; }
.site-foot .foot-title { color: #fff; text-transform: uppercase; letter-spacing: 4px; font-size: .9rem; margin-bottom: 8px; }
.site-foot .verse { font-style: italic; color: rgba(255,255,255,.6); margin: 12px 0 0; }
.site-foot .verse cite { display: block; color: var(--sky); font-size: .8rem; margin-top: 2px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); margin-bottom: 18px; }
.card.lead-card { border-top: 4px solid var(--sky); }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.hidden { display: none !important; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }

label { display: block; font-weight: 600; margin: 12px 0 6px; }
input[type=text], input[type=password], input[type=email], input[type=tel], input[type=search], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid #c9ced4;
  border-radius: 4px; padding: 11px 12px; min-height: 46px;
}
input:focus-visible, select:focus-visible, button:focus-visible, textarea:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
button, .btn {
  font: inherit; font-size: .85rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  border-radius: 99px; border: 1px solid #93999d; background: transparent;
  color: #5d6368; padding: 10px 22px; min-height: 44px; cursor: pointer; text-decoration: none; display: inline-flex;
  align-items: center; justify-content: center; gap: 6px;
}
button:hover:not(:disabled), .btn:hover { border-color: var(--navy); color: var(--navy); }
button.primary, .btn.primary { background: var(--navy); color: #fff; border-color: var(--navy); }
button.primary:hover:not(:disabled), .btn.primary:hover { background: var(--navy-deep); color: #fff; }
button.danger { color: var(--bad); border-color: var(--bad); }
button.small, .btn.small { padding: 5px 14px; min-height: 34px; font-size: .75rem; }
button:disabled { opacity: .45; cursor: not-allowed; }
button.big { width: 100%; padding: 15px; font-size: 1rem; letter-spacing: 1px; }

.notice { border-radius: 10px; padding: 12px 14px; margin: 12px 0; background: var(--accent-soft); }
.notice.good { background: var(--good-soft); color: var(--good); }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.notice.bad { background: var(--bad-soft); color: var(--bad); }
.pill { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: .8rem; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }

/* ranker */
.slots { list-style: none; margin: 0; padding: 0; counter-reset: none; }
.slot { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px; background: var(--surface); min-height: 52px; }
.slot.empty { border-style: dashed; color: var(--muted); background: transparent; }
.slot .num { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--gold); color: var(--navy); font-size: .95rem; }
.slot.empty .num { background: var(--surface-2); color: var(--muted); }
.slot .nm { flex: 1; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.slot .pts { color: var(--muted); font-size: .8rem; flex: none; }
.slot .ctl { display: flex; gap: 4px; flex: none; }
.slot .ctl button { min-height: 36px; min-width: 36px; padding: 4px 8px; border-radius: 50%; }
.pool { max-height: 420px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; margin-top: 8px; background: var(--surface); }
.pool button { display: flex; width: 100%; justify-content: space-between; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; font-weight: 400; font-size: 1rem; text-transform: none; letter-spacing: 0; color: var(--ink); text-align: left; min-height: 48px; padding: 10px 14px; }
.pool button:last-child { border-bottom: 0; }
.pool button:hover:not(:disabled) { background: var(--accent-soft); }
.pool button .add { color: var(--link); font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .5px; }
.pool .letter { position: sticky; top: 0; background: var(--surface-2); color: var(--muted); font-size: .8rem; font-weight: 700; padding: 3px 14px; }
.pool .none { padding: 14px; color: var(--muted); }
.sticky-submit { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 30%); padding: 18px 0 6px; }

/* dialogs */
dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); padding: 22px; max-width: min(520px, calc(100vw - 32px)); width: 100%; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(10, 12, 18, .5); }
dialog ol { padding-left: 1.4em; }

/* admin */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button { border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: transparent; color: var(--muted); padding: 10px 14px; }
.tabs button[aria-selected=true] { border-bottom-color: var(--gold) !important; }
.tabs button[aria-selected=true] { color: var(--ink); border-bottom-color: var(--accent); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.stat b { display: block; font-size: 1.7rem; font-weight: 600; color: var(--navy); }
.stat span { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: 1px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .93rem; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: var(--surface-2); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); position: sticky; top: 0; }
tr:last-child td { border-bottom: 0; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.elected td { background: var(--good-soft); }
tr.tied td { background: var(--warn-soft); }
.segmented { display: inline-flex; border: 1px solid #93999d; border-radius: 99px; overflow: hidden; }
.segmented button { border: 0; border-radius: 0; border-right: 1px solid var(--line); background: var(--surface); }
.segmented button:last-child { border-right: 0; }
.segmented button[aria-pressed=true] { background: var(--accent); color: var(--accent-ink); }
.qrbox { display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-start; }
.qrbox img { width: 180px; height: 180px; background: #fff; border-radius: 8px; border: 1px solid var(--line); }
.mapgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chips label { font-weight: 500; margin: 0; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; background: var(--surface); }
.bar { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; background: var(--accent); }
code { background: var(--surface-2); padding: 1px 5px; border-radius: 5px; font-size: .88em; overflow-wrap: anywhere; }

/* print ballot */
.paper { max-width: 640px; margin: 0 auto; padding: 32px 24px; color: #000; background: #fff; }
.paper h1 { font-size: 1.6rem; color: #000; }
.paper .church { text-transform: uppercase; letter-spacing: 2px; font-size: .8rem; margin-bottom: 4px; }
.paper .line { border-bottom: 1px solid #000; height: 38px; display: flex; align-items: flex-end; gap: 12px; padding-bottom: 4px; }
.paper .line b { width: 28px; }
.paper .namebox { border: 2px solid #000; padding: 10px; margin: 16px 0; }
.print-only-hide { margin-bottom: 16px; }
@media print {
  body { background: #fff; display: block; }
  .site-head, .site-foot { display: none; }
  .print-only-hide { display: none; }
  .paper { page-break-after: always; }
}
@media (max-width: 520px) {
  h1 { font-size: 1.45rem; }
  .card { padding: 16px; }
}
.gap { height: 16px; }
.gap-top { margin-top: 18px; }
.gap-bottom { margin-bottom: 12px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 600; box-shadow: var(--shadow); z-index: 10; max-width: calc(100vw - 32px); }
.plist { margin-top: 10px; }
.plist .item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.plist .item:last-child { border-bottom: 0; }
.plist .item .nm { flex: 1; font-weight: 600; min-width: 160px; }
dialog .ranker-wrap { max-height: 60vh; overflow-y: auto; margin: 10px 0; }
dialog.wide { max-width: min(640px, calc(100vw - 32px)); }
.paper.center { text-align: center; }
.paper .lead { font-size: 1.4rem; font-weight: 700; }
.qr-sign { width: 340px; height: 340px; margin: 12px auto 20px; display: block; }
@media print { .qr-sign { width: 9cm; height: 9cm; } }
.row > input[type=text], .row > input[type=search], .row > select { flex: 1 1 180px; width: auto; }
.row > select { flex: 0 1 220px; }
@media (max-width: 560px) {
  .site-head-in { justify-content: center; padding: 12px 16px 10px; gap: 6px; }
  .site-tag { margin-left: 0; width: 100%; text-align: center; font-size: .75rem; letter-spacing: 2px; color: var(--gold); }
}

/* photo header with the church's stacked logo, like the homepage hero */
.hero { position: relative; background: var(--navy) center 40% / cover no-repeat; border-bottom: 3px solid var(--gold); }
.hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(18,32,48,.30) 0%, rgba(18,32,48,.62) 100%); }
.hero-autumn { background-image: url(/img/hero-autumn.jpg); }
.hero-path { background-image: url(/img/hero-path.jpg); }
.hero-redwoods { background-image: url(/img/hero-redwoods.jpg); }
.hero-in { position: relative; max-width: 1100px; margin: 0 auto; padding: 30px 16px 76px; text-align: center; }
.hero-logo { display: inline-block; }
.hero-logo img { width: 128px; height: auto; display: block; filter: drop-shadow(0 2px 8px rgba(0,0,0,.35)); }
.hero-kicker { color: #fff; text-transform: uppercase; letter-spacing: 5px; font-size: .9rem; font-weight: 600; margin: 16px 0 0; text-shadow: 0 1px 6px rgba(0,0,0,.5); }
.hero + main.wrap, .hero + main > .wrap { position: relative; margin-top: -52px; padding-top: 0; }
.logo-h { display: block; }
.logo-h img { height: 42px; width: auto; display: block; }
.site-foot .credit { font-size: .72rem; color: rgba(255,255,255,.45); margin: 14px 0 0; }
body.login-bg { background: var(--navy) url(/img/hero-redwoods.jpg) center / cover no-repeat fixed; }
body.login-bg #login { max-width: 420px; margin: 8vh auto 0; }
body:not(.login-bg) .login-credit { display: none; }
@media (max-width: 560px) {
  .hero-in { padding: 22px 16px 64px; }
  .hero-logo img { width: 104px; }
  .hero-kicker { font-size: .78rem; letter-spacing: 3px; }
  .logo-h img { height: 34px; }
}
.paper-logo { height: 54px; width: auto; display: block; margin: 0 0 14px; }
.paper.center .paper-logo { margin: 0 auto 18px; height: 64px; }

.userbar { margin: -6px 0 6px; }
.qr-big { width: min(340px, 80vw); height: auto; display: block; margin: 10px auto; background: #fff; border-radius: 6px; }
.linkbox { display: flex; gap: 8px; align-items: center; margin: 10px 0; }
.linkbox code { flex: 1; padding: 8px; }
dialog .center { text-align: center; }
