/*
 * Capa pública de contraste de Esnake Base.
 *
 * Se carga después del tema y de los estilos editoriales para mantener texto,
 * enlaces, foco y contenido de bloques/Elementor legibles sobre la paleta
 * oscura. Las superficies claras declaradas de forma explícita conservan
 * texto oscuro para no quedar en blanco sobre blanco.
 */
:root {
  --esnake-contrast-bg: #061009;
  --esnake-contrast-surface: #0d1911;
  --esnake-contrast-text: #f4fbf5;
  --esnake-contrast-muted: #d0ddd3;
  --esnake-contrast-link: #b7ff8c;
  --esnake-contrast-focus: #e5ff7a;
  --esnake-contrast-on-light: #142119;
  --esnake-contrast-link-on-light: #0c6731;
}

body:not(.wp-admin) {
  background-color: var(--esnake-contrast-bg);
  color: var(--esnake-contrast-text);
  color-scheme: dark;
}

body:not(.wp-admin) :is(.site-main, .site-content, .entry-content, .wp-site-blocks) {
  color: var(--esnake-contrast-text);
}

body:not(.wp-admin) .entry-content :is(p, li, dt, dd, figcaption, blockquote, cite, table, td, th),
body:not(.wp-admin) .wp-block :is(p, li, dt, dd, figcaption, blockquote, cite, table, td, th),
body:not(.wp-admin) .elementor :is(.elementor-widget-text-editor, .elementor-widget-icon-list, .elementor-widget-toggle, .elementor-widget-accordion, .elementor-widget-tabs) {
  color: var(--esnake-contrast-muted);
}

body:not(.wp-admin) :is(.entry-content, .wp-block, .elementor) :is(h1, h2, h3, h4, h5, h6, .elementor-heading-title) {
  color: var(--esnake-contrast-text) !important;
}

body:not(.wp-admin) :is(.entry-content, .wp-block, .elementor) :is(p, li, dt, dd, figcaption, blockquote, cite, .elementor-icon-list-text) {
  color: var(--esnake-contrast-muted);
}

body:not(.wp-admin) :is(.entry-content, .wp-block, .elementor) a:not(.button):not(.wp-element-button):not(.elementor-button):not(.eth-button):not(.eth-toolbar-button) {
  color: var(--esnake-contrast-link);
  text-decoration-thickness: .12em;
  text-underline-offset: .16em;
}

body:not(.wp-admin) :is(.entry-content, .wp-block, .elementor) a:not(.button):not(.wp-element-button):not(.elementor-button):not(.eth-button):not(.eth-toolbar-button):hover {
  color: #efffe9;
}

body:not(.wp-admin) .elementor {
  --e-global-color-text: var(--esnake-contrast-muted) !important;
}

body:not(.wp-admin) :is(.wp-block-quote, .wp-block-pullquote, .entry-content blockquote, .elementor-widget-accordion .elementor-tab-content, .elementor-widget-toggle .elementor-tab-content) {
  border-color: rgba(183, 255, 140, .46);
  background-color: var(--esnake-contrast-surface);
}

body:not(.wp-admin) :is(.wp-block-table, .entry-content table) :is(th, td) {
  border-color: rgba(208, 221, 211, .34);
}

body:not(.wp-admin) :is(.wp-block-button__link, .wp-element-button, .elementor-button) {
  color: #07110a !important;
  background-color: var(--esnake-contrast-link);
}

body:not(.wp-admin) :is(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid var(--esnake-contrast-focus) !important;
  outline-offset: 3px;
}

/* Bloques Gutenberg con superficie clara declarada por clase. */
body:not(.wp-admin) :is(
  .has-white-background-color,
  .has-cyan-bluish-gray-background-color,
  .has-pale-pink-background-color,
  .has-luminous-vivid-amber-background-color,
  .has-luminous-vivid-orange-background-color,
  .has-vivid-red-background-color
) {
  color: var(--esnake-contrast-on-light);
}

body:not(.wp-admin) :is(
  .has-white-background-color,
  .has-cyan-bluish-gray-background-color,
  .has-pale-pink-background-color,
  .has-luminous-vivid-amber-background-color,
  .has-luminous-vivid-orange-background-color,
  .has-vivid-red-background-color
) :is(h1, h2, h3, h4, h5, h6, p, li, dt, dd, figcaption, .elementor-heading-title, .elementor-icon-list-text) {
  color: var(--esnake-contrast-on-light) !important;
}

body:not(.wp-admin) :is(
  .has-white-background-color,
  .has-cyan-bluish-gray-background-color,
  .has-pale-pink-background-color,
  .has-luminous-vivid-amber-background-color,
  .has-luminous-vivid-orange-background-color,
  .has-vivid-red-background-color
) a:not(.button):not(.wp-element-button):not(.elementor-button) {
  color: var(--esnake-contrast-link-on-light);
}

/* Corrección para fondos blancos añadidos directamente desde Elementor. */
body:not(.wp-admin) :is(
  .elementor-element[style*="background-color:#fff"],
  .elementor-element[style*="background-color: #fff"],
  .elementor-element[style*="background-color:#ffffff"],
  .elementor-element[style*="background-color: #ffffff"],
  .elementor-element[style*="background: #fff"],
  .elementor-element[style*="background:#fff"]
) :is(h1, h2, h3, h4, h5, h6, p, li, dt, dd, figcaption, .elementor-heading-title, .elementor-icon-list-text) {
  color: var(--esnake-contrast-on-light) !important;
}

@media (prefers-contrast: more) {
  body:not(.wp-admin) :is(.entry-content, .wp-block, .elementor) :is(p, li, dt, dd, figcaption, blockquote, cite, .elementor-icon-list-text) {
    color: #fff;
  }

  body:not(.wp-admin) :is(.entry-content, .wp-block, .elementor) a:not(.button):not(.wp-element-button):not(.elementor-button):not(.eth-button):not(.eth-toolbar-button) {
    color: #d8ffbd;
  }
}
