:root {
  --navy: #12244D;
  --navy-deep: #0A1730;
  --red: #E31B23;
  --red-soft: #FDECEC;
  --ink: #12244D;
  --ink-light: #5B6478;
  --bg: #F4F6FA;
  --border: #E4E7EE;
  --white: #FFFFFF;
  --font-display: "Archivo Black", "Inter", sans-serif;
  --font-body: "Inter", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.5;
}

h1, h2 { font-family: var(--font-display); margin: 0; }

.page-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 24px 60px;
}

/* ---------- Top bar ---------- */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.shield-icon { width: 42px; height: 42px; color: var(--navy); flex-shrink: 0; }
.wordmark { font-family: var(--font-display); font-size: 2.4rem; line-height: 1; white-space: nowrap; }
.w-defend { color: var(--navy); }
.w-dorchester { color: var(--red); }

.election-badge-block { text-align: right; }
.election-badge {
  display: inline-block;
  background: var(--red);
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  padding: 10px 18px;
  border-radius: 8px;
}
.election-badge-sub { margin-top: 6px; font-size: 0.8rem; font-weight: 700; color: var(--navy); letter-spacing: 0.02em; }

.edition-subtitle {
  color: var(--red);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  margin: 8px 0 28px;
}

/* ---------- Pills / buttons ---------- */
.pill {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 5px 12px;
  border-radius: 20px;
}
.pill-red { background: var(--red); color: #fff; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  padding: 14px 20px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: #c8161d; }
.btn-white { background: #fff; color: var(--navy); }
.btn-outline { background: transparent; color: #fff; border: 2px solid rgba(255,255,255,0.55); }
.btn-outline-light { background: transparent; color: #fff; border: 2px solid rgba(255,255,255,0.35); width: 100%; margin-top: 18px; }

/* ---------- Action grid ---------- */
.action-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1fr;
  grid-template-areas:
    "primary deadlines locate"
    "primary note note";
  gap: 20px;
  margin-bottom: 28px;
}
.action-card {
  border-radius: 20px;
  padding: 28px;
}
.card-primary {
  grid-area: primary;
  background: var(--navy);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.hero-headline { font-size: 2.6rem; line-height: 1.05; color: #fff; margin: 20px 0 18px; }
.accent-red { color: var(--red); }
.hero-copy { color: rgba(255,255,255,0.85); font-size: 0.95rem; max-width: 340px; margin-bottom: 26px; }
.hero-btn-row { display: flex; flex-direction: column; gap: 12px; }

.card-deadlines { grid-area: deadlines; background: var(--red-soft); }
.card-locate { grid-area: locate; background: var(--navy-deep); color: #fff; text-align: center; }

.card-icon-row { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.card-icon-row h2 { font-size: 1.1rem; color: var(--red); }

.icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  flex-shrink: 0;
}
.icon-badge svg { width: 22px; height: 22px; }
.icon-badge-red { background: var(--red); color: #fff; }
.icon-badge-dark { background: rgba(255,255,255,0.08); color: #fff; width: 56px; height: 56px; border-radius: 50%; margin-bottom: 4px; }

.deadline-list { list-style: none; margin: 0; padding: 0; }
.deadline-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(18,36,77,0.08);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-light);
  letter-spacing: 0.02em;
}
.deadline-list li:last-child { border-bottom: none; }
.deadline-list li span:last-child { color: var(--navy); font-size: 0.9rem; }

.locate-heading { font-size: 1.2rem; font-style: italic; margin: 4px 0 10px; }
.locate-copy { font-size: 0.82rem; color: rgba(255,255,255,0.7); margin-bottom: 4px; }

.card-note {
  grid-area: note;
  background: #fff;
  border: 1px solid var(--border);
  display: flex;
  gap: 22px;
  align-items: flex-start;
}
.note-photo {
  width: 260px;
  height: 260px;
  flex-shrink: 0;
  border-radius: 16px;
  background: repeating-linear-gradient(45deg, #eef0f5, #eef0f5 10px, #e4e7ee 10px, #e4e7ee 20px);
  border: 2px dashed #c7cce0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px;
}
.note-photo.has-photo { border: none; background: none; padding: 0; }
.photo-placeholder-label { font-size: 0.65rem; color: var(--ink-light); font-weight: 600; }
.note-photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 16px; }
.note-label { color: var(--red); font-weight: 800; font-size: 0.78rem; letter-spacing: 0.02em; margin: 0 0 8px; }
.note-text { font-size: 0.88rem; color: var(--ink-light); margin: 0; line-height: 1.6; }

/* ---------- Panels ---------- */
.panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 30px;
  margin-bottom: 24px;
}
.panel-head {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.panel-head h2 { font-size: 1.3rem; }
.panel-sub { color: var(--ink-light); font-size: 0.85rem; margin: 4px 0 0; }
.hours-pill {
  margin-left: auto;
  background: var(--bg);
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--ink-light);
  text-align: right;
}
.hours-pill strong { display: block; color: var(--navy); font-size: 0.85rem; margin-top: 2px; }

.location-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.location-card {
  background: var(--bg);
  border-radius: 14px;
  padding: 18px;
}
.location-card .icon-badge { width: 34px; height: 34px; border-radius: 8px; margin-bottom: 10px; }
.location-card .icon-badge svg { width: 16px; height: 16px; }
.location-name { font-weight: 800; color: var(--navy); font-size: 0.88rem; margin-bottom: 4px; }
.location-address { font-size: 0.78rem; color: var(--ink-light); }

.window-banner {
  background: var(--red-soft);
  border-radius: 14px;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--red);
}
.window-banner strong { color: var(--navy); }
.window-note { font-style: italic; font-size: 0.78rem; color: var(--red); }
.inline-icon { width: 16px; height: 16px; vertical-align: -3px; margin-right: 4px; }

/* ---------- Candidates ---------- */
.candidates-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.candidates-head h2 { font-size: 1.3rem; }
.candidates-controls { display: flex; gap: 12px; flex-wrap: wrap; }
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border-radius: 10px;
  padding: 10px 14px;
}
.search-box svg { width: 16px; height: 16px; color: var(--ink-light); flex-shrink: 0; }
.search-box input {
  border: none;
  background: transparent;
  outline: none;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink);
  width: 200px;
}
#office-filter {
  background: var(--bg);
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--ink);
  cursor: pointer;
}

.candidate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}
.candidate-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
  display: flex;
  flex-direction: column;
}
.candidate-photo-row { position: relative; width: 56px; height: 56px; margin-bottom: 16px; }
.candidate-photo {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: cover;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
}
.check-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--red-soft);
  color: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  border: 2px solid #fff;
}
.candidate-office { color: var(--red); font-weight: 800; font-size: 0.7rem; letter-spacing: 0.04em; margin-bottom: 4px; }
.candidate-name { color: var(--navy); font-weight: 800; font-size: 1.15rem; line-height: 1.2; margin-bottom: 10px; font-family: var(--font-body); }
.candidate-divider { height: 2px; width: 40px; background: var(--red-soft); margin-bottom: 12px; }
.candidate-quote {
  font-style: italic;
  color: var(--ink-light);
  font-size: 0.82rem;
  margin-bottom: 20px;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.candidate-btn {
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  width: 100%;
}
.candidate-btn:hover { background: var(--navy-deep); }

.no-results { text-align: center; color: var(--ink-light); padding: 30px 0; }

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  color: var(--ink-light);
  font-size: 0.78rem;
  padding: 20px 10px 0;
  max-width: 760px;
  margin: 0 auto;
}
.site-footer a { color: var(--navy); }
.paid-for { font-weight: 700; color: var(--navy); margin-top: 10px; }

/* ---------- Modal ---------- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 23, 48, 0.72);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-panel {
  background: #fff;
  border-radius: 22px;
  max-width: 620px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}
.modal-header {
  background: linear-gradient(135deg, var(--navy) 0%, #1b3a75 100%);
  border-radius: 22px 22px 0 0;
  padding: 32px;
  display: flex;
  align-items: center;
  gap: 22px;
  position: relative;
  overflow: hidden;
}
.modal-shield-watermark {
  position: absolute;
  top: -20px;
  right: -10px;
  width: 140px;
  height: 140px;
  color: rgba(255,255,255,0.08);
}
.modal-photo {
  width: 92px;
  height: 92px;
  border-radius: 16px;
  border: 3px solid rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.15);
  flex-shrink: 0;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 1.6rem;
  overflow: hidden;
}
.modal-photo img { width: 100%; height: 100%; object-fit: cover; }
.modal-name { color: #fff; font-size: 1.7rem; margin-top: 8px; font-family: var(--font-body); font-weight: 900; }

.modal-body {
  padding: 30px 32px;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
}
.modal-section-label {
  display: flex;
  align-items: center;
  color: var(--red);
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  margin: 0 0 12px;
}
.modal-policy-text { font-size: 0.85rem; color: var(--ink); text-transform: uppercase; line-height: 1.7; font-weight: 600; }
.modal-issues {
  background: var(--bg);
  border-radius: 14px;
  padding: 18px;
}
.modal-issues ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.modal-issues li {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 0.75rem;
  color: var(--navy);
  letter-spacing: 0.01em;
}
.modal-issues li::before {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--red-soft);
  border: 2px solid var(--red);
  flex-shrink: 0;
}

.modal-footer {
  background: var(--navy-deep);
  border-radius: 0 0 22px 22px;
  padding: 20px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.modal-socials { display: flex; gap: 10px; }
.social-btn {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: 700;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .action-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "primary"
      "deadlines"
      "locate"
      "note";
  }
  .card-note { flex-direction: column; }
  .note-photo { width: 100%; height: 240px; }
  .modal-body { grid-template-columns: 1fr; }
  .hours-pill { margin-left: 0; text-align: left; }
}
@media (max-width: 560px) {
  .wordmark { font-size: 1.6rem; }
  .hero-headline { font-size: 2rem; }
  .top-bar { flex-direction: column; align-items: flex-start; }
  .election-badge-block { text-align: left; }
}

/* ---------- Print ---------- */
@media print {
  .btn, .modal-overlay, .candidates-controls, #btn-print { display: none !important; }
}

