/* ==========================================================================
   Base: page-wide defaults for the redesign. Keep this file small.
   Anything specific to one screen goes in css/pages/<screen>.css instead.
   ========================================================================== */
@layer app-base {

    /* Alpine hides an element with x-cloak until it has started */
    [x-cloak] { display: none; }

    /* Screen panels: switchAppView() toggles .active on one .view-panel at a time */
    .view-panel { display: none; }
    .view-panel.active { display: block; }

    /* Visually hidden label for screen readers */
    .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;
    }

    /* One root size for the whole app (the old stylesheet's html/body rules, 14px and 13.5px, sit in the lower
       legacy layer). Text sizes below are written in rem, so they follow this value. */
    html { font-size: var(--d26-font-root, 16px); }
    body { font-size: 1rem; }

    /* Hide custom elements until they are defined, so the page does not flash
       unstyled controls (Web Awesome registers them a moment after load). */
    :not(:defined) {
        visibility: hidden;
    }

    /* Always-visible keyboard focus (UI_PATTERNS.md accessibility rules) */
    :focus-visible {
        outline: 3px solid var(--wa-color-focus, var(--d26-accent));
        outline-offset: 2px;
    }

    /* Respect the user's reduced-motion setting */
    @media (prefers-reduced-motion: reduce) {
        *,
        *::before,
        *::after {
            animation-duration: 0.01ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: 0.01ms !important;
        }
    }
}
