/*
===============================================
New header / footer chrome

This stylesheet styles the shared header, signed-in subheader (tab
strip) and footer that render on EVERY page via _Layout.cshtml - both
the redesigned pages and the legacy pages that still use the old
style.css/mobile.css for their own content below the nav.

It is deliberately scoped to the <header>, <nav class="subheader"> and
<footer> elements (and a couple of classes that only ever appear
inside them: .badge, .burger, .navlink, .brand, .logo). It must never
style bare tags/classes that legacy page content also uses (button,
.badge, .row, .column, h1/h2, section, main, etc.) - that CSS lives in
experian.css instead, and is only loaded by the pages that were
actually redesigned.

The header and signed-in subheader are fixed/sticky on every page, so
they stay visible while scrolling. Since that takes them out of normal
document flow, this file also adds a matching top padding to <body> so
legacy page content isn't hidden underneath them. Redesigned/hero pages
(that also load experian.css) cancel that padding, because their hero
section is designed to run behind the transparent header instead - see
the "Hero header" section at the top of experian.css.
===============================================
*/

:root {
    --primary-color: #1d4f91;
    --primary-foreground-color: #ffffff;
    --primary-hover-color: #164179;

    --secondary-color: #c1188b;
    --secondary-foreground-color: #ffffff;
    --secondary-hover-color: #a11473;

    --background-color: #ffffff;
    --background-subtle-color: #f4f5f8;
    --background-hover-color: #f8f9fd;

    --subtle-color: #666666;
    --border-color: #d1d1d1;

    --bullet-color-1: #632678;
    --bullet-color-2: #982881;
    --bullet-color-3: #ba2f7d;

    --section-max-width: 100rem;
    --header-height: 5rem;
    --subheader-height: 3.25rem;
}

/*
===============================================
Footer
===============================================
*/

footer {
    background-color: var(--background-color);
    color: #333;
    clear: both;
    display: block;
    padding: 0;
    text-align: center;
}

footer nav {
    border-bottom: 2px solid var(--border-color);
    padding: 1.25rem 4rem 0;
}

footer nav ul {
    display: flex;
    flex-flow: row wrap;
    justify-content: center;
    gap: 0;
    max-width: var(--section-max-width);
    margin: 0 auto;
    padding: 0;
    list-style: none;
}

footer nav li {
    display: inline-block;
    margin: 0 0 1.25rem;
    padding: 0 1.25rem 0 0;
    font-size: 0.875rem;
    line-height: 1.5;
}

footer nav li::before {
    content: none;
}

footer nav a {
    color: #333;
    text-decoration: none;
    text-underline-offset: 8px;
}

footer nav a:hover,
footer nav a:focus-visible {
    color: var(--primary-color);
    text-decoration: underline;
}

footer > div {
    max-width: var(--section-max-width);
    margin: 0 auto;
    padding: 2.5rem 4rem;
}

footer > div p {
    margin: 0 0 0.75rem;
    color: #333;
    font-size: 0.75rem;
    line-height: 1.5;
}

footer > div p:last-child {
    margin-bottom: 0;
}

footer > div small {
    font-size: inherit;
}

/*
===============================================
Header (fixed/sticky on every page)
===============================================
*/

header {
    height: var(--header-height);
    width: 100%;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 4rem;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: background 0.3s ease, box-shadow 0.3s ease, backdrop-filter 0.3s ease, -webkit-backdrop-filter 0.3s ease;
}

/* The header is fixed on every page, so normal-flow content needs a
   top offset to avoid sitting underneath it. Redesigned/hero pages
   cancel this (see the "Hero header" section in experian.css) because
   their hero section is designed to run behind the transparent header
   instead of being pushed down. */
body {
    padding-top: var(--header-height);
}

@media (min-width: 768px) {
    body:has(> nav.subheader) {
        padding-top: calc(var(--header-height) + var(--subheader-height));
    }
}

header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 0 0.5rem 0 rgba(0, 0, 0, 0.25);
}

/* Signed-in users always get an opaque header - there's no hero image behind
   it to see through. */
header.is-authenticated {
    background: var(--background-color);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: 0 0 0.5rem 0 rgba(0, 0, 0, 0.1);
}

/*
===============================================
Subheader (signed-in tab navigation)
===============================================
*/

nav.subheader {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    height: var(--subheader-height);
    background: var(--primary-color);
    z-index: 999;
    display: flex;
    justify-content: center;
}

nav.subheader .inner {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: var(--section-max-width);
    padding: 0 4rem;
    overflow-x: auto;
}

nav.subheader a.navlink {
    color: var(--primary-foreground-color);
    height: var(--subheader-height);
    padding: 0 1.5rem;
    white-space: nowrap;
}

nav.subheader a.navlink:not(:last-child) {
    border-right: 1px solid rgba(255, 255, 255, 0.25);
}

nav.subheader a.navlink:hover {
    color: var(--primary-foreground-color);
    background: rgba(255, 255, 255, 0.1);
    text-decoration: underline var(--primary-foreground-color) 2px solid;
}

nav.subheader a.navlink:focus-visible {
    color: var(--primary-foreground-color);
    background: rgba(255, 255, 255, 0.1);
    text-decoration: underline var(--primary-foreground-color) 2px solid;
}

nav.subheader a.navlink.active {
    background: rgba(255, 255, 255, 0.18);
    text-decoration: underline var(--primary-foreground-color) 3px solid;
}

nav.subheader a.navlink.active:focus-visible {
    color: var(--primary-foreground-color);
}

@media (min-width: 768px) {
    /* The subheader only replaces the tab links in the top header on wider
       screens. On mobile the burger drawer still carries every link (tabs,
       language switcher, badge/logout) in one place, as before. */
    header.is-authenticated #headerTabs a.navlink:not(.language-switch) {
        display: none;
    }
}

@media (max-width: 767px) {
    nav.subheader {
        display: none;
    }
}

header .inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: var(--section-max-width);
    gap: 1rem;
}

header button.burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 0.3rem;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0.5rem;
    background: none;
    border: none;
    box-shadow: none;
    cursor: pointer;
    flex-shrink: 0;
}

header button.burger:hover {
    box-shadow: none;
}

header button.burger span {
    display: block;
    width: 100%;
    height: 2px;
    background: #000;
    border-radius: 1px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

header button.burger[aria-expanded="true"] span {
    &:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    &:nth-child(2) { opacity: 0; }
    &:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

header nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

header nav > div {
    display: flex;
    align-items: center;
}

header nav a {
    text-underline-offset: 8px;
}

a.brand {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

a.navlink {
    font-size: 0.9rem;
    font-weight: 500;
    color: #000;
    margin: 0;
    padding: 0 2rem;
    height: 2.2rem;
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
}

a.navlink:not(:last-child) {
    border-right: 1px solid var(--border-color);
}

a.navlink:hover {
    color: var(--primary-color);
    text-decoration: underline var(--primary-color) 2px solid;
}

a.navlink:focus-visible {
    color: var(--secondary-color);
    text-decoration: underline var(--secondary-color) 2px solid;
}

a.navlink img {
    width: 1.4rem;
    height: 0.9rem;
    flex-shrink: 0;
}

a.navlink.active {
    color: var(--primary-hover-color);
    text-decoration: underline var(--primary-hover-color) 3px solid;
}

a.navlink.active:focus-visible {
    color: var(--secondary-color);
    text-decoration: underline var(--secondary-color) 2px solid;
}

img.logo {
    height: 2.8rem;
    object-fit: contain;
    float: left;
    object-position: left;
}

/* Login/logout buttons and the "Welcome <name>" badge in the header.
   Scoped to header so they never restyle legacy page buttons/badges. */
header .badge {
    border: 1px solid var(--border-color);
    padding: 0 1.2rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2rem;
    font-size: 0.9rem;
    font-weight: 500;
}

header button {
    font-size: 0.9rem;
    font-weight: 500;
    color: #000;
    margin: 0;
    padding: 0 1.2rem;
    height: 2.8rem;
    display: flex;
    align-items: center;
    line-height: 1.5;
    border-radius: 0.25rem;
    border: 0;
    cursor: pointer;
    outline-color: var(--secondary-color);
    transition: background-color 0.1s ease-in-out, box-shadow 0.1s ease-in-out, transform 0.1s ease-in-out;
    box-shadow: 0 0 0.5rem 0 rgba(0, 0, 0, 0.25);
}

header button:hover {
    box-shadow: 0 4px 1rem 0 rgba(0, 0, 0, 0.25);
}

header button:active {
    box-shadow: 0 0 0.5rem 0 rgba(0, 0, 0, 0.25);
    transform: translateY(1px);
}

header button span {
    margin: 0 0.4rem;
    font-size: inherit;
}

header button.primary {
    background-color: var(--primary-color);
    color: var(--primary-foreground-color);
    fill: #fff;
}

header button.primary:hover {
    background-color: var(--primary-hover-color);
}

/*
===============================================
Mobile
===============================================
*/

@media (max-width: 767px) {
    header {
        padding: 0 1.25rem;
    }

    header button.burger {
        display: flex;
        position: relative;
        z-index: 1002;
    }

    a.brand {
        position: relative;
        z-index: 1002;
    }

    header:has(nav.is-open) {
        z-index: 1001;
    }

    header nav {
        position: fixed;
        inset: 0;
        width: 100%;
        height: 100dvh;
        z-index: 1000;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: var(--background-color);
        box-shadow: none;
        max-height: none;
        overflow: hidden;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        padding: var(--header-height) 0 0;
        box-sizing: border-box;
    }

    header nav.is-open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        overflow-y: auto;
    }

    header nav > div {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        width: 100%;
        flex: 1;
    }

    header nav a.navlink {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        justify-content: flex-start;
        padding: 1.25rem 1.5rem;
        height: auto;
        min-height: 3.5rem;
        width: 100%;
        box-sizing: border-box;
        font-size: 1rem;
    }

    header nav > div:last-child .badge {
        margin: 1rem 1.25rem 0;
        width: calc(100% - 2.5rem);
        box-sizing: border-box;
    }

    header nav > div:last-child .primary,
    header nav > div:last-child a.navlink {
        margin: 0;
    }

    header nav > div:last-child [data-open-modal="login"] {
        display: none;
    }

    body.mobile-menu-open {
        overflow: hidden;
    }

    footer nav {
        padding: 1.25rem;
    }

    footer nav ul {
        flex-direction: column;
    }

    footer nav li {
        display: block;
        margin-bottom: 1.25rem;
        padding-right: 0;
    }

    footer > div {
        padding: 2.5rem 1.25rem;
    }
}
