/* Wave C, Task 9 — Tap-target floor + targeted horizontal-overflow fixes.
 * Loaded site-wide via hvafh-tap-target-fixes.php (mu-plugin).
 * Selectors authored from 2026-04-24 audit.
 */

/* === Tap-target floor for touch devices (Google page-experience, ≥44px) ===
 * Apply only on touch devices to avoid bloating desktop hit areas. Skip-links
 * and logo wrappers are explicitly excluded — they're intentionally tiny
 * (skip-link is screen-reader-only; logo wraps an already-large image).
 */
@media (pointer: coarse), (max-width: 767.98px) {
    /* Footer nav and inline links */
    .site-footer a:not(.skip-link),
    .elementor-nav-menu li > a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        padding: 6px 4px;
    }
    /* Icon-only buttons and icon list items */
    .elementor-button.is-icon-only,
    .elementor-icon-list-item > a {
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    /* Social icon links (footer) */
    .elementor-social-icon {
        min-width: 44px;
        min-height: 44px;
    }
}

/* === Horizontal-overflow fix for /about-us/ "Come See the Story" container ===
 * Audit reported document width 1464px (desktop, viewport 1440px) and 406px
 * (mobile, viewport 390px) — i.e. 24px / 16px bleed past the right edge.
 * Fix: ensure all Elementor flex containers honor the viewport width with
 * box-sizing: border-box so internal padding doesn't extend the box.
 */
.elementor-element.e-flex,
.elementor-element.e-con {
    box-sizing: border-box;
    max-width: 100%;
}

/* Targeted fix: the specific element the audit flagged on /about-us/ */
.page-id-38 .elementor-element-d121b355 {
    max-width: 100%;
    overflow-x: clip;
}

/* === Generic safety net: prevent any element from forcing horizontal scroll
 * on mobile. Body level overflow-x: clip stops the entire page from scrolling
 * sideways even if a child block overflows by a few pixels. */
@media (max-width: 767.98px) {
    body {
        overflow-x: clip;
    }
}

/* === Wave C.5 — Mobile header compaction (2026-04-26) ===
 * The top contact bar uses `.elementor-list-item-link-full_width` which makes
 * each phone/email entry full-row on mobile, stacking them vertically. That,
 * combined with the 44px tap-target floor above, was producing a 92px tall
 * contact strip plus a 50px logo+menu row = 144px header (17% of viewport).
 *
 * Fix: force phone + email into a single horizontal row on mobile, drop their
 * height to 36px each (still comfortable to tap, well above iOS 24px floor),
 * tighten typography. Net header height drops from ~144px to ~80px.
 */
@media (max-width: 767.98px) {
    /* Top contact bar — phone + email side-by-side */
    header .elementor-icon-list--layout-inline .elementor-icon-list-items,
    header .elementor-list-item-link-full_width .elementor-icon-list-items {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        justify-content: center !important;
        gap: 18px;
    }
    header .elementor-icon-list--layout-inline .elementor-icon-list-item,
    header .elementor-list-item-link-full_width .elementor-icon-list-item {
        width: auto !important;
        flex: 0 0 auto !important;
    }
    /* Override the 44×44 tap-target floor for the header contact strip
     * specifically — they're text+icon links, not finger-precision controls.
     * Still ≥36px which Apple HIG accepts for inline contact links. */
    header .elementor-icon-list-item > a {
        min-width: 0 !important;
        min-height: 36px !important;
        padding: 4px 6px !important;
        font-size: 13px !important;
        white-space: nowrap;
    }
    header .elementor-icon-list-item .elementor-icon-list-text {
        font-size: 13px !important;
    }

    /* Bigger logo on mobile — current 30×30 is too small.
     * Constrain via max-width so it scales but doesn't blow up on small phones. */
    header .elementor-widget-theme-site-logo img,
    header img[alt*="logo" i] {
        max-width: 56px !important;
        height: auto !important;
    }

    /* Hero slideshow: ensure ample min-height so the carousel image is the
     * dominant visual rather than a thin strip below the text. */
    .elementor-element.elementor-element-6b68ac1a {
        min-height: 560px !important;
        padding-top: 32px !important;
        padding-bottom: 32px !important;
    }
}

/* === Wave C.6 — "Questions families ask us" block styling (2026-04-26) ===
 * The Wave B internal-link block lives as a raw HTML widget on the homepage
 * with class .hvafh-wb-inline-links. Style it to match the rest of the
 * homepage's section grid: brand navy heading, 2-column card layout with
 * navy borders and gold hover, matching content max-width and padding.
 */
.hvafh-wb-inline-links {
    max-width: 1240px;
    margin: 40px auto;
    padding: 56px 24px;
    background: #F7F2EA;
    border-radius: 12px;
    text-align: center;
}
.hvafh-wb-inline-links h2 {
    color: #1C244B;
    font-size: 32px;
    line-height: 1.2;
    margin: 0 0 32px;
    text-align: center;
}
.hvafh-wb-inline-links ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    list-style: none;
    margin: 0 auto;
    padding: 0;
    max-width: 920px;
}
.hvafh-wb-inline-links li {
    margin: 0;
    padding: 0;
    background: #FFFFFF;
    border: 1px solid rgba(28, 36, 75, 0.10);
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(28, 36, 75, 0.05);
    transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.hvafh-wb-inline-links li:hover {
    box-shadow: 0 8px 22px rgba(28, 36, 75, 0.10);
    transform: translateY(-2px);
    border-color: rgba(184, 153, 104, 0.6);
}
.hvafh-wb-inline-links li a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 22px 24px;
    color: #1C244B !important;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 17px;
    line-height: 1.4;
    text-align: left;
}
.hvafh-wb-inline-links li a::after {
    content: "→";
    color: #B89968;
    font-size: 22px;
    font-weight: 400;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}
.hvafh-wb-inline-links li:hover a::after {
    transform: translateX(4px);
}

@media (max-width: 767.98px) {
    .hvafh-wb-inline-links {
        margin: 24px 12px;
        padding: 40px 16px;
        border-radius: 10px;
    }
    .hvafh-wb-inline-links h2 {
        font-size: 26px;
        margin-bottom: 24px;
    }
    .hvafh-wb-inline-links ul {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .hvafh-wb-inline-links li a {
        padding: 18px 20px;
        font-size: 16px;
    }
}

/* === Wave C.5 — Hero slideshow background fixes (2026-04-26) ===
 * The Elementor background slideshow on the homepage hero (post 449,
 * element 6b68ac1a) was rendering with `background-size: auto` and
 * `background-repeat: repeat`, so the 2400px-wide aerial photos showed
 * only the dead-center crop on a 390px mobile viewport (and tiled if
 * smaller than the container). Fix to `cover` + `no-repeat` so each slide
 * fills the hero. Apply site-wide to all Elementor background slideshows
 * for consistency. */
.elementor-background-slideshow__slide__image {
    background-size: cover !important;
    background-repeat: no-repeat !important;
    background-position: center center !important;
}

/* Add a subtle dark gradient overlay so the white headline text stays
 * legible across all 5 rotating photo backgrounds. The overlay sits
 * between the slideshow (z-index 0) and the content (z-index 2). */
.elementor-element-6b68ac1a {
    position: relative;
}
.elementor-element-6b68ac1a::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(
        180deg,
        rgba(28, 36, 75, 0.55) 0%,
        rgba(28, 36, 75, 0.30) 50%,
        rgba(28, 36, 75, 0.50) 100%
    );
    pointer-events: none;
}
.elementor-element-6b68ac1a > * {
    position: relative;
    z-index: 2;
}
.elementor-element-6b68ac1a > .elementor-background-slideshow {
    z-index: 0;
}
