/* ====================================================================
   eSoucoulou Suite — Mode sombre
   Principe : on redéfinit les variables du thème enfant (--eso-*) et de
   Tutor LMS (--tutor-*) sous [data-eso-theme="dark"]. Les composants qui
   consomment ces variables basculent seuls ; quelques surfaces codées en
   dur (Astra, WooCommerce, Elementor) sont traitées explicitement.
   ==================================================================== */

[data-eso-theme="dark"] {
  color-scheme: dark;

  /* Thème enfant */
  --eso-white: #121816;
  --eso-black: #f4f7f5;
  --eso-black-soft: #e6ebe8;
  --eso-gray-900: #f1f5f2;
  --eso-gray-700: #cfd6d1;
  --eso-gray-500: #9aa59e;
  --eso-gray-300: #3a453f;
  --eso-gray-200: #2a332e;
  --eso-gray-100: #1c2420;
  --eso-gray-50: #171e1a;
  --eso-green-pale: #16241a;
  --eso-green-lighter: #17301d;
  --eso-green-light: #245c2e;
  --eso-sand: #1e1a14;
  --eso-shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
  --eso-shadow-md: 0 4px 12px rgba(0, 0, 0, .5);
  --eso-shadow-lg: 0 12px 30px rgba(0, 0, 0, .55);
  --eso-shadow-xl: 0 24px 60px rgba(0, 0, 0, .6);

  /* Suite */
  --esos-text: #f1f5f2;
  --esos-muted: #9aa59e;
  --esos-surface: #171e1a;
  --esos-surface-2: #1c2420;
  --esos-border: #2a332e;

  /* Tutor LMS (v2/v3) */
  --tutor-body-color: #e6ebe8;
  --tutor-color-black: #f4f7f5;
  --tutor-color-white: #171e1a;
  --tutor-color-gray-10: #1c2420;
  --tutor-color-gray-20: #242d28;
  --tutor-color-gray-30: #2a332e;
  --tutor-color-gray-40: #3a453f;
  --tutor-color-gray-50: #5a665f;
  --tutor-color-gray-60: #8c968f;
  --tutor-color-gray-70: #b5bdb8;
  --tutor-color-gray-80: #cfd6d1;
  --tutor-color-gray-90: #e6ebe8;
  --tutor-color-gray-100: #f4f7f5;
  --tutor-border-color: #2a332e;
  --tutor-color-primary: #2ec72e;
  --tutor-color-primary-hover: #34d834;
  --tutor-color-primary-10: #17301d;
  --tutor-color-primary-20: #1c3a23;
  --tutor-color-primary-30: #245c2e;
  --tutor-color-primary-40: #2a7a37;
  --tutor-color-primary-50: #2ec72e;
  --tutor-color-primary-60: #34d834;
  --tutor-color-primary-70: #5fe25f;
  --tutor-color-primary-80: #8eec8e;
  --tutor-color-primary-90: #c5f5c5;
  --tutor-color-primary-100: #e4fbe4;
  --tutor-color-subdued: #9aa59e;
  --tutor-color-muted: #8c968f;
  --tutor-color-hints: #9aa59e;
}

/* Surfaces de base */
[data-eso-theme="dark"] body,
[data-eso-theme="dark"] .site,
[data-eso-theme="dark"] .ast-container,
[data-eso-theme="dark"] #content,
[data-eso-theme="dark"] .site-content { background-color: #121816; color: #e6ebe8; }
[data-eso-theme="dark"] h1, [data-eso-theme="dark"] h2, [data-eso-theme="dark"] h3,
[data-eso-theme="dark"] h4, [data-eso-theme="dark"] h5, [data-eso-theme="dark"] h6 { color: #f4f7f5; }
[data-eso-theme="dark"] a:not(.tutor-btn):not(.eso-btn):not(.button) { color: #6fe36f; }
[data-eso-theme="dark"] .eso-header, [data-eso-theme="dark"] .site-header, [data-eso-theme="dark"] .ast-primary-header-bar,
[data-eso-theme="dark"] .eso-footer, [data-eso-theme="dark"] .site-footer { background: #0f1412; color: #cfd6d1; border-color: #2a332e; }
[data-eso-theme="dark"] .eso-card, [data-eso-theme="dark"] .eso-course-card, [data-eso-theme="dark"] .eso-feature,
[data-eso-theme="dark"] .eso-blog-card, [data-eso-theme="dark"] .eso-faq-item, [data-eso-theme="dark"] .eso-pricing-card,
[data-eso-theme="dark"] .tutor-card, [data-eso-theme="dark"] .tutor-course-card, [data-eso-theme="dark"] .tutor-course-sidebar-card,
[data-eso-theme="dark"] .tutor-dashboard-content, [data-eso-theme="dark"] .tutor-dashboard-left-menu, [data-eso-theme="dark"] .tutor-dropdown,
[data-eso-theme="dark"] .tutor-modal-window, [data-eso-theme="dark"] .tutor-accordion-item, [data-eso-theme="dark"] .tutor-course-topics-item,
[data-eso-theme="dark"] .tutor-quiz-wrap, [data-eso-theme="dark"] .tutor-course-single-content-wrapper {
  background-color: #171e1a; color: #e6ebe8; border-color: #2a332e;
}
[data-eso-theme="dark"] input:not([type="submit"]):not([type="button"]):not([type="checkbox"]):not([type="radio"]),
[data-eso-theme="dark"] textarea, [data-eso-theme="dark"] select, [data-eso-theme="dark"] .tutor-form-control {
  background-color: #1c2420; color: #f1f5f2; border-color: #3a453f;
}
[data-eso-theme="dark"] ::placeholder { color: #8c968f; }
[data-eso-theme="dark"] .tutor-topbar, [data-eso-theme="dark"] .tutor-course-spotlight-wrapper, [data-eso-theme="dark"] .tutor-course-spotlight-tab { background: #0f1412; }
[data-eso-theme="dark"] img.eso-logo-dark-invert { filter: invert(1) hue-rotate(180deg); }

/* Contenu de cours « maison » (HTML inline avec couleurs claires codées en dur) :
   on adoucit sans casser la charte. */
[data-eso-theme="dark"] .tutor-course-details-content article[style],
[data-eso-theme="dark"] .tutor-lesson-content article[style],
[data-eso-theme="dark"] .entry-content article[style] { color: #e6ebe8 !important; }
[data-eso-theme="dark"] .tutor-course-details-content article[style] :is(h1, h2, h3, h4, p, li, strong, span, div):not([style*="background"]),
[data-eso-theme="dark"] .tutor-lesson-content article[style] :is(h1, h2, h3, h4, p, li, strong, span, div):not([style*="background"]) { color: inherit !important; }
[data-eso-theme="dark"] .tutor-course-details-content article[style] [style*="background: #f3faf4"],
[data-eso-theme="dark"] .tutor-course-details-content article[style] [style*="background: #eafaf0"],
[data-eso-theme="dark"] .tutor-lesson-content article[style] [style*="background: #f3faf4"],
[data-eso-theme="dark"] .tutor-lesson-content article[style] [style*="background: #eafaf0"] { background: #17301d !important; border-color: #245c2e !important; color: #e6ebe8 !important; }
[data-eso-theme="dark"] .tutor-course-details-content article[style] [style*="background: #eaf2fd"],
[data-eso-theme="dark"] .tutor-lesson-content article[style] [style*="background: #eaf2fd"] { background: #14243a !important; color: #dbe7fb !important; }
[data-eso-theme="dark"] .tutor-course-details-content article[style] [style*="background: #fff6e6"],
[data-eso-theme="dark"] .tutor-lesson-content article[style] [style*="background: #fff6e6"] { background: #3a2a0f !important; color: #fbe7c2 !important; }
[data-eso-theme="dark"] .tutor-course-details-content article[style] [style*="background"] *,
[data-eso-theme="dark"] .tutor-lesson-content article[style] [style*="background"] * { color: inherit !important; }

/* Certificat et aperçus d'image : jamais assombris */
[data-eso-theme="dark"] .tutor-certificate-preview, [data-eso-theme="dark"] .tutor-certificate-template { filter: none; background: #fff; }

/* Transition douce */
[data-eso-theme] body, [data-eso-theme] .eso-card, [data-eso-theme] .tutor-card { transition: background-color .2s ease, color .2s ease; }
