@media (prefers-color-scheme: dark) {
  [style*="background-color: #e0f7fa"], [style*="background-color:#e0f7fa"],
  [style*="background-color: rgb(224, 247, 250)"] {
    background-color: #0e2d33 !important;
    color: #e8f6f9 !important;
    border: 1px solid rgba(255,255,255,0.12) !important;
  }
  [style*="background-color: #e0f7fa"] strong,
  [style*="background-color:#e0f7fa"] strong,
  [style*="background-color: rgb(224, 247, 250)"] strong {
    color: #ffffff !important;
  }
  [style*="background-color: #e0f7fa"] a,
  [style*="background-color:#e0f7fa"] a,
  [style*="background-color: rgb(224, 247, 250)"] a {
    color: #9fd8ff !important;
    text-decoration: underline;
    text-underline-offset: 2px;
  }
}
@media (prefers-color-scheme: light) {
  [style*="background-color: #e0f7fa"], [style*="background-color:#e0f7fa"],
  [style*="background-color: rgb(224, 247, 250)"] { color: #0f1f24; }
}


/* v1.4.7 — Dark listings/page overrides for 'all-products' and 'all-posts' */

:root {
  --dm-bg: #0c1216;
  --dm-surface: #0f1820;
  --dm-text: #e6edf3;
  --dm-muted: #b3c0c8;
  --dm-link: #9fd8ff;
  --dm-border: rgba(255,255,255,.10);
}

/* Recognize many dark-mode activators */
html.dark, body.dark, .dark, .darkmode--activated, .night, .night-mode,
html[data-theme="dark"], body[data-theme="dark"], [data-theme="dark"],
.wp-dark-mode-active, .wp-night-mode-active {
  /* Page canvas */
  background-color: var(--dm-bg) !important;
  color: var(--dm-text) !important;
}

/* Archive & listing containers used by WordPress/Elementor/Gutenberg */
html.dark .site, .dark .site,
html.dark .site-content, .dark .site-content,
html.dark .content-area, .dark .content-area,
html.dark .entry-content, .dark .entry-content,
html.dark .wp-block-group, .dark .wp-block-group,
html.dark .wp-block-query, .dark .wp-block-query,
html.dark .wp-block-post-template, .dark .wp-block-post-template,
html.dark .wp-block-post, .dark .wp-block-post,
html.dark .post, .dark .post,
html.dark .hentry, .dark .hentry,
html.dark .archive .site-main article, .dark .archive .site-main article,
html.dark .blog .site-main article, .dark .blog .site-main article,
html.dark .elementor-section, .dark .elementor-section,
html.dark .elementor-container, .dark .elementor-container,
html.dark .elementor-widget-container, .dark .elementor-widget-container {
  background-color: transparent !important;
  color: var(--dm-text) !important;
}

/* Card-like wrappers frequently used on listings */
html.dark .card, .dark .card,
html.dark .post-card, .dark .post-card,
html.dark .product-card, .dark .product-card,
html.dark .elementor-post, .dark .elementor-post,
html.dark .elementor-post__card, .dark .elementor-post__card,
html.dark .elementor-post__text, .dark .elementor-post__text,
html.dark .elementor-widget-posts .elementor-post, .dark .elementor-widget-posts .elementor-post,
html.dark .woocommerce ul.products li.product, .dark .woocommerce ul.products li.product,
html.dark .archive article, .dark .archive article {
  background-color: var(--dm-surface) !important;
  color: var(--dm-text) !important;
  border: 1px solid var(--dm-border) !important;
}

/* Override common hardcoded light backgrounds (inline or CSS) */
html.dark [style*="background:#fff"], .dark [style*="background:#fff"],
html.dark [style*="background: #fff"], .dark [style*="background: #fff"],
html.dark [style*="background-color:#fff"], .dark [style*="background-color:#fff"],
html.dark [style*="background-color: #fff"], .dark [style*="background-color: #fff"],
html.dark [style*="background-color:#ffffff"], .dark [style*="background-color:#ffffff"],
html.dark [style*="background-color: #ffffff"], .dark [style*="background-color: #ffffff"],
html.dark [style*="background-color:rgb(255,255,255)"], .dark [style*="background-color:rgb(255,255,255)"] {
  background-color: var(--dm-surface) !important;
  color: var(--dm-text) !important;
}

/* Ensure headings/links/excerpts are legible */
html.dark h1, .dark h1, html.dark h2, .dark h2, html.dark h3, .dark h3,
html.dark .entry-title a, .dark .entry-title a,
html.dark .elementor-post__title a, .dark .elementor-post__title a {
  color: var(--dm-text) !important;
}
html.dark a, .dark a { color: var(--dm-link) !important; }
html.dark .entry-summary, .dark .entry-summary,
html.dark .excerpt, .dark .excerpt { color: var(--dm-muted) !important; }

/* Previous v1.4.6 rule for info boxes like #e0f7fa kept intact but generalized */
html.dark [style*="background-color: #e0f7fa"],
.dark [style*="background-color: #e0f7fa"],
html.dark [style*="background-color:#e0f7fa"],
.dark [style*="background-color:#e0f7fa"],
html.dark [style*="background-color: rgb(224, 247, 250)"],
.dark [style*="background-color: rgb(224, 247, 250)"] {
  background-color: #0e2d33 !important;
  color: #e8f6f9 !important;
  border: 1px solid var(--dm-border) !important;
}
html.dark [style*="#e0f7fa"] strong, .dark [style*="#e0f7fa"] strong { color: #fff !important; }
html.dark [style*="#e0f7fa"] a, .dark [style*="#e0f7fa"] a {
  color: var(--dm-link) !important; text-decoration: underline; text-underline-offset: 2px;
}

/* Footer widgets and meta areas */
html.dark .site-footer, .dark .site-footer,
html.dark .widget, .dark .widget {
  background-color: var(--dm-bg) !important;
  color: var(--dm-muted) !important;
}

/* v1.4.10 — Add robust fix for inline light-gray boxes (#f0f0f0) in dark mode */

/* 1) System dark mode */
@media (prefers-color-scheme: dark) {
  [style*="background-color: #f0f0f0"],
  [style*="background-color:#f0f0f0"],
  [style*="background: #f0f0f0"],
  [style*="background:#f0f0f0"],
  [style*="background-color: rgb(240, 240, 240)"],
  [style*="background: rgb(240, 240, 240)"] {
    background-color: var(--dm-surface) !important;
    color: var(--dm-text) !important;
    border: 1px solid var(--dm-border) !important;
  }
  [style*="#f0f0f0"] strong { color: #ffffff !important; }
  [style*="#f0f0f0"] a {
    color: var(--dm-link) !important;
    text-decoration: underline;
    text-underline-offset: 2px;
  }
}

/* 2) Class-based dark mode toggles used by popular plugins/themes */
html.dark [style*="background-color: #f0f0f0"],
.dark [style*="background-color: #f0f0f0"],
html.dark [style*="background-color:#f0f0f0"],
.dark [style*="background-color:#f0f0f0"],
html.dark [style*="background-color: rgb(240, 240, 240)"],
.dark [style*="background-color: rgb(240, 240, 240)"],
body.dark [style*="#f0f0f0"],
body.dark-mode [style*="#f0f0f0"],
.wp-dark-mode-active [style*="#f0f0f0"],
[data-theme="dark"] [style*="#f0f0f0"],
.is-dark-mode [style*="#f0f0f0"] {
  background-color: var(--dm-surface) !important;
  color: var(--dm-text) !important;
  border: 1px solid var(--dm-border) !important;
}

html.dark [style*="#f0f0f0"] strong, .dark [style*="#f0f0f0"] strong { color: #ffffff !important; }
html.dark [style*="#f0f0f0"] a, .dark [style*="#f0f0f0"] a,
body.dark [style*="#f0f0f0"] a, body.dark-mode [style*="#f0f0f0"] a,
.wp-dark-mode-active [style*="#f0f0f0"] a, [data-theme="dark"] [style*="#f0f0f0"] a,
.is-dark-mode [style*="#f0f0f0"] a {
  color: var(--dm-link) !important;
  text-decoration: underline;
  text-underline-offset: 2px;
}
