/* School Page Specific Styles */
.school-header {
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)),
                url('/images/image-terrain1.webp') center/cover;
    min-height: 80vh;
}

.gallery-section {
    padding: 6rem 2rem;
    background: white;
}

.terrain-description {
    max-width: 1200px;
    margin: 0 auto 3rem;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    padding: 0 1rem;
}

.terrain-info {
    background: var(--light-gray);
    padding: 2rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.terrain-info:hover {
    transform: translateY(-5px);
    box-shadow: var(--card-shadow);
}

.terrain-info h3 {
    color: var(--secondary-color);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.terrain-info p {
    color: var(--text-color);
    line-height: 1.6;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1400px;
    margin: 3rem auto 0;
}

.gallery-category {
    margin-bottom: 6rem;
}

.gallery-category:last-child {
    margin-bottom: 0;
}

.gallery-category h2 {
    text-align: center;
    margin-bottom: 3rem;
    color: var(--secondary-color);
    font-size: 2.5rem;
    position: relative;
}

.gallery-category h2:after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
}

.gallery-item {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    aspect-ratio: 4/3;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--soft-shadow);
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--card-shadow);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    -o-object-fit: cover;
       object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.3), transparent);
    opacity: 0;
    transition: var(--transition);
}

.gallery-item:hover::after {
    opacity: 1;
}

/* Modal */
.gallery-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 2rem;
}

.gallery-modal.active {
    display: flex;
}

.modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content img {
    max-width: 100%;
    max-height: 90vh;
    -o-object-fit: contain;
       object-fit: contain;
}

.modal-close {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 1010;
}

.modal-close i {
    font-size: 1.5rem;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.modal-nav {
    position: fixed;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 2rem;
    pointer-events: none;
    z-index: 1010;
}

.modal-nav button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    pointer-events: auto;
}

.modal-nav button i {
    font-size: 1.5rem;
}

.modal-nav button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .terrain-description {
        grid-template-columns: 1fr;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .gallery-category {
        margin-bottom: 4rem;
    }

    .gallery-category h2 {
        font-size: 2rem;
    }

    .modal-nav {
        padding: 0 1rem;
    }

    .modal-nav button {
        width: 3rem;
        height: 3rem;
    }

    .modal-nav button i {
        font-size: 1.2rem;
    }

    .modal-close {
        width: 3rem;
        height: 3rem;
    }

    .modal-close i {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .gallery-section {
        padding: 4rem 1rem;
    }

    .gallery-category h2 {
        font-size: 1.8rem;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .gallery-item {
        aspect-ratio: 3/2;
    }

    .modal-content {
        width: 100%;
    }

    .modal-close {
        top: 0.5rem;
        right: 0.5rem;
    }
}