/*
 * FitHaven Responsive Fix
 * Reversible: deactivate/delete the fithaven-responsive-fix plugin.
 * Scope: FitHaven.org only, via body.fithaven-responsive-fix.
 */

/* ISSUE 1: Remove giant mobile/tablet header gaps without changing desktop layout. */
body.fithaven-responsive-fix .site-header,
html.fithaven-responsive-fix-html body .site-header,
body.fithaven-responsive-fix header.site-header,
body.fithaven-responsive-fix .main-header,
body.fithaven-responsive-fix .header-main,
body.fithaven-responsive-fix .elementor-location-header {
    min-height: 0 !important;
}

/* ISSUE 1: Keep FitHaven logo visible and properly scaled. */
body.fithaven-responsive-fix .custom-logo,
body.fithaven-responsive-fix .site-logo img,
body.fithaven-responsive-fix .navbar-brand img,
body.fithaven-responsive-fix .header-logo img,
body.fithaven-responsive-fix .elementor-widget-theme-site-logo img {
    display: block !important;
    width: auto !important;
    max-width: min(220px, 56vw) !important;
    max-height: 72px !important;
    object-fit: contain !important;
}

body.fithaven-responsive-fix .site-branding,
body.fithaven-responsive-fix .header-branding,
body.fithaven-responsive-fix .navbar-brand {
    display: flex !important;
    align-items: center !important;
    min-height: 0 !important;
}

/* ISSUE 1: Keep the logo from rendering as a huge white block on mobile. */
body.fithaven-responsive-fix .custom-logo-link,
body.fithaven-responsive-fix .site-logo,
body.fithaven-responsive-fix .navbar-brand,
body.fithaven-responsive-fix .header-logo,
body.fithaven-responsive-fix .elementor-widget-theme-site-logo {
    width: auto !important;
    max-width: min(230px, 64vw) !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

/* ISSUE 1: Keep navigation/menu accessible on tablet and mobile. */
body.fithaven-responsive-fix .top-navigation,
body.fithaven-responsive-fix .main-navigation,
body.fithaven-responsive-fix nav.primary-navigation,
body.fithaven-responsive-fix .menu-toggle,
body.fithaven-responsive-fix .mobile-menu-toggle,
body.fithaven-responsive-fix .hamburger {
    visibility: visible !important;
}

/* ISSUE 1: Preserve active ticker/trending strip from desktop. */
body.fithaven-responsive-fix .trending,
body.fithaven-responsive-fix .trending-bar,
body.fithaven-responsive-fix .ticker,
body.fithaven-responsive-fix .news-ticker,
body.fithaven-responsive-fix .breaking-news,
body.fithaven-responsive-fix .elementor-widget-news-ticker {
    display: flex !important;
    visibility: visible !important;
    min-height: 34px !important;
    overflow: hidden !important;
}

/* ISSUE 1: Preserve the approved blue/pink FitHaven brand line. */
body.fithaven-responsive-fix .brand-line,
body.fithaven-responsive-fix .gradient-line,
body.fithaven-responsive-fix .header-gradient-line,
body.fithaven-responsive-fix .site-header::after {
    display: block !important;
    height: 4px !important;
    background: linear-gradient(90deg, #1277ff 0%, #ff4faf 100%) !important;
}

/* ISSUE 1: Keep article cards readable and prevent cropped media. */
body.fithaven-responsive-fix article,
body.fithaven-responsive-fix .post,
body.fithaven-responsive-fix .post-card,
body.fithaven-responsive-fix .entry-card,
body.fithaven-responsive-fix .elementor-post {
    min-width: 0 !important;
}

body.fithaven-responsive-fix .post-card img,
body.fithaven-responsive-fix .entry-card img,
body.fithaven-responsive-fix .elementor-post__thumbnail img {
    width: 100% !important;
    height: auto !important;
    object-fit: cover !important;
}

/* ISSUE 1: Collapse empty ad/hero/spacer blocks causing the giant white gap. */
@media (max-width: 1024px) {
    body.fithaven-responsive-fix .elementor-widget-spacer,
    body.fithaven-responsive-fix .elementor-spacer,
    body.fithaven-responsive-fix .elementor-spacer-inner,
    body.fithaven-responsive-fix .wp-block-spacer,
    body.fithaven-responsive-fix .header-ad:empty,
    body.fithaven-responsive-fix .ad-header:empty,
    body.fithaven-responsive-fix .ad-banner:empty,
    body.fithaven-responsive-fix .leaderboard-ad:empty,
    body.fithaven-responsive-fix .top-ad:empty,
    body.fithaven-responsive-fix .hero-spacer:empty,
    body.fithaven-responsive-fix .mobile-spacer:empty,
    body.fithaven-responsive-fix section:empty,
    body.fithaven-responsive-fix .elementor-section:empty,
    body.fithaven-responsive-fix .elementor-container:empty,
    body.fithaven-responsive-fix .elementor-widget-container:empty {
        display: none !important;
        height: 0 !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
    }

    body.fithaven-responsive-fix .site-header + .wp-block-spacer,
    body.fithaven-responsive-fix .site-header + .elementor-section:has(.elementor-widget-spacer),
    body.fithaven-responsive-fix .elementor-location-header + .wp-block-spacer,
    body.fithaven-responsive-fix .elementor-location-header + .elementor-section:has(.elementor-widget-spacer) {
        display: none !important;
        height: 0 !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }
}

@media (max-width: 1024px) {
    body.fithaven-responsive-fix .site-header,
    html.fithaven-responsive-fix-html body .site-header,
    body.fithaven-responsive-fix header.site-header,
    body.fithaven-responsive-fix .main-header,
    body.fithaven-responsive-fix .header-main,
    body.fithaven-responsive-fix .elementor-location-header {
        padding-block: 10px !important;
    }

    body.fithaven-responsive-fix .site-header .container,
    body.fithaven-responsive-fix .header-main .container,
    body.fithaven-responsive-fix .elementor-location-header .elementor-container {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 12px !important;
        min-height: 0 !important;
    }

    body.fithaven-responsive-fix .main-navigation ul,
    body.fithaven-responsive-fix nav.primary-navigation ul {
        max-width: 100% !important;
    }

    body.fithaven-responsive-fix .post-card,
    body.fithaven-responsive-fix .entry-card,
    body.fithaven-responsive-fix .elementor-post {
        display: block !important;
        margin-bottom: 22px !important;
    }
}

@media (max-width: 767px) {
    body.fithaven-responsive-fix .custom-logo,
    body.fithaven-responsive-fix .site-logo img,
    body.fithaven-responsive-fix .navbar-brand img,
    body.fithaven-responsive-fix .header-logo img,
    body.fithaven-responsive-fix .elementor-widget-theme-site-logo img {
        max-width: min(180px, 62vw) !important;
        max-height: 58px !important;
    }

    body.fithaven-responsive-fix .trending,
    body.fithaven-responsive-fix .trending-bar,
    body.fithaven-responsive-fix .ticker,
    body.fithaven-responsive-fix .news-ticker,
    body.fithaven-responsive-fix .breaking-news {
        font-size: 13px !important;
        line-height: 1.25 !important;
        white-space: nowrap !important;
    }
}
