:root {
  --elections-bg: #f5f7fb;
  --elections-panel: #ffffff;
  --elections-panel-2: #ffffff;
  --elections-border: rgba(15, 23, 42, 0.08);
  --elections-text: #0f172a;
  --elections-muted: #64748b;
  --elections-gold: #d4af37;
  --elections-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.electionsPage {
  margin: 0;
  background: var(--elections-bg);
  color: var(--elections-text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.electionsLayout {
  max-width: 1320px;
  margin: 0 auto;
  padding: 32px 18px 48px;
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.85fr);
  gap: 24px;
}

.electionsMain,
.electionsSidebar {
  min-width: 0;
}

.card {
  background: var(--elections-panel);
  border: 1px solid var(--elections-border);
  border-radius: 22px;
  box-shadow: var(--elections-shadow);
}

.electionsHero,
.editorialBlock,
#electionsArticles,
.sidebarCard {
  padding: 24px;
}

.electionsMain {
  display: grid;
  gap: 20px;
}

.eyebrow,
.sectionKicker {
  margin: 0 0 8px;
  color: var(--elections-gold);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
}

.electionsHero h1,
.sectionHeader h2,
.editorialBlock h2,
.sidebarHeader h2 {
  margin: 0;
  line-height: 1.08;
}

.electionsHero h1 {
  font-size: clamp(2rem, 4vw, 3.45rem);
  max-width: 820px;
}

.heroText,
.editorialBlock p,
.sidebarIntro,
.sidebarStatus,
.articleCard p,
.articleMeta,
.electionDate,
.electionType {
  color: var(--elections-muted);
}

.heroText {
  margin: 16px 0 0;
  font-size: 1.02rem;
  line-height: 1.7;
  max-width: 880px;
}

.heroActions {
  margin-top: 22px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btnPrimary,
.btnGhost,
.refreshBtn,
.filterBtn,
.regionFilterBtn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  cursor: pointer;
  transition: 0.2s ease;
}

.btnPrimary,
.btnGhost {
  text-decoration: none;
  padding: 11px 16px;
  font-weight: 700;
}

.btnPrimary {
  background: linear-gradient(180deg, #d8b84e, #b98d16);
  color: #081326;
}

.btnPrimary:hover,
.refreshBtn:hover,
.filterBtn:hover,
.filterBtn.isActive,
.regionFilterBtn:hover,
.regionFilterBtn.isActive {
  transform: translateY(-1px);
}

.btnGhost,
.refreshBtn,
.filterBtn,
.regionFilterBtn {
  background: #ffffff;
  color: var(--elections-text);
  border-color: rgba(15, 23, 42, 0.12);
}

.editorialGrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.editorialGrid article {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  padding: 18px;
  background: #f8fafc;
}

.editorialGrid h3,
.articleCard h3,
.electionCountry {
  margin: 0 0 8px;
}

.scopeList {
  margin: 16px 0 0;
  padding-left: 18px;
  color: var(--elections-muted);
  line-height: 1.8;
}

.sectionHeader,
.sidebarHeader {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.articleControls {
  margin-top: 18px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.articleFilters,
.regionFilters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.regionFilters {
  margin-top: 14px;
}

.filterBtn,
.regionFilterBtn {
  padding: 8px 12px;
}

.filterBtn.isActive,
.regionFilterBtn.isActive {
  border-color: rgba(212, 175, 55, 0.45);
  background: rgba(212, 175, 55, 0.16);
}

.articleSearchWrap {
  width: min(100%, 320px);
}

.articleSearchInput {
  margin-top: 0;
}

.articleFeed {
  margin-top: 18px;
  display: grid;
  gap: 14px;
}

.articleCard {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  padding: 18px;
  background: #f8fafc;
}

.articleCard a {
  color: var(--elections-text);
  text-decoration: none;
}

.articleCard a:hover,
.electionSourceLink:hover {
  color: var(--elections-gold);
}

.articleMeta {
  font-size: 0.92rem;
  margin-bottom: 8px;
}

.electionsSidebar {
  position: relative;
}

.sidebarCard {
  position: sticky;
  top: 22px;
}

.refreshBtn {
  padding: 10px 14px;
}

.searchInput {
  width: 100%;
  box-sizing: border-box;
  margin-top: 16px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.12);
  color: var(--elections-text);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
}

.searchInput::placeholder {
  color: #94a3b8;
}

.regionSelect {
  appearance: none;
}

.electionList {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.electionItem {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #f8fafc;
}

.flagWrap {
  width: 54px;
  height: 38px;
  border-radius: 10px;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  display: grid;
  place-items: center;
}

.flagWrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.electionBody {
  min-width: 0;
}

.electionCountry {
  font-size: 1rem;
  font-weight: 700;
}

.electionDate,
.electionType {
  font-size: 0.92rem;
  line-height: 1.45;
}

.electionSourceLink {
  display: inline-block;
  margin-top: 6px;
  color: var(--elections-text);
  font-size: 0.88rem;
  text-decoration: none;
  font-weight: 600;
}

.electionArticleLink {
  display: inline-block;
  margin-top: 6px;
  margin-left: 10px;
  color: var(--elections-text);
  font-size: 0.88rem;
  text-decoration: none;
  font-weight: 600;
}

.electionArticleLink:hover {
  color: var(--elections-gold);
}

.skeleton {
  pointer-events: none;
}

.flagSkeleton,
.lineSkeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.06), rgba(255,255,255,0.12), rgba(255,255,255,0.06));
  background-size: 200% 100%;
  animation: electionShimmer 1.4s infinite linear;
}

.flagSkeleton {
  width: 54px;
  height: 38px;
  border-radius: 10px;
}

.lineSkeleton {
  height: 11px;
  border-radius: 999px;
}

.lineSkeleton.short { width: 45%; margin-bottom: 10px; }
.lineSkeleton.long { width: 75%; }

.sidebarEmpty {
  padding: 18px;
  border-radius: 16px;
  border: 1px dashed rgba(15, 23, 42, 0.14);
  color: var(--elections-muted);
}

.srOnly {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes electionShimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

@media (max-width: 1100px) {
  .electionsLayout {
    grid-template-columns: 1fr;
  }

  .sidebarCard {
    position: static;
  }
}

@media (max-width: 760px) {
  .electionsLayout {
    padding: 18px 14px 34px;
    gap: 18px;
  }

  .electionsHero,
  .editorialBlock,
  #electionsArticles,
  .sidebarCard {
    padding: 18px;
  }

  .editorialGrid {
    grid-template-columns: 1fr;
  }

  .sectionHeader,
  .sidebarHeader,
  .articleControls {
    align-items: flex-start;
    flex-direction: column;
  }

  .articleSearchWrap {
    width: 100%;
  }
}

.electionTopRow {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.electionStatusBadge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.2;
  border: 1px solid transparent;
}

.statusScheduled {
  background: rgba(34, 197, 94, 0.12);
  color: #166534;
  border-color: rgba(34, 197, 94, 0.22);
}

.statusExpected {
  background: rgba(212, 175, 55, 0.16);
  color: #8a6a12;
  border-color: rgba(212, 175, 55, 0.3);
}

.statusDelayed {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
  border-color: rgba(239, 68, 68, 0.22);
}

.statusCompleted {
  background: rgba(100, 116, 139, 0.14);
  color: #475569;
  border-color: rgba(100, 116, 139, 0.24);
}

.statusNeutral {
  background: rgba(15, 23, 42, 0.06);
  color: #334155;
  border-color: rgba(15, 23, 42, 0.12);
}

.electionNotes {
  margin-top: 8px;
  color: var(--elections-muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.electionLinks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.electionSourceLink,
.electionArticleLink {
  margin-top: 0;
  margin-left: 0;
}

@media (max-width: 520px) {
  .electionTopRow {
    flex-direction: column;
    align-items: flex-start;
  }
}
.electionMonthGroup {
  display: grid;
  gap: 10px;
}

.electionMonthGroup + .electionMonthGroup {
  margin-top: 6px;
}

.electionMonthHeading {
  margin: 4px 2px 0;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--elections-text);
}

.electionMonthItems {
  display: grid;
  gap: 12px;
}