/* Bandeau de consentement aux traceurs.
   Feuille autonome, volontairement independante de theme.css : le bandeau doit
   s'afficher a l'identique sur le modele one-page et sur les pages legales, ou
   seule la feuille du theme parent est en place. Toutes les regles sont donc
   prefixees .an-consent et n'atteignent rien d'autre. Les couleurs reprennent
   la palette de la maquette, la typographie est heritee de la page. */

.an-consent {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 9000;
  box-sizing: border-box;
  padding: 1.25rem 1.5rem;
  background-color: #ffffff;
  border-top: 1px solid #cec3cf;
  box-shadow: 0 -8px 28px -10px rgba(48, 13, 71, 0.22);
  color: #1e1b19;
  /* Police declaree explicitement : le preflight de theme.css est confine a
     .an-page, et le bandeau vit hors de ce conteneur. Un font-family herite
     retomberait sur le serif par defaut du navigateur. */
  font-family: 'Plus Jakarta Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  opacity: 0;
  transform: translateY(100%);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.an-consent[hidden] {
  display: none;
}

.an-consent.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.an-consent *,
.an-consent *::before,
.an-consent *::after {
  box-sizing: border-box;
}

.an-consent__inner {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 72rem;
  margin: 0 auto;
}

.an-consent__body {
  flex: 1 1 auto;
  min-width: 0;
}

.an-consent__title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  color: #300d47;
}

.an-consent__text {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.55;
  color: #4b444e;
}

.an-consent__text a {
  color: #7c5800;
  text-decoration: underline;
}

.an-consent__actions {
  display: flex;
  flex-wrap: wrap;
  flex: 0 0 auto;
  gap: 0.75rem;
}

/* Les deux boutons partagent strictement la meme geometrie et le meme poids :
   refuser se voit et se clique aussi facilement qu'accepter. */
.an-consent__btn {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  margin: 0;
  padding: 0.75rem 1.5rem;
  border: 2px solid transparent;
  border-radius: 0.5rem;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.an-consent__btn--accept {
  background-color: #d4a853;
  border-color: #d4a853;
  color: #300d47;
}

.an-consent__btn--accept:hover {
  background-color: #e2b967;
  border-color: #e2b967;
}

.an-consent__btn--refuse {
  background-color: #ffffff;
  border-color: #300d47;
  color: #300d47;
}

.an-consent__btn--refuse:hover {
  background-color: #f4ece8;
}

.an-consent__btn:focus-visible {
  outline: 2px solid #7c5800;
  outline-offset: 3px;
}

/* Rappel du choix en cours lorsque le visiteur rouvre le bandeau depuis le
   pied de page, pour savoir ce qu'il revient sur. */
.an-consent[data-an-current="granted"] .an-consent__btn--accept::before,
.an-consent[data-an-current="denied"] .an-consent__btn--refuse::before {
  content: "\2713";
  margin-right: 0.5rem;
  font-weight: 700;
}

@media (min-width: 900px) {
  .an-consent__inner {
    flex-direction: row;
    align-items: center;
    gap: 2rem;
  }
}

@media (max-width: 30rem) {
  .an-consent {
    padding: 1rem 1.25rem;
  }

  .an-consent__actions {
    width: 100%;
  }

  .an-consent__btn {
    flex: 1 1 0;
    padding: 0.75rem 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .an-consent,
  .an-consent__btn {
    transition: none;
  }
}
