/* Keep the library and every knowledge room independent of the administrator's site theme.
   :has also covers native dialogs in the top layer and resets on client-side navigation. */
:root:has([data-library-theme="true"]) {
    --aj-primary: #0f6073;
    --aj-primary-dark: #093d49;
    --aj-primary-light: #3d8999;
    --aj-secondary: #c19a45;
    --aj-secondary-light: #dda533;
    --aj-surface: #f8faf9;
    --aj-surface-alt: #e8eff0;
    --aj-text: #20292c;
    --aj-muted: #657276;
    --aj-on-primary: #fff;
    --aj-on-secondary: #1b1f16;
    --aj-heading-font: "Kufam", serif;
    --aj-body-font: "Alexandria", sans-serif;
    --aj-base-font-size: 15px;
    --aj-nav-font-size: 15px;
    --aj-bg-pattern: url('/images/pattern/islamic-pattern.svg');
    --aj-bg-pattern-opacity: 1;
    --aj-bg-pattern-veil: transparent;
}

body {
    --bs-body-font-family: var(--aj-body-font);
    --bs-body-color: var(--aj-text);
    --bs-body-bg: var(--aj-surface);
    --bs-primary: var(--aj-primary);
    --bs-secondary: var(--aj-secondary);
    --bs-link-color: var(--aj-primary);
    --bs-link-hover-color: var(--aj-secondary);
    --bs-border-color: var(--aj-line);
}

button, input, select, textarea { font-family: var(--aj-body-font); }
:focus-visible { outline: 3px solid var(--aj-secondary); outline-offset: 3px; }

.aj-form-hint { color: var(--aj-muted); font-size: .85rem; margin-block: .75rem; }
.aj-form-feedback {
    padding: 1rem 1.25rem; margin-block: 1rem; border: 1px solid #b42318;
    border-inline-start-width: 5px; border-radius: .6rem; background: #fff4f2;
    color: #8f1d14; font-family: var(--aj-body-font); line-height: 1.9;
}
.aj-form-feedback ul { margin-block: .5rem; padding-inline-start: 1.5rem; }
.aj-form-feedback { scroll-margin-top: 6rem; }
.aj-form-feedback small { display: block; }
.invalid, [aria-invalid="true"] { border-color: #b42318 !important; }
.validation-message { color: #b42318; font-size: .85rem; line-height: 1.8; }
.notice.is-error { background: #fff4f2; color: #8f1d14; border: 1px solid #b42318; }

/* Errors remain beside their controls until the application clears them. */
.aj-shell .is-error:not(input):not(select):not(textarea) { scroll-margin-top: 6rem; }
.aj-errorToastHost { max-height: calc(100dvh - 2rem); overflow-y: auto; overscroll-behavior: contain; }
