html[data-theme="news"] {
    --masthead-bg: var(--vr-block-color, var(--vr-theme-color));
    --masthead-nav-bg: var(--vr-mega-menu-color, var(--vr-theme-color));
    --masthead-ink: #fff;
    --masthead-line: color-mix(in srgb, var(--masthead-ink) 24%, transparent);
    --masthead-hover: color-mix(in srgb, var(--masthead-ink) 13%, transparent);
}

@supports (color: contrast-color(red)) {
    html[data-theme="news"] {
        --masthead-ink: contrast-color(var(--masthead-bg));
    }

    html[data-theme="news"] #mega-menu-wrapper .navbar-collapse {
        --masthead-ink: contrast-color(var(--masthead-nav-bg));
    }
}

html[data-theme="news"] #sticky-menu-wrapper,
html[data-theme="news"] #sticky-menu-wrapper #mega-menu-wrapper,
html[data-theme="news"] body .mobile-nav-wrapper > .mobile-header,
html[data-theme="news"][data-bs-theme="dark"] .mobile-nav-wrapper > .mobile-header {
    background: var(--masthead-bg) !important;
    color: var(--masthead-ink) !important;
}

html[data-theme="news"] #mega-menu-wrapper .navbar-collapse {
    --masthead-line: color-mix(in srgb, var(--masthead-ink) 24%, transparent);
    --masthead-hover: color-mix(in srgb, var(--masthead-ink) 13%, transparent);
    background: var(--masthead-nav-bg) !important;
    color: var(--masthead-ink) !important;
}

html[data-theme="news"] #mega-menu-wrapper :is(.navbar-brand, .header-social-links, .header-quick-actions) {
    background: transparent !important;
}

html[data-theme="news"] #mega-menu-wrapper .navbar-brand .js-logo-light,
html[data-theme="news"] .mobile-nav-wrapper .mobile-header .js-logo-light {
    display: block !important;
}

html[data-theme="news"] #mega-menu-wrapper .navbar-brand .js-logo-dark,
html[data-theme="news"] .mobile-nav-wrapper .mobile-header .js-logo-dark {
    display: none !important;
}

html[data-theme="news"] :is(#mega-menu-wrapper, .mobile-header) :is(a, button, input):focus-visible {
    outline: 2px solid var(--masthead-ink);
    outline-offset: -3px;
}

html[data-theme="news"] body .mobile-nav-wrapper .mobile-header :is(.header-btn, .header-btn svg) {
    color: var(--masthead-ink) !important;
}

@media (min-width: 992px) {
    html[data-theme="news"] #mega-menu-wrapper {
        container-type: inline-size;
        --masthead-gutter: .75rem;
    }

    html[data-theme="news"] #mega-menu-wrapper .navbar > .container-fluid {
        grid-template-rows: 76px 44px;
    }

    html[data-theme="news"] #mega-menu-wrapper :is(.navbar-brand, .header-social-links, .header-quick-actions) {
        height: 76px;
    }

    html[data-theme="news"] #mega-menu-wrapper .navbar-brand .logo {
        max-width: 280px !important;
        max-height: 55px !important;
    }

    html[data-theme="news"] #mega-menu-wrapper .header-social-links {
        padding-inline: var(--masthead-gutter) 0;
        gap: 8px;
    }

    html[data-theme="news"] #mega-menu-wrapper .header-social-links a {
        width: 30px;
        height: 30px;
    }

    html[data-theme="news"] #mega-menu-wrapper .header-quick-actions {
        padding-inline: 0 var(--masthead-gutter);
        gap: 10px !important;
    }

    html[data-theme="news"] #mega-menu-wrapper .header-quick-date {
        padding: 0 !important;
        color: var(--masthead-ink) !important;
    }

    html[data-theme="news"] #mega-menu-wrapper .navbar-collapse {
        grid-template-columns: 54px minmax(0, 1fr) auto;
        min-height: 44px;
        border-top: 1px solid var(--masthead-line) !important;
        border-bottom: 0 !important;
        padding-inline: var(--masthead-gutter);
    }

    html[data-theme="news"] #mega-menu-wrapper .navbar-nav {
        justify-content: safe center;
        overflow-x: auto;
        scrollbar-width: none;
        border: 0 !important;
    }

    html[data-theme="news"] #mega-menu-wrapper .navbar-nav .nav-link {
        min-height: 43px !important;
        padding-inline: clamp(7px, 1.1vw, 18px) !important;
        border: 0 !important;
        color: var(--masthead-ink) !important;
        font-size: clamp(12px, 1vw, 16px) !important;
        font-weight: 750 !important;
        text-transform: none !important;
    }

    html[data-theme="news"] #mega-menu-wrapper .navbar-collapse > .ms-auto,
    html[data-theme="news"] #mega-menu-wrapper :is(.header-inline-search, .theme-toggle-btn) {
        border: 0 !important;
    }

    html[data-theme="news"] #mega-menu-wrapper :is(.header-inline-search-btn, .theme-toggle-btn, .theme-toggle-btn svg) {
        color: var(--masthead-ink) !important;
    }

    html[data-theme="news"] #mega-menu-wrapper .navbar-collapse > .ms-auto {
        position: relative;
        justify-content: flex-end;
        min-width: 96px;
    }

    html[data-theme="news"] #mega-menu-wrapper .header-inline-search:focus-within {
        position: absolute;
        inset-inline-end: 48px;
        z-index: 2;
        width: 245px;
        border: 1px solid var(--masthead-line) !important;
        border-radius: 4px;
        background: var(--masthead-nav-bg) !important;
    }

    html[data-theme="news"] #mega-menu-wrapper .header-inline-search:focus-within .header-inline-search-input {
        width: auto;
        padding-inline: 12px 4px;
        opacity: 1;
        pointer-events: auto;
        color: var(--masthead-ink);
    }

    html[data-theme="news"] #mega-menu-wrapper .header-inline-search-input::placeholder {
        color: var(--masthead-ink);
        opacity: .75;
    }

    html[data-theme="news"] #mega-menu-wrapper :is(.theme-toggle-btn:hover, .nav-link:hover) {
        background: var(--masthead-hover) !important;
    }

}

/* Match the Bootstrap container-xl used by the Magazine content. */
@media (min-width: 1200px) {
    html[data-theme="news"] #mega-menu-wrapper {
        --masthead-gutter: calc(.75rem + max(0px, (100cqw - 1140px) / 2));
    }
}

@media (min-width: 1400px) {
    html[data-theme="news"] #mega-menu-wrapper {
        --masthead-gutter: calc(.75rem + max(0px, (100cqw - 1320px) / 2));
    }
}

@media (width < 992px) {
    html[data-theme="news"] .mobile-nav-wrapper > .mobile-header {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        direction: ltr;
        gap: 0;
    }

    .mobile-header .mobile-header-actions {
        display: flex;
        align-items: center;
    }

    .mobile-header .mobile-header-actions .header-btn {
        width: 40px;
        min-width: 40px;
    }

    .mobile-header .header-logo {
        justify-self: start;
        min-width: 0;
        max-width: 100%;
    }

    .mobile-header .header-logo img {
        max-width: 100%;
        object-fit: contain;
    }

    .mobile-header-theme .mobile-theme-sun,
    [data-bs-theme="dark"] .mobile-header-theme .mobile-theme-moon {
        display: none;
    }

    [data-bs-theme="dark"] .mobile-header-theme .mobile-theme-sun {
        display: block;
    }
}
