/**
 * Habillage de la popin de consentement.
 *
 * La librairie tarteaucitron a changé de thème entre la 20210509 (production
 * avant migration) et la 1.34 : fond sombre -> fond clair, accent vert -> jaune,
 * glyphes ✓/✗ -> cases à cocher ☐/☑. On rétablit ici le rendu attendu.
 *
 * Les règles de la librairie utilisent !important ; on les surcharge donc avec
 * une spécificité supérieure (préfixe html body) plutôt qu'en comptant sur
 * l'ordre du cascade, que l'agrégation CSS peut réordonner.
 *
 * ATTENTION : .tarteaucitronMainLine porte AUSSI la classe .tarteaucitronLine.
 * Les règles qui les distinguent ont la même spécificité, donc l'ordre à
 * l'intérieur de ce fichier compte : MainLine doit rester après Line.
 */

/* ------------------------------------------------------------------ *
 * Police
 * ------------------------------------------------------------------ */

/**
 * La production imposait `font-family: sans-serif !important` sur toute la
 * popin. La 1.34 a retiré cette règle et ne pose plus que `font: inherit` sur
 * les enfants du root : la popin hérite donc désormais de la police du thème
 * (Montserrat sur ce site). On rétablit la police neutre d'origine.
 */
html body #tarteaucitronRoot * {
  font-family: sans-serif !important;
}

/* ------------------------------------------------------------------ *
 * Glyphes des puces
 * ------------------------------------------------------------------ */

html body #tarteaucitronRoot .tarteaucitronCheck::before,
html body #tarteaucitronRoot .tarteaucitronAllow .tarteaucitronCheck::before,
html body #tarteaucitronRoot .tarteaucitronIsAllowed .tarteaucitronAllow .tarteaucitronCheck::before,
html body #tarteaucitronRoot .tarteaucitronIsDenied .tarteaucitronAllow .tarteaucitronCheck::before,
html body #tarteaucitronRoot #tarteaucitronServices_mandatory .tarteaucitronCheck::before {
  content: '\2713' !important;
  /* les puces sont toujours posées sur un bouton coloré : blanc, comme en production */
  color: #fff !important;
}

html body #tarteaucitronRoot .tarteaucitronCross::before,
html body #tarteaucitronRoot .tarteaucitronDeny .tarteaucitronCross::before,
html body #tarteaucitronRoot .tarteaucitronIsAllowed .tarteaucitronDeny .tarteaucitronCross::before,
html body #tarteaucitronRoot .tarteaucitronIsDenied .tarteaucitronDeny .tarteaucitronCross::before {
  content: '\2717' !important;
  color: #fff !important;
}

/* Le « + » des catégories, posé sur un bandeau sombre */
html body #tarteaucitronRoot .tarteaucitronPlus::before {
  color: #fff !important;
}

/* ------------------------------------------------------------------ *
 * Bandeau initial
 * ------------------------------------------------------------------ */

html body #tarteaucitronRoot #tarteaucitronAlertBig {
  background: #333 !important;
  color: #fff !important;
}

html body #tarteaucitronRoot #tarteaucitronAlertBig #tarteaucitronDisclaimerAlert,
html body #tarteaucitronRoot #tarteaucitronAlertBig #tarteaucitronDisclaimerAlert strong,
html body #tarteaucitronRoot #tarteaucitronAlertBig #tarteaucitronDisclaimerAlert a {
  color: #fff !important;
}

/* Bouton « Ok, tout accepter » */
html body #tarteaucitronRoot #tarteaucitronAlertBig #tarteaucitronPersonalize2 {
  background: #008300 !important;
  color: #fff !important;
}

/* Bouton « Personnaliser » : blanc sur le bandeau sombre */
html body #tarteaucitronRoot #tarteaucitronAlertBig #tarteaucitronCloseAlert {
  background: #fff !important;
  color: #333 !important;
}

/* La 1.34 masque les puces dans les boutons du bandeau ; on rétablit le ✓ */
html body #tarteaucitronRoot button#tarteaucitronPersonalize2 .tarteaucitronCheck {
  display: inline !important;
}

/* ------------------------------------------------------------------ *
 * Panneau de personnalisation
 * ------------------------------------------------------------------ */

html body #tarteaucitron .tarteaucitronBorder {
  background: #fff !important;
  border: 2px solid #333 !important;
  /* la 1.34 force border-color: #fff en !important sur ce même élément */
  border-color: #333 !important;
  border-top: 0 !important;
}

/* Lignes de service */
html body #tarteaucitron #tarteaucitronServices .tarteaucitronLine {
  background: rgba(51, 51, 51, 0.1) !important;
}

html body #tarteaucitron #tarteaucitronServices .tarteaucitronLine:hover {
  background: rgba(51, 51, 51, 0.2) !important;
}

/* En-tête du panneau : titre, texte d'information et les deux boutons.
   Doit rester APRES les règles .tarteaucitronLine ci-dessus. */
html body #tarteaucitron #tarteaucitronServices .tarteaucitronMainLine,
html body #tarteaucitron #tarteaucitronServices .tarteaucitronMainLine:hover {
  background: #333 !important;
  border-color: #333 !important;
}

html body #tarteaucitronRoot .tarteaucitronH1,
html body #tarteaucitronRoot .tarteaucitronH2,
html body #tarteaucitron #tarteaucitronServices .tarteaucitronMainLine .tarteaucitronName a,
html body #tarteaucitron #tarteaucitronServices .tarteaucitronMainLine .tarteaucitronName button {
  color: #fff !important;
}

html body #tarteaucitron #tarteaucitronClosePanel {
  background: #333 !important;
  color: #fff !important;
}

/* Texte d'information : la 1.34 le passe en gras */
html body #tarteaucitron #tarteaucitronInfo {
  background: #333 !important;
  color: #fff !important;
  font-weight: 500 !important;
}

/* Titres de catégorie et détails repliés */
html body #tarteaucitron #tarteaucitronServices .tarteaucitronTitle button,
html body #tarteaucitron #tarteaucitronServices .tarteaucitronDetails {
  background: #333 !important;
  color: #fff !important;
}

/* Boutons Autoriser / Interdire de chaque service : gris estompé au repos... */
html body #tarteaucitron #tarteaucitronServices .tarteaucitronLine .tarteaucitronAsk .tarteaucitronAllow,
html body #tarteaucitron #tarteaucitronServices .tarteaucitronLine .tarteaucitronAsk .tarteaucitronDeny {
  background: gray !important;
  color: #fff !important;
  border: 0 !important;
  border-radius: 4px !important;
  padding: 6px 10px !important;
  opacity: 0.4;
}

/* ... puis vert / rouge sur le choix retenu */
html body #tarteaucitron #tarteaucitronServices .tarteaucitronLine.tarteaucitronIsAllowed .tarteaucitronAllow {
  background-color: #1b870b !important;
  opacity: 1;
}

html body #tarteaucitron #tarteaucitronServices .tarteaucitronLine.tarteaucitronIsDenied .tarteaucitronDeny {
  background-color: #9c1a1a !important;
  opacity: 1;
}

/* Boutons « Autoriser / Refuser tous les cookies » en tête de panneau */
html body #tarteaucitron #tarteaucitronServices #tarteaucitronAllAllowed.tarteaucitronIsSelected {
  background-color: #1b870b !important;
}

html body #tarteaucitron #tarteaucitronServices #tarteaucitronAllDenied.tarteaucitronIsSelected,
html body #tarteaucitron #tarteaucitronServices #tarteaucitronAllDenied2.tarteaucitronIsSelected {
  background-color: #9c1a1a !important;
}

/* Boutons d'action : vert de production plutôt que le jaune de la 1.34 */
html body #tarteaucitronRoot .tarteaucitronCTAButton,
html body #tarteaucitronRoot .tarteaucitronAllow,
html body #tarteaucitron #tarteaucitronPrivacyUrlDialog {
  background: #008300 !important;
  color: #fff !important;
}

html body #tarteaucitronRoot .tarteaucitronDeny {
  background: #9c1a1a !important;
  color: #fff !important;
}

/**
 * Statut et nombre de cookies par service (« autorisé - Ce service peut déposer
 * 3 cookies. »). La 1.34 génère bien ce bloc mais le masque par défaut ; les
 * libellés français sont fournis par le fichier de langue de la librairie.
 */
html body #tarteaucitronRoot .tarteaucitronStatusInfo {
  display: block !important;
}

/* Le bouton « Enregistrer » n'existait pas dans l'implémentation précédente */
html body #tarteaucitronRoot #tarteaucitronSave {
  display: none !important;
}

/* Ordre des catégories : « Autre » en dernier, après « Mesure d'audience ».
   La librairie trie les catégories par libellé traduit, ce qui place « Autre »
   avant « Mesure d'audience » en français. */
html body #tarteaucitron .tarteaucitronBorder > ul {
  display: flex;
  flex-direction: column;
}

html body #tarteaucitron .tarteaucitronBorder > ul > li {
  order: 0;
}

html body #tarteaucitron .tarteaucitronBorder > ul > li#tarteaucitronServicesTitle_other {
  order: 1;
}

html body #tarteaucitron #tarteaucitronPrivacyUrl {
  background: #fff !important;
  color: #333 !important;
}
