/* ══════════════════════════════════════════════
   THEME TOGGLE BUTTON — compartido entre páginas
══════════════════════════════════════════════ */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  color: #6B7280;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color 0.25s ease, transform 0.4s ease;
  flex-shrink: 0;
}
.theme-toggle:hover { color: #E8E8E8; transform: rotate(18deg); }
.theme-toggle:focus-visible { outline: 1.5px solid #008f4c; outline-offset: 3px; border-radius: 2px; }
.theme-toggle .icon-moon { display: block; }
.theme-toggle .icon-sun  { display: none; }

/* ══════════════════════════════════════════════
   LIGHT MODE — html[data-theme="light"]
══════════════════════════════════════════════ */

/* Toggle icon swap */
html[data-theme="light"] .theme-toggle .icon-moon { display: none; }
html[data-theme="light"] .theme-toggle .icon-sun  { display: block; }
html[data-theme="light"] .theme-toggle { color: #4B5563; }
html[data-theme="light"] .theme-toggle:hover { color: #111111; transform: rotate(-18deg); }

/* Base */
html[data-theme="light"]            { background: #F5F5F5 !important; }
html[data-theme="light"] body       { background: #F5F5F5 !important; color: #111111 !important; }

/* Nav */
html[data-theme="light"] .nav-glass {
  background: rgba(245,245,245,0.88) !important;
  border-bottom: 1px solid rgba(0,0,0,0.07) !important;
}
html[data-theme="light"] .nav-link            { color: #4B5563 !important; }
html[data-theme="light"] .nav-link:hover      { color: #111111 !important; }
html[data-theme="light"] #mobile-menu         { background: rgba(245,245,245,0.97) !important; }
html[data-theme="light"] .nav-dropdown-menu   {
  background: rgba(245,245,245,0.98) !important;
  border-color: rgba(0,0,0,0.09) !important;
}
html[data-theme="light"] .nav-dropdown-item        { color: #4B5563 !important; }
html[data-theme="light"] .nav-dropdown-item:hover  { color: #111111 !important; }
html[data-theme="light"] .nav-mobile-sub-link       { color: #4B5563 !important; }
html[data-theme="light"] .nav-mobile-sub-link:hover { color: #111111 !important; }

/* Secciones */
html[data-theme="light"] .services-section,
html[data-theme="light"] .projects-section,
html[data-theme="light"] .academia-section,
html[data-theme="light"] .contact-section,
html[data-theme="light"] .blog-section        { background: #F5F5F5 !important; }

html[data-theme="light"] .why-section,
html[data-theme="light"] .immersive-section,
html[data-theme="light"] .services-overview   { background: #F0F0F0 !important; }

html[data-theme="light"] .trust-banner        { background: #EEEEEE !important; border-color: rgba(0,0,0,0.05) !important; }
html[data-theme="light"] .site-footer         { background: #EEEEEE !important; }

/* Títulos y textos comunes */
html[data-theme="light"] .section-title       { color: #111111 !important; }
html[data-theme="light"] .section-subtitle    { color: #4B5563 !important; }
html[data-theme="light"] .section-eyebrow span{ color: #6B7280 !important; }

/* Cards genéricas */
html[data-theme="light"] .service-card,
html[data-theme="light"] .course-card,
html[data-theme="light"] .sov-card,
html[data-theme="light"] .blog-card           { background: #FFFFFF !important; }

html[data-theme="light"] .why-card            { background: #FAFAFA !important; }

/* Modal */
html[data-theme="light"] .modal-backdrop      { background: rgba(180,180,180,0.72) !important; }
html[data-theme="light"] .modal-box           { background: #FFFFFF !important; border-color: #E0E0E0 !important; }
html[data-theme="light"] .modal-proj-title    { color: #111111 !important; }
html[data-theme="light"] .modal-desc          { color: #4B5563 !important; }

/* Scroll to top */
html[data-theme="light"] #btn-top {
  background: rgba(240,240,240,0.9) !important;
  border-color: rgba(0,0,0,0.1) !important;
  color: rgba(17,17,17,0.5) !important;
}

/* WA float */
html[data-theme="light"] .wa-float {
  background: rgba(255,255,255,0.9) !important;
  box-shadow: 0 2px 20px rgba(0,0,0,0.1) !important;
}

/* Cursor */
html[data-theme="light"] .cur-dot  { background: #111111 !important; }
html[data-theme="light"] .cur-ring { border-color: rgba(17,17,17,0.18) !important; }

/* ──────────────────────────────────────────────
   Blog / artículos (academia/*.html)
────────────────────────────────────────────── */
html[data-theme="light"] .article-hero        { background: #EFEFEF !important; border-bottom-color: #E0E0E0 !important; }
html[data-theme="light"] .article-title       { color: #111111 !important; }
html[data-theme="light"] .article-layout      { background: #F5F5F5 !important; }
html[data-theme="light"] .prose p             { color: #4B5563 !important; }
html[data-theme="light"] .prose p strong      { color: #111111 !important; }
html[data-theme="light"] .prose h2            { color: #111111 !important; border-top-color: #E0E0E0 !important; }
html[data-theme="light"] .prose h3            { color: #1A1A1A !important; }
html[data-theme="light"] .prose ul li         { color: #4B5563 !important; }
html[data-theme="light"] .prose ul li strong  { color: #111111 !important; }
html[data-theme="light"] .data-table th       { background: #F0F0F0 !important; border-bottom-color: #E0E0E0 !important; }
html[data-theme="light"] .data-table td       { color: #4B5563 !important; border-bottom-color: #E8E8E8 !important; }
html[data-theme="light"] .data-table td strong{ color: #111111 !important; }
html[data-theme="light"] .cite-block          { background: #F8F8F8 !important; border-color: #E0E0E0 !important; border-left-color: rgba(0,143,76,0.5) !important; }
html[data-theme="light"] .cite-text           { color: #4B5563 !important; }
html[data-theme="light"] .cite-text strong    { color: #111111 !important; }
html[data-theme="light"] .meta-item           { color: #6B7280 !important; }

/* Sidebar de artículos */
html[data-theme="light"] .sidebar-box         { background: #F0F0F0 !important; border-color: #E0E0E0 !important; }
html[data-theme="light"] .sidebar-title       { color: #111111 !important; }
html[data-theme="light"] .sidebar-link        { color: #4B5563 !important; }
html[data-theme="light"] .sidebar-card        { background: #F0F0F0 !important; border-color: #E0E0E0 !important; }
html[data-theme="light"] .sidebar-label       { color: rgba(0,143,76,0.75) !important; }
html[data-theme="light"] .toc-item a          { color: #6B7280 !important; border-bottom-color: #E0E0E0 !important; }
html[data-theme="light"] .toc-item a:hover    { color: #111111 !important; }
html[data-theme="light"] .share-btn           { color: #6B7280 !important; border-bottom-color: #E0E0E0 !important; }
html[data-theme="light"] .share-btn:hover     { color: #111111 !important; }
html[data-theme="light"] .related-link        { border-bottom-color: #E0E0E0 !important; }
html[data-theme="light"] .related-text        { color: #6B7280 !important; }

/* Cite extras */
html[data-theme="light"] .cite-label          { color: rgba(0,143,76,0.75) !important; }
html[data-theme="light"] .cite-format         { color: #9CA3AF !important; }

/* Figure blocks */
html[data-theme="light"] .figure-block        { background: #F0F0F0 !important; border-color: #E0E0E0 !important; }
html[data-theme="light"] .figure-caption      { color: #6B7280 !important; border-top-color: #E0E0E0 !important; }
html[data-theme="light"] .figure-caption strong { color: #4B5563 !important; }

/* References */
html[data-theme="light"] .references-section  { border-top-color: #E0E0E0 !important; }
html[data-theme="light"] .references-list     { border-color: #E0E0E0 !important; }
html[data-theme="light"] .references-list li  { color: #6B7280 !important; border-bottom-color: #E0E0E0 !important; }
html[data-theme="light"] .ref-list li         { color: #6B7280 !important; }

/* Pull quote */
html[data-theme="light"] .pull-quote          { background: rgba(0,143,76,0.04) !important; }
html[data-theme="light"] .pull-quote p        { color: #4B5563 !important; }

/* Inline CTA block */
html[data-theme="light"] .inline-cta          { background: #F0F0F0 !important; border-color: #E0E0E0 !important; }
html[data-theme="light"] .inline-cta-title    { color: #111111 !important; }
html[data-theme="light"] .inline-cta p        { color: #6B7280 !important; }
html[data-theme="light"] .btn-ghost-sm        { color: #6B7280 !important; }
html[data-theme="light"] .btn-ghost-sm:hover  { color: #111111 !important; }

/* Workflow infographic */
html[data-theme="light"] .wf-infographic      { background: #EFEFEF !important; }
html[data-theme="light"] .wf-header-title     { color: #111111 !important; }
html[data-theme="light"] .wf-tl-card          { background: #FFFFFF !important; border-color: #E0E0E0 !important; }
html[data-theme="light"] .wf-tl-title         { color: #1A1A1A !important; }
html[data-theme="light"] .wf-tl-detail        { color: #6B7280 !important; }

/* Labeled items list */
html[data-theme="light"] .labeled-items       { border-color: #E0E0E0 !important; }
html[data-theme="light"] .labeled-item        { border-bottom-color: #E0E0E0 !important; }
html[data-theme="light"] .labeled-item-key    { background: #F0F0F0 !important; color: #111111 !important; border-right-color: #E0E0E0 !important; }
html[data-theme="light"] .labeled-item-val    { color: #4B5563 !important; }

/* Article CTA section */
html[data-theme="light"] .article-cta         { background: #EFEFEF !important; border-top-color: #E0E0E0 !important; }
html[data-theme="light"] .btn-cta-secondary   { color: #6B7280 !important; }
html[data-theme="light"] .btn-cta-secondary:hover { color: #111111 !important; }
html[data-theme="light"] .cta-footnote        { color: #9CA3AF !important; }
html[data-theme="light"] .cta-footnote a      { color: #6B7280 !important; }

/* ──────────────────────────────────────────────
   Academia page (academia.html inline styles)
────────────────────────────────────────────── */
/* Hero */
html[data-theme="light"] .page-hero           { background: #EFEFEF !important; }
html[data-theme="light"] .hero-title          { color: #111111 !important; }
html[data-theme="light"] .hero-title span     { color: #6B7280 !important; }
html[data-theme="light"] .hero-subtitle       { color: #4B5563 !important; }
html[data-theme="light"] .hero-divider        { background: linear-gradient(to right, transparent, rgba(0,0,0,0.08) 30%, rgba(0,0,0,0.08) 70%, transparent) !important; }
/* Stats */
html[data-theme="light"] .stat-num            { color: #111111 !important; }
html[data-theme="light"] .stat-label          { color: #6B7280 !important; }
/* Programs section */
html[data-theme="light"] .programs-section    { background: #F5F5F5 !important; }
html[data-theme="light"] .section-sub         { color: #6B7280 !important; }
/* Course cards (overrides generic + adds border) */
html[data-theme="light"] .course-card         { background: #FFFFFF !important; border-color: #E0E0E0 !important; }
html[data-theme="light"] .course-card:hover   { background: #F8F8F8 !important; box-shadow: 0 12px 40px rgba(0,0,0,0.08) !important; }
html[data-theme="light"] .course-title        { color: #111111 !important; }
html[data-theme="light"] .course-desc         { color: #6B7280 !important; }
html[data-theme="light"] .course-meta-item    { color: #6B7280 !important; }
html[data-theme="light"] .modules-inner       { border-top-color: #E0E0E0 !important; }
html[data-theme="light"] .modules-label       { color: #9CA3AF !important; }
html[data-theme="light"] .module-item         { color: #6B7280 !important; }
html[data-theme="light"] .module-item:hover   { color: #4B5563 !important; }
/* Article rows */
html[data-theme="light"] .articles-grid       { background: #E8E8E8 !important; }
html[data-theme="light"] .article-row         { background: #F5F5F5 !important; }
html[data-theme="light"] .article-row:hover   { background: #F0F0F0 !important; }
html[data-theme="light"] .article-title       { color: #111111 !important; }
html[data-theme="light"] .article-desc        { color: #6B7280 !important; }
html[data-theme="light"] .article-readtime,
html[data-theme="light"] .article-date        { color: #9CA3AF !important; }
html[data-theme="light"] .article-arrow       { color: #C0C0C0 !important; }
/* CTA section */
html[data-theme="light"] .cta-section         { background: #F0F0F0 !important; border-top-color: #E0E0E0 !important; }
html[data-theme="light"] .cta-title           { color: #111111 !important; }
html[data-theme="light"] .cta-sub             { color: #4B5563 !important; }
/* Footer */
html[data-theme="light"] .page-footer         { background: #EEEEEE !important; border-top-color: #E0E0E0 !important; }
html[data-theme="light"] .footer-text         { color: #9CA3AF !important; }
/* Program rows (si los hay) */
html[data-theme="light"] .program-row         { border-bottom-color: #E0E0E0 !important; }
html[data-theme="light"] .program-row:hover   { background: rgba(0,0,0,0.02) !important; }
html[data-theme="light"] .program-name        { color: #111111 !important; }

/* ──────────────────────────────────────────────
   Servicios pages (servicios.css)
────────────────────────────────────────────── */
html[data-theme="light"] .service-hero        { background: #EFEFEF !important; }
html[data-theme="light"] .service-hero-title  { color: #111111 !important; }
html[data-theme="light"] .feature-card        { background: #FFFFFF !important; border-color: #E0E0E0 !important; }
html[data-theme="light"] .feature-title       { color: #111111 !important; }
html[data-theme="light"] .feature-desc        { color: #6B7280 !important; }
html[data-theme="light"] .bim-section         { background: #F5F5F5 !important; }
html[data-theme="light"] .bim-name            { color: #111111 !important; }
html[data-theme="light"] .process-step        { background: #F8F8F8 !important; border-color: #E0E0E0 !important; }

/* ──────────────────────────────────────────────
   Vacantes / Política / páginas genéricas
────────────────────────────────────────────── */
html[data-theme="light"] .vacante-card        { background: #FFFFFF !important; border-color: #E0E0E0 !important; }
html[data-theme="light"] .policy-section      { background: #F5F5F5 !important; }
html[data-theme="light"] .policy-content      { color: #4B5563 !important; }
html[data-theme="light"] .policy-content h2   { color: #111111 !important; }
html[data-theme="light"] .policy-content h3   { color: #1A1A1A !important; }
html[data-theme="light"] .faq-item            { background: #FFFFFF !important; border-color: #E0E0E0 !important; }

/* Footer links hover — respetar colores en modo claro */
html[data-theme="light"] .footer-bottom-bar   { border-top-color: #E0E0E0 !important; }
html[data-theme="light"] .footer-copy         { color: #AAAAAA !important; }

/* ──────────────────────────────────────────────
   SVG infografías embebidas en .figure-block
   — invert dark-mode SVGs preservando el verde
────────────────────────────────────────────── */
html[data-theme="light"] .figure-block svg {
  filter: invert(1) hue-rotate(180deg);
}

/* ──────────────────────────────────────────────
   Bloques con inline style="background:#..." oscuro
   (bloques de código, herramientas interactivas)
────────────────────────────────────────────── */
html[data-theme="light"] [style*="background:#0D0D0D"] {
  background: #F0F0F0 !important;
  border-color: #E0E0E0 !important;
}
html[data-theme="light"] [style*="background:#080808"] {
  background: #EFEFEF !important;
  border-color: #E0E0E0 !important;
}
html[data-theme="light"] [style*="background:#050505"] {
  background: #F5F5F5 !important;
  border-color: #E0E0E0 !important;
}
html[data-theme="light"] [style*="background:#111111"] {
  background: #F0F0F0 !important;
  border-color: #E0E0E0 !important;
}
/* Textos dentro de bloques código inline */
html[data-theme="light"] [style*="background:#0D0D0D"],
html[data-theme="light"] [style*="background:#080808"],
html[data-theme="light"] [style*="background:#050505"] {
  color: #4B5563 !important;
}
/* Bordes oscuros inline */
html[data-theme="light"] [style*="border:1px solid #1A1A1A"] { border-color: #E0E0E0 !important; }
html[data-theme="light"] [style*="border:1px solid #141414"] { border-color: #E0E0E0 !important; }
html[data-theme="light"] [style*="border: 1px solid #1A1A1A"] { border-color: #E0E0E0 !important; }
html[data-theme="light"] [style*="border: 1px solid #141414"] { border-color: #E0E0E0 !important; }
