/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

@media (min-width: 769px) {
    .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.gallery-item {
    cursor: pointer;
    overflow: hidden;
    border-radius: 8px;
    aspect-ratio: 1 / 1;
    position: relative;
    background: #f0f0f0;
}

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

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

/* Carousel Modal */
.carousel-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0,0,0,0.95);
    align-items: center;
    justify-content: center;
}

.carousel-content {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

.carousel-prev, .carousel-next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -25px; /* Half of assumed height */
    color: white;
    font-weight: bold;
    font-size: 30px;
    transition: 0.3s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    -webkit-user-select: none;
    background-color: rgba(0, 0, 0, 0.3);
    text-decoration: none;
    z-index: 2002;
}

.carousel-next {
    right: 0;
    border-radius: 3px 0 0 3px;
}

.carousel-prev {
    left: 0;
    border-radius: 3px 0 0 3px;
}

.carousel-prev:hover, .carousel-next:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.carousel-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 2002;
    line-height: 1;
}

.carousel-close:hover {
    color: #bbb;
}
