/**
 * Hero Section Header Gap Fix
 * Fixes spacing issues between header and hero section on mobile
 */

/* Mobile Hero Section Spacing Fix */
@media (max-width: 767px) {
    /* Remove gap between header and hero */
    .hero,
    .hero__style-one {
        margin-top: 0 !important;
        padding-top: 80px !important; /* Adjust based on header height */
    }
    
    /* If header is fixed/sticky */
    .stricky-fixed ~ .hero,
    .header-fixed ~ .hero,
    .sticky-header ~ .hero {
        padding-top: 70px !important;
    }
    
    /* Remove any default margins */
    section.hero:first-of-type {
        margin-top: 0 !important;
    }
    
    /* Adjust hero content padding */
    .hero__content {
        padding-top: 20px !important;
        padding-bottom: 40px !important;
    }
    
    /* Hero title adjustments */
    .hero__content h1 {
        font-size: 32px !important;
        line-height: 1.2 !important;
        margin-bottom: 20px !important;
    }
    
    .hero__content h1 span {
        display: inline-block !important;
    }
    
    /* Hero paragraph */
    .hero__content p {
        font-size: 16px !important;
        line-height: 1.5 !important;
        margin-bottom: 20px !important;
    }
    
    /* Hero list */
    .hero__content .xb-list {
        margin-top: 20px !important;
        margin-bottom: 30px !important;
    }
    
    .hero__content .xb-list li {
        font-size: 14px !important;
        margin-bottom: 10px !important;
        padding-left: 25px !important;
    }
    
    .hero__content .xb-list li i {
        font-size: 12px !important;
        left: 0 !important;
    }
    
    /* Hero buttons */
    .hero__content .btns {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 10px !important;
        margin-top: 25px !important;
    }
    
    .hero__content .btns .thm-btn {
        flex: 1 1 auto !important;
        min-width: 140px !important;
        padding: 12px 20px !important;
        font-size: 14px !important;
        text-align: center !important;
    }
    
    /* Hero background positioning */
    .hero.bg_img {
        background-position: center center !important;
        background-size: cover !important;
        min-height: auto !important;
    }
    
    /* Remove unnecessary padding/margin from body */
    body.home .hero:first-child,
    body.front-page .hero:first-child,
    body.page-template-front-page .hero:first-child {
        margin-top: 0 !important;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .hero,
    .hero__style-one {
        padding-top: 70px !important;
        padding-bottom: 40px !important;
    }
    
    .hero__content h1 {
        font-size: 28px !important;
    }
    
    .hero__content p {
        font-size: 15px !important;
    }
    
    .hero__content .xb-list li {
        font-size: 13px !important;
    }
    
    .hero__content .btns {
        flex-direction: column !important;
    }
    
    .hero__content .btns .thm-btn {
        width: 100% !important;
    }
}

/* Fix for admin bar spacing */
@media (max-width: 767px) {
    body.admin-bar .hero {
        padding-top: calc(80px + 46px) !important; /* Header height + admin bar */
    }
    
    body.admin-bar.logged-in .hero:first-child {
        margin-top: 0 !important;
    }
}

/* Ensure no gap after header in all scenarios */
@media (max-width: 767px) {
    /* Direct child after header */
    header + .hero,
    header + section.hero,
    .header-area + .hero,
    .header-area + section.hero,
    .xb-header + .hero,
    .xb-header + section.hero,
    .vt-header + .hero,
    .vt-header + section.hero {
        margin-top: 0 !important;
    }
    
    /* With sticky header */
    .stricky-fixed + .hero,
    .stricky-fixed + section.hero {
        margin-top: 0 !important;
    }
    
    /* Main content area */
    main > .hero:first-child,
    #main > .hero:first-child,
    .site-main > .hero:first-child {
        margin-top: 0 !important;
    }
}

/* Fix specific to front page */
@media (max-width: 767px) {
    .page-template-front-page .hero,
    .home .hero,
    body.front-page .hero {
        margin-top: 0 !important;
        padding-top: 60px !important; /* Reduced top padding */
    }
}

/* Remove any potential double spacing */
@media (max-width: 767px) {
    .hero::before {
        display: none !important;
    }
    
    .hero .container {
        padding-top: 0 !important;
    }
}

/* Landscape orientation fixes */
@media (max-width: 767px) and (orientation: landscape) {
    .hero {
        padding-top: 50px !important;
        padding-bottom: 30px !important;
        min-height: auto !important;
    }
    
    .hero__content h1 {
        font-size: 26px !important;
        margin-bottom: 15px !important;
    }
}