/* Optional dark palette for the legacy Pages/Bootstrap UI. Light mode remains unchanged. */
html[data-theme="dark"] {
  color-scheme: dark;
  --rudyon-ink: #e8f0fb;
  --rudyon-muted: #a8b8cc;
  --rudyon-line: #2b3b52;
  --rudyon-accent: #6ce0d7;
  --rudyon-blue: #83baff;
  --rudyon-surface: #19273a;
}

html[data-theme="dark"] body.rudyon-site,
html[data-theme="dark"] body.rudyon-site .bc-white,
html[data-theme="dark"] body.rudyon-site .page-container,
html[data-theme="dark"] body.rudyon-site .page-content-wrapper,
html[data-theme="dark"] body.rudyon-site .page-content-wrapper .content,
html[data-theme="dark"] body.rudyon-site .rudyon-home {
  background: #0e1725 !important;
  color: var(--rudyon-ink);
}
html[data-theme="dark"] body.rudyon-site .header {
  background: #0a1322 !important;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .32) !important;
}
html[data-theme="dark"] body.rudyon-site .rudyon-page-label,
html[data-theme="dark"] body.rudyon-site .rudyon-brand small { color: #a8bfd5; }
html[data-theme="dark"] body.rudyon-site .rudyon-theme-toggle {
  border-color: rgba(108,224,215,.42);
  background: rgba(108,224,215,.13);
  color: #e5fffb;
}
html[data-theme="dark"] body.rudyon-site .rudyon-theme-toggle:hover {
  background: rgba(108,224,215,.22);
}

html[data-theme="dark"] body.rudyon-site h1,
html[data-theme="dark"] body.rudyon-site h2,
html[data-theme="dark"] body.rudyon-site h3,
html[data-theme="dark"] body.rudyon-site h4,
html[data-theme="dark"] body.rudyon-site h5,
html[data-theme="dark"] body.rudyon-site h6,
html[data-theme="dark"] body.rudyon-site .m-black,
html[data-theme="dark"] body.rudyon-site .m-n-color,
html[data-theme="dark"] body.rudyon-site .m-card-title {
  color: var(--rudyon-ink) !important;
}
html[data-theme="dark"] body.rudyon-site .m-gray,
html[data-theme="dark"] body.rudyon-site .text-muted,
html[data-theme="dark"] body.rudyon-site .hint-text,
html[data-theme="dark"] body.rudyon-site .muted { color: var(--rudyon-muted) !important; }
html[data-theme="dark"] body.rudyon-site .m-title,
html[data-theme="dark"] body.rudyon-site .text-complete { color: var(--rudyon-blue) !important; }
html[data-theme="dark"] body.rudyon-site .rudyon-home-stage h1 { color: #fff !important; }
html[data-theme="dark"] body.rudyon-site .rudyon-home-stage h1 span { color: #8be9d8; }
html[data-theme="dark"] body.rudyon-site .content a:not(.btn):not(.page-link),
html[data-theme="dark"] body.rudyon-site .footer a { color: #a9d0ff; }
html[data-theme="dark"] body.rudyon-site .content a:not(.btn):not(.page-link):hover,
html[data-theme="dark"] body.rudyon-site .footer a:hover { color: #d3e9ff; }
html[data-theme="dark"] body.rudyon-site .rudyon-home .hero-actions a:first-child {
  color: #102a33 !important;
}
html[data-theme="dark"] body.rudyon-site .rudyon-home .hero-actions a + a {
  color: #fff !important;
}
html[data-theme="dark"] body.rudyon-site .rudyon-quicklink {
  background: #19273a;
  border-color: var(--rudyon-line);
  color: var(--rudyon-ink) !important;
  box-shadow: 0 12px 28px rgba(0,0,0,.16);
}
html[data-theme="dark"] body.rudyon-site .rudyon-quicklink:hover { background: #223650; }
html[data-theme="dark"] body.rudyon-site .rudyon-quicklink > i { background: #214a4b; color: #91ecdc; }
html[data-theme="dark"] body.rudyon-site .rudyon-quicklink small { color: var(--rudyon-muted); }
html[data-theme="dark"] body.rudyon-site .rudyon-quicklink-arrow { color: #a8bfd5; }

/* Home cards and shared panels */
html[data-theme="dark"] body.rudyon-site .rudyon-home .social-card.share,
html[data-theme="dark"] body.rudyon-site .rudyon-home .social-card.share .card-header,
html[data-theme="dark"] body.rudyon-site .rudyon-home .social-card .card,
html[data-theme="dark"] body.rudyon-site .rudyon-home .social-card .tab-content,
html[data-theme="dark"] body.rudyon-site .card,
html[data-theme="dark"] body.rudyon-site .panel,
html[data-theme="dark"] body.rudyon-site .bg-white,
html[data-theme="dark"] body.rudyon-site .bg-master-lighter {
  background: var(--rudyon-surface) !important;
  color: var(--rudyon-ink);
  border-color: var(--rudyon-line) !important;
}
html[data-theme="dark"] body.rudyon-site .rudyon-home .social-card .nav-tabs {
  border-color: var(--rudyon-line);
}
html[data-theme="dark"] body.rudyon-site .rudyon-home .social-card .nav-tabs a,
html[data-theme="dark"] body.rudyon-site .rudyon-home .social-card .list-group-item {
  color: #d4e0ee !important;
}
html[data-theme="dark"] body.rudyon-site .rudyon-home .social-card .nav-tabs a.active {
  color: var(--rudyon-accent) !important;
}
html[data-theme="dark"] body.rudyon-site .rudyon-home .social-card .list-group-item,
html[data-theme="dark"] body.rudyon-site .list-group-item {
  background: var(--rudyon-surface) !important;
  border-color: var(--rudyon-line) !important;
  color: #d4e0ee;
}
html[data-theme="dark"] body.rudyon-site .rudyon-home .social-card .list-group-item:hover,
html[data-theme="dark"] body.rudyon-site .list-group-item:hover {
  background: #233750 !important;
  color: #fff !important;
}
html[data-theme="dark"] body.rudyon-site .rudyon-home .social-card .badge.bg-complete {
  background: #19453e !important;
  color: #9af0d3;
}
html[data-theme="dark"] body.rudyon-site .rudyon-promo {
  background: var(--rudyon-surface);
  border-color: var(--rudyon-line);
}
html[data-theme="dark"] body.rudyon-site .rudyon-promo-controls { color: var(--rudyon-muted); }

/* Boards, rankings, comments, and pagination */
html[data-theme="dark"] body.rudyon-site .table {
  background: #172437;
  color: var(--rudyon-ink);
  border-color: var(--rudyon-line);
}
html[data-theme="dark"] body.rudyon-site .table thead,
html[data-theme="dark"] body.rudyon-site .table thead tr,
html[data-theme="dark"] body.rudyon-site .table thead th {
  background: #1d2e44 !important;
  color: #d9e7f6 !important;
  border-color: var(--rudyon-line) !important;
}
html[data-theme="dark"] body.rudyon-site .table tbody tr,
html[data-theme="dark"] body.rudyon-site .table tbody td {
  background: #172437 !important;
  color: #d7e2ef;
  border-color: var(--rudyon-line) !important;
}
html[data-theme="dark"] body.rudyon-site .table-hover tbody tr:hover td {
  background: #263a53 !important;
}
html[data-theme="dark"] body.rudyon-site .table tbody tr.notice td {
  background: #1a3047 !important;
}
html[data-theme="dark"] body.rudyon-site .page-link,
html[data-theme="dark"] body.rudyon-site .pagination a,
html[data-theme="dark"] body.rudyon-site .paginate_button a {
  background: #1b2a3e;
  color: #cbdbee !important;
  border-color: var(--rudyon-line);
}
html[data-theme="dark"] body.rudyon-site .page-item.active .page-link,
html[data-theme="dark"] body.rudyon-site .pagination .active a {
  background: #3679d0;
  color: #fff !important;
  border-color: #3679d0;
}
html[data-theme="dark"] body.rudyon-site .comment-item,
html[data-theme="dark"] body.rudyon-site .comment-list,
html[data-theme="dark"] body.rudyon-site .article-toolbar {
  border-color: var(--rudyon-line);
}
html[data-theme="dark"] body.rudyon-site .view-content .post-body,
html[data-theme="dark"] body.rudyon-site .rudyon-footer-stats a {
  background: #19273a;
  border-color: var(--rudyon-line);
  box-shadow: 0 14px 36px rgba(0,0,0,.16);
}

/* Give articles a dark reading surface instead of a white panel. */
html[data-theme="dark"] body.rudyon-site .post-body {
  padding: 22px;
  border-radius: 14px;
  background: #19273a;
  color: var(--rudyon-ink);
}
html[data-theme="dark"] body.rudyon-site .post-body h1,
html[data-theme="dark"] body.rudyon-site .post-body h2,
html[data-theme="dark"] body.rudyon-site .post-body h3,
html[data-theme="dark"] body.rudyon-site .post-body h4,
html[data-theme="dark"] body.rudyon-site .post-body h5,
html[data-theme="dark"] body.rudyon-site .post-body h6,
html[data-theme="dark"] body.rudyon-site .post-body .m-black {
  color: var(--rudyon-ink) !important;
}
html[data-theme="dark"] body.rudyon-site .post-body a { color: #a9d0ff !important; }

/* Controls and overlays */
html[data-theme="dark"] body.rudyon-site .btn:not(.btn-primary):not(.btn-success):not(.btn-danger):not(.btn-complete),
html[data-theme="dark"] body.rudyon-site button.btn-rounded:not(.btn-complete) {
  background: #22344b;
  border-color: #344c68;
  color: #e0ebf7;
}
html[data-theme="dark"] body.rudyon-site .btn:not(.btn-primary):not(.btn-success):not(.btn-danger):not(.btn-complete):hover,
html[data-theme="dark"] body.rudyon-site button.btn-rounded:not(.btn-complete):hover {
  background: #304662;
}
html[data-theme="dark"] body.rudyon-site .btn:not(.btn-complete) .text-let-8 { color: #e0ebf7 !important; }
html[data-theme="dark"] body.rudyon-site .btn-complete { background: #377dcf; border-color: #377dcf; }
html[data-theme="dark"] body.rudyon-site .btn-complete .text-let-8 { color: #fff !important; }
html[data-theme="dark"] body.rudyon-site .modal-content,
html[data-theme="dark"] body.rudyon-site .modal-header,
html[data-theme="dark"] body.rudyon-site .modal-body,
html[data-theme="dark"] body.rudyon-site .dropdown-menu,
html[data-theme="dark"] body.rudyon-site .quickview-wrapper {
  background: #1a293c !important;
  color: var(--rudyon-ink);
  border-color: var(--rudyon-line);
}
html[data-theme="dark"] body.rudyon-site .dropdown-item { color: #dbe7f5 !important; }
html[data-theme="dark"] body.rudyon-site .dropdown-item:hover { background: #2a405b !important; }
html[data-theme="dark"] body.rudyon-site .rudyon-editor-category label { color: #c7d7e8; }
html[data-theme="dark"] body.rudyon-site .rudyon-editor-category::after { border-color: #b8cbe0; }
html[data-theme="dark"] body.rudyon-site .modal-content .text-info,
html[data-theme="dark"] body.rudyon-site .modal-content a,
html[data-theme="dark"] body.rudyon-site .modal-content .close { color: #a9d0ff !important; }
html[data-theme="dark"] body.rudyon-site .form-group-default,
html[data-theme="dark"] body.rudyon-site .form-control,
html[data-theme="dark"] body.rudyon-site input:not([type="checkbox"]):not([type="radio"]),
html[data-theme="dark"] body.rudyon-site textarea,
html[data-theme="dark"] body.rudyon-site select {
  background: #111d2d !important;
  color: #eaf2fb !important;
  border-color: #3b506a !important;
}
html[data-theme="dark"] body.rudyon-site input::placeholder,
html[data-theme="dark"] body.rudyon-site textarea::placeholder { color: #97aabe; }
html[data-theme="dark"] body.rudyon-site .form-group-default label { color: #b7c8da; }
html[data-theme="dark"] body.rudyon-site .footer {
  border-color: var(--rudyon-line);
  color: var(--rudyon-muted);
}

/* Profile contrast and empty states in dark mode. */
html[data-theme="dark"] body.rudyon-site .rudyon-profile-stat,
html[data-theme="dark"] body.rudyon-site .rudyon-profile-panel {
  background: #19273a;
  border-color: #31435a;
  box-shadow: 0 12px 30px rgba(0,0,0,.12);
}
html[data-theme="dark"] body.rudyon-site .rudyon-profile-empty,
html[data-theme="dark"] body.rudyon-site .rudyon-profile-tabs span { background: #22354c; color: #b9cbe0; }
html[data-theme="dark"] body.rudyon-site .rudyon-profile-activity-type { background: #204b48; color: #9bf0d8; }
html[data-theme="dark"] body.rudyon-site .rudyon-profile-status { background: #31425a; color: #d6e2f0; }
html[data-theme="dark"] body.rudyon-site .rudyon-profile-status-1 { background: #1b4b3e; color: #abf3d3; }
html[data-theme="dark"] body.rudyon-site .rudyon-profile-status-2 { background: #58332e; color: #ffb8ad; }
html[data-theme="dark"] body.rudyon-site .rudyon-profile-tabs a.active,
html[data-theme="dark"] body.rudyon-site .rudyon-profile-tabs a[aria-current="page"] { color: #91c9ff !important; border-color: #91c9ff; }
html[data-theme="dark"] body.rudyon-site .rudyon-profile-activity-list a,
html[data-theme="dark"] body.rudyon-site a.rudyon-profile-more,
html[data-theme="dark"] body.rudyon-site .rudyon-profile-pagination a { color: #e6f0fb !important; }
html[data-theme="dark"] body.rudyon-site .rudyon-profile-activity-list a:hover,
html[data-theme="dark"] body.rudyon-site a.rudyon-profile-more:hover { color: #a9d5ff !important; }
html[data-theme="dark"] body.rudyon-site .rudyon-profile-pagination a[aria-current="page"] { color: #11253b !important; }
