/* The three approved Figma covers share one stable title and one layout. */
.ag-election-cover {
  --ag-cover-ink: #202440;
  --ag-cover-accent: var(--fl-color-entity-particulierpro-clair, #6866ac);
  --ag-cover-paper: #fbfafc;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--ag-cover-paper);
  color: var(--ag-cover-ink);
}
.ag-cover-images, .ag-cover-image, .ag-cover-veil { position: absolute; inset: 0; width: 100%; height: 100%; }
.ag-cover-images { z-index: -2; }
.ag-election-cover .ag-cover-image {
  display: block;
  max-width: none;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  transition: opacity 700ms ease;
}
.ag-election-cover .ag-cover-image.is-active { opacity: 1; }
/* Keep the roof flag in view, including on mobile where the generic crop shifts right. */
.ag-election-cover .ag-cover-image[data-scene="republique"] { object-position: center top; }
/* Fit the entire map above the controls; only the empty left background fades. */
.ag-election-cover .ag-cover-image[data-scene="territoires"] {
  inset: 0 0 auto auto;
  width: auto;
  height: calc(100% - 64px);
  object-fit: contain;
  object-position: right center;
  mask-image: linear-gradient(to right, transparent 25%, #000 44%), linear-gradient(to bottom, #000 93%, transparent);
  mask-composite: intersect;
}
.ag-cover-veil {
  z-index: -1;
  background: linear-gradient(90deg, #fbfafcf5 0%, #fbfafce8 28%, #fbfafc66 48%, #fbfafc00 72%);
}
.ag-election-cover[data-scene="territoires"] {
  --ag-cover-paper: #f3f0fc;
  background: linear-gradient(110deg, #f3f0fc 30%, #bcb2d1 75%, #a9a1c5);
}
.ag-election-cover[data-scene="territoires"] .ag-cover-veil {
  background: linear-gradient(90deg, #f3f0fcf5 0%, #f3f0fce8 28%, #f3f0fc66 48%, #f3f0fc00 72%);
}
.ag-election-cover[data-scene="campagne"] { --ag-cover-paper: #222341; --ag-cover-ink: #fff; --ag-cover-accent: #fff; }
.ag-election-cover[data-scene="campagne"] .ag-cover-veil {
  background: linear-gradient(90deg, #222341f5 0%, #222341e8 28%, #22234166 48%, #22234100 72%);
}
.ag-cover-inner { position: relative; min-height: 336px; padding: 26px 32px 32px; }
.ag-cover-copy { width: min(100%, 630px); }
.ag-election-cover .ag-cover-kicker {
  margin: 0 0 7px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .09em;
  line-height: 1.5;
  text-transform: uppercase;
  color: var(--ag-cover-accent);
}
.ag-election-cover .ag-cover-title { margin: 0 0 8px; font-size: clamp(26px, 2.65vw, 38px); font-weight: 600; line-height: 1.12; color: var(--ag-cover-ink); }
.ag-cover-title > span { display: block; }
.ag-cover-title .ag-cover-year { display: flex; align-items: center; gap: 16px; margin-top: 4px; font-size: 80px; font-weight: 700; line-height: 1.03; letter-spacing: -.04em; color: var(--ag-cover-accent); }
.ag-cover-emblem { display: inline-flex; align-items: center; justify-content: center; width: 54px; height: 61px; flex-shrink: 0; border-radius: 10px; }
.ag-cover-emblem img { display: block; width: 38px; height: 45px; }
.ag-election-cover[data-scene="campagne"] .ag-cover-emblem { background: #fff; }
.ag-election-cover .ag-cover-description { max-width: 510px; margin: 0 0 12px; font-size: 14px; line-height: 1.5; }
.ag-election-cover .ag-cover-cta { min-width: 190px; color: #fff; background: var(--fl-color-entity-particulierpro-clair, #6866ac); border-color: transparent; font-weight: 500; }
.ag-election-cover .ag-cover-cta:hover { background: color-mix(in srgb, var(--fl-color-entity-particulierpro-clair, #6866ac), black 15%); color: #fff; }
.ag-election-cover[data-scene="campagne"] .ag-cover-cta { color: var(--fl-color-entity-particulierpro-clair, #6866ac); background: #fff; }
.ag-election-cover[data-scene="campagne"] .ag-cover-cta:hover { background: #eeeef7; }
.ag-cover-controls {
  position: absolute;
  right: 24px;
  bottom: 20px;
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid #ffffff80;
  border-radius: 28px;
  background: #ffffffed;
  color: #202440;
  box-shadow: 0 2px 16px #2024401a;
}
.ag-cover-control { display: inline-flex; justify-content: center; align-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; font: 600 13px/1 Poppins, system-ui, sans-serif; color: inherit; background: transparent; cursor: pointer; }
.ag-cover-control:hover { background: #eeeef7; }
.ag-cover-choice span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; }
.ag-cover-choice[aria-pressed="true"] span { color: #fff; background: var(--fl-color-entity-particulierpro-clair, #6866ac); }
.ag-cover-control:disabled { cursor: default; opacity: .45; }
.ag-election-cover :focus-visible { outline: 3px solid #007e98; outline-offset: 3px; box-shadow: 0 0 0 3px #fff; }
.ag-election-cover .ag-cover-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
#ag-agenda-content { scroll-margin-top: 100px; }
@media (min-width: 768px) and (max-width: 1100px) {
  .ag-cover-inner { padding: 24px; min-height: 320px; }
  .ag-cover-copy { width: 440px; max-width: 60%; }
  .ag-election-cover .ag-cover-title { font-size: 30px; }
  .ag-cover-title .ag-cover-year { font-size: 72px; }
  .ag-cover-veil { background: linear-gradient(90deg, #fbfafcf5 0%, #fbfafce8 30%, #fbfafc44 62%, #fbfafc00 85%); }
  .ag-election-cover[data-scene="territoires"] .ag-cover-veil { background: linear-gradient(90deg, #f3f0fcf5 0%, #f3f0fce8 30%, #f3f0fc44 62%, #f3f0fc00 85%); }
  .ag-election-cover[data-scene="campagne"] .ag-cover-veil { background: linear-gradient(90deg, #222341f5 0%, #222341e8 30%, #22234144 62%, #22234100 85%); }
}
@media (max-width: 767px) {
  .ag-cover-inner { min-height: 320px; padding: 20px 22px 80px; }
  .ag-cover-copy { width: min(100%, 280px); }
  .ag-election-cover .ag-cover-image { object-position: 70% center; }
  /* The map occupies the space to the right of the year and CTA, never a crop. */
  .ag-election-cover .ag-cover-image[data-scene="territoires"] {
    top: 110px;
    width: min(384px, calc((100% - 220px) * 1.85));
    height: auto;
    mask-image: linear-gradient(to right, transparent 25%, #000 44%), linear-gradient(to bottom, transparent, #000 2%, #000 94%, transparent);
  }
  .ag-cover-veil { background: linear-gradient(90deg, #fbfafcf5 0%, #fbfafce8 45%, #fbfafc66 72%, #fbfafc1f 100%); }
  .ag-election-cover[data-scene="territoires"] .ag-cover-veil { background: linear-gradient(90deg, #f3f0fcf5 0%, #f3f0fce8 40%, #f3f0fc00 60%); }
  .ag-election-cover[data-scene="campagne"] .ag-cover-veil { background: linear-gradient(90deg, #222341f5 0%, #222341e8 45%, #22234166 72%, #2223411f 100%); }
  .ag-election-cover .ag-cover-kicker { font-size: 10px; margin-bottom: 6px; }
  .ag-election-cover .ag-cover-title { font-size: 26px; margin-bottom: 12px; }
  .ag-cover-title .ag-cover-year { font-size: 65px; gap: 12px; }
  .ag-cover-emblem { width: 46px; height: 51px; }
  .ag-cover-emblem img { width: 30px; height: 35px; }
  .ag-election-cover .ag-cover-description { display: none; }
  .ag-cover-controls { right: 16px; bottom: 12px; }
}
@media (prefers-reduced-motion: reduce) { .ag-election-cover .ag-cover-image { transition: none; } }
@media print { .ag-election-cover { display: none; } }
