.gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
    padding: 10px;
    background-color: #FAEBD7;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(139, 69, 19, 0.1);
}

.gallery-item {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 3px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 80%;
    max-height: 80%;
    display: flex;
    align-items: center;
}

#modalImg {
    display: block;
    max-width: 100%;
    max-height: 100%;
}

#prevButton,
#nextButton {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    padding: 15px 10px;
    background-color: rgba(139, 69, 19, 0.7);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 24px;
    transition: background-color 0.3s;
}

#prevButton:hover,
#nextButton:hover {
    background-color: rgba(139, 69, 19, 0.9);
}

#prevButton {
    left: 0;
    border-top-right-radius: 5px;
    border-bottom-right-radius: 5px;
}

#nextButton {
    right: 0;
    border-top-left-radius: 5px;
    border-bottom-left-radius: 5px;
}

.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

.gallery-container {
    max-width: 1200px;
    margin: 0 auto;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.gallery-navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
}

.gallery-navigation button {
    padding: 10px 20px;
    background-color: rgba(139, 69, 19, 0.7);
    color: white;
    border: none;
    cursor: pointer;
    margin: 0 10px;
}

.gallery-navigation button:hover {
    background-color: rgba(139, 69, 19, 0.9);
}

#pageIndicator {
    font-size: 16px;
}

@media screen and (max-width: 768px) {
    .gallery {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .modal-content {
        max-width: 100%;
        max-height: 100%;
        width: 100%;
        height: auto;
    }
    
    #modalImg {
        width: 100%;
        height: auto;
        object-fit: contain;
    }
}

@media screen and (max-width: 480px) {
    .gallery {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        max-width: 100%;
        max-height: 100%;
        width: 100%;
        height: auto;
    }
    
    #modalImg {
        width: 100%;
        height: auto;
        object-fit: contain;
    }
}
