/* App-wide Blazor states; visual components use Tailwind utilities. */
h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--color-success);
}

.invalid {
    outline: 2px solid var(--color-danger);
}

.validation-message {
    color: var(--color-danger);
}

.blazor-error-boundary {
    background: var(--color-danger);
    border-radius: var(--radius-control);
    padding: 1rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

/* Admin collapsible sidebar. admin-sidebar.js owns the state and projects it to the toggle's
   aria-expanded attribute; these rules read that same attribute. The default hidden display keeps
   the control unavailable below md and until the enhancement runs, leaving the sidebar expanded. */
[data-admin-sidebar-toggle] {
    display: none;
}

@media (min-width: 48rem) {
    [data-admin-sidebar-toggle]:not([hidden]) {
        display: inline-flex;
    }

    [data-admin-sidebar-toggle][aria-expanded="false"] svg {
        transform: scaleX(-1);
    }

    /* Icon-only rail: 5rem wide, centred mark and icons. Link labels stay in the accessibility
       tree (clipped, never display:none) so names, focus and active styling are preserved. */
    [data-navigation-shell]:has([data-admin-sidebar-toggle][aria-expanded="false"]) {
        [data-navigation-panel] {
            width: 5rem;
        }

        [data-navigation-panel] > div {
            padding-inline: 0;
        }

        [data-navigation-panel] > div:first-child {
            justify-content: center;
        }

        [data-navigation-panel] .brand {
            gap: 0;
        }

        [data-navigation-panel] .brand-wordmark {
            display: none;
        }

        [data-navigation-panel] nav {
            padding-inline: 0.75rem;
        }

        [data-navigation-panel] nav a {
            justify-content: center;
            gap: 0;
            padding-inline: 0.25rem;
        }

        [data-navigation-panel] [data-admin-sidebar-label] {
            position: absolute;
            width: 1px;
            height: 1px;
            margin: -1px;
            padding: 0;
            overflow: hidden;
            clip-path: inset(50%);
            white-space: nowrap;
            border: 0;
        }
    }
}
