/**
 * Global Responsive Utilities & Overrides - Custom Agency
 * Matches React index.css responsive breakpoints & ensures 100% mobile perfection
 */

html, body {
    max-width: 100%;
    overflow-x: clip;
}

/* Prevent iOS auto-zoom on form inputs by ensuring >= 16px on mobile */
@media (max-width: 767px) {
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="url"],
    input[type="number"],
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* Mobile Devices (< 640px) */
@media (max-width: 640px) {
    body {
        font-size: 14px;
        line-height: 1.6;
    }

    .section-title-large {
        font-size: clamp(1.6rem, 7vw, 2.5rem);
        line-height: 1.15;
    }

    /* Bottom Draggable Nav Pill */
    .nav-trigger-pill {
        bottom: 1.25rem !important;
        height: 44px !important;
    }

    /* Fullscreen Modal Nav Dialog */
    .nav-dialog {
        padding: 1.25rem !important;
        border-radius: 1.25rem !important;
        max-height: 94vh !important;
        -webkit-overflow-scrolling: touch;
    }

    .nav-links-list {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    /* Case Studies Cards */
    .case-study-item-card {
        border-radius: 1.25rem !important;
    }

    /* Interactive Buttons & Touch Targets (excluding dots) */
    a.filter-tab-btn,
    .nav-item-btn {
        min-height: 38px;
    }

    /* Video Embeds and Media */
    iframe, video {
        max-width: 100% !important;
        height: auto;
    }
}

/* Tablets & Small Laptops (< 800px) */
@media (max-width: 800px) {
    .preloader-progress-bar {
        left: 0%;
        width: 100%;
        transform: translateX(0%) scaleX(0);
    }

    .preloader-logo .logo-text {
        font-size: 2rem;
    }

    .preloader-footer {
        width: 85%;
    }
}

/* Tablet to Small Desktop (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .nav-dialog {
        max-width: 32rem;
    }
}

/* Large Screens & Ultra-Wide */
@media (min-width: 1536px) {
    .site-main {
        max-width: 1920px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* Safe Area Insets for Modern Mobile Notches */
@supports (padding: max(0px)) {
    .nav-trigger-pill {
        bottom: max(1.5rem, env(safe-area-inset-bottom)) !important;
    }
}

/* ==========================================================================
   Universal Compact Slider Dots (Site-wide Consistency)
   ========================================================================== */
.wp-ind-dot,
.wp-ins-dot,
.mobile-cs-dot,
.commerce-problem-dot,
.commerce-service-dot,
.commerce-why-dot,
.advisory-dot,
.mobile-dot {
    height: 5px !important;
    min-height: 0 !important;
    max-height: 5px !important;
    min-width: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 9999px !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    line-height: 0 !important;
    box-shadow: none !important;
    display: inline-block !important;
    vertical-align: middle !important;
    margin: 0 2px !important;
}

.wp-ind-dot:not(.is-active):not(.active),
.wp-ins-dot:not(.is-active):not(.active),
.mobile-cs-dot:not(.is-active):not(.active),
.commerce-problem-dot:not(.is-active):not(.active),
.commerce-service-dot:not(.is-active):not(.active),
.commerce-why-dot:not(.is-active):not(.active),
.advisory-dot:not(.is-active):not(.active),
.mobile-dot:not(.is-active):not(.active) {
    width: 6px !important;
    background-color: rgba(255, 255, 255, 0.3) !important;
}

.wp-ind-dot.is-active,
.wp-ind-dot.active,
.wp-ins-dot.is-active,
.wp-ins-dot.active,
.mobile-cs-dot.is-active,
.mobile-cs-dot.active,
.commerce-problem-dot.is-active,
.commerce-problem-dot.active,
.commerce-service-dot.is-active,
.commerce-service-dot.active,
.commerce-why-dot.is-active,
.commerce-why-dot.active,
.advisory-dot.is-active,
.advisory-dot.active,
.mobile-dot.is-active,
.mobile-dot.active {
    width: 18px !important;
    background-color: #f4efe7 !important;
}

/* ==========================================================================
   Our Work Page: Case Studies Grid Spacing & Alternating Card Transitions
   ========================================================================== */
#case-studies-grid,
.case-studies-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 2rem !important; /* 32px gap on mobile */
    width: 100% !important;
}

@media (min-width: 640px) {
    #case-studies-grid,
    .case-studies-list {
        gap: 2.75rem !important; /* 44px gap on tablet */
    }
}

@media (min-width: 1024px) {
    #case-studies-grid,
    .case-studies-list {
        gap: 3.5rem !important; /* 56px gap on desktop */
    }
}

/* Case study card hover and image transition */
.case-study-item-card {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.3s ease,
                box-shadow 0.4s ease !important;
}

.case-study-item-card:hover {
    transform: translateY(-4px) !important;
}

.case-study-item-card .card-img-wrapper img {
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.case-study-item-card:hover .card-img-wrapper img {
    transform: scale(1.05) !important;
}

/* ==========================================================================
   Custom Solutions: 5-Column Our Approach Grid & Timeline
   ========================================================================== */
.approach-grid-5 {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    position: relative;
    z-index: 10;
    width: 100%;
}

.approach-cards-grid-5 {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 0.75rem !important;
    width: 100%;
}

@media (min-width: 1024px) {
    .approach-cards-grid-5 {
        gap: 1.25rem !important;
    }
}

@media (min-width: 1280px) {
    .approach-cards-grid-5 {
        gap: 1.5rem !important;
    }
}

/* Responsive display helpers for Approach section */
@media (max-width: 767px) {
    .approach-desktop-wrapper {
        display: none !important;
    }
    .approach-mobile-wrapper {
        display: flex !important;
        flex-direction: column !important;
        gap: 1rem !important;
    }
}

@media (min-width: 768px) {
    .approach-desktop-wrapper {
        display: block !important;
    }
    .approach-mobile-wrapper {
        display: none !important;
    }
}

/* ==========================================================================
   Case Study Detail: Spacing & Bottom Navigation Comfort
   ========================================================================== */
.case-study-detail-main {
    padding-bottom: 8rem !important;
}

@media (min-width: 640px) {
    .case-study-detail-main {
        padding-bottom: 10rem !important;
    }
}

.case-study-nav-bar {
    margin-top: 4.5rem !important;
    margin-bottom: 3.5rem !important;
    padding-top: 2rem !important;
    padding-bottom: 1.5rem !important;
}

@media (min-width: 640px) {
    .case-study-nav-bar {
        margin-top: 6rem !important;
        margin-bottom: 4.5rem !important;
        padding-top: 2.5rem !important;
        padding-bottom: 2rem !important;
    }
}

