/* 1. Define the dynamic height variable */
:root {
    --banner-height: 0px;
}

/* 2. Anchor the scroll position for anchor links */
html:has(.dynamic-banner:not(.hidden)) {
    scroll-padding-top: calc(var(--banner-height) + 80px); /* Adjust 80px to your header height */
}

body {
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

/* 3. Banner Styling */
.dynamic-banner {
    background-color: #ccccf1;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 2005;
    height: 35px; /* Default height */
    padding: 0 0.65rem;
    box-sizing: border-box;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* 4. Handle Hidden State */
.dynamic-banner.hidden {
    display: none !important;
}

.dynamic-banner p,
.dynamic-banner a,
.dynamic-banner a:visited {
    color: var(--primary-corporate-blue, #000080);
    font-size: 1.4rem;
    margin: 0;
    padding: 0;
    width: fit-content;
    text-align: center;
    line-height: 17.5px;
}

.dynamic-banner > button {
    background-color: transparent;
    border: none;
    cursor: pointer;
    margin-left: 0.5rem;
    padding: 0;
    display: flex;
    align-items: center;
}

.dynamic-banner > button > img {
    height: 1.8rem;
}

/* 5. Header Styling - Stacks below banner */
header, .navbar {
    position: sticky;
    /* This variable is updated via JS based on banner presence/height */
    top: var(--banner-height); 
    z-index: 2004;
    width: 100%;
    transform: translateZ(0);
    backface-visibility: hidden;
    transition: top 0.2s ease;
    margin-bottom: 0 !important;
}

/* 6. Responsive Adjustments */
@media screen and (max-width: 767px) {
    .dynamic-banner {
        height: auto;
        min-height: 53px;
        padding: 8px 0.65rem;
    }
}

main {
    margin-top: 0 !important;
}