/*
 * Visitor-selectable Eljame visual modes.
 *
 * Warm is the current 1.3 design. Classic revives the original Eljame
 * blue/teal identity without reviving its obsolete templates or dependencies.
 */

:root {
  --eljame-switcher-accent: #0f6371;
  --eljame-switcher-accent-strong: #054f5b;
  --eljame-switcher-surface: #ffffff;
  --eljame-switcher-ink: #17202a;
  --eljame-switcher-muted: #5f6b76;
  --eljame-switcher-border: #d8dee4;
  --eljame-switcher-focus: #c08a1d;
}

html[data-eljame-theme="warm"] {
  color-scheme: light;
}

html[data-eljame-theme="classic"] {
  color-scheme: light;
  --eljame-switcher-accent: #003973;
  --eljame-switcher-accent-strong: #002b57;
  --eljame-switcher-focus: #0c90a6;
}

html[data-eljame-theme="classic"] body {
  color: #1f2933;
  background: #f3f6f8;
}

html[data-eljame-theme="classic"] ::selection {
  color: #ffffff;
  background: #0f6371;
}

html[data-eljame-theme="classic"] .site-header {
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 3px solid #0f6371;
  box-shadow: 0 4px 16px rgba(0, 57, 115, 0.08);
}

html[data-eljame-theme="classic"] .top-bar,
html[data-eljame-theme="classic"] .news-ticker {
  background: #003973;
}

html[data-eljame-theme="classic"] .nav-menu .face-bottom,
html[data-eljame-theme="classic"] #primary-menu .face-bottom,
html[data-eljame-theme="classic"] .btn-cta,
html[data-eljame-theme="classic"] .button,
html[data-eljame-theme="classic"] .view-button,
html[data-eljame-theme="classic"] .download-button {
  background: #0f6371;
  color: #ffffff;
}

html[data-eljame-theme="classic"] .nav-menu .current-menu-item > a .face-front,
html[data-eljame-theme="classic"] .nav-menu .current_page_item > a .face-front,
html[data-eljame-theme="classic"] #primary-menu .current-menu-item > a .face-front,
html[data-eljame-theme="classic"] #primary-menu .current_page_item > a .face-front,
html[data-eljame-theme="classic"] a:hover {
  color: #0f6371;
}

html[data-eljame-theme="classic"] .home-library-grid,
html[data-eljame-theme="classic"] .home-section,
html[data-eljame-theme="classic"] .archive-header,
html[data-eljame-theme="classic"] .page-header {
  background-color: #f3f6f8;
}

html[data-eljame-theme="classic"] .library-card,
html[data-eljame-theme="classic"] .lecture-card,
html[data-eljame-theme="classic"] .book-card,
html[data-eljame-theme="classic"] .book-card-compact,
html[data-eljame-theme="classic"] .series-card,
html[data-eljame-theme="classic"] .video-card,
html[data-eljame-theme="classic"] .list-card,
html[data-eljame-theme="classic"] .widget,
html[data-eljame-theme="classic"] article {
  background-color: #ffffff;
  border-color: #d7e0e6;
  box-shadow: 0 8px 24px rgba(0, 57, 115, 0.07);
}

html[data-eljame-theme="classic"] .section-header h2,
html[data-eljame-theme="classic"] .entry-title,
html[data-eljame-theme="classic"] .page-title,
html[data-eljame-theme="classic"] .widget-title {
  color: #003973;
}

html[data-eljame-theme="classic"] .site-footer {
  background: #00315f;
}

html[data-eljame-theme="classic"] .footer-copyright,
html[data-eljame-theme="classic"] .footer-listen__links a,
html[data-eljame-theme="classic"] .footer-apps li {
  background: #002547;
}

/* The footer statistics card composites to #18456e in classic mode. Its
   default light gold measures 4.09:1 there; this step clears AA at 4.98:1. */
html[data-eljame-theme="classic"] .eljame-site-stats--footer {
  --eljame-stats-gold: #e8ad55;
}

html[data-eljame-theme="classic"] .footer-col h3,
html[data-eljame-theme="classic"] .footer-col h4 {
  border-bottom-color: #4fc2cf;
}

.theme-switcher {
  position: fixed;
  top: 50%;
  left: 0;
  z-index: 1080;
  display: flex;
  align-items: center;
  direction: ltr;
  transform: translateY(-50%);
}

.theme-switcher__toggle {
  display: inline-flex;
  width: 46px;
  height: 52px;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: #ffffff;
  background: var(--eljame-switcher-accent);
  border: 0;
  border-radius: 0 12px 12px 0;
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.2);
  cursor: pointer;
  transition: width 160ms ease, background 160ms ease;
}

.theme-switcher__toggle:hover,
.theme-switcher.is-open .theme-switcher__toggle {
  width: 52px;
  background: var(--eljame-switcher-accent-strong);
}

.theme-switcher__toggle svg {
  width: 22px;
  height: 22px;
}

.theme-switcher__toggle:focus-visible,
.theme-switcher__choice:focus-visible {
  outline: 3px solid var(--eljame-switcher-focus);
  outline-offset: 3px;
}

.theme-switcher__panel {
  width: min(260px, calc(100vw - 70px));
  margin-left: 10px;
  padding: 0.75rem;
  direction: rtl;
  color: var(--eljame-switcher-ink);
  background: var(--eljame-switcher-surface);
  border: 1px solid var(--eljame-switcher-border);
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(17, 24, 39, 0.22);
}

.theme-switcher__panel[hidden] {
  display: none;
}

.theme-switcher__panel > strong {
  display: block;
  margin: 0 0 0.55rem;
  font-size: 0.82rem;
}

.theme-switcher__choice {
  display: grid;
  width: 100%;
  grid-template-columns: 32px minmax(0, 1fr) 18px;
  gap: 0.65rem;
  align-items: center;
  padding: 0.65rem;
  color: var(--eljame-switcher-ink);
  text-align: right;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
}

.theme-switcher__choice + .theme-switcher__choice {
  margin-top: 0.35rem;
}

.theme-switcher__choice:hover {
  background: #f3f6f8;
  border-color: var(--eljame-switcher-border);
}

.theme-switcher__choice[aria-pressed="true"] {
  background: #edf8f8;
  border-color: #78b8bf;
}

html[data-eljame-theme="classic"] .theme-switcher__choice[aria-pressed="true"] {
  background: #eef5fb;
  border-color: #8aaccb;
}

.theme-switcher__choice > span:not(.theme-switcher__swatch) {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.theme-switcher__choice b {
  font-size: 0.82rem;
}

.theme-switcher__choice small {
  color: var(--eljame-switcher-muted);
  font-size: 0.68rem;
  line-height: 1.45;
}

.theme-switcher__swatch {
  width: 30px;
  height: 30px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--eljame-switcher-border);
}

.theme-switcher__swatch--warm {
  background: linear-gradient(135deg, #fcf9f5 0 50%, #b78318 50% 75%, #0f5f5a 75%);
}

.theme-switcher__swatch--classic {
  background: linear-gradient(135deg, #ffffff 0 50%, #003973 50% 75%, #0f6371 75%);
}

.theme-switcher__check {
  width: 18px;
  height: 18px;
  color: var(--eljame-switcher-accent);
  opacity: 0;
}

.theme-switcher__choice[aria-pressed="true"] .theme-switcher__check {
  opacity: 1;
}

@media (max-width: 639px) {
  .theme-switcher {
    top: auto;
    bottom: 5.5rem;
    left: 0;
    transform: none;
  }

  .theme-switcher__toggle {
    width: 42px;
    height: 46px;
  }

  .theme-switcher__toggle:hover,
  .theme-switcher.is-open .theme-switcher__toggle {
    width: 46px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .theme-switcher__toggle,
  html[data-eljame-theme="classic"] * {
    transition-duration: 0.01ms !important;
  }
}
