/* Fenêtre d'annonce du site — styles PARTAGÉS (console ATS : aperçu ; site : assets/css/annonce.css).
   Toute modification doit être recopiée à l'identique des deux côtés.
   Les dimensions sont relatives à la fenêtre (.bdj-ann) et les adaptations mobiles passent par des
   requêtes de conteneur : l'aperçu « mobile » de la console se comporte donc exactement comme un téléphone. */

.bdj-ann {
  --ann-blue: #044f7f; --ann-navy: #062f52; --ann-maroon: #6e0303; --ann-orange: #f38f1c; --ann-pink: #de005d;
  --ann-sand: #f9c27a; --ann-ink: #1d2b36; --ann-muted: #4f5d68;
  position: fixed; inset: 0; z-index: 10000;
  display: grid; place-items: center;
  container-type: size; container-name: bdjann;
  font-family: Arial, Helvetica, sans-serif; line-height: 1.5; color: var(--ann-ink);
  -webkit-font-smoothing: antialiased;
}
.bdj-ann--preview { position: absolute; z-index: 1; }
.bdj-ann *, .bdj-ann *::before, .bdj-ann *::after { box-sizing: border-box; }

.bdj-ann__backdrop { position: absolute; inset: 0; background: rgba(6, 22, 38, .62); }

/* Au moins les trois quarts de l'écran */
.bdj-ann__dialog {
  position: relative; display: grid; overflow: hidden;
  width: 87cqw; height: 87cqh; max-width: 1680px; max-height: 1000px;
  background: #fff; border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
  animation: bdj-ann-in .32s ease-out both;
}
@keyframes bdj-ann-in { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .bdj-ann__dialog { animation: none; } }
/* Aperçu de la console : redessiné à chaque frappe, sans animation d'ouverture */
.bdj-ann--preview .bdj-ann__dialog { animation: none; }

.bdj-ann__media { position: relative; min-height: 0; overflow: hidden; background: var(--ann-navy); }
.bdj-ann__img, .bdj-ann__vid { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.bdj-ann__vid { background: #000; }

/* Diaporama : fondu enchaîné */
.bdj-ann__slides, .bdj-ann__video { position: absolute; inset: 0; }
.bdj-ann__slide { position: absolute; inset: 0; opacity: 0; transition: opacity .9s ease; }
.bdj-ann__slide.is-active { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .bdj-ann__slide { transition: none; } }

/* Commandes posées sur le visuel (diaporama, vidéo) */
.bdj-ann__controls {
  position: absolute; left: 14px; bottom: 14px; z-index: 2;
  display: flex; align-items: center; gap: 6px; padding: 5px;
  border-radius: 999px; background: rgba(6, 22, 38, .62); color: #fff;
}
.bdj-ann__ctrl {
  width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 50%;
  background: transparent; color: #fff; cursor: pointer;
}
.bdj-ann__ctrl:hover { background: rgba(255, 255, 255, .18); }
.bdj-ann__dots { display: flex; gap: 2px; }
.bdj-ann__dot { width: 24px; height: 40px; border: 0; background: transparent; cursor: pointer; display: grid; place-items: center; padding: 0; }
.bdj-ann__dot::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, .5); }
.bdj-ann__dot[aria-current="true"]::before { background: #fff; transform: scale(1.25); }
.bdj-ann__sound {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px 0 12px;
  border: 0; border-radius: 999px; cursor: pointer; background: var(--ann-orange); color: #fff;
  font: inherit; font-weight: 800; font-size: 15px;
}
.bdj-ann__sound[aria-pressed="true"] { background: rgba(255, 255, 255, .2); }
.bdj-ann__ctrl:focus-visible, .bdj-ann__dot:focus-visible, .bdj-ann__sound:focus-visible { outline: 3px solid var(--ann-orange); outline-offset: 2px; }
/* Visuel en fond : commandes en haut à gauche pour ne pas gêner le texte */
.bdj-ann--image-background .bdj-ann__controls { top: 14px; bottom: auto; }

.bdj-ann__panel {
  position: relative; min-height: 0; overflow: auto;
  display: flex; flex-direction: column; justify-content: center;
  padding: clamp(28px, 4.2cqw, 64px);
}
.bdj-ann__card { display: flex; flex-direction: column; gap: 14px; }
.bdj-ann__bars { display: flex; gap: 6px; margin-bottom: 4px; }
.bdj-ann__bars span { display: block; height: 5px; border-radius: 3px; width: 34px; background: var(--ann-pink); }
.bdj-ann__bars span:nth-child(2) { background: var(--ann-orange); }
.bdj-ann__bars span:nth-child(3) { width: 90px; background: currentColor; opacity: .9; }

.bdj-ann__eyebrow { margin: 0; font-weight: 700; font-size: clamp(15px, 1.35cqw, 20px); letter-spacing: .01em; }
.bdj-ann__title { margin: 0; color: inherit; font-family: inherit; text-transform: none; font-weight: 800; font-size: clamp(30px, 4.1cqw, 64px); line-height: 1.06; letter-spacing: -.01em; text-wrap: balance; }
.bdj-ann__subtitle { margin: 0; color: inherit; font-weight: 700; font-size: clamp(17px, 1.75cqw, 26px); line-height: 1.3; }
.bdj-ann__body { margin: 0; color: inherit; line-height: 1.55; font-size: clamp(15px, 1.25cqw, 19px); white-space: pre-line; max-width: 62ch; }

.bdj-ann__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin-top: 10px; }
.bdj-ann__cta {
  display: inline-flex; align-items: center; justify-content: center; min-height: 52px;
  padding: 14px 28px; border-radius: 10px; background: var(--ann-orange); color: #fff;
  font-weight: 800; font-size: clamp(16px, 1.3cqw, 19px); text-decoration: none;
  box-shadow: 0 8px 20px rgba(243, 143, 28, .35);
}
.bdj-ann__cta:hover { background: #e07f0f; }
.bdj-ann__later {
  appearance: none; border: 0; background: none; padding: 8px 2px; cursor: pointer;
  font: inherit; font-weight: 700; font-size: 16px; color: inherit; text-decoration: underline; text-underline-offset: 4px; opacity: .92;
}
.bdj-ann__close {
  position: absolute; top: 14px; right: 14px; z-index: 3;
  width: 48px; height: 48px; display: grid; place-items: center;
  border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(255, 255, 255, .94); color: var(--ann-ink);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .22);
}
.bdj-ann__close:hover { background: #fff; color: var(--ann-maroon); }
.bdj-ann__cta:focus-visible, .bdj-ann__later:focus-visible, .bdj-ann__close:focus-visible { outline: 3px solid var(--ann-orange); outline-offset: 3px; }

/* Couleurs du panneau de texte */
.bdj-ann--theme-blue .bdj-ann__panel { background: var(--ann-blue); color: #fff; }
.bdj-ann--theme-blue .bdj-ann__eyebrow { color: var(--ann-sand); }
.bdj-ann--theme-maroon .bdj-ann__panel { background: var(--ann-maroon); color: #fff; }
.bdj-ann--theme-maroon .bdj-ann__eyebrow { color: var(--ann-sand); }
.bdj-ann--theme-white .bdj-ann__panel { background: #fff; color: var(--ann-ink); }
.bdj-ann--theme-white .bdj-ann__eyebrow { color: var(--ann-orange); }
.bdj-ann--theme-white .bdj-ann__title { color: var(--ann-maroon); }
.bdj-ann--theme-white .bdj-ann__subtitle { color: var(--ann-blue); }
.bdj-ann--theme-white .bdj-ann__bars span:nth-child(3) { background: var(--ann-blue); }

/* Mises en page */
.bdj-ann--image-left { grid-template-columns: 56% 44%; }
.bdj-ann--image-right { grid-template-columns: 44% 56%; }
.bdj-ann--image-right .bdj-ann__media { order: 2; }
.bdj-ann--image-top { grid-template-rows: minmax(28%, 1fr) auto; }
.bdj-ann--image-top .bdj-ann__panel { justify-content: flex-start; max-height: 72cqh; padding-block: clamp(20px, 3cqh, 36px); }
.bdj-ann--image-top .bdj-ann__title { font-size: clamp(28px, 3.4cqw, 54px); }
.bdj-ann--text-only .bdj-ann__panel { align-items: center; text-align: center; padding-inline: clamp(28px, 10cqw, 180px); }
.bdj-ann--text-only .bdj-ann__body { margin-inline: auto; }
.bdj-ann--text-only .bdj-ann__actions { justify-content: center; }

/* Image en fond, texte placé sur l'image dans une carte colorée */
.bdj-ann--image-background { grid-template: 1fr / 1fr; }
.bdj-ann--image-background .bdj-ann__media,
.bdj-ann--image-background .bdj-ann__panel { grid-area: 1 / 1; }
.bdj-ann--image-background .bdj-ann__media::after {
  content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(6, 22, 38, .10), rgba(6, 22, 38, .45));
}
.bdj-ann--image-background .bdj-ann__panel {
  z-index: 2; background: transparent !important; overflow: visible;
  display: flex; flex-direction: row; padding: clamp(24px, 4cqw, 60px);
  align-items: center; justify-content: flex-start;
}
.bdj-ann--image-background .bdj-ann__card {
  width: min(46cqw, 640px); max-height: 100%; overflow: auto;
  padding: clamp(24px, 3cqw, 44px); border-radius: 14px;
  background: rgba(4, 79, 127, .9); color: #fff; box-shadow: 0 18px 50px rgba(0, 0, 0, .3);
}
.bdj-ann--image-background.bdj-ann--theme-maroon .bdj-ann__card { background: rgba(110, 3, 3, .9); }
.bdj-ann--image-background.bdj-ann--theme-white .bdj-ann__card { background: rgba(255, 255, 255, .96); color: var(--ann-ink); }
.bdj-ann--image-background.bdj-ann--pos-top-left .bdj-ann__panel, .bdj-ann--image-background.bdj-ann--pos-top-center .bdj-ann__panel, .bdj-ann--image-background.bdj-ann--pos-top-right .bdj-ann__panel { align-items: flex-start; }
.bdj-ann--image-background.bdj-ann--pos-bottom-left .bdj-ann__panel, .bdj-ann--image-background.bdj-ann--pos-bottom-center .bdj-ann__panel, .bdj-ann--image-background.bdj-ann--pos-bottom-right .bdj-ann__panel { align-items: flex-end; }
.bdj-ann--image-background.bdj-ann--pos-top-center .bdj-ann__panel, .bdj-ann--image-background.bdj-ann--pos-middle-center .bdj-ann__panel, .bdj-ann--image-background.bdj-ann--pos-bottom-center .bdj-ann__panel { justify-content: center; }
.bdj-ann--image-background.bdj-ann--pos-top-right .bdj-ann__panel, .bdj-ann--image-background.bdj-ann--pos-middle-right .bdj-ann__panel, .bdj-ann--image-background.bdj-ann--pos-bottom-right .bdj-ann__panel { justify-content: flex-end; }
.bdj-ann--image-background.bdj-ann--pos-top-center .bdj-ann__card, .bdj-ann--image-background.bdj-ann--pos-middle-center .bdj-ann__card,
.bdj-ann--image-background.bdj-ann--pos-bottom-center .bdj-ann__card { text-align: center; }
.bdj-ann--image-background.bdj-ann--pos-top-center .bdj-ann__card .bdj-ann__bars, .bdj-ann--image-background.bdj-ann--pos-middle-center .bdj-ann__card .bdj-ann__bars, .bdj-ann--image-background.bdj-ann--pos-bottom-center .bdj-ann__card .bdj-ann__bars,
.bdj-ann--image-background.bdj-ann--pos-top-center .bdj-ann__card .bdj-ann__actions, .bdj-ann--image-background.bdj-ann--pos-middle-center .bdj-ann__card .bdj-ann__actions, .bdj-ann--image-background.bdj-ann--pos-bottom-center .bdj-ann__card .bdj-ann__actions { justify-content: center; }
.bdj-ann--image-background .bdj-ann__panel { padding-top: clamp(70px, 7cqh, 90px); }

/* Téléphone et petite fenêtre : empilement, texte prioritaire, fenêtre presque plein écran */
@container bdjann (max-width: 700px) {
  .bdj-ann__dialog { width: 94cqw; height: 92cqh; border-radius: 16px; }
  .bdj-ann--image-left, .bdj-ann--image-right, .bdj-ann--image-top { grid-template-columns: 1fr; grid-template-rows: 38% 62%; }
  .bdj-ann--image-right .bdj-ann__media { order: 0; }
  .bdj-ann__panel { justify-content: flex-start; padding: 24px 22px 26px; }
  .bdj-ann__card { gap: 10px; }
  .bdj-ann__title { font-size: clamp(27px, 8.2cqw, 36px); }
  .bdj-ann__subtitle { font-size: 18px; }
  .bdj-ann__body { font-size: 15.5px; }
  .bdj-ann__cta { width: 100%; }
  .bdj-ann__actions { gap: 6px; }
  .bdj-ann__later { margin-inline: auto; }
  .bdj-ann--image-background .bdj-ann__panel { padding: 70px 14px 14px; justify-content: center !important; }
  .bdj-ann--image-background .bdj-ann__card { width: 100%; padding: 22px 20px; }
  .bdj-ann__close { top: 10px; right: 10px; width: 44px; height: 44px; }
  .bdj-ann--text-only .bdj-ann__panel { padding-inline: 26px; justify-content: center; }
}
@container bdjann (max-height: 560px) and (min-width: 701px) {
  .bdj-ann__dialog { height: 94cqh; }
  .bdj-ann__title { font-size: clamp(26px, 3.2cqw, 40px); }
}
.bdj-ann--text-only .bdj-ann__card { align-items: center; }
.bdj-ann--text-only .bdj-ann__bars { justify-content: center; }

/* ───── Formats de fenêtre (règles d'affichage) ───── */
.bdj-ann--size-full .bdj-ann__dialog { width: 96cqw; height: 94cqh; max-width: none; max-height: none; }
.bdj-ann--size-medium .bdj-ann__dialog { width: min(74cqw, 1180px); height: min(74cqh, 720px); }
.bdj-ann--size-medium .bdj-ann__title { font-size: clamp(28px, 3.2cqw, 50px); }

/* Non bloquants : la page reste utilisable autour */
.bdj-ann--nonmodal { pointer-events: none; }
.bdj-ann--nonmodal .bdj-ann__dialog { pointer-events: auto; position: absolute; box-shadow: 0 18px 50px rgba(6, 22, 38, .35); }

/* Petite fenêtre en bas à droite */
.bdj-ann--size-corner .bdj-ann__dialog {
  right: 20px; bottom: 20px; width: min(400px, calc(100cqw - 32px)); height: auto; max-height: min(680px, calc(100cqh - 40px));
  border-radius: 16px; grid-template-columns: 1fr; grid-template-rows: auto auto;
}
.bdj-ann--size-corner .bdj-ann__media { height: 200px; }
.bdj-ann--size-corner .bdj-ann__panel { padding: 22px 22px 20px; justify-content: flex-start; max-height: none; }
.bdj-ann--size-corner .bdj-ann__card { gap: 8px; }
.bdj-ann--size-corner .bdj-ann__title { font-size: 25px; }
.bdj-ann--size-corner .bdj-ann__subtitle { font-size: 16.5px; }
.bdj-ann--size-corner .bdj-ann__eyebrow { font-size: 14px; }
.bdj-ann--size-corner .bdj-ann__body { font-size: 14.5px; }
.bdj-ann--size-corner .bdj-ann__cta { min-height: 46px; padding: 11px 20px; font-size: 16px; }
.bdj-ann--size-corner .bdj-ann__later { font-size: 14.5px; }
.bdj-ann--size-corner .bdj-ann__close { top: 10px; right: 10px; width: 40px; height: 40px; }
.bdj-ann--size-corner.bdj-ann--text-only .bdj-ann__panel, .bdj-ann--size-corner .bdj-ann--text-only .bdj-ann__panel { padding-inline: 24px; }

/* Bandeau en bas de l'écran */
.bdj-ann--size-bar .bdj-ann__dialog {
  left: 0; right: 0; bottom: 0; width: 100%; height: auto; max-width: none; max-height: 46cqh;
  border-radius: 16px 16px 0 0; grid-template-columns: 260px 1fr; grid-template-rows: auto;
}
.bdj-ann--size-bar .bdj-ann--text-only, .bdj-ann--size-bar .bdj-ann__dialog.bdj-ann--text-only { grid-template-columns: 1fr; }
.bdj-ann--size-bar .bdj-ann__media { min-height: 150px; }
.bdj-ann--size-bar .bdj-ann__panel { padding: 20px 80px 20px 30px; }
.bdj-ann--size-bar .bdj-ann__card { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 28px; row-gap: 4px; align-items: center; }
.bdj-ann--size-bar .bdj-ann__card > :not(.bdj-ann__actions) { grid-column: 1; }
.bdj-ann--size-bar .bdj-ann__actions { grid-column: 2; grid-row: 1 / span 6; margin: 0; flex-direction: column; align-items: stretch; }
.bdj-ann--size-bar .bdj-ann__bars { display: none; }
.bdj-ann--size-bar .bdj-ann__title { font-size: clamp(22px, 2cqw, 30px); }
.bdj-ann--size-bar .bdj-ann__subtitle { font-size: 17px; }
.bdj-ann--size-bar .bdj-ann__eyebrow { font-size: 14px; }
.bdj-ann--size-bar .bdj-ann__body { font-size: 15px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bdj-ann--size-bar .bdj-ann__close { top: 50%; transform: translateY(-50%); }
.bdj-ann--size-bar.bdj-ann--size-bar .bdj-ann--text-only .bdj-ann__panel { align-items: stretch; text-align: left; padding-inline: 30px 80px; }

@container bdjann (max-width: 700px) {
  .bdj-ann--size-full .bdj-ann__dialog, .bdj-ann--size-medium .bdj-ann__dialog { width: 94cqw; height: 92cqh; }
  .bdj-ann--size-corner .bdj-ann__dialog { right: 10px; left: 10px; bottom: 10px; width: auto; grid-template-rows: auto auto; }
  .bdj-ann--size-corner .bdj-ann__media { height: 150px; }
  .bdj-ann--size-bar .bdj-ann__dialog { grid-template-columns: 1fr; grid-template-rows: auto; max-height: 60cqh; }
  .bdj-ann--size-bar .bdj-ann__media { display: none; }
  .bdj-ann--size-bar .bdj-ann__panel { padding: 18px 60px 18px 18px; }
  .bdj-ann--size-bar .bdj-ann__card { grid-template-columns: 1fr; }
  .bdj-ann--size-bar .bdj-ann__actions { grid-column: 1; grid-row: auto; flex-direction: row; margin-top: 6px; }
  .bdj-ann--size-bar .bdj-ann__cta { width: auto; }
  .bdj-ann--size-bar .bdj-ann__close { top: 12px; transform: none; }
}
