/**
 * Block browser Force Dark / auto-inversion on every page.
 * color-scheme: only light — do NOT declare light dark (triggers Samsung algorithm).
 * Pin critical surfaces with explicit hex so partial inversion cannot break contrast.
 */
:root,
html {
  color-scheme: only light !important;
  forced-color-adjust: none;
  -webkit-forced-color-adjust: none;
}

*,
*::before,
*::after {
  forced-color-adjust: none;
  -webkit-forced-color-adjust: none;
}

html,
body {
  color-scheme: only light !important;
}

/* —— Page shells —— */
html[data-theme='light'] body,
html[data-theme='light'] .app-shell,
html[data-theme='light'] .home-shell,
html[data-theme='light'] .topic-shell {
  background-color: #f7f8fc !important;
  color: #1b264f !important;
}

html[data-theme='dark'] body,
html[data-theme='dark'] .app-shell,
html[data-theme='dark'] .home-shell,
html[data-theme='dark'] .topic-shell,
html[data-theme='dark'] .standard-page,
html[data-theme='dark'] .author-page,
html[data-theme='dark'] .travel-page,
html[data-theme='dark'] .wallet-page,
html[data-theme='dark'] .auth-page,
html[data-theme='dark'] .admin-page {
  background-color: #0f1428 !important;
  color: #eef1ff !important;
}

html[data-theme='dark'] .text-muted,
html[data-theme='dark'] .load-section-skeleton,
html[data-theme='dark'] .load-section-skeleton-label,
html[data-theme='dark'] .page-standard-lead {
  color: #c5cee8 !important;
  -webkit-text-fill-color: #c5cee8 !important;
}

html[data-theme='light'] .text-muted,
html[data-theme='light'] .load-section-skeleton,
html[data-theme='light'] .load-section-skeleton-label {
  color: #5c6478 !important;
  -webkit-text-fill-color: #5c6478 !important;
}

/* OS dark + user chose light in app */
@media (prefers-color-scheme: dark) {
  html[data-theme-preference='light'],
  html[data-theme-preference='light'] body,
  html[data-theme='light'][data-theme-preference='light'] .home-shell,
  html[data-theme='light'][data-theme-preference='light'] .app-shell,
  html[data-theme='light'][data-theme-preference='light'] .topic-shell {
    background-color: #f7f8fc !important;
    color: #1b264f !important;
    color-scheme: only light !important;
  }
}

/* —— Home nav (transparent bar) —— */
html[data-theme='dark'] .home-page #site-nav .nav-left .logo,
html[data-theme='dark'] .home-page #site-nav .logo-text {
  color: #eef1ff !important;
  -webkit-text-fill-color: #eef1ff !important;
}

/* Wallet pill: always light surface + navy text (beats layout.css blanket dark home pill rule) */
html .home-page #site-nav .nav-account-pill--wallet {
  background: rgb(255 255 255 / 92%) !important;
  border: 1px solid rgb(91 127 255 / 28%) !important;
  color: #1b264f !important;
  -webkit-text-fill-color: #1b264f !important;
  color-scheme: only light !important;
}

html .home-page #site-nav .nav-account-pill--wallet .nav-account-amount {
  color: #1b264f !important;
  -webkit-text-fill-color: #1b264f !important;
}

html[data-theme='dark'] .home-page #site-nav .nav-account-pill--login {
  background: #1a2242 !important;
  border: 1px solid rgb(139 168 255 / 55%) !important;
  color: #eef1ff !important;
  -webkit-text-fill-color: #eef1ff !important;
}

html[data-theme='light'] .home-page #site-nav .nav-left .logo,
html[data-theme='light'] .home-page #site-nav .logo-text {
  color: #eef1ff !important;
  -webkit-text-fill-color: #eef1ff !important;
}

/* —— Hero search —— */
html[data-theme='dark'] .home-search,
html[data-theme='dark'] .home-hero .home-search {
  background-color: #1a2242 !important;
  border-color: rgb(139 168 255 / 38%) !important;
  color: #eef1ff !important;
}

html[data-theme='dark'] .home-search-ghost {
  color: #c5cee8 !important;
  -webkit-text-fill-color: #c5cee8 !important;
}

html[data-theme='dark'] .home-search-ghost-term {
  color: #eef1ff !important;
  -webkit-text-fill-color: #eef1ff !important;
}

html[data-theme='dark'] .home-search-input {
  color: #eef1ff !important;
  -webkit-text-fill-color: #eef1ff !important;
}

html[data-theme='light'] .home-search,
html[data-theme='light'] .home-hero .home-search {
  background-color: #ffffff !important;
  color: #1b264f !important;
}

/* —— Article / stream cards —— */
html[data-theme='dark'] .card-article,
html[data-theme='dark'] .post-card,
html[data-theme='dark'] .stream-card,
html[data-theme='dark'] .topic-article-card,
html[data-theme='dark'] .family-card {
  background-color: #1a2242 !important;
  border-color: #2a3558 !important;
  color: #eef1ff !important;
}

html[data-theme='dark'] .post-card-body,
html[data-theme='dark'] .stream-card-body,
html[data-theme='dark'] .card-article-body,
html[data-theme='dark'] .family-card-body {
  background-color: #1a2242 !important;
  color: #eef1ff !important;
}

html[data-theme='dark'] .post-card h3,
html[data-theme='dark'] .stream-card-body h3,
html[data-theme='dark'] .card-article-body h3 {
  color: #eef1ff !important;
  -webkit-text-fill-color: #eef1ff !important;
}

html[data-theme='dark'] .post-card-excerpt,
html[data-theme='dark'] .post-card-author,
html[data-theme='dark'] .post-card-author-name,
html[data-theme='dark'] .post-card-stats,
html[data-theme='dark'] .post-card-stat,
html[data-theme='dark'] .post-card-meta {
  color: #c5cee8 !important;
  -webkit-text-fill-color: #c5cee8 !important;
}

html[data-theme='light'] .card-article,
html[data-theme='light'] .post-card,
html[data-theme='light'] .stream-card,
html[data-theme='light'] .topic-article-card,
html[data-theme='light'] .family-card {
  background-color: #ffffff !important;
  border-color: #e8ecf4 !important;
  color: #1b264f !important;
}

html[data-theme='light'] .post-card-body,
html[data-theme='light'] .stream-card-body,
html[data-theme='light'] .card-article-body {
  background-color: #ffffff !important;
  color: #1b264f !important;
}

html[data-theme='light'] .post-card h3,
html[data-theme='light'] .stream-card-body h3 {
  color: #1b264f !important;
  -webkit-text-fill-color: #1b264f !important;
}

html[data-theme='light'] .post-card-excerpt,
html[data-theme='light'] .post-card-author,
html[data-theme='light'] .post-card-stats {
  color: #5c6478 !important;
  -webkit-text-fill-color: #5c6478 !important;
}

/* —— Discovery destination badges (white blobs fix) —— */
html[data-theme='dark'] .discovery-card-badge {
  background-color: rgb(15 20 40 / 78%) !important;
  color: #eef1ff !important;
  -webkit-text-fill-color: #eef1ff !important;
}

html[data-theme='light'] .discovery-card-badge {
  background-color: rgb(255 255 255 / 92%) !important;
  color: #1b264f !important;
  -webkit-text-fill-color: #1b264f !important;
}

html[data-theme='dark'] .stream-card-share {
  background-color: #1a2242 !important;
  color: #c5cee8 !important;
}

html[data-theme='light'] .stream-card-share {
  background-color: rgb(255 255 255 / 92%) !important;
  color: #5c6478 !important;
}
