/* ================================================================
 * View Transitions API — Cross-Document Navigation
 * AnimesLand Theme
 *
 * Suporte: Chrome 126+ / Safari 18.2+ / Firefox 131+
 * Fallback: navegação normal em browsers sem suporte (graceful)
 *
 * IMPORTANTE: NÃO atribuir view-transition-name a elementos com
 * position:fixed ou que participem de stacking context do tema
 * (header, nav) — causa visibility:hidden e quebra z-index.
 * ================================================================ */

/* Ativa transições automáticas entre páginas do mesmo domínio */
@view-transition {
    navigation: auto;
}

/* ── Root: fade rápido em tudo ───────────────────────────────── */
@keyframes al-vt-fade-out {
    to { opacity: 0; }
}
@keyframes al-vt-fade-in {
    from { opacity: 0; }
}

::view-transition-old(root) {
    animation: 150ms ease-in al-vt-fade-out;
}
::view-transition-new(root) {
    animation: 220ms ease-out al-vt-fade-in;
}

/* ── Conteúdo principal: slide + fade ────────────────────────── */
@keyframes al-vt-content-out {
    to { opacity: 0; transform: translateY(-6px); }
}
@keyframes al-vt-content-in {
    from { opacity: 0; transform: translateY(16px); }
}

#contenedor {
    view-transition-name: al-content;
}
::view-transition-old(al-content) {
    animation: 150ms ease-in al-vt-content-out;
}
::view-transition-new(al-content) {
    animation: 280ms cubic-bezier(0.25, 0.46, 0.45, 0.94) al-vt-content-in;
}

/* ── Respeita preferência do sistema por menos movimento ──────── */
@media (prefers-reduced-motion: reduce) {
    ::view-transition-old(root),
    ::view-transition-new(root),
    ::view-transition-old(al-content),
    ::view-transition-new(al-content) {
        animation: none;
    }
}
