/* HECS Polish v5 — Mobile + desktop fix (2026-09-11) */

/* === HEADER FIXES === */

/* Desktop: keep logo full width so tagline is visible */
@media (min-width: 769px) {
    html body #hecs-universal-header .hecs-uh-logo {
        max-width: 260px !important;
    }
    html body #hecs-universal-header .hecs-uh-logo img {
        height: auto !important;
        max-width: 260px !important;
    }
}

/* Mobile: logo should fit WITHOUT overlapping Contact Us button */
@media (max-width: 768px) {
    /* Logo: bigger max width so tagline fits. Use object-fit to preserve aspect. */
    html body #hecs-universal-header .hecs-uh-logo {
        max-width: 220px !important;
        flex: 1 1 auto !important;
    }
    html body #hecs-universal-header .hecs-uh-logo img {
        height: auto !important;
        max-width: 220px !important;
        width: 100% !important;
        object-fit: contain !important;
    }

    /* Hide "Contact Us" button on mobile (hamburger has contact link) */
    #hecs-universal-header .gtb-pr-btn-1,
    html body #hecs-universal-header a.gtb-pr-btn-1 {
        display: none !important;
    }

    /* Hamburger menu: ensure 44px tap target */
    #hecs-universal-header .hecs-uh-menu-toggle,
    html body #hecs-universal-header button.hecs-uh-menu-toggle,
    html body #hecs-universal-header .hecs-uh-hamburger {
        min-height: 44px !important;
        min-width: 44px !important;
        padding: 12px !important;
    }

    /* Make header top bar fit content */
    #hecs-universal-header .hecs-uh-topbar,
    #hecs-universal-header .hecs-uh-header-inner {
        padding: 8px 12px !important;
    }
}

/* === Fortified page H-scroll fix (all viewports) === */
html, body {
    overflow-x: hidden !important;
}

/* === ABOUT-US HERO (page-id 4815) === */

/* Base: full-bleed + bg photo via ::before */
body.page-id-4815 .wp-block-cover.alignfull.is-light:first-of-type,
body.page-id-4815 .wp-block-cover.alignfull.is-light {
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
    position: relative !important;
    left: 0 !important;
    right: 0 !important;
    padding: 100px 0 !important;
    background: #0a4639 !important;
    overflow: hidden !important;
}

/* Photo via ::before — darken with brightness filter */
body.page-id-4815 .wp-block-cover.alignfull.is-light:first-of-type::before {
    content: '' !important;
    position: absolute !important;
    inset: 0 !important;
    z-index: 0 !important;
    background-image: url('https://hecsusa.com/wp-content/uploads/2024/08/pexels-anthonyshkraba-production-8837511.jpg') !important;
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    filter: brightness(0.5) contrast(1.15) saturate(1.05) !important;
    pointer-events: none !important;
    -webkit-filter: brightness(0.5) contrast(1.15) saturate(1.05) !important;
}

/* When v6 injects real <img>, hide the ::before bg-image fallback */
body.page-id-4815 .wp-block-cover.hecs-has-real-bg::before {
    background-image: none !important;
}

/* Hide the v6-injected <img> from being part of focus / accessibility tree */
body.page-id-4815 .wp-block-cover img.hecs-hero-bg {
    user-select: none;
    -webkit-user-drag: none;
}

/* Tinted overlay via ::after */
body.page-id-4815 .wp-block-cover.alignfull.is-light:first-of-type::after {
    content: '' !important;
    position: absolute !important;
    inset: 0 !important;
    z-index: 0 !important;
    background: linear-gradient(135deg, rgba(14, 94, 78, 0.45) 0%, rgba(10, 70, 57, 0.60) 100%) !important;
    pointer-events: none !important;
}

/* Hide the original opaque overlay span */
body.page-id-4815 .wp-block-cover__background {
    background-color: transparent !important;
    opacity: 0 !important;
    display: none !important;
}

/* Text content above overlays */
body.page-id-4815 .wp-block-cover.alignfull.is-light:first-of-type .wp-block-cover__inner-container {
    position: relative !important;
    z-index: 1 !important;
    max-width: 1100px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    width: 100% !important;
    padding-left: 24px !important;
    padding-right: 24px !important;
    box-sizing: border-box !important;
}

/* Center all hero text */
body.page-id-4815 .wp-block-cover__inner-container > p,
body.page-id-4815 .wp-block-cover__inner-container .wp-block-paragraph {
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: center !important;
}

body.page-id-4815 .wp-block-cover__inner-container h1,
body.page-id-4815 .wp-block-cover__inner-container h2,
body.page-id-4815 .wp-block-cover__inner-container h3 {
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

body.page-id-4815 .wp-block-cover__inner-container .wp-block-buttons,
body.page-id-4815 .wp-block-cover__inner-container .wp-block-button {
    margin-left: auto !important;
    margin-right: auto !important;
}

/* === MOBILE-SPECIFIC HERO === */
@media (max-width: 768px) {
    body.page-id-4815 .wp-block-cover.alignfull.is-light:first-of-type,
    body.page-id-4815 .wp-block-cover.alignfull.is-light {
        padding: 60px 0 !important;
        min-height: 620px !important;  /* taller so photo + text + buttons fit */
    }

    body.page-id-4815 .wp-block-cover.alignfull.is-light:first-of-type .wp-block-cover__inner-container {
        padding-left: 20px !important;
        padding-right: 20px !important;
    }

    /* Smaller H1 on mobile so all text fits */
    body.page-id-4815 .wp-block-cover__inner-container h1 {
        font-size: clamp(1.4rem, 5vw, 1.8rem) !important;
        line-height: 1.18 !important;
        padding-top: 12px !important;
        padding-bottom: 16px !important;
    }

    /* Smaller overline */
    body.page-id-4815 .wp-block-cover__inner-container > p:first-of-type {
        font-size: 0.72rem !important;
        letter-spacing: 0.13em !important;
        line-height: 1.35 !important;
    }

    /* Smaller subtitle */
    body.page-id-4815 .wp-block-cover__inner-container .wp-block-paragraph:not(:first-of-type) {
        font-size: 0.95rem !important;
        line-height: 1.5 !important;
    }

    /* Buttons: stack vertically, full-width */
    body.page-id-4815 .wp-block-cover__inner-container .wp-block-buttons {
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100% !important;
        gap: 10px !important;
    }

    body.page-id-4815 .wp-block-cover__inner-container .wp-block-buttons .wp-block-button,
    body.page-id-4815 .wp-block-cover__inner-container .wp-block-buttons .wp-block-button a {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        text-align: center !important;
        display: block !important;
    }
}
