/*
 * Research7X universal theme.
 * Preserve the existing navy and gold identity.
 */

html[data-bs-theme="light"] {
    color-scheme: light;
    --r7x-background: #f8fafc;
    --r7x-surface: #ffffff;
    --r7x-text: #102943;
    --r7x-muted: #475569;
    --r7x-border: #dce3eb;
    --r7x-link: #174e80;
    --r7x-accent: #f2ad18;
}

html[data-bs-theme="dark"] {
    color-scheme: dark;
    --r7x-background: #101827;
    --r7x-surface: #1e293b;
    --r7x-text: #f1f5f9;
    --r7x-muted: #cbd5e1;
    --r7x-border: #405168;
    --r7x-link: #93c5fd;
    --r7x-accent: #f2ad18;
    --bs-body-bg: #101827;
    --bs-body-color: #f1f5f9;
    --bs-border-color: #405168;
}

html[data-bs-theme="dark"] body {
    background-color: var(--r7x-background);
    color: var(--r7x-text);
}

html[data-bs-theme="dark"] main {
    color: var(--r7x-text);
}

html[data-bs-theme="dark"] main a:not(.btn) {
    color: var(--r7x-link);
}

html[data-bs-theme="dark"] main :is(
    .tile, .card, .panel, .callout
) {
    background-color: var(--r7x-surface);
    color: var(--r7x-text);
    border-color: var(--r7x-border);
}

html[data-bs-theme="dark"] main :is(
    .muted, .text-muted
) {
    color: var(--r7x-muted);
}

html[data-bs-theme="dark"] main :is(
    input, select, textarea
) {
    background-color: var(--r7x-surface);
    color: var(--r7x-text);
    border-color: var(--r7x-border);
}

html[data-bs-theme="dark"] main :is(
    input, textarea
)::placeholder {
    color: var(--r7x-muted);
}

html[data-bs-theme="dark"] main :is(
    table, th, td
) {
    border-color: var(--r7x-border);
}

html[data-bs-theme="dark"] main :is(
    th, td
) {
    background-color: var(--r7x-surface);
    color: var(--r7x-text);
}

html[data-bs-theme="dark"] main hr {
    border-color: var(--r7x-border);
}

html[data-bs-theme="dark"] footer {
    background-color: #0b1220;
    color: var(--r7x-text);
}

html[data-bs-theme="dark"] footer a {
    color: #cbd5e1;
}

.r7x-site-header .r7x-brand[aria-current="page"] {
    box-shadow: 0 0 0 2px #f2ad18;
}

.r7x-site-header .offcanvas-header .btn-close {
    --bs-btn-close-filter:
        invert(1) grayscale(100%) brightness(200%);
    filter: invert(1) grayscale(100%) brightness(200%);
}

.r7x-site-header .research7x-theme-toggle[hidden],
.r7x-site-header [data-theme-icon][hidden] {
    display: none !important;
}

.r7x-site-header .research7x-theme-toggle svg {
    display: block;
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.r7x-site-header .research7x-theme-toggle:hover {
    background-color: #294967;
    color: #f2ad18;
}

@media (prefers-reduced-motion: reduce) {
    .r7x-site-header *,
    .offcanvas-backdrop {
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
    }
}

@media print {

    html[data-bs-theme],
    html[data-bs-theme] body {
        color-scheme: light !important;
        background: #fff !important;
        color: #000 !important;
    }

    html[data-bs-theme] main,
    html[data-bs-theme] main :is(
        .tile, .card, .panel, .callout,
        table, th, td, input, select, textarea
    ) {
        background-color: #fff !important;
        color: #000 !important;
        border-color: #777 !important;
    }

    html[data-bs-theme] main a {
        color: #000 !important;
    }

    .research7x-theme-toggle,
    .r7x-site-header,
    .offcanvas-backdrop {
        display: none !important;
    }
}
