/* MKH Site Dark Mode — royal blue + sky blue palette */
:root {
  --mkh-dm-page-bg: #101B28;
  --mkh-dm-surface: #172638;
  --mkh-dm-surface-raised: #20364B;
  --mkh-dm-text: #F1F5F9;
  --mkh-dm-muted: #B7C7D6;
  --mkh-dm-link: #91D8F5;
  --mkh-dm-border: #344C63;
  --mkh-dm-primary: #174D91;
  --mkh-dm-accent: #6EC1E4;
}

html.mkh-site-dark-mode { color-scheme: dark; background: var(--mkh-dm-page-bg) !important; }
html.mkh-site-dark-mode body,
body.mkh-site-dark-mode {
  background-color: var(--mkh-dm-page-bg) !important;
  color: var(--mkh-dm-text);
}

/* Common WordPress + OceanWP content shells. */
html.mkh-site-dark-mode body #outer-wrap,
html.mkh-site-dark-mode body #wrap,
html.mkh-site-dark-mode body #main,
html.mkh-site-dark-mode body #content-wrap,
html.mkh-site-dark-mode body #primary,
html.mkh-site-dark-mode body #content,
html.mkh-site-dark-mode body .site-content,
html.mkh-site-dark-mode body .content-area,
html.mkh-site-dark-mode body .entry,
html.mkh-site-dark-mode body .entry-content,
html.mkh-site-dark-mode body .page-header,
html.mkh-site-dark-mode body .archive-page-header,
html.mkh-site-dark-mode body .blog-entry,
html.mkh-site-dark-mode body .widget-area {
  background-color: var(--mkh-dm-page-bg) !important;
  color: var(--mkh-dm-text);
}

/* Automatically detected light surfaces, including pale blue/gray backgrounds and light gradients. */
html.mkh-site-dark-mode .mkh-dm-surface {
  background-color: var(--mkh-dm-surface) !important;
  background-image: none !important;
  border-color: var(--mkh-dm-border) !important;
  color: var(--mkh-dm-text) !important;
  box-shadow: 0 5px 20px rgba(0,0,0,.16);
}
html.mkh-site-dark-mode .mkh-dm-surface :where(
  h1,h2,h3,h4,h5,h6,p,span,strong,b,em,small,li,a,label,dt,dd,
  blockquote,figcaption,legend,th,td,div,section,article,
  .elementor-heading-title,.elementor-widget-text-editor,
  .elementor-icon-list-text,.elementor-tab-title,.elementor-tab-content
) {
  color: var(--mkh-dm-text) !important;
  -webkit-text-fill-color: var(--mkh-dm-text) !important;
  opacity: 1 !important;
}
html.mkh-site-dark-mode .mkh-dm-surface :where(a:not(.elementor-button):not(.button):not(.wp-block-button__link)) {
  color: var(--mkh-dm-link) !important;
  -webkit-text-fill-color: var(--mkh-dm-link) !important;
}
html.mkh-site-dark-mode .mkh-dm-surface :where(small,.description,.elementor-icon-list-text) {
  color: var(--mkh-dm-muted) !important;
  -webkit-text-fill-color: var(--mkh-dm-muted) !important;
}
html.mkh-site-dark-mode .mkh-dm-surface :where(hr) { border-color: var(--mkh-dm-border) !important; }
html.mkh-site-dark-mode .mkh-dm-surface :where(input:not([type="submit"]),textarea,select) {
  background: var(--mkh-dm-surface-raised) !important;
  color: var(--mkh-dm-text) !important;
  border-color: var(--mkh-dm-border) !important;
}

/* Unified dark-mode treatment for action buttons, icon buttons and rounded action links. */
html.mkh-site-dark-mode .mkh-dm-button {
  background: var(--mkh-dm-primary) !important;
  background-image: none !important;
  border-color: var(--mkh-dm-accent) !important;
  color: #FFFFFF !important;
  -webkit-text-fill-color: #FFFFFF !important;
  box-shadow: 0 3px 12px rgba(0,0,0,.18) !important;
  opacity: 1 !important;
}
html.mkh-site-dark-mode .mkh-dm-button :where(span,i,b,strong,em,svg) {
  color: #FFFFFF !important;
  -webkit-text-fill-color: #FFFFFF !important;
}
html.mkh-site-dark-mode .mkh-dm-button svg [fill]:not([fill="none"]) {
  fill: #FFFFFF !important;
}
html.mkh-site-dark-mode .mkh-dm-button svg [stroke]:not([stroke="none"]) {
  stroke: #FFFFFF !important;
}
html.mkh-site-dark-mode .mkh-dm-button:hover,
html.mkh-site-dark-mode .mkh-dm-button:focus-visible {
  background: var(--mkh-dm-accent) !important;
  border-color: var(--mkh-dm-accent) !important;
  color: #123F78 !important;
  -webkit-text-fill-color: #123F78 !important;
  outline: 2px solid rgba(110,193,228,.35);
  outline-offset: 2px;
}
html.mkh-site-dark-mode .mkh-dm-button:hover :where(span,i,b,strong,em,svg),
html.mkh-site-dark-mode .mkh-dm-button:focus-visible :where(span,i,b,strong,em,svg) {
  color: #123F78 !important;
  -webkit-text-fill-color: #123F78 !important;
}
html.mkh-site-dark-mode .mkh-dm-button:active {
  background: #123F78 !important;
  color: #FFFFFF !important;
}
/* Some custom round arrows draw their circle with pseudo-elements. */
html.mkh-site-dark-mode .mkh-dm-before-button::before,
html.mkh-site-dark-mode .mkh-dm-after-button::after {
  background-color: var(--mkh-dm-primary) !important;
  border-color: var(--mkh-dm-accent) !important;
}

/* Library count badges: preserve a light sky-blue pill with readable royal-blue text. */
html.mkh-site-dark-mode .mkh-dir-count,
html.mkh-site-dark-mode .mkh-dir-count * {
  background-color: #DFF2FC !important;
  background-image: none !important;
  color: #174D91 !important;
  -webkit-text-fill-color: #174D91 !important;
  border-color: #6EC1E4 !important;
  opacity: 1 !important;
}

/* Text whose original dark color would be unreadable over a dark background. */
html.mkh-site-dark-mode .mkh-dm-light-text {
  color: var(--mkh-dm-text) !important;
  -webkit-text-fill-color: var(--mkh-dm-text) !important;
  opacity: 1 !important;
}
html.mkh-site-dark-mode .mkh-dm-link-text {
  color: var(--mkh-dm-link) !important;
  -webkit-text-fill-color: var(--mkh-dm-link) !important;
}

/* Explicitly forced dark component, even if its original background was not white. */
html.mkh-site-dark-mode .mkh-dm-forced-surface {
  background-color: var(--mkh-dm-surface) !important;
  background-image: none !important;
  border-color: var(--mkh-dm-border) !important;
  color: var(--mkh-dm-text) !important;
}
html.mkh-site-dark-mode .mkh-dm-forced-surface :where(h1,h2,h3,h4,h5,h6,p,span,strong,small,li,label,div,a) {
  color: var(--mkh-dm-text) !important;
}
html.mkh-site-dark-mode .mkh-dm-forced-surface a { color: var(--mkh-dm-link) !important; }

/* Opt-outs: do not recolor these components. */
html.mkh-site-dark-mode .mkh-dark-exempt,
html.mkh-site-dark-mode [data-mkh-dark="exclude"] {
  color-scheme: light !important;
}

/* Preserve branded header, logos, photos, thumbnails and embedded services. */
html.mkh-site-dark-mode .mkh-main-header {
  background: #174D91 !important;
  color: #FFFFFF !important;
  border-bottom-color: #6EC1E4 !important;
}
html.mkh-site-dark-mode .mkh-header-title strong,
html.mkh-site-dark-mode .mkh-header-title span,
html.mkh-site-dark-mode .mkh-open-menu,
html.mkh-site-dark-mode .mkh-home-link {
  color: #FFFFFF !important;
}
html.mkh-site-dark-mode .mkh-side-drawer,
html.mkh-site-dark-mode .mkh-drawer-header,
html.mkh-site-dark-mode .mkh-drawer-footer {
  background: #111E2C !important;
  color: #F1F5F9 !important;
}
html.mkh-site-dark-mode .mkh-drawer-header {
  border-bottom-color: #6EC1E4 !important;
  box-shadow: 0 1px 0 #6EC1E4 !important;
}
html.mkh-site-dark-mode .mkh-drawer-brand-text,
html.mkh-site-dark-mode .mkh-drawer-footer {
  color: #F1F5F9 !important;
}
html.mkh-site-dark-mode .mkh-drawer-menu > li > a,
html.mkh-site-dark-mode .mkh-drawer-menu .sub-menu a,
html.mkh-site-dark-mode .mkh-submenu-toggle {
  color: #DFEAF5 !important;
}
html.mkh-site-dark-mode .mkh-drawer-menu > li > a:hover,
html.mkh-site-dark-mode .mkh-drawer-menu > li.current-menu-item > a,
html.mkh-site-dark-mode .mkh-drawer-menu > li.current-menu-ancestor > a,
html.mkh-site-dark-mode .mkh-drawer-menu .sub-menu a:hover,
html.mkh-site-dark-mode .mkh-drawer-menu .sub-menu .current-menu-item > a {
  background: #203B55 !important;
  color: #A9DDF5 !important;
}
html.mkh-site-dark-mode .mkh-submenu-toggle:hover,
html.mkh-site-dark-mode .mkh-close-menu,
html.mkh-site-dark-mode .mkh-theme-toggle {
  background: #20374D !important;
  border-color: #42617C !important;
  color: #BFE9FA !important;
}
html.mkh-site-dark-mode .mkh-search-form,
html.mkh-site-dark-mode .mkh-search-form.is-expanded {
  background: #172638 !important;
  border-color: #6EC1E4 !important;
}
html.mkh-site-dark-mode .mkh-search-form input { color: #EDF5FC !important; }
html.mkh-site-dark-mode .mkh-search-form input::placeholder { color: #A7B9CA !important; }
html.mkh-site-dark-mode .mkh-search-form button { background: transparent !important; color: #BFE9FA !important; }
html.mkh-site-dark-mode .mkh-search-form button::before { border-color: #BFE9FA !important; }
html.mkh-site-dark-mode .mkh-search-form button::after { background: #BFE9FA !important; }
html.mkh-site-dark-mode .mkh-logo-circle,
html.mkh-site-dark-mode .mkh-drawer-logo-circle {
  background: #FFFFFF !important;
}
html.mkh-site-dark-mode img,
html.mkh-site-dark-mode picture,
html.mkh-site-dark-mode video,
html.mkh-site-dark-mode iframe,
html.mkh-site-dark-mode canvas {
  filter: none !important;
}
html.mkh-site-dark-mode input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]),
html.mkh-site-dark-mode textarea,
html.mkh-site-dark-mode select {
  color-scheme: dark;
}

/* Optional shortcode toggle. */
.mkh-site-dark-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 14px;
  border: 1px solid #6EC1E4;
  border-radius: 10px;
  background: #174D91;
  color: #FFFFFF;
  font: inherit;
  cursor: pointer;
}
.mkh-site-dark-toggle:hover { background: #6EC1E4; color: #174D91; }
