/* ============================================================
   Barre d'annonce — au-dessus du header principal
   Elle défile avec la page ; le header flottant se cale dessous
   tant qu'elle est visible (variable --ann-vis posée par le JS).
   ============================================================ */
.ann-bar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1001;   /* reste en haut jusqu'au clic sur ✕ */
    display: flex; align-items: center; justify-content: center;
    min-height: 48px; padding: .55rem 3.25rem .55rem 1rem;
    color: #fff; overflow: hidden; isolation: isolate;
    -webkit-text-size-adjust: 100%; text-size-adjust: 100%;   /* iPhone : empêche Safari d'agrandir le texte */
    /* iPhone : la barre descend sous la zone heure / batterie (le fond bleu la remplit) au lieu d'être cachée dessous */
    border-top: env(safe-area-inset-top, 0px) solid transparent;
    background: linear-gradient(100deg, #061a3a 0%, #0b2552 45%, #04326d 100%);
}
.ann-bar::before, .ann-bar::after {   /* formes discrètes en fond */
    content: ""; position: absolute; z-index: -1; border-radius: 50%; pointer-events: none;
    background: radial-gradient(circle, rgba(59,130,246,.35) 0%, transparent 70%);
}
.ann-bar::before { width: 340px; height: 340px; left: -120px; top: -200px; }
.ann-bar::after  { width: 300px; height: 300px; right: 4%; top: -180px; }
.ann-inner { display: flex; align-items: center; justify-content: center; gap: .9rem; flex-wrap: nowrap; max-width: 1180px; min-width: 0; width: 100%; }
.ann-ico { width: 18px; height: 18px; color: #fbbf24; flex-shrink: 0; }
/* Message : une seule ligne ; défilement en boucle s'il est trop long */
.ann-msg { flex: 0 1 auto; min-width: 0; overflow: hidden; }
.ann-track { display: flex; width: max-content; column-gap: 3rem; }
.ann-text { margin: 0; font-size: .92rem; line-height: 1.45; white-space: nowrap; }
.ann-msg.is-marquee { flex: 1 1 auto; -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%); }
.ann-msg.is-marquee .ann-track { animation: annMarquee var(--ann-dur, 20s) linear 1s infinite; }
.ann-msg.is-marquee:hover .ann-track { animation-play-state: paused; }
@keyframes annMarquee { from { transform: translateX(0); } to { transform: translateX(calc(-1 * var(--ann-dist, 50%))); } }
.ann-text strong { font-weight: 700; }
.ann-text span { color: rgba(255,255,255,.88); }
.ann-text strong + span::before { content: ""; display: inline-block; width: 1px; height: .95em; margin: 0 .7rem; background: rgba(255,255,255,.35); vertical-align: -.1em; }
.ann-btn {
    flex-shrink: 0; display: inline-flex; align-items: center; padding: .42rem .95rem; border-radius: 4px;
    background: #fbbf24; color: #0b1530; font-size: .84rem; font-weight: 700; text-decoration: none; white-space: nowrap;
    transition: background .15s ease, transform .15s ease;
}
.ann-btn:hover { background: #fcd34d; transform: translateY(-1px); }
.ann-close {
    position: absolute; right: .75rem; top: 50%; transform: translateY(-50%);
    width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
    border: 0; border-radius: 4px; background: transparent; color: #fff; cursor: pointer; transition: background .15s;
}
.ann-close:hover { background: rgba(255,255,255,.12); }
.ann-close svg { width: 18px; height: 18px; }

/* Espace réservé dans la page (même hauteur que la barre) */
.ann-spacer { height: var(--ann-h, 0px); }
.ann-closing .ann-spacer { transition: height .35s ease; }

/* Header flottant : toujours sous la barre */
.has-ann .navbar { top: calc(.9rem + var(--ann-vis, 0px)); transition: background .3s ease, border-color .3s ease, box-shadow .3s ease; }

@media (max-width: 768px) {
    .ann-bar { min-height: 0; padding: .55rem 2.75rem .55rem .9rem; justify-content: flex-start; }
    .ann-inner { gap: .6rem; }
    .ann-ico { display: none; }
    .ann-text { font-size: .84rem; }
    .ann-btn { padding: .32rem .75rem; font-size: .78rem; }
    .ann-close { right: .4rem; }
    /* Menu ouvert : il commence sous la barre d'annonce (sinon le ✕ du menu est caché dessous) */
    .has-ann .nav-links { top: var(--ann-vis, 0px); height: calc(100dvh - var(--ann-vis, 0px)); padding-top: 5.5rem; }
    .has-ann .nav-links > li.nav-close-item { top: 1.2rem; }   /* la barre couvre déjà la zone heure / batterie */
}
/* Téléphones (iPhone 11 Pro : 375 px) : bande plus fine, texte plus petit */
@media (max-width: 480px) {
    .ann-bar { padding: .4rem 2.4rem .4rem .75rem; }
    .ann-inner { gap: .5rem; }
    .ann-text { font-size: .75rem; line-height: 1.35; }
    .ann-btn { padding: .26rem .6rem; font-size: .7rem; border-radius: 3px; }
    .ann-close { width: 28px; height: 28px; right: .3rem; }
    .ann-close svg { width: 16px; height: 16px; }
}

/* ============================================================
   Animations
   ============================================================ */
/* Entrée : la barre descend, puis le contenu apparaît */
.ann-bar { animation: annDrop .55s cubic-bezier(.2,.8,.2,1) both; }
.ann-inner > * { animation: annFadeUp .5s ease both; }
.ann-inner > .ann-btn { flex-shrink: 0; }
.ann-inner > :nth-child(1) { animation-delay: .25s; }
.ann-inner > :nth-child(2) { animation-delay: .32s; }
.ann-inner > :nth-child(3) { animation-delay: .42s; }
.ann-close { animation: annFade .4s ease .5s both; }
@keyframes annDrop   { from { transform: translateY(-100%); } to { transform: none; } }
@keyframes annFadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes annFade   { from { opacity: 0; } to { opacity: 1; } }

/* Fond : les halos dérivent lentement */
.ann-bar::before { animation: annDrift1 14s ease-in-out infinite alternate; }
.ann-bar::after  { animation: annDrift2 18s ease-in-out infinite alternate; }
@keyframes annDrift1 { to { transform: translate(260px, 40px) scale(1.15); } }
@keyframes annDrift2 { to { transform: translate(-320px, 30px) scale(1.2); } }

/* Mégaphone : petit tremblement toutes les 6 s */
.ann-inner > .ann-ico { transform-origin: 30% 60%; animation: annFadeUp .5s ease both, annRing 6s ease-in-out infinite; animation-delay: .25s, 1.5s; }
@keyframes annRing {
    0%, 86%, 100% { transform: rotate(0); }
    88% { transform: rotate(-14deg); } 90% { transform: rotate(12deg); }
    92% { transform: rotate(-9deg); }  94% { transform: rotate(6deg); } 96% { transform: rotate(-3deg); }
}

/* Bouton : reflet lumineux qui le traverse toutes les 4 s */
.ann-btn { position: relative; overflow: hidden; }
.ann-btn::after {
    content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 45%;
    background: linear-gradient(100deg, transparent 0%, rgba(255,255,255,.65) 50%, transparent 100%);
    transform: skewX(-20deg); animation: annShine 4s ease-in-out 1.2s infinite;
}
@keyframes annShine { 0% { left: -60%; } 30%, 100% { left: 130%; } }

/* Fermeture : la barre se replie, le header remonte en douceur */
.ann-bar.is-closing { animation: none; transition: height .35s ease, min-height .35s ease, padding .35s ease, opacity .25s ease; opacity: 0; min-height: 0; padding-top: 0; padding-bottom: 0; border-top-width: 0; }
.ann-closing .navbar { transition: top .35s ease, background .3s ease, border-color .3s ease, box-shadow .3s ease; }

@media (prefers-reduced-motion: reduce) {
    .ann-bar, .ann-bar::before, .ann-bar::after, .ann-inner > *, .ann-close, .ann-ico, .ann-btn::after { animation: none !important; }
    .ann-msg.is-marquee .ann-track { animation-duration: calc(var(--ann-dur, 20s) * 2) !important; }
    .ann-btn::after { display: none; }
}
