/*
 * RX Theme v10.23.75.11.77.72
 * Sitewide Dark Mode Surface + Readability Guardian.
 * Loaded after the normal responsive layer so existing component-specific
 * dark rules remain authoritative while uncovered light surfaces are closed.
 */
body.rx-dark-mode {
  color-scheme: dark;
  --rx-dark-bg: #08111f;
  --rx-dark-surface: #0f172a;
  --rx-dark-surface-2: #111c2f;
  --rx-dark-soft: #172033;
  --rx-dark-border: #29384d;
  --rx-dark-text: #dbe5f1;
  --rx-dark-muted: #aab8ca;
  --rx-dark-heading: #f8fafc;
  background: var(--rx-dark-bg) !important;
  color: var(--rx-dark-text);
}

body.rx-dark-mode :where(
  #page,
  .site,
  .site-content,
  #content,
  #primary,
  .content-area,
  .site-main,
  .rx-main,
  .rx-homepage-v3,
  .rx-home-body-shell,
  .rx-content-layout,
  .rx-medical-page-layout
) {
  background-color: var(--rx-dark-bg) !important;
  color: var(--rx-dark-text);
}

/* Homepage surfaces that historically stayed light after the body class changed. */
body.rx-dark-mode :where(
  .rx-home-search,
  .rx-home-hero-panel,
  .rx-health-card,
  .rx-health-mini-grid > div,
  .rx-home-category-card,
  .rx-home-post-card,
  .rx-home-popular-item,
  .rx-az-tabs a,
  .rx-az-group,
  .rx-home-doctor-card,
  .rx-home-btn-secondary
) {
  background: var(--rx-dark-surface) !important;
  border-color: var(--rx-dark-border) !important;
  color: var(--rx-dark-text) !important;
  box-shadow: none !important;
}

body.rx-dark-mode .rx-home-az {
  background: linear-gradient(180deg, #0b1526 0%, var(--rx-dark-bg) 100%) !important;
}

body.rx-dark-mode .rx-health-card {
  background: linear-gradient(135deg, #102034, #0f2b2a) !important;
}

body.rx-dark-mode .rx-home-doctor-card {
  background: linear-gradient(135deg, #0f172a, #102827) !important;
}

body.rx-dark-mode :where(
  .rx-home-section-head p,
  .rx-health-mini-grid span,
  .rx-home-category-card small,
  .rx-home-post-meta,
  .rx-home-post-body p,
  .rx-home-popular-item p,
  .rx-home-doctor p,
  .rx-doctor-meta span
) {
  color: var(--rx-dark-muted) !important;
}

body.rx-dark-mode :where(
  .rx-home-category-card strong,
  .rx-home-post-body h3 a,
  .rx-home-popular-item h3 a,
  .rx-home-doctor h2,
  .rx-doctor-meta strong,
  .rx-az-group a
) {
  color: var(--rx-dark-heading) !important;
}

body.rx-dark-mode .rx-home-search input,
body.rx-dark-mode .rx-home-search input::placeholder {
  color: var(--rx-dark-text) !important;
}
body.rx-dark-mode .rx-home-search input::placeholder { color: #91a2b7 !important; }

/* Standard content/card surfaces across posts, pages, archives and tools. */
body.rx-dark-mode :where(
  .rx-post-card,
  .rx-single-area,
  .rx-page,
  .rx-content-none,
  .rx-sidebar .widget,
  .widget,
  .rx-toc,
  .rx-medical-box,
  .rx-medical-disclaimer,
  .rx-author-box,
  .rx-related,
  .rx-faq,
  .rx-article-meta-panel,
  .rx-article-toc,
  .rx-medical-section-card,
  .rx-article-faq,
  .rx-article-references,
  .rx-medical-page-article,
  .rx-medical-page-sidebar .widget
) {
  background-color: var(--rx-dark-surface) !important;
  border-color: var(--rx-dark-border) !important;
  color: var(--rx-dark-text) !important;
}

body.rx-dark-mode :where(
  .entry-content,
  .post-content,
  .article-content,
  .rx-article-content,
  .wp-block-post-content,
  .single-post-content,
  .single-content
) {
  color: var(--rx-dark-text) !important;
}

body.rx-dark-mode :where(h1,h2,h3,h4,h5,h6,.entry-title,.page-title,.widget-title) {
  color: var(--rx-dark-heading);
}

body.rx-dark-mode :where(
  .entry-content,
  .post-content,
  .article-content,
  .rx-article-content,
  .wp-block-post-content,
  .single-post-content,
  .single-content
) :where(p,li,dd,dt) {
  color: var(--rx-dark-text);
}

body.rx-dark-mode :where(
  input[type="text"],
  input[type="search"],
  input[type="email"],
  input[type="url"],
  input[type="number"],
  input[type="tel"],
  input[type="password"],
  textarea,
  select
) {
  background-color: #0b1526;
  color: var(--rx-dark-heading);
  border-color: var(--rx-dark-border);
}

body.rx-dark-mode :where(input,textarea)::placeholder { color: #8798ad; }

body.rx-dark-mode :where(table,th,td) { border-color: var(--rx-dark-border); }
body.rx-dark-mode th { background-color: #132036; color: var(--rx-dark-heading); }
body.rx-dark-mode td { background-color: #0f172a; color: var(--rx-dark-text); }

body.rx-dark-mode :where(details,blockquote,pre,code) {
  border-color: var(--rx-dark-border);
}
body.rx-dark-mode pre,
body.rx-dark-mode blockquote { background-color: #0b1526; color: var(--rx-dark-text); }
body.rx-dark-mode code { color: #d7e7ff; }

/* Keep native images/media visually unchanged. */
body.rx-dark-mode :where(img,picture,video,iframe,canvas,svg) {
  filter: none;
}

/* Translator follows dark state wherever the smart dock moves it. */
body.rx-dark-mode .rx-language-translator {
  background: var(--rx-dark-surface) !important;
  border-color: var(--rx-dark-border) !important;
  color: var(--rx-dark-text) !important;
  box-shadow: 0 10px 28px rgba(0,0,0,.28);
}
body.rx-dark-mode .rx-language-translator__select { color: var(--rx-dark-heading) !important; }
body.rx-dark-mode .rx-language-translator__reset { background:#172554 !important; color:#bfdbfe !important; }

/* Mobile drawer should inherit the same sitewide state. */
@media (max-width: 1100px) {
  body.rx-dark-mode :where(.rx-mobile-panel,.rx-mobile-drawer,.rx-mhs-drawer,.rx-v91-mobile-panel) {
    background-color: var(--rx-dark-surface) !important;
    color: var(--rx-dark-text) !important;
    border-color: var(--rx-dark-border) !important;
  }
}


/* v10.23.75.11.77.72 — restored single-article inner canvas coverage.
 * The legacy medical restoration layer paints .rx-medical-article and the
 * article hero white. Cover those exact descendants without altering light mode.
 */
body.rx-dark-mode.rx-medical-article-restored .rx-medical-article,
body.rx-dark-mode .rx-single-area > article.rx-medical-article,
body.rx-dark-mode .rx-single-area .rx-medical-article {
  background: var(--rx-dark-surface) !important;
  border-color: var(--rx-dark-border) !important;
  color: var(--rx-dark-text) !important;
  box-shadow: none !important;
}

body.rx-dark-mode.rx-medical-article-restored .rx-article-hero,
body.rx-dark-mode .rx-medical-article .rx-article-hero {
  background: linear-gradient(145deg,#101a2c 0%,#0f172a 62%,#102322 100%) !important;
  border-color: var(--rx-dark-border) !important;
}

body.rx-dark-mode.rx-medical-article-restored .rx-entry-content,
body.rx-dark-mode .rx-medical-article .rx-entry-content,
body.rx-dark-mode .rx-medical-article .rx-medical-entry-content {
  background: transparent !important;
  color: var(--rx-dark-text) !important;
}

body.rx-dark-mode.rx-medical-article-restored .rx-article-title,
body.rx-dark-mode.rx-medical-article-restored .rx-entry-content h2,
body.rx-dark-mode.rx-medical-article-restored .rx-entry-content h3,
body.rx-dark-mode .rx-medical-article .rx-article-title,
body.rx-dark-mode .rx-medical-article .rx-entry-content :where(h1,h2,h3,h4,h5,h6) {
  color: var(--rx-dark-heading) !important;
}

body.rx-dark-mode.rx-medical-article-restored .rx-entry-content :where(p,li,dd,dt,strong,b),
body.rx-dark-mode .rx-medical-article .rx-entry-content :where(p,li,dd,dt,strong,b) {
  color: var(--rx-dark-text) !important;
}

body.rx-dark-mode.rx-medical-article-restored .rx-entry-content h2 {
  border-bottom-color: var(--rx-dark-border) !important;
}

body.rx-dark-mode.rx-medical-article-restored .rx-entry-content blockquote,
body.rx-dark-mode .rx-medical-article .rx-entry-content blockquote {
  background: #0b1c20 !important;
  color: #cdebe6 !important;
  border-left-color: #2dd4bf !important;
}

body.rx-dark-mode.rx-medical-article-restored .rx-entry-content table,
body.rx-dark-mode.rx-medical-article-restored .rx-entry-content th,
body.rx-dark-mode.rx-medical-article-restored .rx-entry-content td {
  border-color: var(--rx-dark-border) !important;
}
body.rx-dark-mode.rx-medical-article-restored .rx-entry-content th {
  background: #132036 !important;
  color: var(--rx-dark-heading) !important;
}
body.rx-dark-mode.rx-medical-article-restored .rx-entry-content td {
  background: var(--rx-dark-surface) !important;
  color: var(--rx-dark-text) !important;
}

body.rx-dark-mode .rx-article-reach-strip,
body.rx-dark-mode .rx-legacy-product-reference {
  background: var(--rx-dark-surface-2) !important;
  border-color: var(--rx-dark-border) !important;
  color: var(--rx-dark-text) !important;
  box-shadow: none !important;
}
body.rx-dark-mode .rx-article-reach-strip__context,
body.rx-dark-mode .rx-legacy-product-reference { color: var(--rx-dark-muted) !important; }
body.rx-dark-mode .rx-article-reach-button {
  background: #132036 !important;
  border-color: var(--rx-dark-border) !important;
  color: #dbeafe !important;
}
