/* Shared FEC×EO mockup shell — one content column (max 1200, content-gutter) */
:root {
  --eo-navy: #063755;
  --eo-navy-hover: #0a4a6e;
  --eo-ink: #163c59;
  --eo-cyan: #5a9bb0;
  --ink: #212121;
  --muted-bg: #f0f2f4;
  --line: #dce0e5;
  --serif: "Merriweather", Georgia, serif;
  --sans: "Source Sans 3", "Helvetica Neue", Arial, sans-serif;
  --content: 1200px;
  /* Shared column for banner, brand, nav, welcome, page, footer (USEO px-2 / xl:px-0) */
  --content-gutter: 8px;
  /* Header seal: 128px desktop (≥1024); mid 768–1023 uses 118px via media query */
  --brand-pad: 138px; /* seal + 10px gap to wordmark/nav */
  --seal-size: 128px;
}
@media (min-width: 1280px) {
  :root { --content-gutter: 0px; } /* unit required — unitless 0 breaks max() in right/left */
}

* { box-sizing: border-box; }
html {
  height: 100%;
}
body {
  margin: 0;
  min-height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  font: 15px/1.55 var(--sans);
  background: var(--muted-bg);
}
a { color: inherit; }

.mock-note {
  background: #fff8e6;
  border-bottom: 1px solid #e8d9a8;
  padding: 8px 12px;
  font-size: 13px;
  color: #6b5a20;
  text-align: center;
}
.mock-note code { font-size: 12px; }
.mock-note a { color: #063755; font-weight: 600; }

/* Content shell: same horizontal edge as welcome */
.content-shell {
  max-width: var(--content);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--content-gutter);
  padding-right: var(--content-gutter);
  width: 100%;
  box-sizing: border-box;
}

/* —— Gov banner (full-bleed bg, content column) —— */
.gov-banner {
  background: #eee;
  font-size: 12px;
  color: #333;
}
.gov-banner-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding-top: 4px;
  padding-bottom: 4px;
}
.gov-banner img.flag-astor {
  width: auto;
  height: 11px;
  object-fit: contain;
  display: block;
}
.gov-banner .tools { margin-left: auto; }

/* —— Brand (full-bleed bg/border, content column) —— */
.site-header { background: #fff; flex-shrink: 0; }
.brand-bar {
  background: #fff;
  border-bottom: 1px solid #ddd;
}
.brand-row {
  position: relative;
  min-height: 72px;
  display: flex;
  align-items: center;
}
/* Desktop: overlapping seal (FEC-style size/position). Mobile relocates below. */
.seal {
  position: absolute;
  left: var(--content-gutter); /* column-aligned; FEC uses ~18px from viewport */
  top: 12px;
  width: var(--seal-size);
  height: var(--seal-size);
  margin-top: 0;
  flex: 0 0 auto;
  display: block;
  background: transparent;
  text-decoration: none;
  z-index: 5;
}
.seal img { width: 100%; height: 100%; display: block; }
.wordmark {
  margin-left: var(--brand-pad);
  text-decoration: none;
  color: var(--eo-ink);
  font-family: var(--serif);
  padding: 12px 0;
}
.wordmark strong {
  display: block;
  font-size: 22px;
  line-height: 1.1;
  font-weight: 700;
}
.wordmark span {
  display: block;
  margin-top: 5px;
  font: 700 11px/1.2 var(--sans);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--eo-navy);
}

.mobile-menu-button {
  margin-left: auto;
  display: none;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  padding: 8px;
  color: var(--eo-navy);
  cursor: pointer;
}
.mobile-menu-button .material-symbols-outlined {
  font-size: 1.75rem;
}

/* Nav: same column as content-shell, but NOT the content-shell class
   (that would fight brand-pad / flex and shove Home under the seal). */
.desktop-nav-bar {
  background: #fff;
  box-shadow: 0 1px 1px rgba(0,0,0,.1);
  position: relative;
  z-index: 4;
}
.desktop-nav {
  display: none;
  max-width: var(--content);
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  box-sizing: border-box;
  height: 40px;
  align-items: stretch;
  justify-content: flex-start;
  padding-left: calc(var(--brand-pad) + var(--content-gutter));
  padding-right: var(--content-gutter);
}
.nav-item {
  display: inline-flex;
  align-items: center;
  padding: 0 18px;
  border: 0;
  background: transparent;
  color: #333;
  font: 400 15px/1 var(--serif);
  text-decoration: none;
  cursor: pointer;
  position: relative;
}
.nav-item:hover {
  text-decoration: none;
}
.nav-item:not(.active):hover::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 5px;
  height: 3px;
  background: var(--eo-cyan);
}
.nav-item.active {
  background: var(--eo-navy);
  color: #fff;
}
.nav-item.active::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 5px;
  height: 3px;
  background: var(--eo-cyan);
}

/* Mobile nav: original EO overlay drawer (semantic CSS, no Tailwind) */
.mobile-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.5);
}
.mobile-nav-overlay.is-open {
  display: block;
}
.mobile-nav-panel {
  position: fixed;
  inset-block: 0;
  right: 0;
  width: 16rem;
  max-width: 85vw;
  background: #fff;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
}
.mobile-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 1rem;
  border-bottom: 1px solid var(--line);
}
.mobile-nav-header h3 {
  margin: 0;
  font: 700 1.125rem/1.2 var(--serif);
  color: var(--eo-ink);
}
.mobile-nav-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  padding: 8px;
  color: #4b5563;
  cursor: pointer;
}
.mobile-nav-close:hover { color: var(--eo-ink); }
.mobile-nav-close .material-symbols-outlined { font-size: 1.5rem; }
.mobile-nav-body {
  padding: 1rem;
}
.mobile-nav-body a {
  display: block;
  padding: 0.625rem 1rem;
  border-radius: 4px;
  font: 600 15px/1.3 var(--sans);
  color: var(--eo-ink);
  text-decoration: none;
}
.mobile-nav-body a + a { margin-top: 0.25rem; }
.mobile-nav-body a:hover { background: #f3f4f6; }
.mobile-nav-body a.active {
  background: var(--eo-navy);
  color: #fff;
}
.mobile-nav-sep {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--line);
}
.mobile-nav-sep a + a { margin-top: 0.25rem; }

/*
  Header breakpoints (aligned with common md / lg):
  ≤767px     — hamburger, static 56px seal
  768–1023px — desktop nav, absolute 118px seal
  ≥1024px    — desktop nav, absolute 128px seal (:root)
*/
@media (min-width: 768px) {
  .desktop-nav { display: flex; }
  .mobile-nav-overlay { display: none !important; }
  .welcome-inner {
    padding-left: calc(var(--brand-pad) + var(--content-gutter));
  }
}
@media (min-width: 768px) and (max-width: 1023px) {
  :root {
    --seal-size: 118px;
    --brand-pad: 128px; /* 118 + 10 */
  }
  .wordmark strong {
    font-size: 19px;
  }
  .wordmark span {
    font-size: 10px;
    margin-top: 4px;
  }
}
@media (max-width: 767px) {
  .mobile-menu-button { display: inline-flex; }
  .seal {
    position: static;
    width: 56px;
    height: 56px;
    flex-shrink: 0;
  }
  .footer-brand img {
    width: 56px;
    height: 56px;
  }
  .brand-row { gap: 12px; padding-top: 10px; padding-bottom: 10px; }
  .wordmark { margin-left: 0; flex: 1; min-width: 0; }
  .wordmark strong { font-size: 16px; }
  .wordmark span { letter-spacing: 0.12em; font-size: 9px; }
  .desktop-nav {
    padding-left: var(--content-gutter);
    padding-right: var(--content-gutter);
  }
  .welcome {
    padding-top: 14px !important;
  }
}

/* —— Welcome —— */
.welcome {
  background: var(--eo-navy);
  color: #fff;
  flex-shrink: 0;
  padding: 14px 0;
}
.welcome strong { font-family: var(--serif); font-size: 1.05rem; }
.welcome p { margin: 4px 0 0; font-size: 14px; opacity: .95; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.5rem 0.85rem;
  background: var(--eo-navy);
  color: #fff;
  font: 600 14px var(--sans);
  text-decoration: none;
}
.skip-link:focus {
  left: 8px;
  top: 8px;
}
.eo-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.45rem;
  margin: 0 0 10px;
  font-size: 13px;
  opacity: 0.95;
}
.eo-breadcrumb-sep { opacity: 0.7; }

/* —— Page / panel —— */
.page {
  flex: 1 1 auto;
  width: 100%;
  padding-top: 20px;
  padding-bottom: 40px;
}
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
  padding: 20px 22px;
}
.panel h1 {
  margin: 0 0 16px;
  font: 700 clamp(1.35rem, 2.5vw, 1.75rem)/1.25 var(--serif);
  color: #111;
  word-break: break-word;
}
.section-title {
  margin: 0 0 10px;
  font: 700 1.15rem/1.3 var(--serif);
}
.eo-link {
  color: var(--eo-navy);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.eo-link:hover { color: var(--eo-navy-hover); }
.btn-primary {
  display: inline-block;
  padding: 9px 16px;
  background: var(--eo-navy);
  color: #fff;
  border: 0;
  border-radius: 2px;
  font: 700 14px var(--sans);
  cursor: pointer;
  text-decoration: none;
}
.btn-primary:hover { background: var(--eo-navy-hover); }
.btn-secondary {
  display: inline-block;
  padding: 7px 12px;
  background: #fff;
  color: var(--eo-navy);
  border: 1px solid #b8c5cf;
  border-radius: 2px;
  font: 600 13px var(--sans);
  cursor: pointer;
  text-decoration: none;
}
.field {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
}
.field span { font-size: 12px; font-weight: 600; color: #555; }
.field input, .field select, .field textarea {
  border: 1px solid #c5cad3;
  border-radius: 2px;
  padding: 8px 10px;
  font: 400 14px var(--sans);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--eo-navy);
  outline-offset: 1px;
}

/* —— Footer —— */
footer,
#site-footer {
  flex-shrink: 0;
  margin-top: auto;
  background: var(--eo-navy);
  color: #e8eef2;
}
.footer-inner {
  padding-top: 34px;
  padding-bottom: 40px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px 48px;
}
.footer-brand {
  text-align: left;
  flex: 1 1 280px;
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.footer-brand img {
  width: 88px;
  height: 88px;
  margin: 0;
  display: block;
  object-fit: contain;
  flex-shrink: 0;
}
.footer-brand-text { min-width: 0; }
.footer-brand h2 {
  margin: 0 0 6px;
  font: 700 0.95rem/1.25 var(--serif);
  color: #fff;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.footer-brand p {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
  opacity: .9;
  text-align: left;
}
.footer-nav {
  margin-left: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 40px;
  font-size: 13px;
  text-align: left;
}
.footer-nav a {
  display: block;
  color: #fff;
  text-decoration: none;
  padding: 4px 0;
  line-height: 1.3;
}
.footer-nav a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  /* only vertical — horizontal padding comes from .content-shell */
  padding-top: 12px;
  padding-bottom: 20px;
  display: flex;
  justify-content: flex-end;
  background: var(--eo-navy);
}
.footer-back-top {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  font: 600 13px/1.2 var(--sans);
  text-decoration: none;
  opacity: 0.95;
}
.footer-back-top:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
  opacity: 1;
}
.footer-back-top .chev { font-size: 14px; line-height: 1; }

/* —— Shared data tables —— */
.data-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--line);
  font-size: 14px;
}
.data-table th {
  background: #f9fafb;
  text-align: left;
  font: 700 12px/1.2 var(--sans);
  color: #4b5563;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #eee;
  vertical-align: middle;
}
.data-table tr:hover td { background: #fafafa; }
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 2px;
  font-size: 11px;
  font-weight: 700;
}
.badge-live { background: #dcfce7; color: #166534; }
.badge-pub { background: #dbeafe; color: #1e40af; }
.badge-up { background: #fef9c3; color: #854d0e; }
.badge-closed { background: #ffedd5; color: #9a3412; }

.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
@media (min-width: 640px) {
  .stats { grid-template-columns: repeat(4, 1fr); }
}
.stat {
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 12px;
  background: #f9fafb;
}
.stat .label { font-size: 11px; text-transform: uppercase; color: #6b7280; }
.stat .value { font-size: 1.35rem; font-weight: 700; tabular-nums: true; font-variant-numeric: tabular-nums; }

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
  overflow-x: auto;
}
.tab {
  padding: 10px 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  font: 600 14px var(--sans);
  color: #6b7280;
  cursor: pointer;
  white-space: nowrap;
}
.tab.active {
  color: var(--eo-navy);
  border-bottom-color: var(--eo-navy);
}

/* Ballot (election mockup) */
.info-card {
  margin-bottom: 20px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #f8fafb;
}
.info-card h2 {
  margin: 0 0 8px;
  font: 700 1rem/1.3 var(--serif);
  color: var(--eo-navy);
}
.info-card p {
  margin: 0;
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.55;
  color: #333;
}
.meta-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px 24px;
  margin-bottom: 24px;
  font-size: 14px;
}
@media (min-width: 640px) {
  .meta-grid { grid-template-columns: 1fr 1fr; }
}
.status-live { color: #1b4d3e; font-weight: 700; }
.vote-hint { margin: 0 0 12px; font-size: 14px; color: #444; }
.vote-hint .warn { color: #c2410c; font-weight: 600; }
.ballot-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
@media (min-width: 900px) {
  .ballot-grid { grid-template-columns: 1fr 1fr; }
}
.party-title { margin: 0 0 6px; font: 700 14px/1.3 var(--serif); }
.party-title.d { color: #1e40af; }
.party-title.r { color: #991b1b; }
.ballot-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--line);
  font-size: 13px;
  font-family: var(--serif);
  background: #fff;
}
.ballot-table th {
  background: #f9fafb;
  text-align: left;
  font: 600 11px/1.2 var(--sans);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #6b7280;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}
.ballot-table th.num, .ballot-table td.num { text-align: right; }
.ballot-table td {
  padding: 7px 10px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}
.ballot-table tr.d td { background: #cfe2f3; }
.ballot-table tr.r td { background: #f4cccc; }
.ballot-table tfoot td {
  background: #f3f4f6;
  border-top: 1px solid #c5cad3;
  font: 700 11px/1.2 var(--sans);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #4b5563;
  padding: 9px 10px;
}
.ballot-table tfoot .sum {
  font: 700 14px/1 var(--sans);
  color: var(--eo-navy);
  text-transform: none;
  letter-spacing: 0;
}
.ballot-table input {
  width: 3.5rem;
  padding: 4px 6px;
  border: 1px solid #c5cad3;
  border-radius: 2px;
  text-align: center;
  font: 400 13px var(--sans);
  background: #fff;
}
.remain {
  margin: 16px 0;
  padding: 12px 14px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 2px;
  font-size: 14px;
  color: #1e3a5f;
}
.remain .n { font-weight: 700; color: #2563eb; }

/* Calendar */
.cal-layout {
  display: grid;
  gap: 20px;
}
@media (min-width: 960px) {
  .cal-layout { grid-template-columns: 1fr 240px; }
}
.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.cal-nav h2 { margin: 0; font: 700 1.25rem/1.2 var(--serif); }
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.cal-dow {
  background: #f3f4f6;
  padding: 8px 4px;
  text-align: center;
  font: 700 11px/1 var(--sans);
  color: #6b7280;
  text-transform: uppercase;
}
.cal-day {
  background: #fff;
  min-height: 5.5rem;
  padding: 6px;
  font-size: 12px;
}
.cal-day.out { background: #f9fafb; color: #9ca3af; }
.cal-day .n { font-weight: 700; font-size: 13px; margin-bottom: 4px; }
.cal-pill {
  display: block;
  margin-top: 3px;
  padding: 2px 5px;
  border-radius: 2px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: var(--eo-navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
}
.cal-pill.plan { background: #8a5a10; }
.cal-legend { font-size: 13px; }
.cal-legend li { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.cal-admin {
  margin-top: 20px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #f9fafb;
}

/* Floating back-to-top: only over page content (hidden while footer is in view) */
.back-to-top {
  position: fixed;
  right: 16px;
  bottom: 20px;
  left: auto;
  z-index: 40;
  display: none;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: #fff;
  color: var(--eo-navy);
  border: 1px solid #b8c5cf;
  border-radius: 2px;
  font: 700 12px/1 var(--sans);
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(6, 55, 85, 0.18);
  cursor: pointer;
}
.back-to-top:hover {
  background: #f3f6f8;
  color: var(--eo-navy-hover);
  border-color: var(--eo-navy);
}
.back-to-top.is-visible { display: inline-flex; }
.back-to-top .chev { font-size: 14px; line-height: 1; }
