/* La République en débats — page d'accueil
   Trois mises en page : ordinateur (>= 1200 px), tablette (768–1199 px), téléphone (< 768 px). */

@font-face {
  font-family: "Lora";
  src: url("/assets/fonts/lora-variable.woff") format("woff");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Lora";
  src: url("/assets/fonts/lora-italic-variable.woff") format("woff");
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
}

:root {
  --marine: #0B2F5E;
  --marine-fonce: #002D60;
  --rouge: #C8161D;
  --rouge-vif: #E30613;
  --encre: #0B1424;
  --bleu-tricolore: #1F3F8F;
  --fond-carte: #F7F9FC;
  --bordure: #C9D6EA;
  --creme: #F6EFE6;
  --gris: #5B6575;
  --serif: "Lora", Georgia, "Times New Roman", serif;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --largeur: 1440px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--encre);
  background: #fff;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
button { font: inherit; color: inherit; }

.sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.lien-evitement {
  position: absolute; left: 12px; top: -60px; z-index: 10;
  background: var(--marine); color: #fff; padding: 10px 16px; border-radius: 6px;
}
.lien-evitement:focus { top: 12px; }

:focus-visible { outline: 3px solid var(--rouge-vif); outline-offset: 2px; }

/* ---------- Ruban tricolore (coin supérieur gauche) ---------- */
.ruban-cadre { position: absolute; inset: 0 0 auto 0; height: 200px; overflow: hidden; pointer-events: none; }
.ruban {
  position: absolute; top: -40px; left: -60px; width: 230px; height: 46px;
  transform: rotate(-52deg); transform-origin: center;
  background: linear-gradient(to bottom, #1E3A8F 0 33.3%, #fff 33.3% 66.6%, var(--rouge-vif) 66.6% 100%);
  box-shadow: 0 0 0 1px rgba(11, 47, 94, .08);
  pointer-events: none;
}

/* ---------- En-tête ---------- */
.entete {
  position: relative;
  max-width: var(--largeur); margin: 0 auto;
  padding: 14px 40px 12px 120px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  border-bottom: 3px solid var(--marine);
}
.entete__marque { display: flex; align-items: center; gap: 22px; }
.logo { display: inline-flex; align-items: center; gap: 8px; color: var(--marine); text-decoration: none; }
.logo__picto { width: 46px; height: 46px; }
.logo__mot {
  font-family: var(--sans); font-weight: 900; font-size: 30px; letter-spacing: -.02em; line-height: 1;
  position: relative; padding-bottom: 6px;
}
.logo__mot::after {
  content: ""; position: absolute; left: 4px; right: -2px; bottom: 0; height: 5px;
  background: var(--rouge-vif); border-radius: 50% / 100% 100% 0 0; transform: rotate(-2deg);
}
.entete__devise {
  margin: 0; padding-left: 22px; border-left: 2px solid var(--marine);
  display: flex; flex-direction: column; line-height: 1.25;
}
.entete__devise em { font-family: var(--serif); font-weight: 700; font-size: 22px; color: var(--marine); }
.entete__devise span { font-family: var(--serif); font-size: 15px; color: var(--encre); }
.entete__nav ul {
  list-style: none; margin: 0; padding: 0 0 8px; display: flex; gap: 10px; align-items: center;
  border-top: 2px solid var(--marine); border-bottom: 2px solid var(--marine); padding-top: 6px;
  position: relative;
}
.entete__nav li {
  font-family: var(--serif); font-weight: 700; font-size: 15px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--marine);
}
.entete__nav li + li::before { content: "•"; color: var(--rouge-vif); margin-right: 10px; }
.entete__nav ul::after {
  content: ""; position: absolute; left: 50%; bottom: -8px; width: 74px; height: 6px; transform: translateX(-50%);
  background: linear-gradient(to right, var(--marine) 0 40%, transparent 40% 60%, var(--rouge-vif) 60% 100%);
}

/* ---------- Grille principale ---------- */
.accueil {
  max-width: var(--largeur); margin: 0 auto; padding: 28px 40px 8px;
  display: grid; gap: 24px 36px;
}

/* ---------- Titre ---------- */
.titre__nom {
  margin: 0; font-family: var(--serif); font-weight: 700; color: var(--encre);
  font-size: clamp(52px, 7.4vw, 118px); line-height: .92; letter-spacing: -.025em;
}
.titre__en {
  display: inline-block; font-style: italic; color: var(--rouge); position: relative; padding-right: .06em;
}
.titre__en::after {
  content: ""; position: absolute; left: -2%; right: 4%; bottom: -.04em; height: .07em;
  background: var(--rouge); border-radius: 50%; transform: rotate(-3deg);
}
.titre__accroche {
  margin: .45em 0 0; font-family: var(--serif); font-style: italic; font-weight: 600;
  font-size: clamp(20px, 2.15vw, 34px); color: var(--marine-fonce);
}
.titre__signature { margin: 10px 0 0; font-size: 15px; font-weight: 700; color: var(--marine); }
.titre__signature span { font-weight: 400; color: var(--gris); }

/* ---------- Cartes de connexion ---------- */
.connexions { display: grid; gap: 26px; align-content: start; }
.carte {
  position: relative; background: #fff; border: 2px solid var(--marine); border-radius: 14px;
  padding: 0 0 18px; overflow: hidden; box-shadow: 0 6px 18px rgba(11, 47, 94, .12);
}
.carte__titre {
  margin: 0 0 16px; padding: 10px 22px 10px 30px; display: flex; align-items: center; gap: 14px;
  background: var(--marine); color: #fff; font-family: var(--serif); font-weight: 700; font-size: 30px;
  border-left: 10px solid var(--rouge-vif);
}
.carte__titre svg { width: 34px; height: 34px; flex: none; }
.champ { position: relative; margin: 0 22px 12px 62px; }
.champ__icone {
  position: absolute; left: -42px; top: 50%; width: 26px; height: 26px; transform: translateY(-50%); color: var(--encre);
}
.champ input {
  width: 100%; height: 44px; padding: 0 46px 0 14px;
  border: 1.5px solid #7F9CCB; border-radius: 9px; background: #fff;
  font-family: var(--serif); font-size: 17px; color: var(--encre);
}
.champ input::placeholder { color: #1E2A3B; opacity: .85; }
.champ input:focus { border-color: var(--marine); box-shadow: 0 0 0 3px rgba(11, 47, 94, .18); outline: none; }
.champ input[aria-invalid="true"] { border-color: var(--rouge-vif); }
.champ__oeil {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border: 0; background: transparent; border-radius: 6px; cursor: pointer; color: var(--encre);
  display: grid; place-items: center;
}
.champ__oeil svg { width: 22px; height: 22px; }
.champ__oeil[aria-pressed="true"] { color: var(--rouge); }

.bouton {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  width: calc(100% - 44px); margin: 6px 22px 0; min-height: 48px; padding: 8px 18px;
  border: 0; border-radius: 10px; cursor: pointer; color: #fff;
  font-family: var(--serif); font-weight: 700; font-size: 22px;
  box-shadow: 0 3px 0 rgba(0, 0, 0, .18);
}
.bouton svg { width: 26px; height: 26px; }
.bouton--rouge { background: linear-gradient(#E0161E, #B3121A); }
.bouton--rouge:hover { background: #A30F16; }
.bouton--marine { background: linear-gradient(#123E78, var(--marine)); }
.bouton--marine:hover { background: #082448; }
.bouton[aria-busy="true"] { opacity: .7; cursor: progress; }
.carte__lien {
  display: block; margin: 12px auto 0; width: max-content; font-family: var(--serif); font-style: italic;
  font-size: 15px; color: var(--marine); text-underline-offset: 3px;
}
.carte__aide { margin: 12px 22px 0; font-size: 13px; color: var(--gris); text-align: center; }
.carte__message { margin: 6px 22px 0; min-height: 0; font-size: 14px; color: var(--marine); text-align: center; }
.carte__message.erreur { color: var(--rouge); font-weight: 600; }

/* ---------- Titres de section ---------- */
.titre-section {
  margin: 0 0 14px; display: flex; align-items: center; gap: 12px;
  font-family: var(--serif); font-weight: 700; font-size: 25px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--encre);
}
.titre-section::before { content: ""; width: 10px; height: 26px; background: var(--rouge-vif); flex: none; }
.titre-section::after { content: ""; height: 2px; background: var(--rouge-vif); flex: 1; max-width: 140px; }

/* ---------- Partis ---------- */
.partis__liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.parti {
  display: flex; align-items: stretch; width: 100%; max-width: 400px; min-height: 40px;
  padding: 0; border: 0; background: transparent; cursor: pointer; text-align: left;
}
.parti__picto {
  flex: none; width: 104px; display: grid; place-items: center; color: #fff; background: var(--c);
  clip-path: polygon(14% 0, 100% 0, 86% 100%, 0 100%);
}
.parti__picto svg { width: 26px; height: 26px; }
.parti__nom {
  flex: 1; display: flex; align-items: center; margin-left: -10px; padding: 4px 26px 4px 22px;
  background: linear-gradient(to right, var(--creme), #FBF7F1 85%, rgba(251, 247, 241, 0));
  clip-path: polygon(3% 0, 100% 0, 96% 100%, 0 100%);
  font-family: var(--serif); font-weight: 700; font-size: 20px; color: var(--encre); letter-spacing: -.01em;
}
.parti:hover .parti__nom, .parti:focus-visible .parti__nom { background: #EFE3D2; }
.parti[data-parti="gr"] { --c: #C00216; }
.parti[data-parti="sd"] { --c: #F91536; }
.parti[data-parti="ec"] { --c: #528E02; }
.parti[data-parti="cr"] { --c: #FA9601; }
.parti[data-parti="dr"] { --c: #005EB4; }
.parti[data-parti="dn"] { --c: #002D60; }

/* ---------- Palais ---------- */
.palais { margin: 0; align-self: center; }
.palais img { width: 100%; }

/* ---------- Thèmes ---------- */
.themes .titre-section::after { max-width: none; }
.themes__liste { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); }
.themes__liste li + li { border-left: 3px solid var(--rouge-vif); }
.theme {
  width: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 6px 8px 14px; border: 0; cursor: pointer;
  background: radial-gradient(ellipse 46% 28% at 50% 78%, #E9ECF1 0 92%, transparent 100%);
}
.theme img { width: auto; height: 64px; }
.theme span { font-family: var(--serif); font-style: italic; font-weight: 700; font-size: 25px; color: var(--encre); }
.theme:hover span, .theme:focus-visible span { color: var(--rouge); }

/* ---------- Pied de page ---------- */
.pied { margin-top: 10px; position: relative; }
.pied__paris { width: 100%; height: clamp(90px, 10vw, 170px); object-fit: cover; object-position: center bottom; }
.pied__mentions {
  position: absolute; left: 0; right: 0; bottom: 0;
  margin: 0; padding: 6px 20px 8px; text-align: center; font-size: 12.5px; color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .45);
}

/* ---------- Fiche (boîte de dialogue) ---------- */
.fiche {
  width: min(520px, 92vw); border: 2px solid var(--marine); border-radius: 14px; padding: 0;
  box-shadow: 0 20px 50px rgba(11, 20, 36, .35);
}
.fiche::backdrop { background: rgba(11, 20, 36, .55); }
.fiche form { padding: 22px 24px 20px; }
.fiche__etiquette { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--rouge); }
.fiche__titre { margin: 6px 0 10px; font-family: var(--serif); font-size: 28px; color: var(--marine); }
.fiche__texte { margin: 0 0 18px; font-family: var(--serif); font-size: 19px; line-height: 1.45; }
.fiche__fermer { width: auto; margin: 0 0 0 auto; font-size: 18px; min-height: 42px; padding: 6px 22px; }

/* =========================================================
   ORDINATEUR (>= 1200 px)
   ========================================================= */
@media (min-width: 1200px) {
  .accueil {
    padding-top: 22px;
    grid-template-columns: minmax(0, 410px) minmax(0, 1fr) minmax(360px, 410px);
    column-gap: 28px;
    grid-template-areas:
      "titre titre connexions"
      "partis palais connexions"
      "themes themes themes";
  }
  .titre { grid-area: titre; }
  .connexions {
    grid-area: connexions; padding-left: 36px; border-left: 3px solid var(--rouge-vif);
    align-self: start;
  }
  .partis { grid-area: partis; align-self: end; }
  .palais { grid-area: palais; }
  .themes { grid-area: themes; }
}

/* Ordinateur : toutes les tailles suivent la hauteur de la fenêtre,
   pour que la page tienne sur un écran quelle que soit la place prise par le navigateur. */
@media (min-width: 1200px) {
  .entete { padding-top: min(14px, 1.2vh); padding-bottom: min(12px, 1vh); }
  .logo__picto { width: min(46px, 4.6vh); height: min(46px, 4.6vh); }
  .logo__mot { font-size: min(30px, 3vh); }
  .entete__devise em { font-size: min(22px, 2.2vh); }
  .entete__devise span { font-size: min(15px, 1.5vh); }
  .entete__nav li { font-size: min(15px, 1.5vh); }
  .accueil { padding-top: min(22px, 1.8vh); row-gap: min(18px, 1.5vh); }
  .titre__nom { font-size: min(7.4vw, 8.8vh); }
  .titre__accroche { font-size: min(2.15vw, 3vh); }
  .titre__signature { font-size: max(12px, min(15px, 1.4vh)); margin-top: min(10px, .8vh); }
  .titre-section { font-size: min(25px, 2.3vh); margin-bottom: min(14px, 1.1vh); }
  .titre-section::before { height: min(26px, 2.4vh); }
  /* Partis et palais aux proportions de la maquette (bandeaux ≈ 3,9 % et palais ≈ 31 % de la hauteur) */
  .titre__signature { display: none; }
  .partis__liste { gap: min(4px, .35vh); }
  .parti { max-width: none; min-height: min(46px, 4vh); }
  .parti__picto { width: min(118px, 10.8vh); }
  .parti__nom { font-size: min(22px, 2.1vh); padding-top: 2px; padding-bottom: 2px; white-space: nowrap; padding-right: 12px; }
  .parti__picto svg { width: min(34px, 3.2vh); height: min(34px, 3.2vh); }
  .palais { margin-left: -48px; margin-right: -8px; position: relative; z-index: 0; }
  .partis { position: relative; z-index: 1; }
  .palais img { max-height: 33.5vh; width: auto; max-width: 100%; margin: 0 auto; }
  .connexions { gap: min(20px, 1.8vh); }
  .carte { padding-bottom: min(18px, 1.5vh); }
  .carte__titre { font-size: min(27px, 2.6vh); padding-top: min(7px, .6vh); padding-bottom: min(7px, .6vh); margin-bottom: min(12px, 1.1vh); }
  .carte__titre svg { width: min(34px, 3.2vh); height: min(34px, 3.2vh); }
  .champ { margin-bottom: min(9px, .8vh); }
  .champ input { height: min(40px, 3.8vh); font-size: max(14px, min(17px, 1.65vh)); }
  .champ__icone { width: min(26px, 2.5vh); height: min(26px, 2.5vh); }
  .bouton { min-height: min(44px, 4.2vh); font-size: min(22px, 2.1vh); padding-top: 4px; padding-bottom: 4px; }
  .bouton svg { width: min(26px, 2.4vh); height: min(26px, 2.4vh); }
  .carte__lien { margin-top: min(12px, 1vh); font-size: max(13px, min(15px, 1.45vh)); }
  .carte__aide { margin-top: min(12px, 1vh); font-size: max(12px, min(13px, 1.3vh)); }
  .theme { padding-top: min(6px, .5vh); padding-bottom: min(14px, 1.1vh); }
  .theme img { height: min(72px, 6vh); }
  .theme span { font-size: min(23px, 2.2vh); }
  .pied { margin-top: min(10px, .8vh); }
  .pied__paris { height: min(170px, 13vh); }
}

/* Ordinateur : proportions de la maquette originale.
   Bandeaux des partis collés au palais, blanc renvoyé sur les bords extérieurs ;
   encarts de connexion étalés sur la hauteur du titre et des partis ;
   bandeau de Paris entier, son ciel blanc passant sous les thèmes. */
@media (min-width: 1200px) {
  .entete, .accueil { max-width: 1640px; }
  .accueil {
    /* Colonne du palais à la largeur du dessin : ligne rouge et encarts collés à l'Élysée,
       le blanc restant part à droite des encarts. */
    grid-template-columns: minmax(0, 440px) minmax(0, max-content) minmax(360px, 420px);
    justify-content: start;
    column-gap: clamp(32px, 3.2vw, 64px);
    padding-left: clamp(40px, 6vw, 120px); padding-right: clamp(40px, 4vw, 80px);
    grid-template-areas:
      "titre titre connexions"
      "partis palais connexions"
      "themes themes themes";
  }
  .titre { position: relative; z-index: 2; }
  .partis { position: relative; z-index: 1; align-self: end; }
  .parti { min-height: min(50px, 4.5vh); }
  .parti__picto { width: min(130px, 12vh); }
  .parti__picto svg { width: min(38px, 3.6vh); height: min(38px, 3.6vh); }
  .parti__nom { font-size: min(25px, 2.4vh); }
  .palais {
    position: relative; z-index: 0; align-self: end; justify-self: start;
    margin: calc(-1 * min(110px, 10vh)) 0 0 -36px;
  }
  .palais img { max-height: 43vh; max-width: 100%; }
  .connexions {
    grid-row: 1 / 3; padding-left: clamp(32px, 3vw, 60px); align-self: stretch; display: flex; flex-direction: column;
    justify-content: space-between; gap: min(20px, 1.8vh); padding-top: clamp(0px, 5vh - 30px, 30px);
  }
  .carte__titre { font-size: min(34px, 3.3vh); }
  .carte__titre svg { width: min(40px, 3.8vh); height: min(40px, 3.8vh); }
  .themes { position: relative; z-index: 1; }
  .theme { background: radial-gradient(ellipse 46% 26% at 50% 80%, rgba(233, 236, 241, .92) 0 92%, transparent 100%); }
  .theme span { font-size: min(27px, 2.6vh); }
  /* Bandeau de Paris affiché en entier, de la pointe de la tour Eiffel (y = 0) à une bande d'eau
     (y = 315 sur 384) pour la mention. Seule la bande de ciel du haut (y < 100), où il n'y a que la
     tour Eiffel au bord droit, passe sous les thèmes. */
  .pied {
    overflow: hidden; height: calc(100vw * 315 / 2894);
    margin-top: calc(-100vw * 100 / 2894);
  }
  .pied__paris { position: absolute; left: 0; bottom: calc(-100vw * 69 / 2894); width: 100%; height: auto; object-fit: fill; }
}

/* Écrans d'ordinateur peu hauts (portables) : encarts de connexion plus compacts */
@media (min-width: 1200px) and (max-height: 700px) {
  .connexions { gap: 8px; }
  .carte { padding-bottom: 8px; }
  .carte__titre { margin-bottom: 6px; }
  .carte__lien { margin-top: 4px; }
  .carte__aide { margin-top: 4px; line-height: 1.25; }
  .pied__mentions { padding-bottom: 3px; font-size: 11.5px; }
  .theme { padding-bottom: 6px; }
  .accueil { row-gap: 8px; }
}

/* =========================================================
   TABLETTE (768–1199 px)
   ========================================================= */
@media (min-width: 768px) and (max-width: 1199px) {
  .entete { padding-left: 96px; flex-wrap: wrap; row-gap: 10px; }
  .entete__devise { white-space: nowrap; }
  .entete__nav { flex-basis: 100%; display: flex; justify-content: center; }
  .entete__nav li { font-size: 13px; letter-spacing: .06em; }
  .entete__nav li + li::before { margin-right: 6px; }
  .accueil {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
    grid-template-areas:
      "titre titre"
      "connexions connexions"
      "partis palais"
      "themes themes";
  }
  .titre { grid-area: titre; text-align: center; }
  .connexions { grid-area: connexions; grid-template-columns: 1fr 1fr; }
  .partis { grid-area: partis; align-self: center; }
  .palais { grid-area: palais; }
  .themes { grid-area: themes; }
  .themes__liste { grid-template-columns: repeat(3, 1fr); row-gap: 18px; }
  .themes__liste li:nth-child(4) { border-left: 0; }
  .carte__titre { font-size: 26px; }
  .parti__picto { width: 76px; }
  .parti__nom { font-size: 17px; }
}

/* =========================================================
   TÉLÉPHONE (< 768 px)
   ========================================================= */
@media (max-width: 767px) {
  .ruban { left: auto; right: -70px; top: -34px; width: 200px; height: 36px; transform: rotate(52deg); }
  .entete { padding: 12px 18px 10px; }
  .entete__devise, .entete__nav { display: none; }
  .logo__picto { width: 40px; height: 40px; }
  .logo__mot { font-size: 26px; }
  .accueil { padding: 20px 18px 4px; gap: 22px; grid-template-columns: minmax(0, 1fr); }
  .titre { order: 1; }
  .connexions { order: 2; }
  .palais { order: 3; }
  .partis { order: 4; }
  .themes { order: 5; }
  .titre__nom { font-size: clamp(42px, 13vw, 64px); }
  .titre__accroche { font-size: 19px; }
  .titre__signature { font-size: 13px; }
  .carte__titre { font-size: 24px; padding-left: 20px; }
  .champ { margin-left: 52px; margin-right: 16px; }
  .champ__icone { left: -36px; width: 22px; height: 22px; }
  .bouton { width: calc(100% - 32px); margin-left: 16px; margin-right: 16px; font-size: 20px; }
  .titre-section { font-size: 19px; }
  .titre-section::after { max-width: none; }
  .parti { max-width: none; min-height: 44px; }
  .parti__picto { width: 70px; }
  .parti__nom { font-size: 17px; }
  .themes__liste { grid-template-columns: repeat(2, 1fr); row-gap: 14px; }
  .themes__liste li + li { border-left: 0; }
  .themes__liste li:nth-child(even) { border-left: 3px solid var(--rouge-vif); }
  .theme img { height: 56px; }
  .theme span { font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
