/* =========================================
   HOMEPAGE MOBILE RESPONSIVENESS
   Complete mobile-first responsive design
   ========================================= */

/* ==========================================
   GENERAL MOBILE FIXES (768px)
   ========================================== */
@media (max-width: 768px) {

    /* Container padding */
    .container {
        padding: 0 15px !important;
    }

    /* Section padding - compact for mobile */
    section,
    .wka-front-page-content section {
        padding: 40px 0 !important;
    }

    /* Typography scaling */
    h1 {
        font-size: 1.75rem !important;
    }

    h2 {
        font-size: 1.5rem !important;
    }

    h3 {
        font-size: 1.25rem !important;
    }

    h4 {
        font-size: 1.1rem !important;
    }

    p {
        font-size: 0.95rem !important;
    }

    /* Grid layouts - single column */
    [style*="grid-template-columns: repeat(2"],
    [style*="grid-template-columns: repeat(3"],
    [style*="grid-template-columns: repeat(4"],
    [style*="grid-template-columns: 1fr 1fr"],
    [style*="grid-template-columns: 2fr 1fr"],
    .grid-2,
    .grid-3,
    .grid-4 {
        display: grid !important;
        grid-template-columns: 1fr !important;
    }

    /* Flex wrapping */
    [style*="display: flex"][style*="gap: 3rem"],
    [style*="display: flex"][style*="gap: 2.5rem"],
    [style*="display: flex"][style*="gap: 2rem"] {
        flex-wrap: wrap !important;
        gap: 1rem !important;
    }

    /* Section tags */
    [style*="border-radius: 50px"][style*="padding: 8px 20px"],
    [style*="border-radius: 50px"][style*="padding: 10px 24px"] {
        font-size: 0.75rem !important;
        padding: 6px 16px !important;
    }

    /* Force any grid-column: span to reset */
    [style*="grid-column: span"] {
        grid-column: span 1 !important;
    }
}

/* ==========================================
   HERO SECTION MOBILE
   ========================================== */
@media (max-width: 768px) {
    .hero-futuristic {
        min-height: 75vh !important;
        padding: 100px 0 50px !important;
    }

    .hero-futuristic h1 {
        font-size: 1.6rem !important;
        line-height: 1.3 !important;
    }

    .hero-futuristic p {
        font-size: 0.95rem !important;
        padding: 0 5px !important;
    }

    /* Hero buttons stack vertically */
    .hero-futuristic [style*="display: flex"][style*="gap: 1.25rem"] {
        flex-direction: column !important;
        gap: 0.75rem !important;
        padding: 0 10px !important;
    }

    .hero-futuristic a[style*="padding: 0.9rem"] {
        padding: 12px 20px !important;
        font-size: 0.9rem !important;
        width: 100% !important;
        justify-content: center !important;
        text-align: center !important;
    }

    /* Hero stats - horizontal scroll-friendly */
    .hero-futuristic [style*="display: flex"][style*="gap: 2.5rem"] {
        flex-wrap: nowrap !important;
        gap: 1rem !important;
        justify-content: center !important;
    }

    .hero-futuristic [style*="font-size: 1.75rem"][style*="font-weight: 800"] {
        font-size: 1.5rem !important;
    }

    .hero-futuristic [style*="font-size: 0.75rem"][style*="letter-spacing"] {
        font-size: 0.65rem !important;
    }

    /* Divider lines between stats */
    .hero-futuristic [style*="width: 2px"][style*="height: 40px"] {
        height: 30px !important;
    }

    /* Hide floating shapes on mobile for performance */
    .hero-shape {
        display: none !important;
    }

    /* Reduce particle count visibility for performance */
    .hero-particle:nth-child(n+5) {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .hero-futuristic {
        min-height: 70vh !important;
        padding: 90px 0 40px !important;
    }

    .hero-futuristic h1 {
        font-size: 1.4rem !important;
    }

    .hero-futuristic [style*="display: flex"][style*="gap: 2.5rem"] {
        gap: 0.5rem !important;
    }

    .hero-futuristic [style*="font-size: 1.75rem"][style*="font-weight: 800"] {
        font-size: 1.25rem !important;
    }
}

/* ==========================================
   EVENTS SECTION MOBILE
   ========================================== */
@media (max-width: 768px) {

    .wka-events-grid,
    .events-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

    .event-card {
        margin-bottom: 0 !important;
    }

    .event-card img {
        height: 180px !important;
    }
}

/* ==========================================
   PRACTICE AREAS MOBILE
   ========================================== */
@media (max-width: 768px) {

    .practice-areas-grid,
    .services-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
    }

    .practice-area-card,
    .service-card {
        margin-bottom: 1rem !important;
        padding: 1.25rem !important;
    }

    .practice-area-card .service-icon,
    .service-card .service-icon {
        width: 60px !important;
        height: 60px !important;
    }
}

/* ==========================================
   BLOG SECTION HEADER MOBILE
   ========================================== */
@media (max-width: 768px) {
    .wka-homepage-blog-header {
        padding: 40px 0 15px !important;
    }

    .wka-homepage-blog-header h2 {
        font-size: 1.75rem !important;
    }

    .wka-homepage-blog-header p {
        font-size: 0.9rem !important;
    }
}

/* ==========================================
   BLOG GRID MOBILE — SINGLE COLUMN
   ========================================== */
@media (max-width: 768px) {

    .wka-blog-grid,
    .posts-grid,
    .blog-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

    .wka-blog-card__image img,
    .post-card img,
    .blog-card img {
        height: 200px !important;
    }

    .wka-blog-card__body,
    .post-card-content,
    .blog-card-content {
        padding: 1rem !important;
    }

    .wka-blog-card__title,
    .wka-blog-card__title a {
        font-size: 1.1rem !important;
    }

    .wka-blog-loadmore-btn {
        padding: 12px 28px !important;
        font-size: 0.9rem !important;
    }
}

/* ==========================================
   ABOUT SECTION MOBILE
   ========================================== */
@media (max-width: 768px) {
    .about-us-section {
        background-attachment: scroll !important;
    }

    .about-us-section [style*="grid-template-columns: 1fr 1fr"],
    .about-us-section [style*="grid-template-columns"] {
        display: block !important;
    }

    .about-us-section [style*="padding: 2rem"],
    .about-us-section [style*="padding: 1.5rem"] {
        padding: 1.25rem !important;
        margin-bottom: 1rem !important;
    }

    /* About section internal grid (Vision/Mission) */
    .about-us-section [style*="grid-template-columns: 1fr 1fr"][style*="gap: 1.5rem"] {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    /* Image after text on mobile */
    .about-us-section img {
        margin-top: 1.5rem !important;
        border-radius: 12px !important;
    }
}

/* ==========================================
   CORE VALUES MOBILE
   ========================================== */
@media (max-width: 768px) {
    .core-values-section [style*="grid-template-columns: repeat(4"] {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }

    .core-values-section [style*="padding: 2rem"] {
        padding: 1rem !important;
    }

    .core-values-section [style*="width: 70px"] {
        width: 50px !important;
        height: 50px !important;
        font-size: 1.25rem !important;
    }
}

@media (max-width: 480px) {
    .core-values-section [style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
}

/* ==========================================
   GLOBAL REACH MOBILE
   ========================================== */
@media (max-width: 768px) {
    .global-reach-section {
        padding: 40px 0 !important;
        background-attachment: scroll !important;
    }

    .global-reach-section h2 {
        font-size: 1.5rem !important;
    }

    .global-reach-section [style*="gap: 2rem"] {
        gap: 0.75rem !important;
    }

    .global-reach-section [style*="padding: 1rem 1.5rem"] {
        padding: 0.75rem 1rem !important;
    }

    .global-reach-section [style*="font-size: 2rem"] {
        font-size: 1.5rem !important;
    }

    #globalMap {
        height: 280px !important;
        border-radius: 12px !important;
    }
}

@media (max-width: 480px) {
    #globalMap {
        height: 250px !important;
    }
}

/* ==========================================
   WHY CHOOSE US MOBILE
   ========================================== */
@media (max-width: 768px) {

    /* 4-column grid → 2-column */
    [style*="display: grid"][style*="repeat(4, 1fr)"][style*="gap: 1.5rem"] {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }

    [style*="padding: 2rem; background: #fff"][style*="border-radius: 16px"] {
        padding: 1.25rem !important;
    }

    /* Stats row at bottom */
    [style*="display: flex"][style*="gap: 3rem"][style*="justify-content: center"] {
        gap: 1.25rem !important;
    }

    [style*="font-size: 2.5rem"][style*="font-weight: 800"] {
        font-size: 1.75rem !important;
    }
}

@media (max-width: 480px) {
    [style*="display: grid"][style*="repeat(4, 1fr)"] {
        grid-template-columns: 1fr !important;
    }
}

/* ==========================================
   TEAM SECTION MOBILE
   ========================================== */
@media (max-width: 768px) {
    .team-members-section {
        padding: 40px 0 !important;
        background-attachment: scroll !important;
    }

    .wka-team-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    .team-card {
        margin-bottom: 0 !important;
    }

    .wka-team-grid .team-card>div:first-child {
        height: 280px !important;
    }
}

@media (max-width: 480px) {
    .wka-team-grid .team-card>div:first-child {
        height: 250px !important;
    }
}

/* ==========================================
   TESTIMONIALS MOBILE
   ========================================== */
@media (max-width: 768px) {
    .testimonials-section [style*="grid-template-columns: repeat(3"] {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

    .testimonial-card {
        margin-bottom: 0 !important;
        padding: 1.5rem !important;
    }

    /* Quote icon positioning */
    .testimonial-card [style*="position: absolute"][style*="top: -15px"] {
        top: -10px !important;
        right: 15px !important;
        width: 40px !important;
        height: 40px !important;
    }
}

/* ==========================================
   FAQs SECTION MOBILE
   ========================================== */
@media (max-width: 768px) {
    .faqs-section [style*="grid-template-columns: repeat(2"] {
        display: grid !important;
        grid-template-columns: 1fr !important;
    }

    details[style*="padding: 1.5rem"] {
        padding: 1rem !important;
        margin-bottom: 0.75rem !important;
    }

    details summary {
        font-size: 0.95rem !important;
        gap: 8px !important;
    }

    /* FAQ subheading full-width on mobile */
    [style*="grid-column: span 2"] {
        grid-column: span 1 !important;
    }
}

/* ==========================================
   CTA / CONSULTATION SECTION MOBILE
   ========================================== */
@media (max-width: 768px) {
    section[style*="background: linear-gradient(135deg, #800020"] {
        padding: 40px 0 !important;
    }

    section[style*="background: linear-gradient(135deg, #800020"] h2 {
        font-size: 1.5rem !important;
    }

    section[style*="background: linear-gradient(135deg, #800020"] [style*="display: flex"][style*="gap: 1rem"] {
        flex-direction: column !important;
        gap: 0.75rem !important;
    }

    section[style*="background: linear-gradient(135deg, #800020"] a[style*="padding: 14px 30px"] {
        width: 100% !important;
        justify-content: center !important;
        text-align: center !important;
        padding: 12px 24px !important;
    }

    /* Trust badges row */
    section[style*="background: linear-gradient(135deg, #800020"] [style*="gap: 2rem"][style*="flex-wrap"] {
        gap: 1rem !important;
    }
}

/* ==========================================
   CONTACT SECTION MOBILE
   ========================================== */
@media (max-width: 768px) {

    .contact-section [style*="grid-template-columns: 1fr 1fr"],
    [style*="grid-template-columns: 1fr 1fr"][style*="gap: 3rem"] {
        display: block !important;
    }

    .contact-section [style*="padding: 2rem"] {
        padding: 1.25rem !important;
        margin-bottom: 1.5rem !important;
    }

    .contact-section form input,
    .contact-section form textarea,
    .contact-section form select {
        font-size: 16px !important;
        padding: 12px !important;
    }
}

/* ==========================================
   STATS SECTION MOBILE
   ========================================== */
@media (max-width: 768px) {
    .wka-front-page-content [style*="grid-template-columns: repeat(5"] {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }

    [style*="font-size: 2.25rem"],
    [style*="font-size: 2.5rem"],
    [style*="font-size: 3rem"] {
        font-size: 1.75rem !important;
    }
}

@media (max-width: 480px) {
    .wka-front-page-content [style*="grid-template-columns: repeat(5"] {
        grid-template-columns: 1fr !important;
    }
}

/* ==========================================
   FOOTER MOBILE
   ========================================== */
@media (max-width: 768px) {
    .footer-futuristic .footer-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
        text-align: center !important;
    }

    .footer-brand,
    .footer-links,
    .footer-contact {
        text-align: center !important;
    }

    .footer-social {
        justify-content: center !important;
    }

    .footer-links li a {
        justify-content: center !important;
    }

    .footer-bottom {
        flex-direction: column !important;
        text-align: center !important;
        gap: 1rem !important;
    }

    .footer-legal {
        justify-content: center !important;
    }

    .footer-contact li {
        justify-content: center !important;
    }

    .footer-seo-text {
        text-align: center !important;
    }

    .cta-content {
        flex-direction: column !important;
        text-align: center !important;
        padding: 1.5rem !important;
        gap: 1.5rem !important;
    }

    .cta-content>div {
        text-align: center !important;
    }

    .cta-buttons {
        flex-direction: column !important;
        width: 100% !important;
    }

    .cta-buttons .btn {
        width: 100% !important;
        justify-content: center !important;
    }
}

/* ==========================================
   TABLET BREAKPOINT (1024px)
   ========================================== */
@media (max-width: 1024px) {
    .wka-blog-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.5rem !important;
    }

    .footer-futuristic .footer-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .about-us-section [style*="grid-template-columns: 1fr 1fr"] {
        gap: 2rem !important;
    }

    .core-values-section [style*="grid-template-columns: repeat(4"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Testimonials 3→2 col on tablet */
    .testimonials-section [style*="grid-template-columns: repeat(3"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* ==========================================
   FIXED BACKGROUND → SCROLL ON MOBILE
   (Prevents janky scroll on iOS/Android)
   ========================================== */
@media (max-width: 768px) {

    [style*="background-attachment: fixed"],
    section[style*="fixed"] {
        background-attachment: scroll !important;
    }
}

/* ==========================================
   OVERFLOW PROTECTION
   ========================================== */
body,
html {
    overflow-x: hidden !important;
}

img {
    max-width: 100%;
    height: auto;
}

/* ==========================================
   NAVIGATION — MOBILE HAMBURGER (≤768px)
   ========================================== */
@media (max-width: 768px) {

    /* Show hamburger toggle */
    .mobile-toggle {
        display: flex !important;
    }

    /* Hide desktop nav links */
    .nav-menu {
        display: none !important;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(26, 26, 26, 0.98);
        backdrop-filter: blur(16px);
        flex-direction: column !important;
        align-items: center;
        justify-content: center;
        gap: 2rem !important;
        z-index: 999;
        padding: 2rem;
    }

    /* When menu is open */
    .nav-menu.active {
        display: flex !important;
    }

    .nav-link {
        font-size: 1.25rem !important;
        color: #fff;
        padding: 0.5rem 1rem;
    }

    /* CTA button inside mobile menu */
    .nav-cta {
        margin-left: 0 !important;
        margin-top: 1rem;
    }

    .nav-cta .btn {
        padding: 0.9rem 2rem !important;
        font-size: 1rem !important;
    }
}

/* ==========================================
   PRACTICE AREAS GRID — OVERFLOW FIX
   auto-fit minmax(320px,1fr) overflows 375px screens
   ========================================== */
@media (max-width: 520px) {

    .wka-practice-grid,
    [class*="practice-grid"],
    .practice-areas-full .wka-practice-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    .practice-card {
        padding: 1.5rem !important;
    }
}

/* Tablet: 2 columns for practice grid */
@media (min-width: 521px) and (max-width: 1024px) {

    .wka-practice-grid,
    [class*="practice-grid"],
    .practice-areas-full .wka-practice-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.5rem !important;
    }
}

/* ==========================================
   TESTIMONIALS — TABLET 2-COLUMN
   ========================================== */
@media (min-width: 600px) and (max-width: 900px) {
    .testimonials-section [style*="grid-template-columns: repeat(3"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* ==========================================
   iOS INPUT ZOOM PREVENTION
   font-size < 16px causes iOS to auto-zoom on focus
   ========================================== */
@media (max-width: 768px) {

    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="url"],
    input[type="number"],
    input[type="search"],
    input[type="password"],
    textarea,
    select {
        font-size: 16px !important;
    }
}

/* ==========================================
   SAFE AREA INSETS (iPhone notch / Dynamic Island)
   ========================================== */
.header {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

body>footer,
.footer-futuristic {
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
}

/* ==========================================
   TINY SCREENS (< 360px)
   ========================================== */
@media (max-width: 360px) {
    .container {
        padding: 0 12px !important;
    }

    h1 {
        font-size: 1.4rem !important;
    }

    h2 {
        font-size: 1.25rem !important;
    }

    .hero-futuristic h1 {
        font-size: 1.25rem !important;
    }

    #globalMap {
        height: 200px !important;
    }
}