/**
 * Accessibility and form-feedback styles for the public site.
 *
 * Additive only — no existing rule is overridden and the visual design is
 * unchanged. Everything here is either invisible until focused (skip link),
 * only present during submission (spinner), or a focus indicator that the
 * theme had removed.
 */

/* --------------------------------------------------------------------------
 * Skip link — hidden until focused by keyboard.
 * ----------------------------------------------------------------------- */
.sota-skip-link {
    position: absolute;
    top: -60px;
    left: 8px;
    z-index: 10000;
    padding: 10px 18px;
    background: #000;
    color: #fff;
    font-size: 15px;
    text-decoration: none;
    border-radius: 0 0 4px 4px;
    transition: top 0.15s ease-in-out;
}

.sota-skip-link:focus {
    top: 0;
    color: #fff;
    outline: 3px solid #fff;
    outline-offset: -6px;
}

/* --------------------------------------------------------------------------
 * Submit spinner.
 * ----------------------------------------------------------------------- */
@keyframes sota-spin {
    to { transform: rotate(360deg); }
}

.sota-spinner {
    display: inline-block;
    width: 1em;
    height: 1em;
    margin-right: 0.4em;
    vertical-align: -0.125em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: sota-spin 0.75s linear infinite;
}

button[aria-busy="true"],
.btn[aria-busy="true"] {
    cursor: progress;
    opacity: 0.85;
}

/* --------------------------------------------------------------------------
 * Visible focus.
 *
 * The theme suppresses outlines in several places, which leaves keyboard users
 * with no indication of where they are. :focus-visible means mouse users see
 * no change at all.
 * ----------------------------------------------------------------------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid #ee3102;
    outline-offset: 2px;
}

/* Inputs on dark sections need a light ring to stay visible. */
.mbr-overlay ~ * input:focus-visible,
section[class*="cid-"] .form-control:focus-visible {
    outline-color: #fff;
}

/* --------------------------------------------------------------------------
 * Screen-reader-only text.
 * ----------------------------------------------------------------------- */
.sota-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --------------------------------------------------------------------------
 * Respect reduced-motion preferences.
 * ----------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .sota-spinner {
        animation-duration: 1.5s;
    }
    .sota-skip-link {
        transition: none;
    }
    html {
        scroll-behavior: auto;
    }
}

/* No image sizing or backgrounds are set here on purpose. Image dimensions are
 * left entirely to the existing theme CSS so the layout renders exactly as it
 * did before. */
