/* LIBRARY UNRIKA — Global theme system: Academic Blue, Light, Dark */
:root, html[data-theme="academic"] {
  color-scheme: dark;
  --theme-bg: #0b1730;
  --theme-surface: #142744;
  --theme-surface-2: #1c3557;
  --theme-text: #edf4ff;
  --theme-muted: #b7c7dc;
  --theme-accent: #4da3ff;
  --theme-border: #345071;
  --theme-nav: rgba(8, 22, 44, .96);
  --theme-footer: #071326;
  --theme-shadow: 0 12px 32px rgba(0,0,0,.18);
}
html[data-theme="light"] {
  color-scheme: light;
  --theme-bg: #f4f7fb;
  --theme-surface: #ffffff;
  --theme-surface-2: #eaf0f7;
  --theme-text: #1c2b3d;
  --theme-muted: #5d6b7b;
  --theme-accent: #145da0;
  --theme-border: #d6e0eb;
  --theme-nav: rgba(255,255,255,.97);
  --theme-footer: #e8eef5;
  --theme-shadow: 0 10px 28px rgba(22,45,75,.08);
}
html[data-theme="dark"] {
  color-scheme: dark;
  --theme-bg: #111315;
  --theme-surface: #1c2024;
  --theme-surface-2: #292f35;
  --theme-text: #f1f3f5;
  --theme-muted: #b4bdc6;
  --theme-accent: #80b7ff;
  --theme-border: #3b444d;
  --theme-nav: rgba(20,23,26,.97);
  --theme-footer: #0b0d0f;
  --theme-shadow: 0 12px 32px rgba(0,0,0,.28);
}
/* Apply consistently across every static page, including inline styles. */
html[data-theme] body {
  background: var(--theme-bg) !important;
  color: var(--theme-text) !important;
  transition: background-color .2s ease, color .2s ease;
}
html[data-theme] .navbar,
html[data-theme] nav.navbar,
html[data-theme] .navbar.bg-dark {
  background: var(--theme-nav) !important;
  border-color: var(--theme-border) !important;
}
html[data-theme] .footer,
html[data-theme] footer {
  background: var(--theme-footer) !important;
  color: var(--theme-text) !important;
  border-color: var(--theme-border) !important;
}
html[data-theme] .card,
html[data-theme] .feature-card,
html[data-theme] .info-box,
html[data-theme] .list-group-item,
html[data-theme] .accordion-item,
html[data-theme] .modal-content {
  background-color: var(--theme-surface) !important;
  color: var(--theme-text) !important;
  border-color: var(--theme-border) !important;
  box-shadow: var(--theme-shadow);
}
html[data-theme] section,
html[data-theme] .bg-dark,
html[data-theme] .bg-secondary {
  color: var(--theme-text);
}
html[data-theme] .bg-light,
html[data-theme] .bg-white {
  background-color: var(--theme-surface-2) !important;
  color: var(--theme-text) !important;
}
html[data-theme] p,
html[data-theme] li,
html[data-theme] label,
html[data-theme] .form-text {
  color: inherit;
}
html[data-theme] .text-white,
html[data-theme] .text-white-50 {
  color: var(--theme-text) !important;
}
html[data-theme] .text-muted {
  color: var(--theme-muted) !important;
}
html[data-theme] .text-primary,
html[data-theme] a:not(.btn):not(.navbar-brand) {
  color: var(--theme-accent);
}
html[data-theme] .nav-link {
  color: var(--theme-text) !important;
}
html[data-theme] .nav-link:hover,
html[data-theme] .nav-link.active {
  color: var(--theme-accent) !important;
}
html[data-theme] .form-control,
html[data-theme] .form-select {
  background-color: var(--theme-surface) !important;
  color: var(--theme-text) !important;
  border-color: var(--theme-border) !important;
}
html[data-theme] .form-control::placeholder {
  color: var(--theme-muted);
}
html[data-theme] .btn-primary {
  background-color: var(--theme-accent) !important;
  border-color: var(--theme-accent) !important;
  color: #071326 !important;
}
html[data-theme="light"] .brand-title,
html[data-theme="light"] .brand-subtitle,
html[data-theme="light"] .brand-tagline {
  color: #1c2b3d !important;
}
.theme-switcher {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .25rem .4rem;
}
.theme-switcher label {
  color: var(--theme-text);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  margin: 0;
}
.theme-switcher select {
  min-width: 132px;
  max-width: 160px;
  padding: .32rem 1.8rem .32rem .55rem;
  border: 1px solid var(--theme-border);
  border-radius: .45rem;
  background: var(--theme-surface);
  color: var(--theme-text);
  font-size: .78rem;
}
@media (max-width: 991.98px) {
  .theme-switcher { padding: .55rem 0; }
  .theme-switcher select { width: 100%; max-width: 220px; }
}

/* Accessibility and theme consistency refinements */
html[data-theme] body,
html[data-theme] main,
html[data-theme] section,
html[data-theme] .container {
  transition: background-color .2s ease, color .2s ease;
}
html[data-theme="light"] .text-white,
html[data-theme="light"] .text-white-50,
html[data-theme="light"] .text-light,
html[data-theme="light"] .navbar-dark .navbar-nav .nav-link {
  color: var(--theme-text) !important;
}
html[data-theme="light"] .navbar-brand .brand-title,
html[data-theme="light"] .navbar-brand .brand-subtitle,
html[data-theme="light"] .navbar-brand .brand-tagline {
  color: var(--theme-text) !important;
}
html[data-theme] .dropdown-menu {
  background: var(--theme-surface) !important;
  border-color: var(--theme-border) !important;
}
html[data-theme] .dropdown-item {
  color: var(--theme-text) !important;
}
html[data-theme] .dropdown-item:hover,
html[data-theme] .dropdown-item:focus {
  background: var(--theme-surface-2) !important;
  color: var(--theme-accent) !important;
}
html[data-theme] a:focus-visible,
html[data-theme] button:focus-visible,
html[data-theme] select:focus-visible {
  outline: 3px solid var(--theme-accent);
  outline-offset: 2px;
}

/* Remove page-specific dark-only assumptions: global surfaces follow selected theme. */
html[data-theme] h1,
html[data-theme] h2,
html[data-theme] h3,
html[data-theme] h4,
html[data-theme] h5,
html[data-theme] h6 {
  color: var(--theme-text) !important;
}
html[data-theme] header.bg-primary {
  background: var(--theme-surface-2) !important;
  color: var(--theme-text) !important;
}
html[data-theme] .card-body p,
html[data-theme] .card-body li {
  color: var(--theme-text) !important;
}
html[data-theme] .navbar .nav-link {
  color: var(--theme-text) !important;
}
html[data-theme] .navbar .nav-link:hover,
html[data-theme] .navbar .nav-link.active {
  color: var(--theme-accent) !important;
}

.cms-article{font-size:1.05rem;line-height:1.85;color:var(--theme-text,#26364a)}
.cms-article h2,.cms-article h3,.cms-article h4{margin:1.7rem 0 .8rem;font-weight:750}
.cms-article img{max-width:100%;height:auto;border-radius:12px}
.cms-article blockquote{border-left:4px solid var(--theme-accent,#c7a24b);padding:.75rem 1rem;background:var(--theme-surface-2,#f3f6fa)}
