/* Dark theme for the main pages (theme.js toggles <html class="dark">).
   The pages use the Tailwind CDN without dark: variants, so this sheet remaps
   the utility classes they use. Every selector starts with html.dark to
   outrank Tailwind, and hover / group-hover / focus variants are restated
   because the plain remaps would otherwise beat them. */

/* ---------- toggle button icons ---------- */
.theme-icon-sun { display: none; }
html.dark .theme-icon-sun { display: block; }
html.dark .theme-icon-moon { display: none; }

/* ---------- page tokens ---------- */
body { transition: background-color 0.2s ease, color 0.2s ease; }

html.dark {
  color-scheme: dark;
  --color-bg-primary: #0b1120;
  --color-bg-card: #131c2e;
  --color-text-main: #e2e8f0;
  --color-accent-primary: #f59e0b;
}

html.dark .visual-card { border-color: #26324a; }
html.dark .visual-card:hover {
  border-color: var(--color-accent-primary);
  box-shadow: 0 6px 16px -4px rgba(0, 0, 0, 0.55);
}

/* ---------- surfaces ---------- */
html.dark .bg-white\/95 { background-color: rgba(11, 17, 32, 0.92); }
/* Logo tiles (a white box wrapping an <img>) stay white so dark logos remain visible. */
html.dark .bg-white:not(:has(> img)) { background-color: #131c2e; }
html.dark .bg-gray-50 { background-color: #1b2538; }
html.dark .bg-gray-100 { background-color: #1e293b; }
html.dark .bg-gray-200 { background-color: #1a2436; }
html.dark .bg-amber-50 { background-color: rgba(245, 158, 11, 0.12); }
html.dark .bg-amber-100 { background-color: rgba(245, 158, 11, 0.18); }

/* ---------- text ---------- */
html.dark .text-gray-900 { color: #f1f5f9; }
html.dark .text-gray-800 { color: #e2e8f0; }
html.dark .text-gray-700 { color: #cbd5e1; }
html.dark .text-gray-600 { color: #a5b4c8; }
html.dark .text-gray-500 { color: #8a99b0; }
html.dark .text-amber-600 { color: #f59e0b; }
html.dark .text-amber-800 { color: #fcd34d; }

/* ---------- borders ---------- */
html.dark .border-gray-100 { border-color: #1f2a3f; }
html.dark .border-gray-200 { border-color: #26324a; }
html.dark .border-gray-300 { border-color: #334155; }
html.dark .border-amber-100 { border-color: rgba(245, 158, 11, 0.25); }

/* ---------- publication type badges ---------- */
html.dark .bg-blue-100 { background-color: rgba(59, 130, 246, 0.16); }
html.dark .text-blue-800 { color: #93c5fd; }
html.dark .border-blue-200 { border-color: rgba(96, 165, 250, 0.35); }
html.dark .bg-green-100 { background-color: rgba(34, 197, 94, 0.14); }
html.dark .text-green-800 { color: #86efac; }
html.dark .border-green-200 { border-color: rgba(74, 222, 128, 0.35); }

/* ---------- interactive states (restated so they beat the remaps) ---------- */
html.dark .hover\:bg-gray-50:hover { background-color: #1b2538; }
html.dark .hover\:bg-amber-50:hover { background-color: rgba(245, 158, 11, 0.12); }
html.dark .hover\:text-amber-600:hover,
html.dark .group:hover .group-hover\:text-amber-600 { color: #fbbf24; }
html.dark .hover\:text-amber-700:hover { color: #fcd34d; }
html.dark .hover\:border-amber-500:hover,
html.dark .focus\:border-amber-500:focus { border-color: #f59e0b; }
