/* Mouvement — site public et administration (demande de Florian du 21/11 : « des petites transitions sympathiques où ça fait sens ») */

/* Passage d'une page à l'autre : fondu court, la page neuve monte de quelques pixels */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: 160ms ease-in both fondu-sort; }
::view-transition-new(root) { animation: 320ms cubic-bezier(.2, .7, .2, 1) both fondu-entre; }
@keyframes fondu-sort { to { opacity: 0; } }
@keyframes fondu-entre { from { opacity: 0; transform: translateY(8px); } }

/* Dévoilement au défilement (proto.js pose .devoile, puis .vu quand l'élément entre à l'écran) */
.mvt .devoile { opacity: 0; transform: translateY(18px); transition: opacity .6s cubic-bezier(.2, .7, .2, 1), transform .6s cubic-bezier(.2, .7, .2, 1); transition-delay: calc(var(--rang, 0) * 70ms); }
.mvt .devoile.vu { opacity: 1; transform: none; }

/* Ce qui s'ouvre se soulève au survol */
.seance-ligne:has(h3 a), a.carte, a.rangee, .repere, .ecran, .carte-lien { transition: transform .2s cubic-bezier(.2, .7, .2, 1), box-shadow .2s; }
.seance-ligne:has(h3 a):hover, a.carte:hover, a.rangee:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(60, 40, 20, .12); }
.seance-ligne.prochaine:has(h3 a):hover { box-shadow: 0 10px 28px rgba(60, 40, 20, .12), inset 6px 0 0 var(--rouge-logo); }

/* Administration : la ligne cliquable s'éclaire en douceur, la flèche avance */
.rangees a.ligne { transition: background-color .18s; }
.rangees a.ligne .chev, .rangees a.ligne .ic-chev { transition: transform .18s; }
.rangees a.ligne:hover .chev, .rangees a.ligne:hover .ic-chev { transform: translateX(3px); }

/* Les boutons répondent à l'appui */
.btn { transition: background-color .15s, color .15s, border-color .15s, transform .1s; }
.btn:active { transform: scale(.97); }

/* Une ligne faite passe au vert en douceur */
.fait-ok { animation: fait .45s ease-out; }
@keyframes fait { from { background-color: transparent; } }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  .mvt .devoile { opacity: 1; transform: none; transition: none; }
  .seance-ligne, a.carte, a.rangee, .btn, .fait-ok { transition: none; animation: none; }
  .seance-ligne:hover, a.carte:hover, a.rangee:hover { transform: none; }
}

/* Toasts empilés (Florian, 21/11) : le plus récent devant, les autres dépassent derrière ; survol = la pile se déplie */
.toasts.pile { display: grid; justify-items: center; align-items: end; }
.toasts.pile > .toast { grid-area: 1 / 1; width: min(440px, 100%); box-sizing: border-box; z-index: calc(100 - var(--i, 0)); transform-origin: 50% 100%;
  transform: translateY(calc(var(--i, 0) * -12px)) scale(calc(1 - var(--i, 0) * .05));
  transition: transform .32s cubic-bezier(.2, .8, .2, 1), opacity .32s; animation: toast-entre .32s cubic-bezier(.2, .8, .2, 1); }
.toasts.pile > .toast:not(:last-child) > * { transition: opacity .2s; }
.toasts.pile:not(:hover) > .toast:not(:last-child) > * { opacity: 0; } /* derrière, on ne lit que le bord */
.toasts.pile > .toast[data-cache] { opacity: 0; pointer-events: none; }
.toasts.pile:hover > .toast { transform: translateY(var(--deplie, 0)); opacity: 1; pointer-events: auto; }
.toasts.pile > .toast.sort { opacity: 0; transform: translateY(24px) scale(.96); }
@keyframes toast-entre { from { opacity: 0; transform: translateY(32px) scale(.96); } }
@media (prefers-reduced-motion: reduce) { .toasts.pile > .toast { animation: none; transition: none; } }
