/* A custom glass menu enhances the original, fully functional theme selector. */
.theme-menu {
  position: relative;
  display: inline-flex;
  flex: none;
  color: var(--text);
}
.theme-menu__trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 8px 11px;
  border: 1px solid rgba(255,255,255,.66);
  border-radius: 13px;
  background: linear-gradient(145deg,rgba(255,255,255,.56),rgba(255,255,255,.24));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8),0 4px 16px rgba(52,70,122,.11);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  transition: background .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.theme-menu__trigger:hover, .theme-menu.is-open .theme-menu__trigger {
  background: linear-gradient(145deg,rgba(255,255,255,.75),rgba(225,235,255,.35));
  box-shadow: inset 0 1px 0 #fff,0 6px 20px rgba(62,81,148,.16);
}
.theme-menu__icon { font-size: 15px; line-height: 1; opacity: .8; }
.theme-menu__caret { display: inline-block; font-size: 11px; opacity: .7; transition: transform .25s ease; }
.theme-menu.is-open .theme-menu__caret { transform: rotate(180deg); }
.theme-menu__panel {
  position: absolute;
  z-index: 100;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  padding: 6px;
  border: 1px solid rgba(255,255,255,.76);
  border-radius: 18px;
  background: linear-gradient(145deg,rgba(249,252,255,.88),rgba(225,231,252,.82));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.95),0 18px 45px rgba(36,48,102,.23),0 3px 10px rgba(36,48,102,.10);
  -webkit-backdrop-filter: blur(28px) saturate(175%);
  backdrop-filter: blur(28px) saturate(175%);
  transform-origin: top right;
  animation: glass-menu-in .24s cubic-bezier(.2,.8,.2,1) both;
}
.theme-menu__panel[hidden] { display: none; }
.theme-menu__option {
  display: flex;
  width: 100%;
  min-height: 39px;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.theme-menu__option:hover, .theme-menu__option:focus-visible { background: rgba(255,255,255,.57); }
.theme-menu__option[aria-selected="true"] { background: rgba(92,118,210,.14); border-color: rgba(117,141,214,.18); font-weight: 700; }
.theme-menu__option .theme-menu__label { flex: 1; }
.theme-menu__check { color: var(--primary); font-weight: 900; opacity: 0; }
.theme-menu__option[aria-selected="true"] .theme-menu__check { opacity: 1; }
.theme-menu__trigger:focus-visible,.theme-menu__option:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.main-nav.has-theme-menu-open,.nav.has-theme-menu-open { z-index: 80; transform: none !important; }
:root[data-theme="dark"] .theme-menu__trigger { color: var(--text); border-color: rgba(198,219,255,.25); background: linear-gradient(145deg,rgba(128,161,219,.24),rgba(44,65,105,.23)); box-shadow: inset 0 1px 0 rgba(234,245,255,.24),0 4px 16px rgba(4,12,32,.22); }
:root[data-theme="dark"] .theme-menu__trigger:hover,:root[data-theme="dark"] .theme-menu.is-open .theme-menu__trigger { background: linear-gradient(145deg,rgba(149,185,244,.32),rgba(55,77,122,.31)); }
:root[data-theme="dark"] .theme-menu__panel { border-color: rgba(216,232,255,.24); background: linear-gradient(145deg,rgba(38,55,87,.92),rgba(24,38,68,.91)); box-shadow: inset 0 1px 0 rgba(231,243,255,.23),0 18px 46px rgba(3,8,24,.48); }
:root[data-theme="dark"] .theme-menu__option:hover,:root[data-theme="dark"] .theme-menu__option:focus-visible { background: rgba(193,218,255,.12); }
:root[data-theme="dark"] .theme-menu__option[aria-selected="true"] { background: rgba(133,165,244,.18); border-color: rgba(201,221,255,.12); }
@keyframes glass-menu-in { from { opacity: 0; transform: translateY(-6px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
@media (prefers-reduced-motion: reduce) { .theme-menu__panel { animation: none; } .theme-menu__trigger,.theme-menu__caret { transition: none; } }
