/* ==========================================================================
   Dark mode  (html[data-theme="dark"], toggled in the header, saved in localStorage)
   Palette: page #150202, panels #150202 + #606060 borders, key colour #162F6A for
   navigation / footer / primary actions, text #FFFFFF, secondary #C6C6C6,
   links #A3BBF3 (Blue group variant, 9.9:1 on #150202).
   This is a normal theme, separate from the legacy yellow/green "High Contrast" mode.
   ========================================================================== */
html[data-theme="dark"] {
    color-scheme: dark;
    --bg-page: #150202;
    --text-primary: #FFFFFF;
    --text-strong: #FFFFFF;
    --text-secondary: #C6C6C6;
    --text-muted: #C6C6C6;
    --border-default: #606060;
    --border-subtle: #606060;
    --link: #A3BBF3;
    --focus-ring: #D2DFFF;
    --bs-body-color: #FFFFFF; --bs-body-bg: #150202; --bs-link-color: #A3BBF3; --bs-border-color: #606060;
}

html[data-theme="dark"] body,
html[data-theme="dark"] #wrapper,
html[data-theme="dark"] .container-fluid,
html[data-theme="dark"] #header,
html[data-theme="dark"] #header .gov-header,
html[data-theme="dark"] .footer, html[data-theme="dark"] #footer { background: #150202; color: #FFFFFF; }

/* Emblem: the official asset is black, so it is shown as its white version on dark backgrounds */
html[data-theme="dark"] #header .logo .logo-img { filter: invert(1); }

/* Text and headings */
html[data-theme="dark"] h1, html[data-theme="dark"] h2, html[data-theme="dark"] h3,
html[data-theme="dark"] h4, html[data-theme="dark"] h5, html[data-theme="dark"] h6,
html[data-theme="dark"] #innerContent h2, html[data-theme="dark"] .rightPart .menuTitle,
html[data-theme="dark"] .important-links-title, html[data-theme="dark"] .connect-title,
html[data-theme="dark"] .profile-name, html[data-theme="dark"] .connect-info h4 { color: #FFFFFF; }
html[data-theme="dark"] p, html[data-theme="dark"] li, html[data-theme="dark"] td, html[data-theme="dark"] span,
html[data-theme="dark"] label, html[data-theme="dark"] .breadcrumb, html[data-theme="dark"] .breadcrumb li,
html[data-theme="dark"] strong, html[data-theme="dark"] b { color: #FFFFFF; }
html[data-theme="dark"] .recordBox span.date, html[data-theme="dark"] .album-content div, html[data-theme="dark"] .designation,
html[data-theme="dark"] .date, html[data-theme="dark"] .text-muted { color: #C6C6C6 !important; }
html[data-theme="dark"] #header .logo .logo-gov, html[data-theme="dark"] #header .logo .logo-text { color: #FFFFFF; }
html[data-theme="dark"] #header .logo .logo-subtext { color: #C6C6C6; }

/* Links */
html[data-theme="dark"] a { color: #A3BBF3; }
html[data-theme="dark"] a:hover { color: #D2DFFF; }
html[data-theme="dark"] #innerContent .mcontent a, html[data-theme="dark"] .contentPart p a, html[data-theme="dark"] .breadcrumb a,
html[data-theme="dark"] .info-footer a, html[data-theme="dark"] .connect-info a, html[data-theme="dark"] .profile-section .profiles-card1 a { color: #A3BBF3; }
html[data-theme="dark"] .recordBox a, html[data-theme="dark"] .important-link-text span, html[data-theme="dark"] .gallery-item .album-content a.title,
html[data-theme="dark"] #menuLeft a { color: #FFFFFF; }
html[data-theme="dark"] .recordBox a:hover, html[data-theme="dark"] #menuLeft a:hover { color: #D2DFFF; }
html[data-theme="dark"] .info-footer a, html[data-theme="dark"] .info-footer b, html[data-theme="dark"] .view-all b, html[data-theme="dark"] .view-all a { color: #A3BBF3; }

/* Header controls */
html[data-theme="dark"] #header .tool { color: #FFFFFF; }
html[data-theme="dark"] #header .tool .tool__label { color: #FFFFFF; }
html[data-theme="dark"] #header .tool:hover, html[data-theme="dark"] #header .tool:focus-visible { background: #162F6A; color: #FFFFFF; }
html[data-theme="dark"] #header .tool--access { background: #162F6A; }
html[data-theme="dark"] #header .tool--access[aria-expanded="true"] { background: #D2DFFF; color: #162F6A; }
html[data-theme="dark"] #header .tool-sep { background: #606060; }
html[data-theme="dark"] #header .gov-search .search-box { background: #150202; border-color: #8E8E8E; border-bottom-color: #A3BBF3; }
html[data-theme="dark"] #header .gov-search .search-box input { color: #FFFFFF; }
html[data-theme="dark"] #header .gov-search .search-box input::placeholder { color: #C6C6C6; }
html[data-theme="dark"] #header .gov-search .search-box button { color: #A3BBF3; }
html[data-theme="dark"] #header .gov-search .search-box button:hover { background: #162F6A; color: #FFFFFF; }
html[data-theme="dark"] #header .lang__list, html[data-theme="dark"] #header .a11y-panel { background: #150202; border-color: #606060; color: #FFFFFF; }
html[data-theme="dark"] #header .lang__list button, html[data-theme="dark"] #header .a11y-panel__head h2 { color: #FFFFFF; }
html[data-theme="dark"] #header .lang__list button:hover, html[data-theme="dark"] #header .lang__list button:focus-visible { background: #162F6A; color: #FFFFFF; }
html[data-theme="dark"] #header .a11y-tile { background: #150202; border-color: #606060; color: #D2DFFF; }
html[data-theme="dark"] #header .a11y-tile:hover, html[data-theme="dark"] #header .a11y-tile:focus-visible { background: #162F6A; border-color: #A3BBF3; }
html[data-theme="dark"] #header .a11y-tile[aria-pressed="true"] { background: #D2DFFF; border-color: #D2DFFF; color: #162F6A; }
html[data-theme="dark"] #header .a11y-panel__foot { border-top-color: #606060; }
html[data-theme="dark"] #header .a11y-link { color: #A3BBF3; }
html[data-theme="dark"] #header .skip-link { background: #D2DFFF; color: #162F6A !important; }

/* Navigation: key colour in both modes */
html[data-theme="dark"] #header .mainNavigation { background: #162F6A; border-bottom: 1px solid #606060; }
html[data-theme="dark"] #header #nav ul.menuSubUl, html[data-theme="dark"] #header #nav ul ul { background: #150202; border-color: #606060; border-top-color: #A3BBF3; box-shadow: 0 8px 20px rgba(0, 0, 0, .6); }
html[data-theme="dark"] #header #nav ul li a { background: #150202; color: #FFFFFF; border-bottom-color: #606060; }
html[data-theme="dark"] #header #nav ul li a:hover, html[data-theme="dark"] #header #nav ul li a:focus-visible { background: #162F6A; color: #FFFFFF; }

/* Panels, cards, forms, tables */
html[data-theme="dark"] .info-box, html[data-theme="dark"] .profile-card, html[data-theme="dark"] .profiles-card, html[data-theme="dark"] .profiles-card1,
html[data-theme="dark"] .profiles-cards, html[data-theme="dark"] .important-link-card, html[data-theme="dark"] .gallery-item,
html[data-theme="dark"] .connect-item, html[data-theme="dark"] .social-container, html[data-theme="dark"] .contentRightBlock,
html[data-theme="dark"] .contentRightBlock_1, html[data-theme="dark"] .contentRightBlock_2, html[data-theme="dark"] .contentRightBlock_3 { background: #150202; border-color: #606060; color: #FFFFFF; }
html[data-theme="dark"] .info-header { background: #162F6A; color: #FFFFFF; border-top-color: #A3BBF3; border-bottom-color: #606060; }
html[data-theme="dark"] .info-header, html[data-theme="dark"] .info-header * { color: #FFFFFF; }
html[data-theme="dark"] .important-link-card:hover, html[data-theme="dark"] .info-box:hover { border-color: #A3BBF3; box-shadow: none; }
html[data-theme="dark"] input[type="text"], html[data-theme="dark"] input[type="email"], html[data-theme="dark"] input[type="password"],
html[data-theme="dark"] input[type="search"], html[data-theme="dark"] input[type="tel"], html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] input[type="date"], html[data-theme="dark"] input[type="url"], html[data-theme="dark"] select,
html[data-theme="dark"] textarea, html[data-theme="dark"] .textBox { background: #150202; border-color: #8E8E8E; color: #FFFFFF; }
html[data-theme="dark"] ::placeholder { color: #C6C6C6; }
html[data-theme="dark"] input:focus, html[data-theme="dark"] select:focus, html[data-theme="dark"] textarea:focus { border-color: #A3BBF3; outline-color: #D2DFFF; }
html[data-theme="dark"] input:disabled, html[data-theme="dark"] select:disabled, html[data-theme="dark"] textarea:disabled { background: #606060; color: #FFFFFF; }
html[data-theme="dark"] table th, html[data-theme="dark"] .table thead th, html[data-theme="dark"] .web th { background: #162F6A; color: #FFFFFF; border-bottom-color: #A3BBF3; }
html[data-theme="dark"] table td, html[data-theme="dark"] table th { border-color: #606060; }
html[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > *, html[data-theme="dark"] .web tr:nth-child(even) { background: #150202 !important; box-shadow: inset 0 -1px 0 #606060; }
html[data-theme="dark"] .pagination a, html[data-theme="dark"] .pagination li a, html[data-theme="dark"] .page-link { background: #150202; color: #A3BBF3; border-color: #606060; }
html[data-theme="dark"] .pagination .active a, html[data-theme="dark"] .pagination a:hover, html[data-theme="dark"] .page-item.active .page-link { background: #162F6A; color: #FFFFFF; border-color: #A3BBF3; }
html[data-theme="dark"] hr, html[data-theme="dark"] .divider { border-color: #606060; }

/* Buttons keep the key colour; secondary buttons invert */
html[data-theme="dark"] .btn-secondary, html[data-theme="dark"] .btn-outline-primary, html[data-theme="dark"] input[type="reset"],
html[data-theme="dark"] input[type="button"], html[data-theme="dark"] .tab-btn { background: #150202; color: #D2DFFF; border-color: #A3BBF3; }
html[data-theme="dark"] .tab-btn:hover, html[data-theme="dark"] input[type="reset"]:hover { background: #162F6A; color: #FFFFFF; }
html[data-theme="dark"] .tab-btn.active { background: #162F6A; color: #FFFFFF; border-color: #A3BBF3; }
html[data-theme="dark"] .button, html[data-theme="dark"] input[type="submit"], html[data-theme="dark"] .view-all-btn, html[data-theme="dark"] .grid-box { border-color: #A3BBF3; }

/* Alerts and status messages stay readable on dark */
html[data-theme="dark"] .alert { background: #150202; color: #FFFFFF; border-color: #606060; }
html[data-theme="dark"] .alert-info::before { color: #A3BBF3; }
html[data-theme="dark"] .text-danger, html[data-theme="dark"] .error, html[data-theme="dark"] span.red { color: #DC3545 !important; }

/* Footer: key colour in both modes (DBIM 5.6) */
html[data-theme="dark"] .footerCont { background: #162F6A; color: #FFFFFF; border-top: 1px solid #606060; }
html[data-theme="dark"] .footerCont a, html[data-theme="dark"] .footerLinks li a { color: #FFFFFF; }
html[data-theme="dark"] .footerCont p, html[data-theme="dark"] .footerCont span, html[data-theme="dark"] .footerCont strong { color: #FFFFFF; }

/* Mobile menu panel */
html[data-theme="dark"] #menuPartWrapper, html[data-theme="dark"] .mp-menu, html[data-theme="dark"] .mobMenuPart { background: #162F6A; }

/* Legacy surfaces that hard-code a white / Linen background */
html[data-theme="dark"] #header .header-container, html[data-theme="dark"] #header .gov-header__row, html[data-theme="dark"] .logoAndSearchRow { background: transparent; }
html[data-theme="dark"] td, html[data-theme="dark"] th.evenRow, html[data-theme="dark"] .responsiveTable, html[data-theme="dark"] .evenRow, html[data-theme="dark"] .tableOut { background: transparent; }
html[data-theme="dark"] tr { background: transparent; }
html[data-theme="dark"] .str_wrap, html[data-theme="dark"] .footerLogos, html[data-theme="dark"] .footerLogosSlider, html[data-theme="dark"] .mfoot { background: #150202; }
html[data-theme="dark"] .goog-te-gadget-simple { background: #150202 !important; border-color: #606060 !important; }
html[data-theme="dark"] .goog-te-gadget-simple span { color: #FFFFFF !important; }

/* Sections / tiles that use Linen as their light surface */
html[data-theme="dark"] .main-section, html[data-theme="dark"] .container-fluid[style*="background"], html[data-theme="dark"] .impHomeLinks li,
html[data-theme="dark"] .info-footer, html[data-theme="dark"] .social-tabs { background: #150202 !important; color: #FFFFFF; }
html[data-theme="dark"] .info-footer { border-top: 1px solid #606060; }
html[data-theme="dark"] .important-link-icon, html[data-theme="dark"] .connect-icon { background: #162F6A; color: #FFFFFF; }
html[data-theme="dark"] .important-link-icon *, html[data-theme="dark"] .connect-icon * { color: #FFFFFF; }
html[data-theme="dark"] tr, html[data-theme="dark"] tbody tr, html[data-theme="dark"] .web tr { background: transparent !important; }
html[data-theme="dark"] tbody tr:nth-child(even) { background: #162F6A !important; }
html[data-theme="dark"] .social-tabs .tab-btn:not(.active) { background: #150202; }

/* Breadcrumb bar */
html[data-theme="dark"] .bdrAddOut, html[data-theme="dark"] .breadcrumb, html[data-theme="dark"] .breadcrumb li, html[data-theme="dark"] .bdrNoLink { background: #150202; border-color: #606060; color: #FFFFFF; }
html[data-theme="dark"] .bdrAddOut { border-bottom: 1px solid #606060; }
html[data-theme="dark"] .menuTitle, html[data-theme="dark"] span.menuTitle, html[data-theme="dark"] .rightPart .menuTitle { background: #150202; color: #FFFFFF; border-bottom: 3px solid #A3BBF3; }
html[data-theme="dark"] #menuLeft, html[data-theme="dark"] #menuLeft li, html[data-theme="dark"] .rightPart { background: #150202; }
html[data-theme="dark"] span.menuTitle, html[data-theme="dark"] .menuTitle { background: #150202 !important; color: #FFFFFF !important; }

/* Content links: legacy rules colour them with the key colour (#162F6A), which vanishes on #150202 */
html[data-theme="dark"] #wrapper a:not(.button):not(.view-all-btn):not(.grid-box):not(.skip-link):not(.tool):not(.a11y-link):not(.menu-trigger):not([class*="btn"]):not(.bannerCaption a):not(.footerCont a) { color: #A3BBF3; }
html[data-theme="dark"] #wrapper a:not(.button):not(.view-all-btn):not(.grid-box):not(.skip-link):not(.tool):not(.a11y-link):not(.menu-trigger):not([class*="btn"]):hover { color: #D2DFFF; }
html[data-theme="dark"] .site_map li a span, html[data-theme="dark"] .site_map li a { color: #A3BBF3 !important; }
html[data-theme="dark"] a.pFlickrIcon, html[data-theme="dark"] a.pFlickrIcon * { color: #A3BBF3; }
html[data-theme="dark"] #wrapper .grid-box, html[data-theme="dark"] #wrapper .view-all-btn, html[data-theme="dark"] #wrapper .button { color: #FFFFFF; }
