/* .pjax-busy is on <body> while a navigation waits for the new page: with no sign of work
   until the new markup lands, the page reads as frozen. */
body.pjax-busy {
    cursor: progress;
}

/* Delayed, so a swap that finishes quickly never flashes a bar. Stops at 90% because what
   ends it is the load finishing - a bar sitting full at 100% reads as stuck. */
body.pjax-busy::before {
    content: "";
    position: fixed;
    inset: 0 auto auto 0;
    z-index: 2000;
    height: 3px;
    width: 0;
    background: var(--ssp-primary);
    animation: ssp-pjax-bar 8s cubic-bezier(0, 0.6, 0.3, 1) 0.12s forwards;
}

@keyframes ssp-pjax-bar {
    to {
        width: 90%;
    }
}

/* Keeps a second click off markup that is about to be replaced. No transition on the way
   back: the class is removed exactly when the new content is in, so it must not linger. */
body.pjax-busy #pjax-content {
    pointer-events: none;
    opacity: 0.6;
    transition: opacity 0.15s linear 0.12s;
}

@media (prefers-reduced-motion: reduce) {
    body.pjax-busy::before {
        animation: none;
        width: 90%;
    }

    body.pjax-busy #pjax-content {
        transition: none;
    }
}

/* Caret browsing (F7) paints a text cursor on static text; hide it there and keep it in fields. */
body {
    caret-color: transparent;
}

input,
textarea,
select,
[contenteditable] {
    caret-color: auto;
}
