@media (max-width: 768px) {
    main {
        padding-top: 80px; /* 80px top padding as requested */
        padding-left: 20px;
        padding-right: 20px;
    }

    /* Mobile Header & Menu */
    header {
        padding: 16px; /* 16px padding */
    }

    footer {
        padding: 16px;
    }

    nav ul {
        display: none; /* Hide standard nav */
    }
    
    /* Mobile Filter Carousel (Swiper) */
    .filters {
        display: none;
    }

    .mobile-filter-container {
        display: block;
    }
    
    /* Mobile Gallery */
    .gallery {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .work-title {
        font-size: 1rem;
    }
    
    .work-category {
        font-size: 0.7rem;
    }

    .modal-content.vertical {
        flex-direction: column;
    }

    .modal-content.vertical .modal-image-container,
    .modal-content.vertical .modal-info {
        flex: auto;
        width: 100%;
    }
    
    .modal-title {
        font-size: 1.5rem;
    }
    
    .modal {
        padding: 0;
        align-items: flex-end; /* Or center? usually center is fine but with small screens... */
        align-items: center;
    }
    
    .modal-content {
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
        overflow-y: auto;
        display: block; /* Stack everything */
        position: relative; /* Set position for the close button */
        padding: 56px 20px 20px 20px;
    }

    .modal-image-container img {
        max-height: 50vh !important;
    }

    /* The close button is positioned within the new padding-top area of .modal-content */
    .modal-close {
        position: absolute;
        width: 40px;
        height: 40px;
        top: 8px; /* Position within the 56px top area */
        right: 16px;
        
        /* Reset/override other properties to ensure consistency */
        color: #000;
        background: none;
        border-radius: 0;
    }
    
    /* Hide desktop nav */
    nav {
        display: none;
    }
    
    /* Ensure header layout */
    header {
        justify-content: space-between;
    }
}

@media (min-width: 769px) {
    .mobile-menu-wrapper,
    .mobile-filter-container {
        display: none !important;
    }
}

@media (max-width: 600px) {
    .social-icons {
        flex-direction: row;
        gap: 20px;
    }
    
    .email-link {
        font-size: 1.1rem;
        word-break: break-all;
    }
}
