/* DBIM dark theme. Applied with <html data-theme="dark"> (set before first paint by a head script,
   toggled by #dbimTheme, remembered in localStorage). Every rule is scoped to the attribute, so light mode is untouched.
   Palette: deep navy surfaces, light text (>= 4.5:1), the key navy kept for the menu bar, slider and footer. */

/* ---- theme button: moon in light mode, sun in dark mode ---- */
.dbim-theme>span {
    display: inline-flex;
}

.dbim-theme .dbim-i-sun {
    display: none;
}

html[data-theme="dark"] .dbim-theme .dbim-i-moon {
    display: none;
}

html[data-theme="dark"] .dbim-theme .dbim-i-sun {
    display: inline-flex;
}

html[data-theme="dark"] {
    color-scheme: dark;
    --d-bg: #0d1226;
    --d-bg2: #0a0e1f;
    --d-surface: #161d3a;
    --d-surface2: #1f2850;
    --d-border: #34406f;
    --d-text: #eceff9;
    --d-text2: #b9c0da;
    --d-accent: #a9c1ff;
    --d-btn: #3d6fe0;
    --d-btn-hover: #2a52b8;
    /* shared tokens that the components read */
    --dbim-text: #eceff9;
    --dbim-linen: #34406f;
    --dbim-grey-3: #b9c0da;
}

/* ---- page ---- */
html[data-theme="dark"] body,
html[data-theme="dark"] #wrapper,
html[data-theme="dark"] .page,
html[data-theme="dark"] #ContentPlaceHolder1_mainbody,
html[data-theme="dark"] #bdMainSite {
    background: var(--d-bg) !important;
    color: var(--d-text);
}

html[data-theme="dark"] .container {
    background: transparent !important;
}

/* inside the inverted legacy content, wrappers must stay un-themed so the invert produces one consistent surface */
html[data-theme="dark"] main[data-legacy] #container,
html[data-theme="dark"] main[data-legacy] .containWrap,
html[data-theme="dark"] main[data-legacy] .container {
    background: transparent !important;
}

html[data-theme="dark"] ::placeholder {
    color: var(--d-text2);
    opacity: 1;
}

/* ---- header ---- */
/* #header (legacy id on the same element) would otherwise win with a white background */
html[data-theme="dark"] .dbim-header,
html[data-theme="dark"] #header.dbim-header {
    background: var(--d-surface);
    color: var(--d-text);
}

html[data-theme="dark"] .dbim-brand-text strong {
    color: var(--d-accent);
}

html[data-theme="dark"] .dbim-brand-text small {
    color: var(--d-text2);
}

html[data-theme="dark"] .dbim-emblem {
    filter: invert(1) brightness(2.15);
}

html[data-theme="dark"] svg {
    background: #00000000;
    color: #ffffff;
    filter: invert(3) brightness(2.15);
}

html[data-theme="dark"] .dbim-skip:focus {
    background: var(--d-surface2);
    color: var(--d-text);
}

html[data-theme="dark"] .dbim-search {
    background: var(--d-surface2);
    border-color: var(--d-border);
    border-bottom-color: var(--d-btn);
    box-shadow: none;
}

html[data-theme="dark"] .dbim-search input {
    color: var(--d-text);
    background: transparent;
}

html[data-theme="dark"] .dbim-search button {
    color: var(--d-accent);
}

html[data-theme="dark"] .dbim-search button:hover {
    background: var(--d-surface);
}

html[data-theme="dark"] .dbim-iconbtn {
    background: transparent;
    color: var(--d-accent);
}

html[data-theme="dark"] .dbim-iconbtn:hover,
html[data-theme="dark"] .dbim-iconbtn[aria-expanded="true"],
html[data-theme="dark"] .dbim-iconbtn[aria-pressed="true"] {
    background: var(--d-surface2);
    color: #fff;
}

html[data-theme="dark"] .dbim-divider {
    background: var(--d-border);
}

html[data-theme="dark"] .dbim-panel {
    background: var(--d-surface2);
    border-color: var(--d-border);
    box-shadow: 0 12px 32px rgba(0, 0, 0, .55);
    color: var(--d-text);
}

html[data-theme="dark"] .dbim-panel-head .dbim-panel-title,
html[data-theme="dark"] .dbim-panel-title {
    color: var(--d-text);
}

html[data-theme="dark"] .dbim-panel-close {
    color: var(--d-accent);
}

html[data-theme="dark"] .dbim-panel-close:hover {
    background: var(--d-surface);
}

html[data-theme="dark"] .dbim-tile {
    background: var(--d-surface);
    border-color: var(--d-border);
    color: var(--d-accent);
}

html[data-theme="dark"] .dbim-tile:hover {
    background: #26315e;
    border-color: var(--d-accent);
}

html[data-theme="dark"] .dbim-tile[aria-pressed="true"] {
    background: var(--d-btn);
    border-color: var(--d-btn);
    color: #fff;
}

html[data-theme="dark"] .dbim-panel-foot {
    border-top-color: var(--d-border);
}

html[data-theme="dark"] .dbim-panel-foot a,
html[data-theme="dark"] .dbim-reset {
    color: var(--d-accent);
}

/* ---- menu bar and dropdowns ---- */
html[data-theme="dark"] .dbim-nav {
    background: #16234f;
}

html[data-theme="dark"] .dbim-sub {
    background: var(--d-surface2);
    border-color: var(--d-border);
    border-top-color: var(--d-btn);
    box-shadow: 0 12px 28px rgba(0, 0, 0, .55);
}

html[data-theme="dark"] .dbim-sub .dbim-row-link a {
    color: var(--d-text);
}

html[data-theme="dark"] .dbim-sub li:hover>.dbim-row-link>a,
html[data-theme="dark"] .dbim-sub li:focus-within>.dbim-row-link>a {
    background: var(--d-surface);
    color: var(--d-accent);
}

@media (max-width: 1279px) {
    html[data-theme="dark"] .dbim-nav {
        background: #121b3f;
    }

    html[data-theme="dark"] .dbim-sub,
    html[data-theme="dark"] .dbim-sub .dbim-row-link a {
        background: transparent;
        color: #fff;
    }
}

/* ---- notice ticker ---- */
html[data-theme="dark"] .dbim-ticker {
    background: linear-gradient(90deg, #141c3f 0%, #19235a 100%);
    border-color: var(--d-border);
}

html[data-theme="dark"] .dbim-ticker-track a {
    color: var(--d-text);
}

html[data-theme="dark"] .dbim-ticker-track a:hover,
html[data-theme="dark"] .dbim-ticker-track a:focus-visible {
    color: var(--d-accent);
}

html[data-theme="dark"] .dbim-ticker-btn {
    background: var(--d-surface2);
    color: var(--d-accent);
    border-color: var(--d-border);
}

html[data-theme="dark"] .dbim-ticker-btn:hover {
    background: var(--d-surface);
}

html[data-theme="dark"] .dbim-ticker-pdf {
    color: var(--d-accent);
    border-color: var(--d-accent);
}

/* ---- Performance Smart Board banner ---- */
html[data-theme="dark"] .dbim-psb {
    background: linear-gradient(100deg, #131a38 0%, #18214b 45%, #1e2c66 100%);
    border-color: var(--d-border);
    color: var(--d-text);
    box-shadow: none;
}

html[data-theme="dark"] .psb-title {
    color: #dfe7ff;
}

html[data-theme="dark"] .psb-desc {
    color: var(--d-text);
}

html[data-theme="dark"] .psb-waves {
    opacity: .22;
}

/* ---- Ambassador / Visas / Consular cards ---- */
html[data-theme="dark"] .dbim-cards {
    color: var(--d-text);
}

html[data-theme="dark"] .dbim-card {
    background: var(--d-surface);
    border-color: var(--d-border);
    box-shadow: none;
}

html[data-theme="dark"] .dbim-card-amb {
    background: var(--d-surface2);
    border-color: var(--d-surface2);
}

html[data-theme="dark"] .dbim-amb-role {
    color: var(--d-text2);
}

html[data-theme="dark"] .dbim-amb-name {
    color: var(--d-accent);
}

html[data-theme="dark"] .dbim-card-title {
    color: var(--d-accent);
    border-bottom-color: var(--d-accent);
}

html[data-theme="dark"] .dbim-text {
    color: var(--d-text);
}

html[data-theme="dark"] .dbim-note {
    background: #3a3114;
    border-left-color: #ffc107;
    color: #f6ebbb;
}

html[data-theme="dark"] .dbim-btn-line {
    background: transparent;
    color: var(--d-accent);
    border-color: var(--d-accent);
}

html[data-theme="dark"] .dbim-btn-line:hover {
    background: var(--d-surface2);
    color: #fff;
}

html[data-theme="dark"] .dbim-btn-fill {
    background: var(--d-btn);
    border-color: var(--d-btn);
    color: #fff;
}

html[data-theme="dark"] .dbim-btn-fill:hover {
    background: var(--d-btn-hover);
    border-color: var(--d-btn-hover);
}

/* ---- information band: tabs and side cards ---- */
html[data-theme="dark"] .dbim-info {
    background: var(--d-bg2);
    color: var(--d-text);
}

html[data-theme="dark"] .dbim-tablist {
    border-bottom-color: var(--d-btn);
}

html[data-theme="dark"] .dbim-tab {
    color: var(--d-accent);
}

html[data-theme="dark"] .dbim-tab:hover {
    background: rgba(255, 255, 255, .07);
}

html[data-theme="dark"] .dbim-tab[aria-selected="true"] {
    background: var(--d-surface);
    color: #fff;
    border-color: var(--d-btn);
    border-bottom-color: var(--d-surface);
}

html[data-theme="dark"] .dbim-panel-tab {
    background: var(--d-surface);
    box-shadow: none;
}

html[data-theme="dark"] .dbim-list li {
    border-bottom-color: var(--d-border);
}

html[data-theme="dark"] .dbim-list a {
    color: var(--d-text);
}

html[data-theme="dark"] .dbim-list a:hover .dbim-li-title,
html[data-theme="dark"] .dbim-list a:focus-visible .dbim-li-title {
    color: var(--d-accent);
}

html[data-theme="dark"] .dbim-li-date,
html[data-theme="dark"] .dbim-empty {
    color: var(--d-text2);
}

html[data-theme="dark"] .dbim-li-icon .ic-pdf,
html[data-theme="dark"] .dbim-li-icon .ic-ext,
html[data-theme="dark"] .dbim-li-icon .ic-go {
    color: var(--d-accent);
}

html[data-theme="dark"] .dbim-list {
    scrollbar-color: #4a5a9a transparent;
}

html[data-theme="dark"] .dbim-social iframe {
    background: var(--d-surface2);
}

html[data-theme="dark"] .dbim-i-card,
html[data-theme="dark"] .dbim-boi {
    background: var(--d-surface);
    box-shadow: none;
}

html[data-theme="dark"] .dbim-i-title {
    color: var(--d-accent);
    border-bottom-color: var(--d-accent);
}

html[data-theme="dark"] .dbim-i-text,
html[data-theme="dark"] .dbim-boi-text {
    color: var(--d-text);
}

html[data-theme="dark"] .dbim-i-line {
    background: transparent;
    color: var(--d-accent);
    border-color: var(--d-accent);
}

html[data-theme="dark"] .dbim-i-line:hover {
    background: var(--d-surface2);
    color: #fff;
}

html[data-theme="dark"] .dbim-i-fill {
    background: var(--d-btn);
    border-color: var(--d-btn);
    color: #fff;
}

html[data-theme="dark"] .dbim-i-fill:hover {
    background: var(--d-btn-hover);
    border-color: var(--d-btn-hover);
}

html[data-theme="dark"] .dbim-consent-note {
    background: var(--d-surface2);
    border-color: var(--d-border);
    color: var(--d-text);
}

html[data-theme="dark"] .dbim-i-scroll {
    scrollbar-color: #4a5a9a transparent;
}

/* ---- Indian Cultural Center ---- */
html[data-theme="dark"] .dbim-culture {
    color: var(--d-text);
}

html[data-theme="dark"] .dc-head h2 {
    color: var(--d-accent);
    border-bottom-color: var(--d-btn);
}

html[data-theme="dark"] .dc-insta {
    background: var(--d-surface);
    border-color: var(--d-border);
    color: var(--d-accent);
}

html[data-theme="dark"] .dc-insta:hover {
    background: var(--d-surface2);
}

html[data-theme="dark"] .dc-card,
html[data-theme="dark"] .dc-feature {
    background: var(--d-surface);
    border-color: var(--d-border);
    box-shadow: none;
}

html[data-theme="dark"] .dc-feature:hover {
    border-color: var(--d-accent);
    box-shadow: 0 8px 22px rgba(0, 0, 0, .5);
}

html[data-theme="dark"] .dc-title {
    color: var(--d-accent);
    border-bottom-color: var(--d-accent);
}

html[data-theme="dark"] .dc-event-list li,
html[data-theme="dark"] .dc-link-list li {
    border-bottom-color: var(--d-border);
}

html[data-theme="dark"] .dc-date {
    background: var(--d-surface2);
    color: var(--d-accent);
}

html[data-theme="dark"] .dc-event-title,
html[data-theme="dark"] .dc-link-list a {
    color: var(--d-text);
}

html[data-theme="dark"] .dc-link-list a:hover span,
html[data-theme="dark"] .dc-link-list a:focus-visible span {
    color: var(--d-accent);
}

html[data-theme="dark"] .dc-link-list svg {
    color: var(--d-accent);
}

html[data-theme="dark"] .dc-ftitle a {
    color: var(--d-accent);
}

html[data-theme="dark"] .dc-text {
    color: var(--d-text2);
}

html[data-theme="dark"] .dc-cat {
    background: var(--d-surface2);
    color: var(--d-accent);
}

html[data-theme="dark"] .dc-actions {
    border-top-color: var(--d-border);
}

html[data-theme="dark"] .dc-btn-line {
    background: transparent;
    color: var(--d-accent);
    border-color: var(--d-accent);
}

html[data-theme="dark"] .dc-btn-line:hover {
    background: var(--d-surface2);
    color: #fff;
}

html[data-theme="dark"] .dc-btn-fill {
    background: var(--d-btn);
    border-color: var(--d-btn);
    color: #fff;
}

html[data-theme="dark"] .dc-btn-fill:hover {
    background: var(--d-btn-hover);
    border-color: var(--d-btn-hover);
}

/* logo thumbnails stay on a white tile so dark logos remain visible */

/* ---- Related Websites strip: logos sit on white tiles in both themes ---- */
html[data-theme="dark"] .dbim-partners {
    background: var(--d-bg2);
    border-top-color: var(--d-border);
}

html[data-theme="dark"] .dp-title {
    color: var(--d-accent);
}

html[data-theme="dark"] .dp-card {
    border-color: var(--d-border);
}

html[data-theme="dark"] .dp-card:hover {
    border-color: var(--d-accent);
}

/* ---- footer ---- */
html[data-theme="dark"] .dbim-footer {
    background: #0b1330;
}

html[data-theme="dark"] .df-rule {
    border-top-color: rgba(255, 255, 255, .22);
}

/* ---- cookie banner ---- */
html[data-theme="dark"] .dbim-consent {
    background: var(--d-surface2);
    color: var(--d-text);
    border-top-color: var(--d-btn);
    box-shadow: 0 -8px 28px rgba(0, 0, 0, .6);
}

html[data-theme="dark"] .ck-title {
    color: var(--d-accent);
}

html[data-theme="dark"] .ck-btn-line {
    background: transparent;
    color: var(--d-accent);
    border-color: var(--d-accent);
}

html[data-theme="dark"] .ck-btn-line:hover {
    background: var(--d-surface);
}

html[data-theme="dark"] .ck-btn-fill {
    background: var(--d-btn);
    border-color: var(--d-btn);
}

html[data-theme="dark"] .ck-btn-fill:hover {
    background: var(--d-btn-hover);
    border-color: var(--d-btn-hover);
}

/* ---- legacy page content (inner pages): smart invert, images/video/embeds flipped back ---- */
html[data-theme="dark"] main[data-legacy] {
    background: #e7ecff;
    /* inverts (with hue-rotate) to the page navy #0d1226 */
    color: #150202;
    /* the LIGHT-mode text colour, so the invert makes it light */
    filter: invert(1) hue-rotate(180deg);
}

html[data-theme="dark"] main[data-legacy] img,
html[data-theme="dark"] main[data-legacy] video,
html[data-theme="dark"] main[data-legacy] iframe,
html[data-theme="dark"] main[data-legacy] canvas,
html[data-theme="dark"] main[data-legacy] picture,
html[data-theme="dark"] main[data-legacy] [style*="background-image"],
html[data-theme="dark"] main[data-legacy] [style*="url("],
html[data-theme="dark"] main[data-legacy] .innerBanner,
html[data-theme="dark"] main[data-legacy] .dbim-pagehead {
    filter: invert(1) hue-rotate(180deg);
}

/* only the OUTERMOST media element is flipped back; anything nested inside it must not flip again */
html[data-theme="dark"] main[data-legacy] :is(img, video, iframe, canvas, picture, [style*="background-image"], [style*="url("], .innerBanner) :is(img, video, iframe, canvas, picture, [style*="background-image"], [style*="url("]) {
    filter: none;
}

/* ---- homepage vacancy popup (legacy markup) ---- */
html[data-theme="dark"] .popup-container-ps {
    background: var(--d-surface2) !important;
    color: var(--d-text) !important;
    border: 1px solid var(--d-border);
}

html[data-theme="dark"] .popup-content-ps,
html[data-theme="dark"] .popup-content-ps * {
    color: var(--d-text) !important;
    background-color: transparent !important;
}

html[data-theme="dark"] .popup-content-ps a {
    color: var(--d-accent) !important;
    text-decoration: underline;
}