/*
 * Décor « Bandeau simple » (apps/site/lib/habillages.ts, choisi par promotion dans
 * la Console depuis le 25/11/2026) : le bandeau seul, bleu foncé de la charte ; le reste du site ne change pas.
 *
 * Chargé avec le bandeau (components/site/habillage.tsx) SEULEMENT pendant
 * les jours d’une promotion qui porte ce décor : hors offre, il ne pèse rien.
 * Couleurs de la charte Bob (docs/charte-bob.md), contrastes AA.
 *
 * Deux préfixes, et aucun autre (habillages.test.mjs) :
 *  - le bandeau : .habillage-bandeau[data-habillage='bandeau'] ;
 *  - le reste du site, repéré au bandeau, premier enfant du <body> :
 *    body:has(> .habillage-bandeau[data-habillage='bandeau']).
 * Deux variantes du bandeau (components/site/bandeau-operation.tsx) :
 * data-variante='remise' (tout le bandeau est le lien) et 'code' (le code à
 * saisir, ses conditions, puis le lien).
 *
 * Animations lentes, sans clignotement (WCAG 2.3.1), coupées quand le
 * visiteur demande moins d’animations.
 */

.habillage-bandeau[data-habillage='bandeau'],
.habillage-bandeau[data-habillage='bandeau'] * {
  --d-fond: #1251c7;
  --d-encre: #fff;
  --d-encre-douce: rgb(255 255 255 / 0.9);
  --d-puce: #ffd13d;
  --d-encre-puce: #21316a;
  --d-lien: #fff;
  --d-focus: #ffd13d;
  --d-bon-fond: #fff;
  --d-bon-encre: #21316a;
  --d-bon-bord: #ffd13d;
}

/* ------------------------------------------------------------------------
   Le bandeau d’opération, en tête de toutes les pages
   ------------------------------------------------------------------------ */
.habillage-bandeau[data-habillage='bandeau'] {
  background: var(--d-fond);
  color: var(--d-encre);
}
/* Remise : tout le bandeau est le lien */
.habillage-bandeau[data-habillage='bandeau'] > .habillage-bandeau-lien {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 12px;
  min-height: 44px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 8px 16px;
  font-size: 14px;
  line-height: 1.35;
  text-align: center;
  color: inherit;
  text-decoration: none;
}
.habillage-bandeau[data-habillage='bandeau']
  .habillage-bandeau-lien:focus-visible {
  outline: 3px solid var(--d-focus);
  outline-offset: -4px;
}
.habillage-bandeau[data-habillage='bandeau'] .habillage-bandeau-nom {
  font-weight: 800;
}
.habillage-bandeau[data-habillage='bandeau'] .habillage-bandeau-remise {
  display: inline-block;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--d-puce);
  color: var(--d-encre-puce);
  font-weight: 800;
  white-space: nowrap;
}
.habillage-bandeau[data-habillage='bandeau'] .habillage-bandeau-texte {
  color: var(--d-encre-douce);
}
.habillage-bandeau[data-habillage='bandeau'] .habillage-bandeau-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  color: var(--d-lien);
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}
.habillage-bandeau[data-habillage='bandeau'] .habillage-bandeau-action svg {
  transition: transform 0.2s ease;
}
.habillage-bandeau[data-habillage='bandeau'] .habillage-bandeau-lien:hover svg {
  transform: translateX(3px);
}
/* Code : le texte et le code, puis le lien ; le code se sélectionne d’un clic */
.habillage-bandeau[data-habillage='bandeau'][data-variante='code'] {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 20px;
  padding: 10px 16px;
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
}
.habillage-bandeau[data-habillage='bandeau'][data-variante='code']
  .habillage-bandeau-offre {
  margin: 0;
}
.habillage-bandeau[data-habillage='bandeau'][data-variante='code']
  .habillage-bandeau-code {
  display: inline-block;
  padding: 0 8px;
  border: 2px dashed var(--d-bon-bord);
  border-radius: 6px;
  background: var(--d-bon-fond);
  color: var(--d-bon-encre);
  font-weight: 800;
  letter-spacing: 0.06em;
  white-space: nowrap;
  cursor: text;
  -webkit-user-select: all;
  user-select: all;
}
.habillage-bandeau[data-habillage='bandeau'][data-variante='code']
  .habillage-bandeau-conditions,
.habillage-bandeau[data-habillage='bandeau'][data-variante='code']
  .habillage-bandeau-details {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--d-encre-douce);
}
.habillage-bandeau[data-habillage='bandeau'][data-variante='code']
  .habillage-bandeau-details
  summary {
  border-radius: 4px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.habillage-bandeau[data-habillage='bandeau'][data-variante='code']
  .habillage-bandeau-details
  summary:focus-visible {
  outline: 3px solid var(--d-focus);
  outline-offset: 2px;
}
.habillage-bandeau[data-habillage='bandeau'][data-variante='code']
  .habillage-bandeau-conditions-offre {
  max-width: 64ch;
  margin: 4px auto 0;
  text-align: left;
  white-space: pre-line;
}
.habillage-bandeau[data-habillage='bandeau'][data-variante='code']
  .habillage-bandeau-lien {
  /* sans les marges automatiques du lien de la variante « remise » (règle
     `> .habillage-bandeau-lien`) : elles poussaient le texte à gauche et
     le lien au milieu de la place restante (01/12/2026) */
  margin: 0;
  border-radius: 4px;
  color: var(--d-lien);
  text-decoration: none;
}
@media (width < 40rem) {
  .habillage-bandeau[data-habillage='bandeau'] > .habillage-bandeau-lien {
    gap: 2px 10px;
    padding: 7px 16px;
    font-size: 13px;
  }
  .habillage-bandeau[data-habillage='bandeau'] .habillage-bandeau-texte {
    order: 3;
    flex-basis: 100%;
    font-size: 12px;
  }
  .habillage-bandeau[data-habillage='bandeau'][data-variante='code'] {
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .habillage-bandeau[data-habillage='bandeau'] .habillage-bandeau-action svg {
    transition: none;
    animation: none;
  }
}

@media print {
  .habillage-bandeau[data-habillage='bandeau'] {
    display: none;
  }
}
