/* Loaded only with legacy Bootstrap (pages whose own HTML uses Bootstrap classes, see
   legacy_bootstrap_routes / denuo_legacy_assets). Points Bootstrap's variables at the theme
   tokens so its components follow the admin colours and light/dark mode. */
:root,
:root[data-bs-theme] {
    --bs-body-font-family: var(--font);
    --bs-body-color: var(--text);
    --bs-body-bg: var(--c-bg-start);
    --bs-emphasis-color: var(--heading);
    --bs-secondary-color: var(--muted);
    --bs-tertiary-bg: var(--surface);
    --bs-border-color: var(--border);
    --bs-link-color: var(--link);
    --bs-link-hover-color: var(--link-hover);
    --bs-heading-color: var(--heading);
    --bs-card-bg: var(--surface);
}

.btn-primary,
.btn-outline-primary {
    --bs-btn-color: var(--link);
    --bs-btn-border-color: var(--primary);
    --bs-btn-hover-bg: var(--primary);
    --bs-btn-hover-border-color: var(--primary);
    --bs-btn-hover-color: var(--on-primary);
    --bs-btn-active-bg: var(--primary);
    --bs-btn-active-border-color: var(--primary);
    --bs-btn-active-color: var(--on-primary);
}

.btn-primary {
    --bs-btn-bg: var(--primary);
    --bs-btn-color: var(--on-primary);
}

.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text);
    --bs-table-border-color: var(--border);
    --bs-table-striped-bg: var(--table-stripe-bg);
    --bs-table-striped-color: var(--text);
    --bs-table-hover-bg: var(--table-hover-bg);
    --bs-table-hover-color: var(--text);
    --bs-table-active-bg: var(--table-hover-bg);
    --bs-table-active-color: var(--text);
}

/* Bootstrap's contextual rows (.table-light etc.) hard-code light colours; in the theme they
   become the tinted head row in both modes. */
.table :is(.table-light, .table-secondary, .table-dark),
.table:is(.table-light, .table-dark) {
    --bs-table-bg: var(--table-head-bg);
    --bs-table-color: var(--heading);
    --bs-table-border-color: var(--border);
    --bs-table-striped-bg: var(--table-stripe-bg);
    --bs-table-hover-bg: var(--table-hover-bg);
}
