/* Light / dark mode button: a round icon button shared by the public site, student area and panels.
   Light mode shows a moon (switch to dark), dark mode shows a sun (switch to light). */
.theme-btn {
    --tb-size: 40px;
    position: relative;
    width: var(--tb-size);
    height: var(--tb-size);
    flex: none;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(0, 72, 132, .14);
    background: #fff;
    color: var(--gulf-blue-dark, #004884);
    box-shadow: 0 .2rem .6rem rgba(0, 40, 70, .08);
    cursor: pointer;
    overflow: hidden;
    transition: background .25s ease, color .25s ease, border-color .25s ease, box-shadow .25s ease, transform .15s ease;
}
.theme-btn:hover {
    border-color: rgba(0, 120, 180, .35);
    box-shadow: 0 .35rem .9rem rgba(0, 72, 132, .16);
    color: var(--gulf-blue, #0078B4);
}
.theme-btn:active { transform: scale(.94); }
.theme-btn:focus-visible { outline: 2px solid var(--gulf-blue, #0078B4); outline-offset: 2px; }

.theme-btn .bi {
    grid-area: 1 / 1;
    font-size: 1.05rem;
    line-height: 1;
    transition: transform .35s ease, opacity .25s ease;
}
.theme-btn .tb-sun { opacity: 0; transform: rotate(-90deg) scale(.5); color: #f5b301; }
.theme-btn .tb-moon { opacity: 1; transform: none; }

[data-bs-theme="dark"] .theme-btn {
    background: rgba(255, 255, 255, .06);
    border-color: rgba(255, 255, 255, .14);
    color: #e6edf3;
    box-shadow: none;
}
[data-bs-theme="dark"] .theme-btn:hover { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .25); }
[data-bs-theme="dark"] .theme-btn .tb-sun { opacity: 1; transform: none; }
[data-bs-theme="dark"] .theme-btn .tb-moon { opacity: 0; transform: rotate(90deg) scale(.5); }

/* Panels use slightly larger controls in the top bar */
.panel-topbar .theme-btn { --tb-size: 44px; }
.panel-topbar .theme-btn .bi { font-size: 1.15rem; }

@media (max-width: 575.98px) {
    .theme-btn, .panel-topbar .theme-btn { --tb-size: 36px; }
    .theme-btn .bi, .panel-topbar .theme-btn .bi { font-size: .95rem; }
}
