/* Theme-agnostic chrome (currently: the theme switcher). Loaded before
   the active theme file so per-theme CSS can still override if a theme
   ever needs a different look for it. Colors here are hardcoded (not
   theme variables) so the switcher stays visible and legible no matter
   which theme is active. */

/* Shared sizing for inline Phosphor SVG icons — 1em ties them to
   whatever font-size the parent button already sets */
.icon {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
}

.theme-toggle {
  position: fixed;
  top: 1.1rem;
  right: 1.1rem;
  z-index: 50;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(232, 168, 61, 0.5);
  background: rgba(10, 7, 4, 0.55);
  color: #E8A83D;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  transition: background 0.2s, transform 0.2s;
}

.theme-toggle:hover {
  background: rgba(10, 7, 4, 0.8);
  transform: rotate(20deg);
}

.voice-toggle {
  position: fixed;
  top: 1.1rem;
  left: 1.1rem;
  z-index: 50;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(232, 168, 61, 0.5);
  background: rgba(10, 7, 4, 0.55);
  color: #E8A83D;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  transition: background 0.2s;
}

.voice-toggle:hover {
  background: rgba(10, 7, 4, 0.8);
}

/* Two stacked icons; toggle which is visible via the button's
   aria-pressed state rather than swapping DOM content */
.voice-toggle .icon-off { display: none; }
.voice-toggle[aria-pressed="true"] .icon-on { display: none; }
.voice-toggle[aria-pressed="true"] .icon-off { display: block; }

.lang-toggle {
  position: fixed;
  top: 3.6rem;
  right: 1.1rem;
  z-index: 50;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(232, 168, 61, 0.5);
  background: rgba(10, 7, 4, 0.55);
  color: #E8A83D;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  transition: background 0.2s;
}

.lang-toggle:hover {
  background: rgba(10, 7, 4, 0.8);
}

.theme-panel,
.lang-panel {
  position: fixed;
  top: 3.6rem;
  right: 1.1rem;
  z-index: 50;
  min-width: 190px;
  background: rgba(8, 5, 3, 0.92);
  border: 1px solid rgba(232, 168, 61, 0.35);
  border-radius: 10px;
  padding: 0.75rem;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.lang-panel {
  top: 6.1rem;
}

.theme-panel[hidden],
.lang-panel[hidden] {
  display: none;
}

.theme-panel-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8A7A5E;
  margin-bottom: 0.5rem;
  padding: 0 0.25rem;
}

.theme-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.theme-option {
  width: 100%;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  background: none;
  border: none;
  border-radius: 6px;
  padding: 0.45rem 0.6rem;
  cursor: pointer;
  color: #F5ECD7;
  font-family: 'Cardo', Georgia, serif;
  font-size: 0.85rem;
  text-align: left;
  transition: background 0.15s;
}

.theme-option:hover {
  background: rgba(232, 168, 61, 0.12);
}

.theme-option.active {
  background: rgba(232, 168, 61, 0.18);
  color: #F5C776;
}

.theme-option-sanskrit {
  font-size: 0.75rem;
  opacity: 0.6;
}

.classic-link {
  position: fixed;
  bottom: 0.9rem;
  right: 1.1rem;
  z-index: 50;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: #8A7A5E;
  text-decoration: none;
  opacity: 0.6;
  transition: opacity 0.2s, color 0.2s;
}

.classic-link:hover {
  opacity: 1;
  color: #E8A83D;
}

@media (max-width: 480px) {
  .classic-link { bottom: 0.7rem; right: 0.85rem; font-size: 0.6rem; }
  .theme-toggle { top: 0.85rem; right: 0.85rem; }
  .theme-panel { top: 3.3rem; right: 0.85rem; }
  .voice-toggle { top: 0.85rem; left: 0.85rem; }
  .lang-toggle { top: 3.3rem; right: 0.85rem; }
  .lang-panel { top: 5.8rem; right: 0.85rem; }
}
