/* Animation des bandeaux d'accueil des pages publiques (voir assets/js/hero-anim.js) :
   lumière qui jaillit du bas, titre révélé mot par mot avec reflet doré, poussière de lumière. */
.hero-anim { position: relative; overflow: hidden; }
.ha-couche { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; direction: ltr; }

/* Lumière qui jaillit du bas : lueur au sol et faisceaux en éventail qui montent vers le haut en ondulant */
.ha-sol {
    position: absolute; inset-inline: -10%; bottom: -30px; height: 55%; mix-blend-mode: screen;
    background: radial-gradient(ellipse 60% 100% at 50% 100%, rgba(255, 214, 140, .6), rgba(255, 170, 90, .22) 45%, transparent 72%);
    animation: ha-sol 4.5s ease-in-out infinite;
}
@keyframes ha-sol { 0%, 100% { opacity: .75; transform: scaleY(.92); } 50% { opacity: 1; transform: scaleY(1.08); } }
.ha-rayon {
    position: absolute; bottom: -8px; left: var(--x); width: var(--l); height: 135%; margin-left: calc(var(--l) / -2);
    transform-origin: 50% 100%; mix-blend-mode: screen; opacity: 0; filter: blur(5px);
    background: linear-gradient(0deg, rgba(255, 226, 160, .62), rgba(255, 210, 140, .3) 38%, rgba(255, 200, 120, 0) 92%);
    clip-path: polygon(34% 100%, 66% 100%, 100% 0, 0 0);
    transform: rotate(var(--a));
    animation: ha-rayon var(--d) ease-in-out var(--r) infinite, ha-rayon-entree 1.6s ease .3s backwards;
}
@keyframes ha-rayon {
    0%, 100% { transform: rotate(calc(var(--a) - 5deg)); opacity: .35; }
    50% { transform: rotate(calc(var(--a) + 5deg)); opacity: .85; }
}
@keyframes ha-rayon-entree { from { opacity: 0; clip-path: polygon(48% 100%, 52% 100%, 60% 100%, 40% 100%); } }


/* Poussière de lumière dorée */
.ha-grain {
    position: absolute; bottom: -12px; border-radius: 50%; opacity: 0;
    background: radial-gradient(circle, rgba(255, 236, 190, .95), rgba(255, 210, 130, .35) 60%, transparent 72%);
    animation: ha-monte linear infinite;
}
@keyframes ha-monte {
    0% { transform: translate3d(0, 0, 0); opacity: 0; }
    12% { opacity: .85; }
    100% { transform: translate3d(var(--dx, 20px), -420px, 0); opacity: 0; }
}

/* Titre : mot par mot, du flou au net, puis un reflet doré */
.ha-mot {
    display: inline-block; white-space: pre;
    background: linear-gradient(100deg, transparent 40%, #f0c75a 50%, transparent 60%) 130% 0 / 260% 100% no-repeat, linear-gradient(#fff, #fff) 0 0 / 100% 100% no-repeat;
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
    opacity: 0; filter: blur(10px); transform: translateY(14px);
    animation: ha-mot .9s cubic-bezier(.2, .8, .2, 1) calc(1.1s + var(--i) * .16s) forwards,
               ha-reflet 1.6s ease calc(2.7s + var(--i) * .1s) 1 forwards;
}
@keyframes ha-mot { to { opacity: 1; filter: blur(0); transform: none; } }
@keyframes ha-reflet { from { background-position: 130% 0, 0 0; } to { background-position: -30% 0, 0 0; } }

/* Badge : halo qui pulse */
.hero-anim .hero-badge { animation: ha-halo 3.2s ease-in-out 2s infinite; }
@keyframes ha-halo { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 214, 140, 0); } 50% { box-shadow: 0 0 0 9px rgba(255, 214, 140, .16), 0 0 22px rgba(255, 214, 140, .3); } }

@media (prefers-reduced-motion: reduce), print { .ha-couche { display: none; } .ha-mot { opacity: 1; filter: none; transform: none; animation: none; background: none; -webkit-text-fill-color: currentColor; color: inherit; } .hero-anim .hero-badge { animation: none; } }


/* ── Bandeaux d'en-tête de toutes les pages publiques (classiques et builder) ──
   Le menu fixe est dégagé par header-moderne.js (padding du <main>) ; le bandeau garde toujours la même hauteur,
   et le texte se met à l'échelle de cette hauteur : l'image apparaît en entier, sans être cachée par le menu. */
:is(section, div):has(> .hero-bg-image, > .builder-hero-bg) {
    --fo-hero-h: clamp(300px, 26vw, 420px);
    container-type: size;
    box-sizing: border-box;
    height: var(--fo-hero-h);
    padding: 0 clamp(16px, 4vw, 48px);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    overflow: hidden;
}
:is(section, div):has(> .hero-bg-image, > .builder-hero-bg) > :not(.hero-bg-image):not(.builder-hero-bg):not(.ha-couche) {
    max-width: min(900px, 100%); width: 100%; margin-inline: auto; flex: 0 1 auto; min-height: 0;
}
:is(section, div):has(> .hero-bg-image, > .builder-hero-bg) :is(.hero-badge, .builder-hero-badge) {
    margin: 0 0 clamp(6px, 3cqh, 18px); padding: clamp(4px, 1.8cqh, 8px) clamp(12px, 4cqh, 20px); font-size: clamp(10px, 3.4cqh, 13px);
}
:is(section, div):has(> .hero-bg-image, > .builder-hero-bg) h1 {
    margin: 0 0 clamp(4px, 2.5cqh, 14px); font-size: clamp(20px, 11cqh, 54px); line-height: 1.12;
}
:is(section, div):has(> .hero-bg-image, > .builder-hero-bg) :is(p, .builder-hero-subtitle) {
    margin: 0; font-size: clamp(11px, 4.4cqh, 17px); line-height: 1.45;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden;
}

/* Bandeau commun (partial shared/partials/bandeau-page) : mêmes couleurs et mêmes proportions que les bandeaux des pages Actualités, Agenda, FAQ… */
.fo-bandeau { position: relative; text-align: center; border-bottom: 3px solid #b8923a; font-family: 'Ubuntu', 'DM Sans', sans-serif; }
.fo-bandeau .hero-bg-image { position: absolute; inset: 0; z-index: 0; }
.fo-bandeau .hero-background-image { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.fo-bandeau .hero-bg-image::after { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(60, 5, 12, .78), rgba(152, 15, 30, .6) 60%, rgba(60, 5, 12, .78)); }
.fo-bandeau-contenu { position: relative; z-index: 1; color: #fff; }
.fo-bandeau .hero-badge { display: inline-flex; align-items: center; gap: 10px; border-radius: 40px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(220, 189, 112, .7); font-weight: 600; color: #f8ecd0; }
.fo-bandeau .hero-badge i { color: #dcbd70; }
.fo-bandeau h1 { font-weight: 700; color: #fff; }
.fo-bandeau h1 .highlight { color: #dcbd70; font-style: normal; }
.fo-bandeau p { color: #f3e6cf; }
.fo-bandeau h1 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }

/* ── Espace citoyen : le bandeau du haut (Mes demandes, Notifications, Profil, Tableau de bord, formulaires) reprend le décor du front-office :
   fond rideau rouge (même image que le pied de page), projecteurs animés (hero-anim.js), texte clair. ── */
main :is(.page-header, .profile-hero, .dashboard-hero-personal) {
    background: linear-gradient(rgba(35, 3, 8, .30), rgba(35, 3, 8, .45)), url('../images/footer.png') center / cover no-repeat;
    border: 1.5px solid rgba(220, 189, 112, .6);
    color: #fff;
}
main :is(.page-header h1, .profile-soft-name, .user-soft-name) { color: #fff; text-shadow: 0 2px 10px rgba(0, 0, 0, .45); }
main :is(.page-header h1 em, .profile-soft-name em, .user-soft-name em) { color: #dcbd70; }
main :is(.page-header, .profile-hero, .dashboard-hero-personal) :is(.hero-avatar-placeholder, .profile-avatar-placeholder, .user-avatar-placeholder, .user-avatar) {
    border: 3px solid #dcbd70; box-shadow: 0 0 0 4px rgba(220, 189, 112, .25), 0 8px 22px rgba(0, 0, 0, .4);
}
main :is(.page-header, .profile-hero, .dashboard-hero-personal) .meta-item { background: rgba(253, 246, 232, .94); }
main :is(.page-header, .profile-hero, .dashboard-hero-personal) .btn-primary-ghost {
    background: linear-gradient(135deg, #f3dc92, #dcbd70 55%, #b8923a); color: #4a0a12; border: 1px solid rgba(255, 255, 255, .45);
    box-shadow: 0 8px 22px rgba(0, 0, 0, .35);
}
main :is(.page-header, .profile-hero, .dashboard-hero-personal) .btn-primary-ghost i { color: #7a0f1c; }
main :is(.page-header, .profile-hero, .dashboard-hero-personal) .btn-primary-ghost:hover { color: #2a0409; filter: brightness(1.06); }
/* Lisibilité sur le fond rouge, en clair comme en sombre (les pages posent leurs propres couleurs, parfois avec .dark) */
main .page-header { padding: 22px 30px; border-radius: 22px; margin-bottom: 28px; overflow: hidden; }
main :is(.page-header, .profile-hero, .dashboard-hero-personal) :is(h1, h2, .profile-soft-name, .user-soft-name) { color: #fff !important; }
main :is(.page-header, .profile-hero, .dashboard-hero-personal) :is(h1, h2, .profile-soft-name, .user-soft-name) em { color: #dcbd70 !important; }
main :is(.page-header, .profile-hero, .dashboard-hero-personal) .header-left h1::before { background: #dcbd70; }
main :is(.page-header, .profile-hero, .dashboard-hero-personal) .sub { color: #f3e6cf !important; }
main :is(.page-header, .profile-hero, .dashboard-hero-personal) .eyebrow { background: rgba(255, 255, 255, .14) !important; border-color: rgba(220, 189, 112, .7) !important; color: #f8ecd0 !important; }
main :is(.page-header, .profile-hero, .dashboard-hero-personal) .meta-item { background: rgba(253, 246, 232, .95) !important; color: #4a2c1a !important; border-color: rgba(184, 146, 58, .5) !important; }
main :is(.page-header, .profile-hero, .dashboard-hero-personal) .meta-item i { color: #b8923a !important; }
main :is(.profile-hero, .dashboard-hero-personal, .page-header) :is(.member-badge, .user-tag, .tag) { background: rgba(253, 246, 232, .95) !important; color: #4a2c1a !important; border: 1px solid rgba(184, 146, 58, .5) !important; }
main :is(.profile-hero, .dashboard-hero-personal, .page-header) :is(.member-badge, .user-tag, .tag) i { color: #b8923a !important; }
/* Photo du citoyen dans le bandeau (Mes demandes, pages de formulaire) : même cadre que l'avatar du profil */
main .fo-photo-citoyen { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; display: block; border: 3px solid #dcbd70; box-shadow: 0 0 0 4px rgba(220, 189, 112, .25), 0 8px 22px rgba(0, 0, 0, .4); background: #7a0f1c; }
@media (max-width: 600px) { main .fo-photo-citoyen { width: 72px; height: 72px; } }
/* Les pages posent « position: relative » sur tous les enfants du bandeau : la couche de projecteurs doit rester en recouvrement */
main :is(.page-header, .profile-hero, .dashboard-hero-personal) > .ha-couche { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
