/*
 * Hingenia — Dark mode (estático, sin Tailwind build).
 * Se activa cuando <html> tiene la clase .dark.
 *
 * Estrategia: cubrir chrome (header/footer) + páginas principales (front-page,
 * cursos, blog, ebooks, masterclass, membresía, page.php genérica) reescribiendo
 * los utilitarios Tailwind más comunes dentro de .site-main, sin tocar
 * componentes ya oscuros (footer, cards con fondos saturados, etc.).
 */

html.dark {
	color-scheme: dark;
	/* Pintamos el HTML del color base para que cualquier zona "fuera" del body
	   (overscroll, área detrás del header sticky en el primer paint, alturas
	   menores al viewport) no muestre blanco. */
	background-color: #080809;
}

html.dark body {
	background-color: #080809;
	color: #e5e7eb;
	background-image:
		radial-gradient(ellipse 1300px 820px at 12% -8%, rgba(37, 99, 235, 0.08), transparent 58%),
		radial-gradient(ellipse 1000px 640px at 88% 26%, rgba(99, 102, 241, 0.05), transparent 58%),
		radial-gradient(ellipse 900px 600px at 50% 112%, rgba(255, 255, 255, 0.022), transparent 60%);
	background-attachment: fixed;
}

/* ============== HEADER ============== */
/* Header sticky con efecto glass: ANTES era muy transparente (alpha 0.62) y al
   estar en scroll=0 el cristal mostraba el cuasi-blanco de páginas con fondo
   claro (membresía, libro de reclamaciones) y se veía una franja luminosa por
   encima del contenido. Subimos la opacidad para que el header funcione como
   un sólido casi-opaco, manteniendo un toque glass al hacer scroll sobre cards
   oscuras del contenido. */
html.dark .site-header {
	background-color: rgba(8, 8, 9, 0.92);
	backdrop-filter: blur(18px) saturate(160%);
	-webkit-backdrop-filter: blur(18px) saturate(160%);
	border-bottom-color: rgba(255, 255, 255, 0.06);
}

/* Logo Hingenia: blanco en modo oscuro.
   - Texto fallback (text-hingenia-primary) → blanco
   - Imagen del logo custom → invertida a blanco con CSS filter */
html.dark .site-header .text-hingenia-primary { color: #ffffff !important; }
html.dark .site-header .custom-logo,
html.dark .site-header .custom-logo-link img,
html.dark #hg-mobile-drawer .custom-logo,
html.dark #hg-mobile-drawer .custom-logo-link img {
	filter: brightness(0) invert(1);
}
html.dark .site-header .text-gray-700,
html.dark .site-header .text-gray-800,
html.dark .site-header .text-gray-900 { color: #e5e7eb; }
html.dark .site-header .text-gray-500,
html.dark .site-header .text-gray-600 { color: #9ca3af; }
html.dark .site-header a:hover,
html.dark .site-header button:hover { color: #f9fafb; }
html.dark .site-header .hover\:bg-gray-50:hover,
html.dark .site-header .hover\:bg-gray-100:hover { background-color: #1c1c21; }

/* Dropdown del menú */
html.dark .site-header .bg-white {
	background-color: #121214;
	border-color: #1c1c21;
}
/* Ítem de menú activo: usa bg-blue-50 (clarísimo) → se veía blanco.
   El texto sigue blanco (regla del logo arriba) y se lee sobre el azul. */
html.dark .site-header .bg-blue-50 { background-color: rgba(37, 99, 235, 0.22) !important; }

/* Drawer mobile */
html.dark #hg-mobile-drawer {
	background-color: #121214;
	color: #e5e7eb;
}
html.dark #hg-mobile-drawer .text-gray-400 { color: #94a3b8; }
html.dark #hg-mobile-drawer .text-gray-500,
html.dark #hg-mobile-drawer .text-gray-600,
html.dark #hg-mobile-drawer .text-gray-700,
html.dark #hg-mobile-drawer .text-gray-800 { color: #e5e7eb; }
html.dark #hg-mobile-drawer .border-gray-100,
html.dark #hg-mobile-drawer .border-gray-200 { border-color: #1c1c21; }
html.dark #hg-mobile-drawer .hover\:bg-gray-50:hover { background-color: #1c1c21; }
html.dark #hg-mobile-drawer .hover\:bg-red-50:hover { background-color: rgba(239, 68, 68, 0.15); }

/* ============== TOGGLE BUTTON ============== */
.hg-theme-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 9999px;
	color: #2a2a30;
	transition: background-color 0.15s, color 0.15s;
	background: transparent;
	border: 0;
	cursor: pointer;
}
.hg-theme-toggle:hover { background-color: rgba(0,0,0,0.05); }
.hg-theme-toggle .icon-sun  { display: none; }
.hg-theme-toggle .icon-moon { display: block; }
html.dark .hg-theme-toggle { color: #e5e7eb; }
html.dark .hg-theme-toggle:hover { background-color: rgba(255,255,255,0.08); }
html.dark .hg-theme-toggle .icon-sun  { display: block; }
html.dark .hg-theme-toggle .icon-moon { display: none; }

/* Versión inline para drawer mobile (no circular) */
.hg-theme-toggle--row {
	width: 100%;
	height: auto;
	border-radius: 0.5rem;
	padding: 0.625rem 0.75rem;
	gap: 0.75rem;
	justify-content: flex-start;
	font-size: 0.875rem;
	font-weight: 500;
}
html.dark .hg-theme-toggle--row { color: #e5e7eb; }

/* ============== MAIN CONTENT ============== */
html.dark .site-main {
	background-color: transparent;
	color: #e5e7eb;
}

/* Wrapper exterior bg-gray-50 que envuelve secciones de varias páginas:
   en vez de un gris plano, lo dejamos transparente para que se vea el
   gradient atmosférico del body (estilo EDteam). */
html.dark .site-main > .bg-gray-50,
html.dark .site-main > div > .bg-gray-50 { background-color: transparent !important; }

/* Cards / surfaces: gradient sutil + borde glow leve sobre el navy más profundo.
   Esto da el feel "EDteam" — cards que parecen levitar sobre el atmosphere. */
html.dark .site-main .bg-white {
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.015) 100%) !important;
	border-color: rgba(255, 255, 255, 0.08) !important;
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
}
html.dark .site-main .bg-gray-50 { background-color: rgba(255, 255, 255, 0.025) !important; }
html.dark .site-main .bg-gray-100 { background-color: rgba(255, 255, 255, 0.04) !important; }
html.dark .site-main .bg-slate-50 { background-color: rgba(255, 255, 255, 0.025) !important; }
html.dark .site-main .bg-slate-100 { background-color: rgba(255, 255, 255, 0.04) !important; }
html.dark .site-main .bg-blue-50 { background-color: rgba(37, 99, 235, 0.10) !important; }
html.dark .site-main .bg-amber-50 { background-color: rgba(245, 158, 11, 0.10) !important; }
html.dark .site-main .bg-emerald-50 { background-color: rgba(16, 185, 129, 0.10) !important; }
html.dark .site-main .bg-rose-50 { background-color: rgba(244, 63, 94, 0.10) !important; }

/* Hover de cards bg-white con shadow-xl/lg → glow azul tipo EDteam */
html.dark .site-main .bg-white.hover\:shadow-xl:hover,
html.dark .site-main .hover\:shadow-xl:hover.bg-white,
html.dark .site-main article.bg-white:hover {
	border-color: rgba(96, 165, 250, 0.25) !important;
	box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.15), 0 12px 40px -12px rgba(37, 99, 235, 0.45) !important;
}

/* Texto */
html.dark .site-main .text-gray-900 { color: #f9fafb !important; }
html.dark .site-main .text-gray-800 { color: #f3f4f6 !important; }
html.dark .site-main .text-gray-700 { color: #e5e7eb !important; }
html.dark .site-main .text-gray-600 { color: #d1d5db !important; }
html.dark .site-main .text-gray-500 { color: #9ca3af !important; }
html.dark .site-main .text-gray-400 { color: #94a3b8 !important; }
html.dark .site-main .text-slate-900 { color: #f9fafb !important; }
html.dark .site-main .text-slate-800 { color: #f3f4f6 !important; }
html.dark .site-main .text-slate-700 { color: #e5e7eb !important; }
html.dark .site-main .text-slate-600 { color: #d1d5db !important; }

/* Bordes */
html.dark .site-main .border-gray-100 { border-color: #18181b !important; }
html.dark .site-main .border-gray-200 { border-color: #2a2a30 !important; }
html.dark .site-main .border-gray-300 { border-color: #4b5563 !important; }
html.dark .site-main .border-slate-100 { border-color: #18181b !important; }
html.dark .site-main .border-slate-200 { border-color: #2a2a30 !important; }
html.dark .site-main .divide-gray-100 > * + * { border-color: #18181b !important; }
html.dark .site-main .divide-gray-200 > * + * { border-color: #2a2a30 !important; }

/* Sombras suaves se ven raras sobre fondo oscuro: las atenuamos */
html.dark .site-main .shadow,
html.dark .site-main .shadow-sm,
html.dark .site-main .shadow-md,
html.dark .site-main .shadow-lg,
html.dark .site-main .shadow-xl { box-shadow: 0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3); }

/* Inputs / forms */
html.dark .site-main input[type="text"],
html.dark .site-main input[type="email"],
html.dark .site-main input[type="password"],
html.dark .site-main input[type="search"],
html.dark .site-main input[type="number"],
html.dark .site-main input[type="tel"],
html.dark .site-main input[type="url"],
html.dark .site-main textarea,
html.dark .site-main select {
	background-color: #18181b;
	color: #e5e7eb;
	border-color: #2a2a30;
}
html.dark .site-main input::placeholder,
html.dark .site-main textarea::placeholder { color: #9ca3af; }

/* Hover de utilitarios claros — los volvemos un poco más oscuros */
html.dark .site-main .hover\:bg-gray-50:hover { background-color: #1c1c21 !important; }
html.dark .site-main .hover\:bg-gray-100:hover { background-color: #18181b !important; }
html.dark .site-main .hover\:bg-white:hover    { background-color: #121214 !important; }

/* Prose (artículos del blog) */
html.dark .site-main .prose {
	color: #e5e7eb;
}
html.dark .site-main .prose :where(h1,h2,h3,h4,h5,h6,strong) { color: #f9fafb; }
html.dark .site-main .prose :where(a) { color: #60a5fa; }
html.dark .site-main .prose :where(blockquote) { color: #d1d5db; border-left-color: #2a2a30; }
html.dark .site-main .prose :where(code) { color: #fbbf24; background: rgba(251, 191, 36, 0.08); }
html.dark .site-main .prose :where(hr) { border-color: #2a2a30; }

/* Badges/pills con fondos claros */
html.dark .site-main .bg-blue-100 { background-color: rgba(37, 99, 235, 0.18) !important; color: #93c5fd !important; }
html.dark .site-main .text-blue-800 { color: #93c5fd !important; }
html.dark .site-main .text-blue-700 { color: #60a5fa !important; }

/* ============== CLASES CUSTOM HINGENIA ============== */
/* text-hingenia-dark (#030712) y text-hingenia-navy (#0F172A) son casi negros —
   se quedan ilegibles sobre fondo oscuro. Los pasamos a blanco/cercano. */
html.dark .site-main .text-hingenia-dark { color: #f9fafb !important; }
html.dark .site-main .text-hingenia-navy { color: #f3f4f6 !important; }
html.dark .site-main .text-hingenia-deep { color: #93c5fd !important; }
html.dark .site-main .text-hingenia-primary { color: #60a5fa !important; }
html.dark .site-main .text-hingenia-secondary { color: #93c5fd !important; }

/* bg-hingenia-dark/navy ya son oscuros — quedan bien igual.
   bg-hingenia-light (#F9FAFB) y bg-hingenia-soft (#DBEAFE) son claros — flipear. */
html.dark .site-main .bg-hingenia-light { background-color: #111827 !important; }
html.dark .site-main .bg-hingenia-soft  { background-color: rgba(37, 99, 235, 0.18) !important; }

/* Bordes de marca con tinte oscuro casi invisibles → cambiamos al primary blue
   para que dibujen el contorno con identidad de marca */
html.dark .site-main .border-hingenia-dark { border-color: #2563eb !important; }
html.dark .site-main .border-hingenia-navy { border-color: #1c1c21 !important; }

/* Botones con bg-hingenia-dark se mimetizan con el navy. Los promovemos al
   azul primary para que destaquen como CTA. Solo cuando son <a> o <button>
   (no cards/articles que sí queremos dejar oscuras). */
html.dark .site-main a.bg-hingenia-dark,
html.dark .site-main button.bg-hingenia-dark {
	background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
	color: #ffffff !important;
}
html.dark .site-main a.bg-hingenia-dark:hover,
html.dark .site-main button.bg-hingenia-dark:hover {
	background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%) !important;
	box-shadow: 0 8px 24px -8px rgba(37, 99, 235, 0.5) !important;
}

/* Botones ghost con border-2 border-hingenia-dark + text-hingenia-dark
   (ej. "Masterclass gratis"): borde azul + texto blanco */
html.dark .site-main a.border-hingenia-dark,
html.dark .site-main button.border-hingenia-dark {
	border-color: rgba(96, 165, 250, 0.5) !important;
	color: #f9fafb !important;
}
html.dark .site-main a.border-hingenia-dark:hover,
html.dark .site-main button.border-hingenia-dark:hover {
	background-color: rgba(37, 99, 235, 0.15) !important;
	border-color: #60a5fa !important;
}

/* Cards `article.bg-hingenia-dark` (ej. card Premium en home, banner CTA fondo
   oscuro): se mimetizan con el navy. Los hacemos un pelín más claros y con
   borde glow azul para que tengan presencia. */
html.dark .site-main article.bg-hingenia-dark,
html.dark .site-main div.bg-hingenia-dark,
html.dark .site-main section.bg-hingenia-dark {
	background: linear-gradient(180deg, rgba(37, 99, 235, 0.12) 0%, rgba(37, 99, 235, 0.04) 100%), #0d1530 !important;
	border: 1px solid rgba(96, 165, 250, 0.18) !important;
	box-shadow: 0 0 60px -20px rgba(37, 99, 235, 0.25);
}

/* Botones con bg-hingenia-dark ya son oscuros — aceptables.
   Los `bg-white text-hingenia-dark` que aparecen DENTRO de un card oscuro
   (ej. badge "Convenio internacional" sobre bg-hingenia-dark) NO deben tocarse:
   son intencionalmente blancos como contraste. Por eso scoping con .site-main
   y no más profundo: si algún día queda raro, agregar excepciones puntuales. */

/* Inputs con fondo blanco explícito en cursos (search bar) */
html.dark .site-main input.bg-white { background-color: #18181b !important; color: #e5e7eb !important; }
html.dark .site-main input.bg-white::placeholder { color: #9ca3af !important; }

/* Los blobs decorativos del fondo (bg-hingenia-primary/10 con blur-3xl) se ven
   demasiado lavados en modo oscuro — los atenuamos un poco */
html.dark .site-main [class*="bg-hingenia-primary/10"],
html.dark .site-main [class*="bg-hingenia-secondary/10"],
html.dark .site-main [class*="bg-sky-300/20"] { opacity: 0.6; }

/* Gradients de fade arriba/abajo del carrusel de testimonios:
   from-gray-50 → debe ser el oscuro del body */
html.dark .site-main .from-gray-50 { --tw-gradient-from: #0c0c0e !important; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(10,14,26,0)) !important; }
html.dark .site-main .to-gray-50 { --tw-gradient-to: #0c0c0e !important; }

/* ============== SIDEBAR GLOBAL DEL DASHBOARD (plugin Tutor Pro Max) ============== */
/* Selectores #tdc-sidebar.tdc-global-sidebar para igualar la especificidad
   alta con !important que tiene sidebar-edupro.css del plugin. */
html.dark #tdc-sidebar.tdc-global-sidebar {
	background-color: #0b1226 !important;
	border-right-color: rgba(255, 255, 255, 0.06) !important;
}
html.dark .tdc-sidebar-header {
	border-bottom-color: rgba(255, 255, 255, 0.06);
}
html.dark .tdc-brand-text { color: #f9fafb; }
html.dark .tdc-brand-icon { color: #60a5fa; }
html.dark .tdc-collapse-btn { color: #9ca3af; }
html.dark .tdc-collapse-btn:hover { background-color: rgba(255, 255, 255, 0.06); color: #e5e7eb; }

html.dark .tdc-menu-item {
	color: #d1d5db !important;
}
html.dark .tdc-menu-item:hover {
	background-color: rgba(37, 99, 235, 0.15) !important;
	color: #93c5fd !important;
}
html.dark .tdc-menu-item.active {
	background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
	color: #ffffff !important;
	box-shadow: 0 4px 12px -2px rgba(37, 99, 235, 0.45) !important;
}
html.dark .tdc-menu-divider {
	background-color: rgba(255, 255, 255, 0.06);
}

html.dark .tdc-sidebar-footer {
	border-top-color: rgba(255, 255, 255, 0.06);
	background-color: rgba(255, 255, 255, 0.02);
}
html.dark .tdc-sidebar-footer .tdc-menu-item { color: #d1d5db !important; }
html.dark .tdc-logout-item { color: #f87171 !important; }
html.dark .tdc-logout-item:hover {
	background-color: rgba(239, 68, 68, 0.12) !important;
	color: #fca5a5 !important;
}
/* Bloque de perfil del usuario (avatar + nombre + rol) */
html.dark .tdc-sidebar-footer .text-slate-800,
html.dark .tdc-sidebar-footer .text-gray-800,
html.dark .tdc-user-name { color: #f3f4f6 !important; }
html.dark .tdc-user-role { color: #94a3b8 !important; }

/* Botón "Sube a Premium" del header global del aula */
html.dark .tdc-premium-cta,
html.dark a[class*="bg-gradient"][class*="from-orange"],
html.dark .tdc-header .bg-amber-500 {
	box-shadow: 0 4px 14px -4px rgba(245, 158, 11, 0.45);
}

/* ============== HOME (front-page.php usa .hg-home, no .site-main) ============== */
/* home.css define todo con variables --hg-*. Reescribiéndolas dentro de
   html.dark, casi todo el home hereda el dark neutro. Luego se cubren los
   pocos fondos claros hardcodeados. */
html.dark .hg-home {
	--hg-bg: #101012;
	--hg-bg-soft: #18181b;
	--hg-canvas: #080809;
	--hg-ink: #e5e7eb;
	--hg-muted: #9aa1ac;
	--hg-border: rgba(255, 255, 255, 0.08);
	--hg-blue-soft: rgba(37, 99, 235, 0.18);
}
html.dark .hg-home-hero { background: linear-gradient(180deg, #0c0c0f 0%, #080809 100%); }
html.dark .hg-home-pill { color: #cbd5e1; }
html.dark .hg-home-modo.feat { background: linear-gradient(180deg, #14141a 0%, #0f0f14 100%); }
html.dark .hg-home-ia { background: linear-gradient(180deg, #0e0e11 0%, #0a0a0c 100%); }
html.dark .hg-home-ia-input { background: rgba(255, 255, 255, 0.06); color: #e5e7eb; }
html.dark .hg-home-logo-row span { color: #6b7280; }
html.dark .hg-home-btn-ghost:hover { border-color: rgba(255, 255, 255, 0.22); }

/* ============== MEMBRESÍA / PREMIUM (.hg-prem) ============== */
html.dark .hg-prem {
	--hg-prem-bg: #101012;
	--hg-prem-bg-soft: #18181b;
	--hg-prem-canvas: #080809;
	--hg-prem-ink: #e5e7eb;
	--hg-prem-muted: #9aa1ac;
	--hg-prem-border: rgba(255, 255, 255, 0.08);
	--hg-prem-blue-soft: rgba(37, 99, 235, 0.18);
}

/* ============== MASTERCLASS (listado público .hg-ml) ============== */
html.dark .hg-ml {
	--ml-bg: #101012;
	--ml-soft: #18181b;
	--ml-canvas: #080809;
	--ml-ink: #e5e7eb;
	--ml-muted: #9aa1ac;
	--ml-border: rgba(255, 255, 255, 0.08);
	--ml-blue-soft: rgba(37, 99, 235, 0.18);
	--ml-green-soft: rgba(16, 163, 74, 0.18);
}

/* ============== BLOG (.hg-blog) ============== */
html.dark .hg-blog {
	--hb-ink: #e5e7eb;
	--hb-muted: #9aa1ac;
	--hb-border: rgba(255, 255, 255, 0.08);
	--hb-soft: #101012;
	background: #080809;
}
html.dark .hg-blog-hero { background: #0a0a0c; }
html.dark .hg-blog-blob-1, html.dark .hg-blog-blob-2 { opacity: 0.12; }
html.dark .hg-blog-eyebrow { background: rgba(37, 99, 235, 0.14); border-color: rgba(37, 99, 235, 0.30); }
html.dark .hg-blog-card { background: #101012; border-color: rgba(255, 255, 255, 0.08); }
html.dark .hg-blog-card-thumb-empty { background: #161619; }

/* ============== BLOG · single post (.hg-blog-single) ============== */
/* single.php usa .hg-blog-single (no .hg-blog) y declara sus propias
   variables CSS. Reescribiéndolas dentro de html.dark, todo el chrome del
   artículo (título, breadcrumb, párrafos, citas, cards laterales, related)
   hereda dark sin tocar selectores individuales. */
html.dark .hg-blog-single {
	--hb-ink: #f3f4f6;
	--hb-muted: #9aa1ac;
	--hb-border: rgba(255, 255, 255, 0.08);
	--hb-soft: #101012;
	background: #080809;
	color: #e5e7eb;
}
html.dark .hg-blog-single-hero { background: #0a0a0c; }
html.dark .hg-blog-single .hg-blog-blob-1,
html.dark .hg-blog-single .hg-blog-blob-2 { opacity: 0.12; }
html.dark .hg-blog-single-cat {
	background: rgba(96, 165, 250, 0.14);
	color: #93c5fd;
	border: 1px solid rgba(96, 165, 250, 0.25);
}
html.dark .hg-blog-single-cat:hover { background: rgba(96, 165, 250, 0.22); }
html.dark .hg-blog-single-meta-author .hg-blog-avatar { border-color: #18181b; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08); }
html.dark .hg-blog-single-cover img { box-shadow: 0 18px 50px -16px rgba(0,0,0,0.6); }

/* Cuerpo del artículo: párrafos legibles, citas, código, tabla. */
html.dark .hg-blog-article { background: transparent; }
html.dark .hg-blog-article-body { color: #d1d5db; }
html.dark .hg-blog-article-body :where(h2, h3, h4, h5, h6) { color: #f3f4f6; }
html.dark .hg-blog-article-body a { color: #60a5fa; }
html.dark .hg-blog-article-body a:hover { color: #93c5fd; }
html.dark .hg-blog-article-body strong { color: #f9fafb; }
html.dark .hg-blog-article-body blockquote {
	background: rgba(255, 255, 255, 0.03);
	border-left-color: #60a5fa;
	color: #cbd5e1;
}
html.dark .hg-blog-article-body code {
	background: rgba(251, 191, 36, 0.10);
	color: #fbbf24;
}
html.dark .hg-blog-article-body pre {
	background: #101014;
	border: 1px solid rgba(255, 255, 255, 0.08);
	color: #e5e7eb;
}
html.dark .hg-blog-article-body figcaption { color: #94a3b8; }
html.dark .hg-blog-article-body hr { border-color: rgba(255, 255, 255, 0.08); }
html.dark .hg-blog-article-body table { border-color: rgba(255, 255, 255, 0.08); }
html.dark .hg-blog-article-body th { background: #18181b; color: #f3f4f6; }
html.dark .hg-blog-article-body td { border-color: rgba(255, 255, 255, 0.08); }

/* Footer del artículo: etiquetas + share. */
html.dark .hg-blog-single-footer { border-color: rgba(255, 255, 255, 0.08); }
html.dark .hg-blog-tag,
html.dark .hg-blog-share-btn {
	background: #101012;
	border: 1px solid rgba(255, 255, 255, 0.08);
	color: #d1d5db;
}
html.dark .hg-blog-tag:hover,
html.dark .hg-blog-share-btn:hover {
	background: rgba(96, 165, 250, 0.12);
	border-color: rgba(96, 165, 250, 0.35);
	color: #93c5fd;
}

/* Sidebar (autor, compartir, etiquetas). */
html.dark .hg-blog-aside-card {
	background: #101012;
	border-color: rgba(255, 255, 255, 0.08);
}
html.dark .hg-blog-aside-title { color: #f3f4f6; }
html.dark .hg-blog-aside-author-name { color: #f3f4f6; }
html.dark .hg-blog-aside-author-role { color: #9aa1ac; }

/* Sección "Sigue leyendo / Artículos relacionados". */
html.dark .hg-blog-related {
	background: #0a0a0c;
	border-top: 1px solid rgba(255, 255, 255, 0.06);
}
html.dark .hg-blog-related-eyebrow { color: #60a5fa; }
html.dark .hg-blog-related-title { color: #f3f4f6; }
html.dark .hg-blog-related-back {
	background: #101012;
	border: 1px solid rgba(255, 255, 255, 0.08);
	color: #cbd5e1;
}
html.dark .hg-blog-related-back:hover {
	background: rgba(96, 165, 250, 0.10);
	border-color: rgba(96, 165, 250, 0.30);
	color: #93c5fd;
}
html.dark .hg-blog-pill {
	background: rgba(96, 165, 250, 0.14);
	color: #93c5fd;
	border: 1px solid rgba(96, 165, 250, 0.25);
}
html.dark .hg-blog-card-title { color: #f3f4f6; }
html.dark .hg-blog-card-excerpt { color: #9aa1ac; }
html.dark .hg-blog-card-date { color: #94a3b8; }
html.dark .hg-blog-breadcrumb a { color: #9aa1ac; }
html.dark .hg-blog-breadcrumb a:hover { color: #f3f4f6; }
html.dark .hg-blog-breadcrumb-sep { color: rgba(255, 255, 255, 0.20); }
html.dark .hg-blog-single-title { color: #f9fafb; }
html.dark .hg-blog-single-meta { color: #9aa1ac; }

/* ============== AJUSTES DE CONTRASTE (home IA/modalidades, cursos) ============== */
/* Home: textos gris-oscuro (#374151) hardcodeados, ilegibles sobre dark. */
html.dark .hg-home-modo li,
html.dark .hg-home-ia-feats li { color: #cbd5e1; }
html.dark .hg-home-ia-msg.bot { background: rgba(255, 255, 255, 0.07); color: #d1d5db; }

/* Cursos: el botón "Ver detalles" se ponía blanco por hover:bg-slate-*. */
html.dark .site-main .hover\:bg-slate-100:hover,
html.dark .site-main .hover\:bg-slate-50:hover { background-color: #1c1c21 !important; }

/* ============== LOGIN / AUTH (body.hg-auth-page, tokens propios) ============== */
html.dark body.hg-auth-page {
	--hg-ink: #e5e7eb;
	--hg-ink-soft: #cbd5e1;
	--hg-muted: #9aa1ac;
	--hg-muted-2: #8b9099;
	--hg-muted-3: #6b7280;
	--hg-border: rgba(255, 255, 255, 0.08);
	--hg-surface: #101012;
	--hg-surface-2: #080809;
	--hg-blue-soft: rgba(37, 99, 235, 0.18);
	--hg-blue-soft-border: rgba(37, 99, 235, 0.35);
}

/* ============== SIDEBAR GLOBAL (aula + dashboard, .hingenia-global-sidebar) ============== */
html.dark .hingenia-global-sidebar {
	--hg-sidebar-bg: rgba(12, 12, 16, 0.72);
	--hg-sidebar-border: rgba(255, 255, 255, 0.08);
	--hg-sidebar-text: #cbd5e1;
	--hg-sidebar-text-muted: #9aa1ac;
	--hg-sidebar-active-bg: rgba(37, 99, 235, 0.18);
	--hg-sidebar-active-text: #93c5fd;
	--hg-sidebar-hover-bg: rgba(255, 255, 255, 0.06);
}
/* Hover: el CSS base fuerza color hingenia-dark (casi negro) en texto e icono. */
html.dark .hingenia-global-sidebar .hg-nav-item:hover { color: #ffffff; }
html.dark .hingenia-global-sidebar .hg-nav-item:hover .hg-nav-icon { color: #93c5fd; }
html.dark .hingenia-global-sidebar .hg-nav-item.is-active .hg-nav-icon { color: #93c5fd; }

/* ============== DASHBOARD DEL AULA (.hg-dash) ============== */
html.dark .hg-dash {
	--hg-d-bg: #101012;
	--hg-d-soft: #18181b;
	--hg-d-ink: #e5e7eb;
	--hg-d-muted: #9aa1ac;
	--hg-d-border: rgba(255, 255, 255, 0.08);
	--hg-d-blue-soft: rgba(37, 99, 235, 0.18);
}
html.dark .hg-dash-date { color: #cbd5e1; }
html.dark .hg-dash-pbar { background: rgba(255, 255, 255, 0.10); }

/* ===== Mis apuntes (vista del aula): chips/acentos legibles en dark ===== */
/* Chip de curso activo (en claro es gris-900) → azul para que resalte en dark. */
html.dark .hg-apuntes .bg-gray-900 { background-color: #2563eb !important; border-color: #2563eb !important; }
/* Badges de KPI e icono de marca de tiempo: tintes oscuros en vez de pasteles. */
html.dark .hg-apuntes .bg-blue-50 { background-color: rgba(37, 99, 235, 0.18) !important; }
html.dark .hg-apuntes .text-blue-600, html.dark .hg-apuntes .text-blue-700 { color: #93c5fd !important; }
html.dark .hg-apuntes .bg-emerald-50 { background-color: rgba(16, 185, 129, 0.16) !important; }
html.dark .hg-apuntes .text-emerald-600 { color: #34d399 !important; }
html.dark .hg-apuntes .bg-violet-50 { background-color: rgba(124, 58, 237, 0.18) !important; }
html.dark .hg-apuntes .text-violet-600 { color: #c4b5fd !important; }
html.dark .hg-apuntes .bg-amber-50 { background-color: rgba(245, 158, 11, 0.16) !important; }
html.dark .hg-apuntes .text-amber-600 { color: #fbbf24 !important; }

/* ============== AULA VIRTUAL (single-lesson) ============== */
/* single-lesson.php fuerza body{background:#F9FAFB!important} inline; lo vencemos. */
html.dark body.single-lesson,
html.dark body.hg-aula { background: #080809 !important; }

/* Botón Completar / Completada (usaba var(--hg-aula-ink) que en dark es claro). */
html.dark .hg-btn-complete { background: #2563eb; color: #fff; border-color: #2563eb; }
html.dark .hg-btn-complete:hover { background: #1d4ed8; border-color: #1d4ed8; }
html.dark .hg-btn-complete-done { color: #34d399; }

/* Sidebar global: marca "Hingenia", botón colapsar/cerrar y card "Hazte Premium". */
html.dark .hg-sidebar-brand { color: #f3f4f6; }
html.dark .hg-sidebar-collapse,
html.dark .hg-sidebar-close,
html.dark .hg-sidebar-mobile-toggle { background: rgba(255, 255, 255, 0.06); color: #cbd5e1; border-color: rgba(255, 255, 255, 0.10); }
html.dark .hg-sidebar-promo { background: linear-gradient(160deg, #15151b, #101018); border-color: rgba(255, 255, 255, 0.08); }
html.dark .hg-sidebar-promo b { color: #f3f4f6; }
/* Nombre del usuario en el footer del sidebar: el CSS base lo fuerza a
   hingenia-dark (casi negro), invisible sobre el sidebar oscuro. */
html.dark .hg-user-name { color: #f3f4f6; }
html.dark .hg-user-label--admin { background: rgba(255, 255, 255, 0.10); color: #e5e7eb; }
/* Desplegable de cuenta del sidebar */
html.dark .hg-acc-trigger { background: rgba(255, 255, 255, 0.04); border-color: rgba(255, 255, 255, 0.08); }
html.dark .hg-acc-trigger:hover { background: rgba(255, 255, 255, 0.07); }
html.dark .hg-acc-menu { background: #15151b; border-color: rgba(255, 255, 255, 0.08); box-shadow: 0 18px 44px -14px rgba(0, 0, 0, 0.6); }
html.dark .hg-acc-email { color: #9aa1ac; border-color: rgba(255, 255, 255, 0.08); }
html.dark .hg-acc-item { color: #cbd5e1; }
html.dark .hg-acc-item svg { color: #9aa1ac; }
html.dark .hg-acc-item:hover { background: rgba(255, 255, 255, 0.06); color: #ffffff; }
html.dark .hg-acc-item:hover svg { color: #93c5fd; }
html.dark .hg-acc-div { background: rgba(255, 255, 255, 0.08); }
html.dark .hg-acc-item.is-danger { color: #f87171; }
html.dark .hg-acc-item.is-danger svg { color: #f87171; }
html.dark .hg-acc-item.is-danger:hover { background: rgba(248, 113, 113, 0.12); }

/* Pestaña Preguntas (Q&A) — colores claros hardcodeados. */
html.dark .hg-qna-empty { background: rgba(255, 255, 255, 0.03); border-color: rgba(255, 255, 255, 0.10); color: #9aa1ac; }
html.dark .hg-qna-empty svg { color: #475569; }
html.dark .hg-qna-empty-title { color: #f3f4f6; }
html.dark .hg-qna-item { background: #101012; border-color: rgba(255, 255, 255, 0.08); }
html.dark .hg-qna-item:hover { border-color: rgba(255, 255, 255, 0.16); box-shadow: none; }
html.dark .hg-qna-name { color: #f3f4f6; }
html.dark .hg-qna-text { color: #cbd5e1; }
html.dark .hg-qna-badge { background: rgba(37, 99, 235, 0.20); color: #93c5fd; }
html.dark .hg-qna-reply-toggle:hover { background: rgba(37, 99, 235, 0.15); }
/* aula.css define todo con variables CSS (--hg-aula-surface, --hg-aula-border,
   etc.). Reescribimos las variables dentro de html.dark y todo el chrome del
   aula (header, sidebar, panels, tabs, módulos, apuntes, Q&A) hereda dark sin
   tocar selectores individuales. */
html.dark body.hg-aula,
html.dark body.single-lesson,
html.dark .hg-aula-shell {
	--hg-aula-primary: #60a5fa;
	--hg-aula-primary-soft: rgba(96, 165, 250, 0.14);
	--hg-aula-ink: #f3f4f6;
	--hg-aula-muted: #94a3b8;
	--hg-aula-border: rgba(255, 255, 255, 0.08);
	--hg-aula-border-soft: rgba(255, 255, 255, 0.04);
	--hg-aula-bg: #080809;
	--hg-aula-surface: #121214;
	--hg-aula-success: #34d399;
	--hg-aula-success-soft: rgba(52, 211, 153, 0.18);
}
html.dark body.hg-aula,
html.dark body.single-lesson { color: #e5e7eb; }

/* Tabs del sidebar de la lección */
html.dark .hg-aula-tabs button { color: #94a3b8; }
html.dark .hg-aula-tabs button:hover { color: #e5e7eb; background-color: rgba(255, 255, 255, 0.04); }
html.dark .hg-aula-tabs button.is-active {
	color: #60a5fa;
	background-color: rgba(96, 165, 250, 0.12);
}

/* Progress bar del curso */
html.dark .hg-aula-progress-bar { background-color: rgba(255, 255, 255, 0.06); }

/* Items de módulos en el timeline (hg-tl-*). La línea entre módulos se eliminó
   en el rediseño de anillos; el dark de los elementos nuevos vive en aula.css. */
html.dark .hg-tl-module-head { color: #e5e7eb; }
html.dark .hg-tl-module-head:hover { background-color: rgba(255, 255, 255, 0.04); }
html.dark .hg-tl-module-title { color: #f3f4f6; }
html.dark .hg-tl-module-count { color: #94a3b8; background-color: rgba(255, 255, 255, 0.04); }
html.dark .hg-tl-module-count.is-done { color: #34d399; background-color: rgba(52, 211, 153, 0.14); }
html.dark .hg-tl-lesson { color: #d1d5db; }
html.dark .hg-tl-lesson:hover { background-color: rgba(255, 255, 255, 0.04); }
html.dark .hg-tl-lesson.is-current { background-color: rgba(96, 165, 250, 0.10); color: #ffffff; }
html.dark .hg-tl-lesson.is-completed .hg-tl-lesson-title { color: #94a3b8; }
html.dark .hg-tl-lesson .hg-tl-circle {
	background-color: rgba(255, 255, 255, 0.04);
	border-color: rgba(255, 255, 255, 0.08);
	color: #94a3b8;
}
html.dark .hg-tl-lesson.is-current .hg-tl-circle {
	background-color: #2563eb;
	border-color: #60a5fa;
	color: #ffffff;
}
html.dark .hg-tl-lesson.is-completed .hg-tl-circle {
	background-color: #10b981;
	border-color: #34d399;
	color: #ffffff;
}
html.dark .hg-tl-lesson-meta { color: #94a3b8; }
html.dark .hg-tl-chevron { color: #94a3b8; }

/* Q&A: el composer y feedback heredan via vars; refuerza textareas/inputs */
html.dark .hg-qna textarea,
html.dark .hg-qna input[type="text"] {
	background-color: rgba(255, 255, 255, 0.03) !important;
	color: #e5e7eb !important;
	border-color: rgba(255, 255, 255, 0.08) !important;
}
html.dark .hg-qna-bar { background-color: rgba(255, 255, 255, 0.03); border-color: rgba(255, 255, 255, 0.08); }
html.dark .hg-qna-bar-placeholder { color: #94a3b8; }
html.dark .hg-qna-name { color: #f3f4f6; }
html.dark .hg-qna-time { color: #94a3b8; }
html.dark .hg-qna-text { color: #d1d5db; }
html.dark .hg-qna-empty { color: #94a3b8; }
html.dark .hg-qna-empty-title { color: #e5e7eb; }
html.dark .hg-qna-reply-toggle { color: #60a5fa; }
html.dark .hg-qna-reply-toggle:hover { background-color: rgba(96, 165, 250, 0.12); }
html.dark .hg-qna-submit { background-color: #2563eb; color: #ffffff; }
html.dark .hg-qna-submit:hover { background-color: #1d4ed8; }
html.dark .hg-qna-cancel { color: #94a3b8; }
html.dark .hg-qna-cancel:hover { color: #e5e7eb; background-color: rgba(255, 255, 255, 0.04); }

/* Respuestas anidadas (incluidas las generadas con IA): el CSS base las pinta
   con fondo claro (#F8FAFC) y borde claro, por eso seguían viéndose blancas en
   dark. Igualamos su superficie a la del tema oscuro. */
html.dark .hg-qna-replies { border-left-color: rgba(255, 255, 255, 0.10); }
html.dark .hg-qna-reply { background: #18181b; }
html.dark .hg-qna-reply.is-ai-authored { background: rgba(99, 102, 241, 0.10); }
html.dark .hg-qna-reply-count { background: rgba(37, 99, 235, 0.22); color: #93c5fd; }
/* Badge "IA" y botón "Generar con IA": gradientes/borders claros → versión dark. */
html.dark .hg-qna-badge--ai {
	background: rgba(99, 102, 241, 0.16);
	color: #c7d2fe;
	border-color: rgba(99, 102, 241, 0.30);
}
html.dark .hg-qna-badge--ai svg { color: #a5b4fc; }
html.dark .hg-qna-ai-draft {
	background: rgba(99, 102, 241, 0.14);
	border-color: rgba(99, 102, 241, 0.30);
	color: #c7d2fe;
}
html.dark .hg-qna-ai-draft:hover { background: rgba(99, 102, 241, 0.22); border-color: rgba(99, 102, 241, 0.45); box-shadow: none; }
html.dark .hg-qna-ai-draft svg { color: #a5b4fc; }
html.dark .hg-qna-ai-done { background: rgba(255, 255, 255, 0.04); border-color: rgba(255, 255, 255, 0.10); color: #94a3b8; }
html.dark .hg-qna-ai-done svg { color: #34d399; }
html.dark .hg-qna-ai-loading { background: rgba(139, 92, 246, 0.12); color: #c4b5fd; }
html.dark .hg-qna-ai-notice { background: rgba(99, 102, 241, 0.12); border-color: rgba(99, 102, 241, 0.30); color: #c7d2fe; }
html.dark .hg-qna-ai-notice svg { color: #a5b4fc; }
html.dark .hg-qna-ai-regen { background: rgba(255, 255, 255, 0.04); border-color: rgba(99, 102, 241, 0.30); color: #c7d2fe; }
html.dark .hg-qna-ai-regen:hover { background: rgba(99, 102, 241, 0.18); }
/* Contenedores expandidos del composer (fondo blanco/#F8FAFC base). */
html.dark .hg-qna-composer--main.is-expanded .hg-qna-expanded { background: #121214; border-color: rgba(255, 255, 255, 0.08); }
html.dark .hg-qna-composer--reply.is-expanded { background: #121214; border-color: rgba(255, 255, 255, 0.08); }

/* Apuntes: lista de notas + add-form */
html.dark .hg-note-add textarea {
	background-color: rgba(255, 255, 255, 0.03) !important;
	color: #e5e7eb !important;
}
html.dark .hg-panel-empty { color: #94a3b8; }
html.dark .hg-panel-header h3 { color: #f3f4f6; }
html.dark .hg-panel-sub { color: #94a3b8; }

/* Materiales */
html.dark .hg-material-item { background-color: rgba(255, 255, 255, 0.03); border-color: rgba(255, 255, 255, 0.08); }
html.dark .hg-material-item:hover { background-color: rgba(255, 255, 255, 0.05); }
html.dark .hg-material-name { color: #e5e7eb; }
html.dark .hg-material-meta { color: #94a3b8; }

/* Header del aula: el título de lección, breadcrumb */
html.dark .hg-aula-course-name { color: #60a5fa; }
html.dark .hg-aula-lesson-name { color: #f3f4f6; }
html.dark .hg-aula-divider { background-color: rgba(255, 255, 255, 0.08); }

/* Botones genéricos del header (Carpeta / WhatsApp / Cert / Completar) ya
   tienen colores propios (azul/verde/dorado) — quedan bien sobre dark.
   Solo bajamos un pelín la opacidad de los disabled. */
html.dark .hg-btn-disabled { opacity: 0.4; }
html.dark .hg-btn-ghost { color: #d1d5db; }
html.dark .hg-btn-ghost:hover { background-color: rgba(255, 255, 255, 0.06); color: #f9fafb; }
html.dark .hg-btn-icon { color: #d1d5db; }
html.dark .hg-btn-icon:hover { background-color: rgba(255, 255, 255, 0.06); }

/* Body wrapper de single-lesson — fondo de página */
html.dark .hg-aula-body { background-color: #080809; }
html.dark .hg-aula-main { background-color: transparent; }
