/* ============================================== 
   MOBILE LAYOUT FIXES - iPhone 16 Pro Max (440px CSS viewport)
   Updated: 2025-11-29 v4
   UNIFIED WIDTH SYSTEM - All outlined blocks match About block width
   ============================================== */

/* 
   UNIFORM WIDTH SYSTEM:
   - All sections use 20px left/right padding
   - All bordered containers (about-content, press-item, contact-content, expertise-item)
     use the SAME width calculation to match exactly
*/

@media (max-width: 768px) {

    /* ==========================================
       GLOBAL SECTION PADDING - Uniform 20px
       ========================================== */
    .projects-section,
    .clients-section,
    .showreel-section,
    .carousel-section {
        padding-left: 20px !important;
        padding-right: 20px !important;
    }

    /* ==========================================
       HAMBURGER MENU SIZE
       ========================================== */
    .mobile-menu-btn {
        width: 32px !important;
        height: 32px !important;
        gap: 6px !important;
    }

    .hamburger-line {
        width: 20px !important;
        height: 1.5px !important;
    }

    .mobile-menu-btn .hamburger-line:nth-child(1) {
        top: 6px !important;
    }

    .mobile-menu-btn .hamburger-line:nth-child(2) {
        top: 15px !important;
    }

    .mobile-menu-btn .hamburger-line:nth-child(3) {
        top: 24px !important;
    }

    .mobile-menu-btn.active .hamburger-line:nth-child(1) {
        top: 15px !important;
    }

    .mobile-menu-btn.active .hamburger-line:nth-child(3) {
        top: 15px !important;
    }

    /* ==========================================
       HERO SECTION - Pills Centering
       ========================================== */
    #home .hero-content,
    .hero-content {
        gap: 20px !important;
        padding: 0 20px !important;
    }

    #home .photo-container,
    .photo-container {
        margin: 0 auto 0 !important;
    }

    #home .hero-text,
    .hero-text {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        width: 100% !important;
    }

    #home .hero-specialties,
    .hero-specialties {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        width: 100% !important;
        gap: 12px !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    #home .hero-specialty-pill,
    .hero-specialty-pill {
        text-align: center !important;
        display: inline-block !important;
        width: fit-content !important;
        max-width: 100% !important;
        margin: 0 auto !important;
        padding: 10px 20px !important;
    }

    /* ==========================================
       STATS SECTION - Full Width
       ========================================== */
    .stats-container {
        padding: 40px 20px !important;
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }

    .stats-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 24px !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* ==========================================
       ABOUT SECTION - This is the REFERENCE width
       All other bordered blocks must match this exactly
       ========================================== */
    #about.projects-section,
    .projects-section#about {
        padding-left: 20px !important;
        padding-right: 20px !important;
        box-sizing: border-box !important;
        width: 100% !important;
    }

    #about .about-container,
    #about.projects-section .about-container,
    .projects-section#about .about-container {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }

    /* about-content is the bordered box - MUST match contact-content */
    #about .about-content,
    #about.projects-section .about-content,
    .projects-section#about .about-content {
        width: 100% !important;
        max-width: 100% !important;
        padding: 24px 20px !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }
    
    /* Section subtitle styling for mobile */
    .section-subtitle {
        font-size: 14px !important;
        padding: 0 10px !important;
        line-height: 1.4 !important;
    }
    
    /* Testimonial styles for mobile - grid-based fixed height */
    .testimonial-carousel {
        margin: 24px auto 0 !important;
        display: grid !important;
        grid-template-columns: 1fr !important;
    }
    
    .about-testimonial {
        grid-row: 1 !important;
        grid-column: 1 !important;
        padding: 24px 20px !important;
    }
    
    .about-testimonial p {
        font-size: 19px !important;
        line-height: 1.6 !important;
        margin-bottom: 18px !important;
    }
    
    .about-testimonial .cite-name {
        font-size: 16px !important;
    }
    
    .about-testimonial .cite-title {
        font-size: 13px !important;
    }

    /* ==========================================
       PRESS SECTION - Match About Block Width EXACTLY
       ========================================== */
    #press.projects-section,
    .projects-section#press {
        padding-left: 20px !important;
        padding-right: 20px !important;
        padding-top: 30px !important;
        overflow: hidden !important;
    }
    
    /* Reduce space above Press title */
    #press .section-header {
        margin-bottom: 16px !important;
    }
    
    #press .section-subtitle {
        font-size: 13px !important;
        padding: 0 5px !important;
        margin-top: 8px !important;
    }

    .press-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        gap: 24px !important;
        box-sizing: border-box !important;
    }

    /* press-item bordered box - MUST match about-content width */
    .press-item {
        padding: 24px 20px !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
        word-wrap: break-word !important;
        position: relative !important;
    }

    /* Press logo - align to top of tag pill */
    .press-logo-link {
        position: absolute !important;
        top: 24px !important;
        right: 20px !important;
        width: 70px !important;
        height: 35px !important;
        z-index: 5 !important;
        display: flex !important;
        align-items: flex-start !important;
        justify-content: flex-end !important;
    }

    .press-logo-img {
        max-width: 100% !important;
        max-height: 100% !important;
        object-fit: contain !important;
    }

    /* Press tag - limit width so it doesn't clip logo */
    .press-project-tag {
        max-width: calc(100% - 100px) !important;
        display: inline-block !important;
        margin-bottom: 12px !important;
    }

    .press-title {
        font-size: 20px !important;
        line-height: 1.3 !important;
        margin-bottom: 12px !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }

    .press-excerpt {
        font-size: 15px !important;
        line-height: 1.5 !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }

    .press-meta {
        font-size: 13px !important;
        margin-top: 16px !important;
    }

    /* ==========================================
       EXPERTISE SECTION - Match About Block Width
       ========================================== */
    #expertise.projects-section,
    .projects-section#expertise {
        padding-left: 20px !important;
        padding-right: 20px !important;
    }

    .expertise-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        gap: 20px !important;
        box-sizing: border-box !important;
    }

    /* expertise-item bordered box - MUST match about-content width */
    .expertise-item {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 24px 20px !important;
        box-sizing: border-box !important;
    }

    /* ==========================================
       CONTACT SECTION - Match About Block Width, Center Contents
       ========================================== */
    #contact.projects-section,
    .projects-section#contact {
        padding-left: 20px !important;
        padding-right: 20px !important;
    }

    .contact-container {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }

    /* contact-content bordered box - MUST match about-content width */
    .contact-content {
        width: 100% !important;
        max-width: 100% !important;
        padding: 24px 20px !important;
        margin: 0 !important;
        box-sizing: border-box !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }

    .contact-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        width: 100% !important;
        gap: 16px !important;
    }

    /* contact-item inner boxes - centered within contact-content */
    .contact-item {
        width: 100% !important;
        max-width: 100% !important;
        padding: 20px !important;
        box-sizing: border-box !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
    }

    .contact-text {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
    }
}

/* ==========================================
   iPhone 16 Pro Max Specific (440px viewport)
   ========================================== */
@media (max-width: 480px) {

    /* Keep menu small */
    .mobile-menu-btn {
        width: 32px !important;
        height: 32px !important;
    }

    /* Tighter spacing for smaller screens */
    #home .hero-content,
    .hero-content {
        gap: 15px !important;
        padding: 0 20px !important;
    }

    /* Ensure pills stay centered */
    #home .hero-specialties,
    .hero-specialties {
        align-items: center !important;
        justify-content: center !important;
        padding: 0 !important;
    }

    #home .hero-specialty-pill,
    .hero-specialty-pill {
        max-width: 100% !important;
        font-size: 14px !important;
    }

    /* Stats - ensure full width */
    .stats-container {
        padding: 30px 20px !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    /* All bordered containers use same padding for consistent width */
    #about .about-content,
    .press-item,
    .expertise-item,
    .contact-content {
        padding: 24px 20px !important;
    }
    
    /* Testimonial small mobile */
    .about-testimonial {
        padding: 22px 18px !important;
    }
    
    .about-testimonial p {
        font-size: 18px !important;
    }
    
    /* Section subtitle small mobile */
    .section-subtitle {
        font-size: 13px !important;
        padding: 0 8px !important;
    }
    
    #press .section-subtitle {
        font-size: 12px !important;
    }

    .press-logo-link {
        top: 20px !important;
        right: 16px !important;
        width: 60px !important;
        height: 30px !important;
    }

    .press-project-tag {
        max-width: calc(100% - 85px) !important;
        font-size: 12px !important;
        padding: 6px 12px !important;
    }

    .contact-item {
        padding: 16px !important;
    }
}