html[data-theme="dark"] img:not(.sd-tab-set.docutils img):not(.dark-light):not(.logo__image),
html[data-theme="dark"] figure:not(.sd-tab-set.docutils figure) img:not(.dark-light),
html[data-theme="dark"] iframe:not([src*="youtube.com"]):not([src*="vimeo.com"]):not(.dark-light):not(.sphinx) {
  filter: none !important;
}

html[data-theme="dark"] img:not(.sd-tab-set.docutils img):not(.only-dark):not(.logo__image),
html[data-theme="dark"] figure:not(.sd-tab-set.docutils figure) img:not(.only-dark),
html[data-theme="dark"] iframe:not([src*="youtube.com"]):not([src*="vimeo.com"]):not(.only-dark):not(.sphinx) {
  background-color: #fff !important;
  mix-blend-mode: plus-lighter !important;
}

/* Add consistency between dark and ligt mode images */
img:not(.sd-tab-set.docutils img):not(.only-light):not(.logo__image),
figure:not(.sd-tab-set.docutils figure) img:not(.only-light),
iframe:not([src*="youtube.com"]):not([src*="vimeo.com"]):not(.only-light):not(.sphinx) {
  background-color: transparent !important;
  mix-blend-mode: darken !important;
}

html[data-theme="dark"] img.dark-light:not(.sd-tab-set.docutils img):not(.logo__image),
html[data-theme="dark"] figure:not(.sd-tab-set.docutils figure) img.dark-light,
html[data-theme="dark"] iframe:not([src*="youtube.com"]):not([src*="vimeo.com"]).dark-light:not(.sphinx) {
  filter: invert(1) hue-rotate(180deg) saturate(1.5) !important;
}

/* Fix alert dark mode */
html[data-theme="dark"] .alert {
  --bs-alert-bg: #132119;
  --bs-alert-color: #d1e7dd;
}

/* Dark mode: Apply inversion specifically for tab-set figures */
html[data-theme="dark"] .sd-tab-set.docutils figure img.dark-light ,
html[data-theme="dark"] .sd-tab-set.docutils img.dark-light {
  filter: brightness(0.8) contrast(1.2) invert(1);
  mix-blend-mode: plus-lighter !important; 
  display: block;
  position: relative;
  opacity: 0.9; 
}
