/* O router anima o conteúdo real. A navegação permanece no mesmo ambiente. */

:root {
    --route-ease: cubic-bezier(.22, .75, .18, 1);
    --route-paper: #fbf8e8;
    background-color: var(--route-paper);
}

html.is-route-changing { scroll-behavior: auto !important; }

/* Mantém a geometria enquanto estilos e controladores da nova vista são montados.
   Os cabeçalhos e a navegação lateral não fazem parte desta região. */
html.is-route-swapping :is(body > main, body > section, body > footer,
    .admin-page > main, .admin-page > footer, .admin-layout main, .admin-layout footer),
html.is-route-swapping :is(body > main, body > section, body > footer,
    .admin-page > main, .admin-page > footer, .admin-layout main, .admin-layout footer) * {
    visibility: hidden !important;
}

.navigation-progress {
    position: fixed;
    inset: 0 0 auto;
    z-index: 10001;
    height: 2px;
    background: linear-gradient(90deg, #83521a, #b17a20 55%, #c7d0aa);
    opacity: 0;
    transform: scaleX(0);
    transform-origin: left;
    pointer-events: none;
    transition: opacity .14s ease;
}

.navigation-progress.is-visible {
    opacity: 1;
    animation: route-progress 1.8s cubic-bezier(.12, .7, .18, 1) both;
}

.navigation-status {
    position: fixed !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip-path: inset(50%);
    white-space: nowrap;
    pointer-events: none;
}

.navigation-error {
    position: fixed;
    z-index: 10002;
    left: 50%;
    bottom: max(20px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    width: min(430px, calc(100% - 32px));
    padding: 18px 22px;
    border: 1px solid #c9bc91;
    border-radius: 18px;
    color: #3f4a30;
    background: #fffce9;
    box-shadow: 0 10px 30px #362a1826;
    font: 500 14px/1.5 Montserrat, sans-serif;
}
.navigation-error p { margin: 0 0 12px; font: inherit; color: inherit; }
.navigation-error button {
    border: 1px solid #83521a;
    border-radius: 30px;
    padding: 8px 16px;
    color: #83521a;
    background: transparent;
    font: inherit;
    cursor: pointer;
}
.navigation-error button:focus-visible {
    outline: 2px solid #83521a;
    outline-offset: 3px;
}

/* A secção participa na passagem da página, sem repetir a entrada antiga. */
body.is-portfolio-mode .portfolio-section,
body.is-about-mode .about-section,
body.is-contact-mode .contact-section,
body.is-coming-soon-mode .coming-soon-section,
body.is-order-mode .order-section {
    animation: none;
}

@keyframes route-progress {
    from { transform: scaleX(.06); }
    to { transform: scaleX(.88); }
}

@media (prefers-reduced-motion: reduce) {
    .navigation-progress.is-visible {
        animation: none;
    }

    .navigation-progress {
        transition: none;
    }

    .navigation-progress.is-visible {
        transform: scaleX(1);
    }
}
