/*
 * Theme switcher (resources/views/theme/theme-switcher.blade.php)
 * Loaded from theme/theme-init in both the app and the guest/auth <head>, before Bootstrap,
 * so selectors are scoped under .theme-switcher to win over Bootstrap's .dropdown-item rules.
 */
.theme-switcher .theme-switcher__toggle {
    display: grid;
    place-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 0.5rem;
    border: 1px solid var(--rev-border);
    background: transparent;
    cursor: pointer;
}

.theme-switcher .theme-switcher__toggle:hover,
.theme-switcher.show .theme-switcher__toggle {
    background: light-dark(
        color-mix(in srgb, var(--primary) 5%, transparent),
        color-mix(in srgb, var(--primary) 50%, transparent)
    );
}

/* show only the icon of the current preference; driven by <html data-theme-preference> so it is right before JS runs */
.theme-switcher .theme-switcher__current {
    display: none;
}

:root[data-theme-preference="light"]
    .theme-switcher
    .theme-switcher__current--light,
:root[data-theme-preference="dark"]
    .theme-switcher
    .theme-switcher__current--dark,
:root[data-theme-preference="auto"]
    .theme-switcher
    .theme-switcher__current--auto {
    display: block;
}

.theme-switcher .theme-switcher__menu {
    min-width: 11rem;
    padding: 0.25rem;
}

.theme-switcher .theme-switcher__check {
    margin-left: auto;
    visibility: hidden;
}

.theme-switcher .theme-switcher__option.active {
    color: var(--secondary);
    background-color: transparent;
}

.theme-switcher .theme-switcher__option.active .theme-switcher__check {
    visibility: visible;
}
