/*
 * Lighthouse Home 2 Header Alignment Fix
 * Scoped by JavaScript to avoid changing unrelated pages.
 */

body.lh-home2-header-fix header,
body.lh-home2-header-fix .site-header,
body.lh-home2-header-fix .elementor-location-header {
    position: relative !important;
    z-index: 100 !important;
}

/* The header's main content row */
body.lh-home2-header-fix .lh-alignment-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    min-height: 112px !important;
    box-sizing: border-box !important;
    padding: 12px 54px !important;
    gap: 28px !important;
}

/* Logo: fully visible, centered vertically, never clipped */
body.lh-home2-header-fix .lh-logo-wrap {
    display: flex !important;
    align-items: center !important;
    flex: 0 0 auto !important;
    min-width: 210px !important;
    padding-top: 0 !important;
    margin-top: 0 !important;
    transform: none !important;
    overflow: visible !important;
}

body.lh-home2-header-fix .lh-logo-wrap img {
    display: block !important;
    width: auto !important;
    max-width: 260px !important;
    max-height: 88px !important;
    height: auto !important;
    object-fit: contain !important;
    object-position: center !important;
    margin: 0 !important;
    transform: none !important;
}

/* Navigation sits on the same visual line as the logo */
body.lh-home2-header-fix .lh-nav-wrap {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
}

body.lh-home2-header-fix .lh-nav-wrap ul,
body.lh-home2-header-fix .lh-nav-wrap .elementor-nav-menu,
body.lh-home2-header-fix .lh-nav-wrap nav {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    flex-wrap: nowrap !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: clamp(12px, 1.25vw, 26px) !important;
}

body.lh-home2-header-fix .lh-nav-wrap li {
    margin: 0 !important;
    padding: 0 !important;
    white-space: nowrap !important;
}

body.lh-home2-header-fix .lh-nav-wrap a {
    display: inline-flex !important;
    align-items: center !important;
    min-height: 44px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
}

/* Give Now remains aligned with the navigation */
body.lh-home2-header-fix .lh-give-wrap {
    display: flex !important;
    align-items: center !important;
    flex: 0 0 auto !important;
    margin: 0 !important;
    padding: 0 !important;
}

body.lh-home2-header-fix .lh-give-wrap a,
body.lh-home2-header-fix a.lh-give-now {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 58px !important;
    white-space: nowrap !important;
    margin: 0 !important;
}

/* Remove accidental clipping from common header containers */
body.lh-home2-header-fix .lh-alignment-row,
body.lh-home2-header-fix .lh-logo-wrap,
body.lh-home2-header-fix .lh-logo-wrap > *,
body.lh-home2-header-fix .lh-nav-wrap {
    overflow: visible !important;
}

/* Keep desktop header comfortably inside the viewport */
@media (min-width: 1200px) {
    body.lh-home2-header-fix .lh-alignment-row {
        padding-left: 60px !important;
        padding-right: 60px !important;
    }
}

/* Tablet: preserve alignment without crowding */
@media (max-width: 1199px) and (min-width: 768px) {
    body.lh-home2-header-fix .lh-alignment-row {
        min-height: 98px !important;
        padding: 10px 30px !important;
        gap: 18px !important;
    }

    body.lh-home2-header-fix .lh-logo-wrap {
        min-width: 170px !important;
    }

    body.lh-home2-header-fix .lh-logo-wrap img {
        max-width: 210px !important;
        max-height: 72px !important;
    }

    body.lh-home2-header-fix .lh-nav-wrap ul,
    body.lh-home2-header-fix .lh-nav-wrap .elementor-nav-menu {
        gap: 10px !important;
    }
}

/* Mobile: do not force a desktop row if the theme switches to a menu button */
@media (max-width: 767px) {
    body.lh-home2-header-fix .lh-alignment-row {
        min-height: 82px !important;
        padding: 8px 18px !important;
        gap: 12px !important;
    }

    body.lh-home2-header-fix .lh-logo-wrap {
        min-width: 0 !important;
    }

    body.lh-home2-header-fix .lh-logo-wrap img {
        max-width: 180px !important;
        max-height: 62px !important;
    }

    body.lh-home2-header-fix .lh-nav-wrap ul,
    body.lh-home2-header-fix .lh-nav-wrap .elementor-nav-menu {
        flex-wrap: wrap !important;
    }
}
