/* Additional Mobile Optimizations - Specifically for 2x2 Grid Layout */

/* Base mobile adjustments */
@media screen and (max-width: 992px) {
    /* Ensure container has proper padding */
    .container {
        padding: 0 20px;
    }
    
    /* Optimize section spacing for mobile */
    .section-spacing {
        padding: 60px 0;
    }
}

/* Medium devices - Tablets */
@media screen and (max-width: 768px) {
    /* Optimize 2x2 grid layout for activities */
    .activities-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .activity-card {
        height: 280px;
    }
    
    .activity-featured {
        grid-column: span 2;
        height: 320px;
    }
    
    /* Optimize 2x2 grid layout for gallery */
    .gallery-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        grid-auto-rows: 180px;
    }
    
    .gallery-item.large {
        grid-column: span 2;
        grid-row: span 1;
    }
    
    /* Adjust text sizes for better readability */
    .section-title {
        font-size: 1.8rem;
    }
    
    .section-subtitle {
        font-size: 0.9rem;
        letter-spacing: 2px;
    }
    
    /* Optimize navbar for mobile */
    .navbar {
        padding: 15px 20px;
    }
    
    .navbar.scrolled {
        padding: 10px 20px;
    }
    
    /* Ensure buttons are properly sized for touch */
    .btn {
        padding: 10px 20px;
        min-height: 44px;
    }
    
    /* Optimize testimonials for mobile */
    .testimonial {
        padding: 25px;
    }
    
    /* Adjust parallax quote section */
    .parallax-quote {
        padding: 60px 0;
        background-attachment: scroll;
    }
    
    .parallax-quote h2 {
        font-size: 1.6rem;
    }
}

/* Small devices - Mobile phones */
@media screen and (max-width: 576px) {
    /* Further optimize 2x2 grid layout for activities */
    .activities-grid {
        gap: 10px;
    }
    
    .activity-card {
        height: 220px;
    }
    
    .activity-featured {
        height: 260px;
    }
    
    .activity-overlay {
        padding: 15px;
    }
    
    .activity-overlay h3 {
        font-size: 1.2rem;
        margin-bottom: 5px;
    }
    
    .activity-overlay p {
        font-size: 0.9rem;
        margin-bottom: 8px;
    }
    
    .activity-overlay .btn {
        padding: 8px 15px;
        font-size: 0.8rem;
    }
    
    /* Further optimize 2x2 grid layout for gallery */
    .gallery-grid {
        gap: 10px;
        grid-auto-rows: 150px;
    }
    
    /* Adjust hero section for mobile */
    .hero h1 {
        font-size: 2.2rem;
    }
    
    .hero h2 {
        font-size: 1rem;
        padding: 0 10px;
    }
    
    /* Optimize contact section for mobile */
    .contact-form, 
    .contact-info {
        padding: 25px;
    }
    
    .info-item {
        margin-bottom: 15px;
    }
    
    /* Adjust footer for mobile */
    footer {
        padding: 50px 0 20px;
    }
    
    .footer-content {
        gap: 25px;
    }
}

/* Extra small devices */
@media screen and (max-width: 375px) {
    /* Further optimize 2x2 grid layout for very small screens */
    .activities-grid {
        gap: 8px;
    }
    
    .activity-card {
        height: 180px;
    }
    
    .activity-featured {
        height: 220px;
    }
    
    .gallery-grid {
        gap: 8px;
        grid-auto-rows: 130px;
    }
    
    /* Adjust text sizes for very small screens */
    .section-title {
        font-size: 1.6rem;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
}

/* Landscape orientation adjustments */
@media screen and (max-height: 500px) and (orientation: landscape) {
    /* Adjust hero section for landscape */
    .hero {
        height: auto;
        min-height: 100vh;
        padding: 70px 0;
    }
    
    /* Maintain 2x2 grid in landscape for consistency */
    .activities-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Touch device optimizations */
@media (hover: none) {
    /* Ensure overlay content is always visible on touch devices */
    .activity-overlay {
        background: linear-gradient(to top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.4) 70%, transparent);
        padding-bottom: 20px;
    }
    
    .activity-overlay .btn {
        opacity: 1;
    }
    
    /* Make gallery overlay always partially visible */
    .gallery-overlay {
        opacity: 0.7;
    }
}

/* Fix for iOS Safari 100vh issue */
@supports (-webkit-touch-callout: none) {
    .hero {
        height: -webkit-fill-available;
    }
}

/* Ensure proper focus states for accessibility */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 3px solid var(--secondary-color);
    outline-offset: 2px;
}

/* Optimize form elements for mobile */
@media screen and (max-width: 768px) {
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 12px;
        font-size: 16px; /* Prevent iOS zoom */
    }
    
    /* Adjust lightbox for mobile */
    .lightbox-image {
        max-height: 70vh;
    }
    
    .lightbox-controls {
        width: 90%;
        left: 5%;
    }
    
    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
    }
}

/* Optimize animations for reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Additional styles for 2x2 grid optimization */
.activities-grid,
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

@media screen and (max-width: 768px) {
    .activities-grid,
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Ensure images load properly in grid */
.activity-img,
.gallery-item {
    background-color: var(--primary-color);
    position: relative;
    overflow: hidden;
}

/* Add loading animation for images */
.placeholder::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    100% {
        left: 100%;
    }
}
