/* HEADER FIX - Ensures header displays on ALL pages */

/* Override EVERYTHING - make header fixed and visible */
body #page-header,
body .page-header,
body header.page-header,
header#page-header.page-header {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    z-index: 99999 !important;
    background-color: transparent !important;
    transition: transform 0.3s ease-in-out !important;
}

/* INTERNAL PAGES ONLY: Force transparent background on header bar (NOT mega menu) */
body:not(.page-template-page-demo) #page-header,
body:not(.page-template-page-demo) .page-header {
    background-color: transparent !important;
    background-image: none !important;
}
body:not(.page-template-page-demo) .page-header .sp-header,
body:not(.page-template-page-demo) .page-header .sp-header *:not(.sub-menu):not(.sub-menu *):not(.burger__line),
body:not(.page-template-page-demo) .page-header .sp-menu-mobile,
body:not(.page-template-page-demo) .page-header .sp-menu-mobile * {
    background-color: transparent !important;
    background-image: none !important;
}

/* Dropdown sub-menu: solid bg + centered (all pages) */
.page-header .sub-menu {
    background-color: #1b1b1e !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    margin-left: 0 !important;
    text-align: center !important;
    border-radius: 0 !important;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3) !important;
}

.page-header .sub-menu a {
    color: #fff !important;
    background-color: transparent !important;
}

.page-header .sub-menu a:hover {
    background-color: #b9a38b !important;
    color: #fff !important;
}

/* Header scroll behavior - target both #page-header and .sp-header */
#page-header.header-hidden,
.sp-header.header-hidden {
    transform: translateY(-100%) !important;
}

#page-header.header-visible,
.sp-header.header-visible {
    transform: translateY(0) !important;
}

/* Ensure .sp-header has transition for smooth hide/show and is fixed for scroll behavior */
.sp-header {
    transition: transform 0.3s ease-in-out !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 99999 !important;
}

/* Homepage - fixed position so hide-on-scroll works */
body.page-template-page-demo #page-header,
body.page-template-page-demo .page-header,
body.page-template-page-demo header.page-header,
body.page-template-page-demo header#page-header.page-header {
    position: fixed !important;
}

/* Ensure ALL header inner elements are visible */
.sp-header,
.sp-header--absolute,
.sp-header--custom,
.afe-content--spark_header_custom,
.cbl__block.block_header,
.cbl__row.row_header {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Make sure header content is visible */
.page-header .cbl__column-box,
.page-header .fd-header__col {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Widgets visible by default, but logos controlled separately below */
.page-header .cbl__widget {
    visibility: visible !important;
    opacity: 1 !important;
}

/* DO NOT push page-container down - each page's first block already has top padding */

/* Ensure header links are clickable */
.page-header a,
.page-header button {
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* CENTER THE LOGO COLUMN */
.column_center,
.column_center .cbl__column-box {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
}

/* Responsive logo visibility - FORCE only one logo at a time */
body .page-header .cbl__widget.widget_logo_desktop,
body .page-header .widget_logo_desktop,
.page-header .cbl__widget.widget_logo_desktop {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    margin: 0 auto !important;
}

body .page-header .cbl__widget.widget_logo_mobile,
body .page-header .widget_logo_mobile,
.page-header .cbl__widget.widget_logo_mobile {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    margin: 0 auto !important;
}

@media (min-width: 992px) {
    body .page-header .cbl__widget.widget_logo_desktop,
    body .page-header .widget_logo_desktop,
    .page-header .cbl__widget.widget_logo_desktop {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    body .page-header .cbl__widget.widget_logo_mobile,
    body .page-header .widget_logo_mobile,
    .page-header .cbl__widget.widget_logo_mobile {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }
}



/* Header logo: compact, white on transparent hero */
.sp-header .column_center .widget_logo_desktop,
.sp-header .column_center .widget_logo_mobile {
    overflow: visible !important;
}
.sp-header .widget_logo_desktop .cb-image,
.page-header .widget_logo_desktop .cb-image {
    width: 283px !important;
    height: auto !important;
    max-width: 283px !important;
    max-height: 154px !important;
    object-fit: contain !important;
    filter: brightness(0) invert(1) !important;
}
.sp-header .widget_logo_mobile .cb-image,
.page-header .widget_logo_mobile .cb-image {
    width: 221px !important;
    height: auto !important;
    max-width: 221px !important;
    max-height: 125px !important;
    object-fit: contain !important;
    filter: brightness(0) invert(1) !important;
}

/* Shift nav links (Work With Us, Explore Areas) left */@media (min-width: 992px) {    .sp-header .column_left .widget_desktop_nav {        transform: translateX(-10%) !important;    }}

/* About page: buttons side by side */
.column_aciii46s4w2 .fd-inline-img.cbl__column-box {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: flex-start !important;
}


/* Logo scale follow-up: ensure oversized header logo fully clears on hide-on-scroll */
.sp-header--sticky.headroom--unpinned,
.spark-header--standard.headroom--unpinned,
.page-header.headroom--unpinned,
.headroom--unpinned.page-header,
.headroom--unpinned.sp-header {
    -webkit-transform: translateY(-240px) !important;
    -ms-transform: translateY(-240px) !important;
    transform: translateY(-240px) !important;
}

@media (max-width: 991px) {
    .sp-header--sticky.headroom--unpinned,
    .spark-header--standard.headroom--unpinned,
    .page-header.headroom--unpinned,
    .headroom--unpinned.page-header,
    .headroom--unpinned.sp-header {
        -webkit-transform: translateY(-190px) !important;
        -ms-transform: translateY(-190px) !important;
        transform: translateY(-190px) !important;
    }
}

/* Make injected preloader/loader logos white, matching the transparent header logo */
.preloader img[src*="melissa-m-mark"],
.pre-loader img[src*="melissa-m-mark"],
.page-loader img[src*="melissa-m-mark"],
.site-loader img[src*="melissa-m-mark"],
.loading-screen img[src*="melissa-m-mark"],
[class*="preload"] img[src*="melissa-m-mark"],
[class*="loader"] img[src*="melissa-m-mark"],
[id*="preload"] img[src*="melissa-m-mark"],
[id*="loader"] img[src*="melissa-m-mark"] {
    filter: brightness(0) invert(1) !important;
}

/* Actual Melissa header scroll state: fully clear the enlarged logo */
.page-header.scrolled,
.page-header.page-header--absolute.scrolled {
    -webkit-transform: translateY(-240px) !important;
    -ms-transform: translateY(-240px) !important;
    transform: translateY(-240px) !important;
    pointer-events: none !important;
}

@media (max-width: 991px) {
    .page-header.scrolled,
    .page-header.page-header--absolute.scrolled {
        -webkit-transform: translateY(-190px) !important;
        -ms-transform: translateY(-190px) !important;
        transform: translateY(-190px) !important;
    }
}
