/* ============================================
   INSIGHTS RESPONSIVE FIXES
   Complete tablet and mobile navigation overhaul
   ============================================ */

/* ============================================
   TABLET BREAKPOINT (768px - 1024px)
   ============================================ */

@media (min-width: 769px) and (max-width: 1024px) {
    /* Show desktop nav, hide mobile toggle on tablet */
    .lg-main-nav {
        display: inline-flex !important;
        position: static !important;
        flex-direction: row !important;
        gap: 20px !important;
        padding: 0 !important;
        background: transparent !important;
        opacity: 1 !important;
        transform: none !important;
    }

    .lg-nav-link {
        color: var(--black) !important;
        font-family: var(--font-base) !important;
        font-size: 13px !important;
        font-weight: 500 !important;
        letter-spacing: 0.08em !important;
        text-transform: uppercase !important;
        min-height: auto !important;
        padding: 0 !important;
    }

    .lg-nav-toggle,
    .lg-nav-close {
        display: none !important;
    }

    .mobile-menu-overlay {
        display: none !important;
    }

    /* Tablet-specific hero adjustments */
    .hero-section {
        min-height: 80vh;
        padding: 3rem 0;
    }

    .insights-video-title {
        max-width: 450px;
    }

    .signature-animation {
        max-width: 300px;
    }

    /* Tab navigation */
    .tab-navigation {
        gap: 0.75rem;
    }

    .tab-button {
        padding: 0.875rem 1.75rem;
        font-size: 1.1rem;
    }

    /* Story carousel */
    .stories-swiper .swiper-slide {
        width: 300px;
    }

    /* Work carousel */
    .work-swiper .swiper-slide {
        width: 380px;
    }

    /* Grid adjustments */
    .find-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .archive-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

/* ============================================
   MOBILE BREAKPOINT (max-width: 768px)
   ============================================ */

@media (max-width: 768px) {
    /* Force hide desktop nav on mobile */
    .lg-main-nav {
        display: none !important;
    }

    .lg-site-header.is-open .lg-main-nav {
        display: none !important;
    }

    /* Show mobile toggle */
    .lg-nav-toggle {
        display: inline-flex !important;
    }

    /* Mobile drawer should be used */
    .mobile-menu-overlay {
        position: fixed !important;
        inset: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        background-color: var(--bg-primary) !important;
        z-index: 11000 !important;
        transform: translateX(100%) !important;
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
        display: none !important;
        flex-direction: column !important;
        overflow: hidden !important;
    }

    .mobile-menu-overlay.active {
        display: flex !important;
        transform: translateX(0) !important;
    }

    /* Show drawer contents only when active */
    .mobile-drawer-header,
    .mobile-drawer-content {
        display: none !important;
    }

    .mobile-menu-overlay.active .mobile-drawer-header,
    .mobile-menu-overlay.active .mobile-drawer-content {
        display: flex !important;
    }

    .mobile-menu-overlay.active .mobile-link,
    .mobile-menu-overlay.active .mobile-group-label,
    .mobile-menu-overlay.active .mobile-divider {
        display: block !important;
    }

    /* Header adjustments */
    .lg-site-header-inner {
        padding: 0 1rem !important;
        height: 56px !important;
    }

    .lg-site-header {
        height: 56px !important;
    }

    .lg-logo-img {
        width: 100px !important;
    }

    /* Hero section */
    .hero-section {
        min-height: auto;
        padding: 1.5rem 0 2rem 0;
    }

    .editorial-label {
        font-size: 0.625rem;
        margin-bottom: 1rem;
    }

    .insights-video-title {
        max-width: 100%;
        padding: 1.5rem;
    }

    .hero-subtitle {
        font-size: 1rem;
        padding: 0 1rem;
    }

    .signature-animation {
        max-width: 200px;
    }

    /* Tab navigation mobile */
    .tab-navigation {
        gap: 0.5rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        border-bottom: 1px solid var(--border-gray);
    }

    .tab-navigation::-webkit-scrollbar {
        display: none;
    }

    .tab-button {
        padding: 0.75rem 1.25rem;
        font-size: 1rem;
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* Story carousel mobile */
    .stories-swiper .swiper-slide {
        width: 280px !important;
    }

    .story-image {
        height: 200px;
    }

    .story-content {
        padding: 1.5rem;
    }

    .story-title {
        font-size: 1.25rem;
    }

    /* Work carousel mobile */
    .work-swiper .swiper-slide {
        width: 300px !important;
    }

    .work-hero-image {
        height: 380px;
    }

    .work-hero-content {
        padding: 2rem;
    }

    .work-hero-title {
        font-size: 1.5rem;
    }

    /* Spotlight article mobile */
    .spotlight-article {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1.5rem;
    }

    .spotlight-image {
        height: 250px;
        border-radius: 12px;
    }

    .spotlight-content {
        padding: 0;
    }

    .spotlight-title {
        font-size: 2rem;
        margin-bottom: 1rem;
    }

    .spotlight-description {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    /* Grid layouts mobile */
    .find-grid,
    .archive-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .find-card,
    .archive-card {
        padding: 2rem;
    }

    /* Numbers grid mobile */
    .numbers-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .number-value {
        font-size: 3rem;
    }

    /* Ahead section mobile */
    .ahead-section {
        padding: 2rem;
    }

    .ahead-section h2 {
        font-size: 1.75rem;
    }

    /* Section headers mobile */
    .section-title {
        font-size: 2rem;
    }

    .section-subtitle {
        font-size: 1rem;
    }

    /* Latest header mobile */
    .latest-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        margin-bottom: 1.5rem;
    }

    /* Swiper navigation mobile - make larger */
    .swiper-button-prev,
    .swiper-button-next {
        width: 40px;
        height: 40px;
    }

    .swiper-button-prev:after,
    .swiper-button-next:after {
        font-size: 18px;
    }

    /* Padding adjustments */
    .container {
        padding: 0 1rem;
    }

    .find-section,
    .latest-section,
    .archive-section,
    .connect-section {
        padding: 3rem 0;
    }

    footer {
        padding: 2rem 0;
    }

    .footer-links {
        flex-direction: column;
        gap: 1rem;
    }
}

/* ============================================
   SMALL MOBILE (max-width: 480px)
   ============================================ */

@media (max-width: 480px) {
    .lg-logo-img {
        width: 90px !important;
    }

    .hero-section {
        padding: 1rem 0 1.5rem 0;
    }

    .insights-video-title {
        padding: 1rem;
    }

    .signature-animation {
        max-width: 180px;
    }

    .tab-button {
        padding: 0.625rem 1rem;
        font-size: 0.9rem;
    }

    .stories-swiper .swiper-slide {
        width: 260px !important;
    }

    .story-image {
        height: 180px;
    }

    .work-swiper .swiper-slide {
        width: 280px !important;
    }

    .work-hero-image {
        height: 340px;
    }

    .work-hero-title {
        font-size: 1.35rem;
    }

    .spotlight-title {
        font-size: 1.75rem;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .number-value {
        font-size: 2.5rem;
    }

    .cta-button {
        padding: 0.875rem 1.75rem;
        font-size: 0.95rem;
    }
}

/* ============================================
   NAVIGATION BEHAVIOR CONSISTENCY
   ============================================ */

/* Prevent body scroll when mobile menu is open */
body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* Ensure theme toggle stays on top */
.theme-toggle {
    z-index: 9999 !important;
}

/* Fix any z-index conflicts */
.lg-site-header {
    z-index: 300;
}

.mobile-menu-overlay {
    z-index: 11000 !important;
}

/* Smooth transitions for responsive changes */
.lg-main-nav,
.lg-nav-link,
.mobile-menu-overlay {
    transition: all 0.3s ease;
}

/* ============================================
   ACCESSIBILITY IMPROVEMENTS
   ============================================ */

/* Focus states for keyboard navigation */
.lg-nav-link:focus-visible,
.mobile-link:focus-visible,
.tab-button:focus-visible {
    outline: 3px solid var(--coral-accent);
    outline-offset: 2px;
    border-radius: 4px;
}

.lg-nav-toggle:focus-visible,
.drawer-close-btn:focus-visible {
    outline: 3px solid var(--coral-accent);
    outline-offset: 2px;
}

/* Improve touch targets on mobile */
@media (max-width: 768px) {
    .mobile-link {
        min-height: 48px;
        display: flex;
        align-items: center;
    }

    .tab-button {
        min-height: 44px;
    }

    .lg-nav-toggle {
        min-width: 48px;
        min-height: 48px;
    }
}

/* ============================================
   PERFORMANCE OPTIMIZATIONS
   ============================================ */

/* Reduce animations on low-end devices */
@media (prefers-reduced-motion: reduce) {
    .mobile-menu-overlay,
    .lg-main-nav,
    .lg-nav-link,
    .swiper-slide {
        transition: none !important;
        animation: none !important;
    }
}

/* GPU acceleration for smooth animations */
.mobile-menu-overlay,
.lg-main-nav,
.swiper-slide {
    will-change: transform;
    transform: translateZ(0);
}
