/* ═══════════════════════════ « Candidat 2027 » : la fausse affiche de candidature ═══════════════════════════
 *
 * Servie **seulement** sur sa fiche (`views/product-affiche.liquid`).
 *
 * La photo de celui ou celle qu'on met en campagne, son nom, un parti qui n'existe pas, un slogan, trois promesses
 * et, en bas, la date du scrutin. **Un seul balisage, quatre affiches de campagne qu'on reconnaît sans les nommer** :
 * - **Institutionnel** (celui que la fiche ouvre) : crème, bleu nuit et or, la photo cernée d'un filet d'or, un nom en
 *   grandes capitales à empattements, le slogan en italique — l'affiche sage de la campagne officielle ;
 * - **Pop** : jaune soleil, la photo en duotone rose et indigo, le slogan en blanc sur un bloc indigo penché, les
 *   promesses en autocollants — l'affiche qui se partage ;
 * - **Rétro** : orange brûlé et crème, la photo en sépia dans un ovale sur ses rayons, le slogan à la main — la
 *   campagne des années soixante-dix ;
 * - **Meeting** : noir, la photo en noir et blanc fondue dans le noir, un slogan fluo en capitales — l'affiche de tournée.
 *
 * **Un seul réunit le bleu, le blanc et le rouge : Institutionnel, en deux filets fins sous l'en-tête et au-dessus du pied**
 * (Fred, 15 nov. 2026 : « pas assez officiel » ; le code électoral, art. R27, vise les vraies affiches électorales, celle-ci
 * se dit fictive en toutes lettres) ; les trois autres n'y touchent pas, et **aucun n'imite un emblème public**. La mention « candidature
 * fictive » est dans la page, pas dans la feuille.
 *
 * **Le traitement de la photo est ici et nulle part ailleurs** (le duotone est un `mix-blend-mode`, le noir et blanc
 * et le sépia des `filter`) : l'image reste celle du client, donc la fabrication imprime ce que la page montre. Aucun
 * filtre flou ni ombre portée de canevas : ce qui se rend à l'écran se rend à 300 dpi.
 *
 * ── Les palettes : des couleurs de produit, pas de charte (point 6 quater) ──
 * En clair, toutes ici, en tête, et nulle part ailleurs. `[data-style]` ne nomme pas `.cp` exprès, pour que les
 * échantillons du formulaire se colorent avec les mêmes variables.
 */
@font-face { font-family: "Anton"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/anton-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Anton"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/anton-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Damion"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/damion-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Damion"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/damion-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* --c-fond : le papier ; --c-texte : l'encre ; --c-accent : le surtitre et les numéros (contraste mesuré sur le papier) ;
   --c-nom : le nom ; --c-slogan / --c-slogan-fond : le slogan et son bloc ; --c-bande / --c-bande-texte : la bande du haut
   et celle du bas ; --c-cadre : le filet autour de la photo ; --c-pastille / --c-pastille-texte : les promesses ;
   --c-ombre / --c-lumiere : les deux couleurs du duotone et du sépia. */
[data-style="Institutionnel"] {
  --c-fond: #f4eddc; --c-texte: #14213d; --c-accent: #7a5c16; --c-nom: #14213d;
  --c-slogan: #14213d; --c-slogan-fond: transparent; --c-bande: #14213d; --c-bande-texte: #f0d9a0;
  --c-cadre: #b8923a; --c-pastille: transparent; --c-pastille-texte: #14213d; --c-pied: #14213d; --c-pied-texte: #f4eddc;
  /* La bande drapeau (Fred, 15 nov. 2026 : « pas assez officiel ») : seul style qui la porte, et seul endroit des quatre où le bleu, le blanc et
     le rouge se rencontrent — deux filets fins, jamais le fond ni le texte. */
  --c-drapeau-bleu: #1b3f94; --c-drapeau-blanc: #ffffff; --c-drapeau-rouge: #d02b2f;
}
[data-style="Pop"] {
  --c-fond: #ffd23f; --c-texte: #1b1f8a; --c-accent: #1b1f8a; --c-nom: #1b1f8a;
  --c-slogan: #ffffff; --c-slogan-fond: #1b1f8a; --c-bande: transparent; --c-bande-texte: #1b1f8a;
  --c-cadre: #1b1f8a; --c-pastille: #ff9ec4; --c-pastille-texte: #1b1f8a; --c-pied: transparent; --c-pied-texte: #1b1f8a;
  --c-ombre: #1b1f8a; --c-lumiere: #ffb3c7;
}
[data-style="Rétro"] {
  --c-fond: #f3e2c0; --c-texte: #4a2511; --c-accent: #a3400f; --c-nom: #4a2511;
  --c-slogan: #a3400f; --c-slogan-fond: transparent; --c-bande: transparent; --c-bande-texte: #a3400f;
  --c-cadre: #c8501a; --c-pastille: transparent; --c-pastille-texte: #4a2511; --c-pied: transparent; --c-pied-texte: #4a2511;
  --c-rayon-1: #e6a24a; --c-rayon-2: #f3e2c0; --c-photo-fond: #d9b27c;
}
[data-style="Meeting"] {
  --c-fond: #0b0b0c; --c-texte: #ffffff; --c-accent: #b6ff2a; --c-nom: #ffffff;
  --c-slogan: #b6ff2a; --c-slogan-fond: transparent; --c-bande: #b6ff2a; --c-bande-texte: #0b0b0c;
  --c-cadre: #b6ff2a; --c-pastille: transparent; --c-pastille-texte: #ffffff; --c-pied: transparent; --c-pied-texte: #b5b5b5; --c-photo-fond: #1a1a1a;
}

/* ── La base, commune aux quatre ── */
.cp {
  --cp-t: 1; --cp-ech: 1;
  background: var(--c-fond); color: var(--c-texte); font-family: "Inter", system-ui, sans-serif; text-align: center; line-height: 1.15;
  align-items: center; justify-content: flex-start; padding: 0; position: relative;
}
.cp p, .cp ol { margin: 0; padding: 0; }
.cp [hidden] { display: none !important; }
.cp__tete { width: 100%; flex: none; display: flex; flex-direction: column; align-items: center; gap: .6cqw; padding: 3.6cqw 6cqw 3cqw; background: var(--c-bande); color: var(--c-bande-texte); }
.cp__kicker { font-weight: 700; font-size: 2.5cqw; letter-spacing: .22em; text-transform: uppercase; }
.cp__candidat { font-size: 2cqw; letter-spacing: .3em; text-transform: uppercase; opacity: .9; }
/* Candidat ou candidate : les deux mots sont dans la page, la feuille n'en montre qu'un. */
.cp[data-accord="Il"] [data-pour="Elle"], .cp[data-accord="Elle"] [data-pour="Il"] { display: none; }

.cp__photo { position: relative; flex: 1 1 0; min-height: 30cqw; width: 70cqw; margin: 4cqw 0 0; overflow: hidden; background: var(--c-photo-fond, rgba(0, 0, 0, .07)); isolation: isolate; }
.cp__photo img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: var(--photo-x, 50%) var(--photo-y, 40%); transform: scale(var(--photo-zoom, 1)); transform-origin: var(--photo-x, 50%) var(--photo-y, 40%); }
.cp__photo[data-photo] { touch-action: none; cursor: grab; }
.cp__vide { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 1.2cqw; cursor: pointer; border: 1px dashed currentColor; opacity: .75; padding: 10%; font-size: 2.4cqw; margin: 0; }
.cp__vide svg { width: 7cqw; height: auto; }

.cp__bloc { flex: none; width: 100%; padding: 0 7cqw 2.6cqw; display: flex; flex-direction: column; align-items: center; margin-top: 3.4cqw; }
.cp__nom { width: 100%; white-space: nowrap; overflow: hidden; text-overflow: clip; text-transform: uppercase; color: var(--c-nom); font-size: calc(9cqw * var(--cp-ech)); line-height: 1.05; letter-spacing: .02em; }
.cp__mouvement { color: var(--c-accent); font-weight: 700; font-size: calc(2.5cqw * var(--cp-t)); letter-spacing: .16em; text-transform: uppercase; margin-top: 1.2cqw; overflow-wrap: anywhere; }
.cp__slogan { color: var(--c-slogan); background: var(--c-slogan-fond); font-size: calc(5.4cqw * var(--cp-t)); line-height: 1.12; margin-top: 2.6cqw; max-width: 100%; overflow-wrap: anywhere; text-wrap: balance; }
.cp__promesses { margin-top: 3cqw; width: 100%; }
.cp__etiquette { color: var(--c-accent); font-weight: 700; font-size: calc(2cqw * var(--cp-t)); letter-spacing: .24em; text-transform: uppercase; margin-bottom: 1cqw; }
.cp__promesses ol { list-style: none; counter-reset: p; display: grid; gap: .9cqw; }
.cp__promesses li { counter-increment: p; font-size: calc(2.8cqw * var(--cp-t)); font-weight: 600; color: var(--c-pastille-texte); overflow-wrap: anywhere; }
.cp__promesses li::before { content: counter(p) ". "; color: var(--c-accent); font-weight: 800; }
.cp__pied { flex: none; width: 100%; margin-top: auto; padding: 2cqw 6cqw 4cqw; display: grid; gap: .5cqw; background: var(--c-pied); color: var(--c-pied-texte); }
.cp__scrutin { font-size: 2cqw; font-weight: 600; letter-spacing: .04em; }
.cp__mention { font-size: 1.9cqw; font-style: italic; overflow-wrap: anywhere; }
.cp__fictif { font-size: 1.55cqw; letter-spacing: .18em; text-transform: uppercase; opacity: .85; }

/* ══ Institutionnel — crème, bleu nuit et or : la bande du haut, la photo cernée d'or, le nom en capitales à empattements ══ */
.cp[data-style="Institutionnel"] .cp__tete { padding-top: 4cqw; }
.cp[data-style="Institutionnel"] .cp__photo { box-shadow: 0 0 0 .9cqw var(--c-fond), 0 0 0 1.5cqw var(--c-cadre); }
.cp[data-style="Institutionnel"] .cp__nom { font-family: "Playfair Display", Georgia, serif; font-weight: 900; }
.cp[data-style="Institutionnel"] .cp__slogan { font-family: "Playfair Display", Georgia, serif; font-style: italic; font-weight: 500; }
.cp[data-style="Institutionnel"] .cp__pied { background: var(--c-pied); padding: 2.4cqw 6cqw 3.4cqw; position: relative; }
/* La bande drapeau : trois tiers égaux, bleu, blanc, rouge, posés contre le bandeau marine (le blanc s'y lit, le bleu franc se distingue du marine). */
.cp[data-style="Institutionnel"] .cp__tete { position: relative; padding-bottom: 4cqw; }
.cp[data-style="Institutionnel"] .cp__tete::after,
.cp[data-style="Institutionnel"] .cp__pied::before {
  content: ""; position: absolute; left: 0; right: 0; height: 1.5cqw;
  background: linear-gradient(90deg, var(--c-drapeau-bleu) 0 33.34%, var(--c-drapeau-blanc) 33.34% 66.67%, var(--c-drapeau-rouge) 66.67% 100%);
}
.cp[data-style="Institutionnel"] .cp__tete::after { bottom: 0; }
.cp[data-style="Institutionnel"] .cp__pied::before { top: 0; }

/* ══ Pop — jaune soleil, duotone rose et indigo : le slogan en blanc sur un bloc penché, les promesses en autocollants ══ */
.cp[data-style="Pop"] .cp__kicker, .cp[data-style="Pop"] .cp__nom, .cp[data-style="Pop"] .cp__slogan { font-family: "Anton", Impact, sans-serif; font-weight: 400; }
.cp[data-style="Pop"] .cp__kicker { font-size: 3.2cqw; letter-spacing: .12em; }
.cp[data-style="Pop"] .cp__photo { width: 80cqw; background: var(--c-lumiere); transform: rotate(-2deg); box-shadow: 1.4cqw 1.4cqw 0 var(--c-ombre); }
/* Le duotone : la photo en gris multipliée sur la lumière, puis l'ombre posée en `lighten` par-dessus. Tous les canaux de
   l'ombre sont plus bas que ceux de la lumière : les noirs deviennent indigo, les blancs restent roses. */
.cp[data-style="Pop"] .cp__photo img { filter: grayscale(1) contrast(1.12); mix-blend-mode: multiply; }
.cp[data-style="Pop"] .cp__photo::after { content: ""; position: absolute; inset: 0; background: var(--c-ombre); mix-blend-mode: lighten; pointer-events: none; }
.cp[data-style="Pop"] .cp__vide { z-index: 2; color: var(--c-ombre); }
.cp[data-style="Pop"] .cp__nom { font-size: calc(11cqw * var(--cp-ech)); letter-spacing: .01em; }
.cp[data-style="Pop"] .cp__mouvement { margin-top: 1.8cqw; }
.cp[data-style="Pop"] .cp__slogan { margin-top: 3.6cqw; padding: 1.6cqw 3cqw; transform: rotate(-1.6deg); font-size: calc(5.8cqw * var(--cp-t)); letter-spacing: .02em; text-transform: uppercase; }
.cp[data-style="Pop"] .cp__promesses ol { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.2cqw; }
.cp[data-style="Pop"] .cp__promesses li { background: var(--c-pastille); padding: .6cqw 2cqw; border-radius: 99px; font-weight: 700; font-size: calc(2.5cqw * var(--cp-t)); }
.cp[data-style="Pop"] .cp__promesses li:nth-child(2) { transform: rotate(1.8deg); }
.cp[data-style="Pop"] .cp__promesses li:nth-child(3) { transform: rotate(-1.8deg); }
.cp[data-style="Pop"] .cp__promesses li::before { content: ""; }

/* ══ Rétro — orange brûlé et crème : la photo en sépia dans un ovale sur ses rayons, le slogan à la main ══ */
.cp[data-style="Rétro"] { background-image: repeating-conic-gradient(from 0deg at 50% 36%, var(--c-rayon-1) 0 6deg, var(--c-rayon-2) 6deg 12deg); background-size: 100% 100%; }
.cp[data-style="Rétro"] .cp__tete { padding-top: 4cqw; background: var(--c-fond); }
.cp[data-style="Rétro"] .cp__kicker { font-family: "Josefin Sans", Inter, sans-serif; font-weight: 700; letter-spacing: .3em; }
.cp[data-style="Rétro"] .cp__photo { width: 56cqw; border-radius: 50% / 46%; border: 1.4cqw solid var(--c-cadre); box-shadow: 0 0 0 1cqw var(--c-fond); }
.cp[data-style="Rétro"] .cp__photo img { filter: grayscale(1) sepia(.85) contrast(1.05) saturate(1.1); }
.cp[data-style="Rétro"] .cp__nom { font-family: "Playfair Display", Georgia, serif; font-style: italic; font-weight: 900; text-transform: none; font-size: calc(10cqw * var(--cp-ech)); }
.cp[data-style="Rétro"] .cp__bloc { background: var(--c-fond); padding: 2.2cqw 6cqw 2.4cqw; width: 88cqw; margin-top: 3cqw; border-radius: 3cqw; }
.cp[data-style="Rétro"] .cp__mouvement { font-family: "Josefin Sans", Inter, sans-serif; }
.cp[data-style="Rétro"] .cp__slogan { font-family: "Damion", cursive; font-size: calc(5.3cqw * var(--cp-t)); line-height: 1.1; margin-top: 1.4cqw; }
.cp[data-style="Rétro"] .cp__promesses { margin-top: 2cqw; }
.cp[data-style="Rétro"] .cp__promesses li { font-family: "Josefin Sans", Inter, sans-serif; }
.cp[data-style="Rétro"] .cp__pied { background: var(--c-fond); }

/* ══ Meeting — noir et vert fluo : la photo fondue dans le noir, le slogan en capitales fluo, comme une affiche de tournée ══ */
.cp[data-style="Meeting"] .cp__tete { padding: 3cqw 6cqw; width: auto; margin-top: 4cqw; border-radius: .8cqw; }
.cp[data-style="Meeting"] .cp__kicker { font-family: "Anton", Impact, sans-serif; font-weight: 400; font-size: 3cqw; letter-spacing: .14em; }
.cp[data-style="Meeting"] .cp__candidat { display: none; }
.cp[data-style="Meeting"] .cp__photo { width: 100%; margin-top: 3cqw; }
.cp[data-style="Meeting"] .cp__photo img { filter: grayscale(1) contrast(1.2) brightness(.95); }
.cp[data-style="Meeting"] .cp__photo::after { content: ""; position: absolute; inset: auto 0 0 0; height: 34%; background: linear-gradient(to bottom, transparent, var(--c-fond)); pointer-events: none; }
.cp[data-style="Meeting"] .cp__bloc { margin-top: -4cqw; position: relative; z-index: 1; }
.cp[data-style="Meeting"] .cp__nom { font-family: "Anton", Impact, sans-serif; font-weight: 400; font-size: calc(11cqw * var(--cp-ech)); letter-spacing: .03em; }
.cp[data-style="Meeting"] .cp__slogan { font-family: "Anton", Impact, sans-serif; font-weight: 400; text-transform: uppercase; letter-spacing: .02em; font-size: calc(7cqw * var(--cp-t)); line-height: 1.05; }
.cp[data-style="Meeting"] .cp__promesses li::before { content: "→ "; }
.cp[data-style="Meeting"] .cp__mouvement { color: var(--c-texte); }

/* ═══════════════════════════════ Le formulaire ═══════════════════════════════ */
.cp-section { border: 0; padding: 0; margin: 0 0 2.4rem; min-width: 0; }
.cp-section > legend { font-family: "Anton", Impact, sans-serif; font-size: 2rem; letter-spacing: .04em; text-transform: uppercase; padding: 0; margin-bottom: 1rem; }
.cp-styles, .cp-accords { display: flex; flex-wrap: wrap; gap: .8rem; margin-bottom: 1.2rem; }
.cp-styles input, .cp-accords input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.cp-styles label, .cp-accords label { display: inline-flex; align-items: center; gap: .6rem; min-height: 4.4rem; padding: .6rem 1.4rem; cursor: pointer; border: .1rem solid rgba(var(--color-foreground), .22); border-radius: 99px; font-size: 1.4rem; }
.cp-styles label { flex-direction: column; align-items: flex-start; border-radius: .8rem; gap: .3rem; padding: 1rem 1.4rem; min-width: 12rem; }
.cp-styles__nom { font-weight: 700; font-size: 1.6rem; }
.cp-styles small { font-size: 1.2rem; color: rgba(var(--color-foreground), .7); }
.cp-styles input:checked + label, .cp-accords input:checked + label { border-color: rgb(var(--color-foreground)); box-shadow: inset 0 0 0 .1rem rgb(var(--color-foreground)); }
.cp-styles input:focus-visible + label, .cp-accords input:focus-visible + label { outline: .2rem solid rgb(var(--bleu-focus)); outline-offset: .2rem; }
/* L'échantillon d'un style : trois traits aux couleurs du style, pour reconnaître l'affiche avant de la choisir. */
.cp-echantillon { display: flex; align-items: center; gap: .3rem; width: 100%; height: 2.4rem; padding: 0 .6rem; border-radius: .4rem; background: var(--c-fond); border: .1rem solid rgba(0, 0, 0, .12); }
.cp-echantillon i { flex: 1; height: .5rem; border-radius: .3rem; background: var(--c-accent); }
.cp-echantillon b { flex: 0 0 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--c-slogan-fond); border: .3rem solid var(--c-cadre); }
.cp-idees { display: flex; flex-wrap: wrap; gap: .6rem; margin: .4rem 0 1.4rem; }
.cp-idee { font: inherit; font-size: 1.2rem; min-height: 4.4rem; padding: .6rem 1.2rem; cursor: pointer; text-align: left; background: none; color: inherit; border: .1rem dashed rgba(var(--color-foreground), .3); border-radius: 99px; }
.cp-idee:hover { border-style: solid; border-color: rgb(var(--color-foreground)); }
.cp-de, .cp-hasard { font: inherit; min-height: 4.4rem; min-width: 4.4rem; cursor: pointer; background: none; color: inherit; border: .1rem solid rgba(var(--color-foreground), .3); border-radius: 99px; }
.cp-hasard { padding: .6rem 1.4rem; margin-bottom: 1rem; }
/* Sur téléphone, les idées défilent sur une rangée au doigt plutôt que de s'empiler. */
@media (max-width: 749px) {
  .cp-idees { flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: .4rem; -webkit-overflow-scrolling: touch; }
  .cp-idee { flex: none; scroll-snap-align: start; white-space: nowrap; }
}
