/* ─── DARK MODE ─── */
/* Toggle -- small switch in footer */
.dark-toggle-nav { display: none; } /* hide nav toggle */

.dark-toggle-footer {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  background: none;
  border: none;
  color: rgba(255,255,255,0.3);
  font-family: inherit;
  font-size: 12px;
  padding: 0;
  transition: color 0.2s;
}
.dark-toggle-footer:hover { color: rgba(255,255,255,0.6); }
.dark-toggle-footer svg { width: 14px; height: 14px; }
.dark-toggle-footer .icon-moon { display: inline; }
.dark-toggle-footer .icon-sun { display: none; }
[data-theme="dark"] .dark-toggle-footer .icon-moon { display: none; }
[data-theme="dark"] .dark-toggle-footer .icon-sun { display: inline; }
[data-theme="dark"] .dark-toggle-footer .toggle-label-dark { display: none; }
.dark-toggle-footer .toggle-label-light { display: none; }
[data-theme="dark"] .dark-toggle-footer .toggle-label-light { display: inline; }

/* ─── DARK THEME OVERRIDES ─── */
/* Soft dark gray, not pitch black */
[data-theme="dark"] {
  --rmc-black: #E8E8E8;
  --rmc-charcoal: #1E1E1E;
  --rmc-slate: #CCCCCC;
  --rmc-gray: #AAAAAA;
  --rmc-light-gray: #3A3A3A;
  --rmc-off-white: #252525;
  --rmc-white: #1A1A1A;
}

/* Nav */
[data-theme="dark"] nav,
[data-theme="dark"] nav#nav {
  background: rgba(26, 26, 26, 0.97) !important;
  border-bottom-color: rgba(255,255,255,0.08) !important;
}
[data-theme="dark"] nav.scrolled { box-shadow: 0 1px 20px rgba(0,0,0,0.3); }
[data-theme="dark"] .nav-links a { color: #E8E8E8; }
[data-theme="dark"] .nav-links a:hover { color: var(--rmc-red); }
[data-theme="dark"] .nav-logo-text { color: #AAAAAA; }
[data-theme="dark"] .nav-logo-mark { color: white; }
[data-theme="dark"] .nav-hamburger span { background: #E8E8E8; }
[data-theme="dark"] .nav-links {
  background: transparent;
}
[data-theme="dark"] .nav-links a.nav-contact-btn { color: white !important; }

/* Hero dot grid */
[data-theme="dark"] .hero::before {
  background-image: radial-gradient(circle, rgba(255,255,255,0.04) 1px, transparent 1px);
}

/* Hero mesh gradient */
[data-theme="dark"] .hero::after {
  background:
    radial-gradient(ellipse at 20% 50%, rgba(196, 30, 42, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(37, 37, 37, 0.6) 0%, transparent 50%),
    radial-gradient(ellipse at 60% 80%, rgba(196, 30, 42, 0.03) 0%, transparent 40%);
}

/* Stats bar */
[data-theme="dark"] .stats-bar { background: #1E1E1E; }
[data-theme="dark"] .stat-item { border-right-color: rgba(255,255,255,0.08); }

/* Asset cards */
[data-theme="dark"] .asset-card { background: #252525; }
[data-theme="dark"] .assets-grid { background: rgba(255,255,255,0.03); }
[data-theme="dark"] .asset-card:hover { box-shadow: 0 8px 30px rgba(0,0,0,0.3); }

/* About visual */
[data-theme="dark"] .about-visual { background: #252525; }
[data-theme="dark"] .about-visual::before { border-color: var(--rmc-red); }
[data-theme="dark"] .insight-stat-number { color: #E8E8E8; }
[data-theme="dark"] .insight-stat-context { color: #CCCCCC; }
[data-theme="dark"] .insight-stat-source { color: #999; }

/* Partners section */
[data-theme="dark"] .partners-section { background: #1E1E1E; }
[data-theme="dark"] .partner-box { background: #2C2C2C; }

/* Trust bar */
[data-theme="dark"] .trust-bar { background: #252525; }
[data-theme="dark"] .trust-item { border-right-color: rgba(255,255,255,0.08); }
[data-theme="dark"] .trust-label { color: #999; }
[data-theme="dark"] .trust-item-label { color: #AAAAAA; }

/* Insights section */
[data-theme="dark"] .insights-section { background: #1A1A1A; border-top-color: rgba(255,255,255,0.06); }
[data-theme="dark"] .insight-card { background: #252525; }
[data-theme="dark"] .insight-card:hover { box-shadow: 0 12px 32px rgba(0,0,0,0.4); }
[data-theme="dark"] .insight-card h3 { color: #E8E8E8; }

/* Form fields -- transparent with subtle border (GHC style) */
[data-theme="dark"] .form-field input,
[data-theme="dark"] .form-field select,
[data-theme="dark"] .form-field textarea {
  background: transparent !important;
  border: 1px solid rgba(255,255,255,0.2) !important;
  color: #E8E8E8 !important;
}
[data-theme="dark"] .form-field input:focus,
[data-theme="dark"] .form-field select:focus,
[data-theme="dark"] .form-field textarea:focus {
  background: transparent !important;
  border-color: rgba(255,255,255,0.4) !important;
}
[data-theme="dark"] .form-field label { color: rgba(255,255,255,0.5) !important; }
[data-theme="dark"] .form-field input:focus ~ label,
[data-theme="dark"] .form-field input:not(:placeholder-shown) ~ label,
[data-theme="dark"] .form-field textarea:focus ~ label,
[data-theme="dark"] .form-field textarea:not(:placeholder-shown) ~ label,
[data-theme="dark"] .form-field select:focus ~ label,
[data-theme="dark"] .form-field select:valid ~ label {
  background: var(--rmc-white) !important;
  color: rgba(255,255,255,0.6) !important;
}
/* Select dropdown fix */
[data-theme="dark"] .form-field select {
  -webkit-appearance: none !important;
  appearance: none !important;
}

/* Success/error messages */
[data-theme="dark"] .form-success { background: #0f2d1d; border-color: #1a4d32; color: #6ee7b7; }
[data-theme="dark"] .form-error { background: #2d0f0f; border-color: #4d1a1a; color: #fca5a5; }
[data-theme="dark"] .form-validation-error { background: #2d0f0f; border-color: #4d1a1a; color: #fca5a5; }

/* Contact info text */
[data-theme="dark"] .contact-info h3 { color: #E8E8E8; }
[data-theme="dark"] .contact-detail-value { color: #CCCCCC; }
[data-theme="dark"] .contact-detail-value a { color: #CCCCCC; }
[data-theme="dark"] .contact-detail-value a:hover { color: var(--rmc-red); }

/* Modals */
[data-theme="dark"] .modal-content { background: #252525; }
[data-theme="dark"] .modal-overlay { background: rgba(0,0,0,0.7); }
[data-theme="dark"] .modal-close { color: #AAAAAA; }
[data-theme="dark"] .modal-close:hover { color: #E8E8E8; }
[data-theme="dark"] .modal-content h2 { color: #E8E8E8; }
[data-theme="dark"] .modal-content h3 { color: #E8E8E8; }
[data-theme="dark"] .modal-content p { color: #AAAAAA; }

/* Privacy principles */
[data-theme="dark"] .privacy-principles { background: linear-gradient(135deg, #2C2C2C 0%, #252525 100%); }
[data-theme="dark"] .principle-icon { background: #2C2C2C; border-color: rgba(196,30,42,0.2); }
[data-theme="dark"] .principle-label { color: #E8E8E8; }
[data-theme="dark"] .principle-desc { color: #AAAAAA; }

/* Footer */
[data-theme="dark"] footer { background: #141414; }

/* Section dividers */
[data-theme="dark"] .section-divider {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06) 20%, rgba(196, 30, 42, 0.12) 50%, rgba(255,255,255,0.06) 80%, transparent);
}

/* Page loader */
[data-theme="dark"] .page-loader { background: #1A1A1A; }

/* Approach numbers */
[data-theme="dark"] .approach-number { color: #3A3A3A; }
[data-theme="dark"] .approach-item:hover .approach-number { color: rgba(196, 30, 42, 0.25); }

/* Select dropdown arrow */
[data-theme="dark"] .form-field select {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  background-color: transparent !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 5l3 3 3-3' stroke='%23AAAAAA' stroke-width='1.5' fill='none'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 16px center !important;
}

/* Asset insights dropdown in homepage cards */
[data-theme="dark"] .asset-insights-list { border-top-color: rgba(255,255,255,0.1); }
[data-theme="dark"] .asset-insights-list a { color: #CCCCCC; }
[data-theme="dark"] .asset-insights-list a:hover { color: var(--rmc-red); }

/* Mobile nav */
@media (max-width: 900px) {
  [data-theme="dark"] .nav-links {
    background: #252525 !important;
    border-bottom-color: rgba(255,255,255,0.08) !important;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3) !important;
  }
}
@media (max-width: 1080px) {
  [data-theme="dark"] .nav-links {
    background: #252525 !important;
    border-bottom-color: rgba(255,255,255,0.08) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3) !important;
  }
}

/* ═══════════════════════════════════════════
   ARTICLE PAGES
   ═══════════════════════════════════════════ */

/* Breadcrumbs */
[data-theme="dark"] .article-breadcrumb,
[data-theme="dark"] .term-breadcrumb,
[data-theme="dark"] .breadcrumb { color: #999; }
[data-theme="dark"] .article-breadcrumb a,
[data-theme="dark"] .term-breadcrumb a,
[data-theme="dark"] .breadcrumb a { color: #999; }
[data-theme="dark"] .article-breadcrumb a:hover,
[data-theme="dark"] .term-breadcrumb a:hover,
[data-theme="dark"] .breadcrumb a:hover { color: var(--rmc-red); }

/* Article hero */
[data-theme="dark"] .article-hero h1 { color: #E8E8E8; }
[data-theme="dark"] .article-meta { color: #999; }

/* Article TOC */
[data-theme="dark"] .article-toc-inner { background: #252525; }
[data-theme="dark"] .article-toc a { color: #CCCCCC; }
[data-theme="dark"] .article-toc a:hover { color: var(--rmc-red); }

/* Article takeaways */
[data-theme="dark"] .article-takeaways-inner { background: #252525; }
[data-theme="dark"] .article-takeaways h2 { color: #E8E8E8; }
[data-theme="dark"] .article-takeaways li { color: #CCCCCC; }

/* Article body */
[data-theme="dark"] .article-body h2 { color: #E8E8E8; }
[data-theme="dark"] .article-body h3 { color: #E8E8E8; }
[data-theme="dark"] .article-body strong { color: #E8E8E8; }
[data-theme="dark"] .article-body p { color: #AAAAAA; }

/* Article FAQ */
[data-theme="dark"] .article-faq h2 { color: #E8E8E8; }
[data-theme="dark"] .faq-item { border-left-color: var(--rmc-red); }
[data-theme="dark"] .faq-item h3 { color: #E8E8E8; }
[data-theme="dark"] .faq-item p { color: #AAAAAA; }

/* Related articles */
[data-theme="dark"] .related-card { background: #252525; }
[data-theme="dark"] .related-card:hover { background: #2C2C2C; }
[data-theme="dark"] .related-card h3 { color: #E8E8E8; }
[data-theme="dark"] .related-card p { color: #999; }

/* Sources section */
[data-theme="dark"] .sources-toggle { color: #999; }
[data-theme="dark"] .sources-list { border-top-color: rgba(255,255,255,0.1); }
[data-theme="dark"] .sources-list a { color: #999; }
[data-theme="dark"] .sources-list a:hover { color: #CCCCCC; }
[data-theme="dark"] .source-publisher { color: #AAAAAA; }

/* Article CTA */
[data-theme="dark"] .article-cta { background: #252525; }
[data-theme="dark"] .article-cta h2 { color: #E8E8E8; }
[data-theme="dark"] .article-cta p { color: #AAAAAA; }

/* CTA buttons + active filters -- keep white text on red bg */
[data-theme="dark"] .cta-btn { color: white; }
[data-theme="dark"] .download-btn { color: white; }
[data-theme="dark"] .filter-btn.active { color: white; }

/* Article site footer */
[data-theme="dark"] .site-footer { background: #141414; }
[data-theme="dark"] .footer-brand { color: #E8E8E8; }
[data-theme="dark"] .footer-links a:hover { color: white; }

/* Citation references */
[data-theme="dark"] .cite-ref { color: #999; }
[data-theme="dark"] .cite-ref:hover { color: var(--rmc-red); }

/* ═══════════════════════════════════════════
   GLOSSARY PAGES
   ═══════════════════════════════════════════ */
[data-theme="dark"] .term-hero h1 { color: #E8E8E8; }
[data-theme="dark"] .term-definition { background: #252525; color: #CCCCCC; }
[data-theme="dark"] .term-body h2 { color: #E8E8E8; }
[data-theme="dark"] .term-body strong { color: #E8E8E8; }
[data-theme="dark"] .term-faq h2 { color: #E8E8E8; }
[data-theme="dark"] .related-term { border-color: #3A3A3A; color: #CCCCCC; }
[data-theme="dark"] .related-term:hover { border-color: var(--rmc-red); color: var(--rmc-red); }

/* ═══════════════════════════════════════════
   ASSET CLASS / FOR SELLER LISTING PAGES
   ═══════════════════════════════════════════ */
[data-theme="dark"] .page-hero h1 { color: #E8E8E8; }
[data-theme="dark"] .asset-grid-section .asset-card { border-color: #3A3A3A; background: #252525; }
[data-theme="dark"] .asset-grid-section .asset-card:hover { border-color: var(--rmc-red); box-shadow: 0 4px 16px rgba(0,0,0,0.3); }
[data-theme="dark"] .asset-grid-section .asset-card h2 { color: #E8E8E8; }

/* ═══════════════════════════════════════════
   CASE STUDY PAGES
   ═══════════════════════════════════════════ */
[data-theme="dark"] .cs-overview-inner { background: #252525; }
[data-theme="dark"] .cs-overview h2 { color: #E8E8E8; }
[data-theme="dark"] .cs-overview-value { color: #E8E8E8; }

/* ═══════════════════════════════════════════
   404 PAGE
   ═══════════════════════════════════════════ */
[data-theme="dark"] .error-code { color: rgba(232,232,232,0.06); }
[data-theme="dark"] .error-title { color: #E8E8E8; }
[data-theme="dark"] .error-desc { color: #AAAAAA; }

/* ═══════════════════════════════════════════
   GLOSSARY INDEX / TERM ARTICLES
   ═══════════════════════════════════════════ */
[data-theme="dark"] .term-articles h2 { color: var(--rmc-red); }
[data-theme="dark"] .term-article-card { background: #252525; }
[data-theme="dark"] .term-article-card:hover { background: #2C2C2C; }
[data-theme="dark"] .term-article-card h3 { color: #E8E8E8; }

/* ═══════════════════════════════════════════
   NAV DARK TOGGLE (article/subpage inline button)
   ═══════════════════════════════════════════ */
.dark-toggle {
  display: inline-flex;
  align-items: center;
  background: none;
  border: none;
  cursor: pointer;
  color: #999;
  padding: 4px;
  margin-left: 8px;
  transition: color 0.2s;
}
.dark-toggle:hover { color: var(--rmc-red); }
.dark-toggle svg { width: 18px; height: 18px; }
.dark-toggle .icon-moon { display: inline; }
.dark-toggle .icon-sun { display: none; }
[data-theme="dark"] .dark-toggle .icon-moon { display: none; }
[data-theme="dark"] .dark-toggle .icon-sun { display: inline; }
[data-theme="dark"] .dark-toggle { color: #999; }
[data-theme="dark"] .dark-toggle:hover { color: var(--rmc-red); }
