/**
 * Global responsive fixes for all Divi child templates
 * Breakpoints: mobile <768 | tablet 768–1023 | laptop 1024–1439 | desktop ≥1440
 */

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    overflow-x: hidden;
    max-width: 100vw;
}

img,
video,
iframe,
svg,
embed,
object {
    max-width: 100%;
    height: auto;
}

iframe {
    width: 100%;
}

/* Keep decorative orbs from causing horizontal scroll */
.orb,
.ambient-glow {
    max-width: min(100vw, 800px);
    max-height: min(100vw, 800px);
    pointer-events: none;
}

/* Heroes: prefer dynamic viewport height on modern browsers */
.hero-container.h-\[100vh\],
header#hero.min-h-\[95vh\],
section.min-h-\[95vh\],
section.h-\[100vh\] {
    min-height: 100vh;
    min-height: 100dvh;
}

/* Fixed parallax backgrounds break on iOS — use scroll on small screens */
@media (max-width: 1023px) {
    .hero-bg,
    .bg-fixed,
    [class*="bg-fixed"] {
        background-attachment: scroll !important;
    }
}

/* Map iframe always fills its container */
.map-container iframe,
footer iframe {
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
    display: block;
}

/* Forms & CF7 — full width inputs on all devices */
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 input[type="url"],
.wpcf7 input[type="number"],
.wpcf7 input[type="date"],
.wpcf7 textarea,
.wpcf7 select,
.secure-input {
    max-width: 100%;
    box-sizing: border-box;
}

.wpcf7-form-control-wrap {
    display: block;
    width: 100%;
}

/* ---------- Mobile (< 768px) ---------- */
@media (max-width: 767px) {
    /* Prevent fixed-height cards from forcing awkward scroll */
    .min-h-\[450px\],
    .min-h-\[480px\],
    .min-h-\[520px\],
    .min-h-\[400px\] {
        min-height: 0 !important;
    }

    /* Soften huge decorative type on small screens */
    .text-\[12rem\],
    .text-\[20rem\] {
        font-size: 6rem !important;
    }

    /* Hero padding under fixed header */
    .hero-container:not([class*="pt-"]),
    header#hero {
        padding-top: 5.5rem;
    }

    /* Tables / wide grids — allow horizontal scroll when needed */
    .overflow-x-auto {
        -webkit-overflow-scrolling: touch;
    }

    /* Contact / intake buttons full width */
    a.btn-premium {
        max-width: 100%;
    }
}

/* ---------- Tablet (768–1023px) ---------- */
@media (min-width: 768px) and (max-width: 1023px) {
    .min-h-\[450px\],
    .min-h-\[480px\],
    .min-h-\[520px\] {
        min-height: 360px !important;
    }
}

/* ---------- Laptop (1024–1439px) ---------- */
@media (min-width: 1024px) and (max-width: 1439px) {
    /* Slightly tighter section padding */
    section.py-32 {
        padding-top: 6rem;
        padding-bottom: 6rem;
    }
}

/* ---------- Desktop (≥ 1440px) ---------- */
@media (min-width: 1440px) {
    /* Ensure content doesn't stretch endlessly */
    .max-w-\[90rem\] {
        max-width: 90rem;
    }
}

/* Prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    .orb,
    .ambient-glow,
    .hero-bg,
    .reveal-blur,
    .reveal-slide-left,
    .reveal-slide-right,
    .cascade-group .cascade-item {
        animation: none !important;
        transition: none !important;
    }
}

/* Lighter paint cost on mobile */
@media (max-width: 767px) {
    .orb,
    .ambient-glow {
        filter: blur(60px) !important;
        animation: none !important;
    }

    .glass-panel,
    .glass-card {
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }
}
