/* Design system base: document defaults, focus, skip link and reduced motion.
 * Reads only --ds-* tokens (tokens.css). Loaded for the authenticated app and sign-in pages after the legacy stylesheets.
 */

body {
    font-family: var(--ds-font-sans);
    font-size: var(--ds-text-base);
    line-height: var(--ds-leading-normal);
}

/* Form controls do not inherit the page font by default. */
:is(button, input, select, textarea, optgroup) { font-family: inherit; }

[hidden] { display: none !important; }

/* One visible keyboard focus treatment everywhere. Components that draw their own ring (inputs) say so in components.css. */
:is(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: var(--ds-focus-outline);
    outline-offset: var(--ds-focus-offset);
}

/* Skip link: first focusable element on every page (markup lives in header.php). */
.skip-link {
    position: fixed;
    top: var(--ds-space-2);
    left: var(--ds-space-2);
    z-index: var(--ds-z-skip-link);
    padding: var(--ds-space-3) var(--ds-space-4);
    border-radius: var(--ds-radius-md);
    background: var(--ds-primary-solid);
    color: var(--ds-on-primary);
    font-weight: var(--ds-weight-semibold);
    text-decoration: none;
    transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

/* Text links: underlined, so colour is never the only cue. Apply .link to a link inside running text. */
.link {
    color: var(--ds-primary);
    text-decoration: underline;
    text-underline-offset: 0.15em;
}
.link:hover { color: var(--ds-primary-hover); }

/* Phones: stop iOS from zooming into small inputs. */
@media (max-width: 600px) {
    input.form-control, textarea.form-control, select.form-control, .form-select { font-size: var(--ds-text-lg); }
}

/* Reduced motion: keep state changes, drop movement. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: var(--ds-duration-reduced) !important;
        animation-iteration-count: 1 !important;
        transition-duration: var(--ds-duration-reduced) !important;
        scroll-behavior: auto !important;
    }
}
