.external_header {    
    background-image: url(/img/gallery_background.webp);    
}
.external_main {
    display: flex;
    flex-direction: column;
    text-align: center;
    font-size: 48px;
    padding-top: 70px;
    padding-bottom: 90px;
}

.instagram {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 20px;

}

.instagram img {
    vertical-align: middle;
}

.icon_instagram {
    border: 3px solid #f1cb81;
    border-radius: 6px;
}

.menu_gallery {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 90px;
}

.conteiner_gallery {
    margin: 0 auto;
}

.menu_item_gallery {
    display: inline-block;
}

.menu_item_gallery:hover a {
    background-color: rgb(250, 203, 126);
    color: #230f0b;
}

.menu_item_gallery+.menu_item_gallery {
    padding-left: 40px;
}

.menu_item_gallery a.active {
    background-color: rgb(167, 129, 68);
    color: #230f0b;
}

/* Сховані елементи */
.hidden {
    display: none;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    /* Забороняємо взаємодію */
}

.main_gallery {
    background-color: #4b4b4b;
    background-image: url(/img/extern_main_background.png); 
    background-position: center center;    
    /*background-size: cover;*/
}

.img_gallery {
    margin: 0 50px 0 50px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-items: flex-start;
}


.item_img_gallery img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    /*aspect-ratio: 4 / 3; розмір картинок */
    transition: transform 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.item_img_gallery img:hover {
    transform: scale(1.05);
}

.item_img_gallery {
    flex: 1 1 auto;
    /* Автоматичне вирівнювання */
    max-width: calc(33.333% - 10px);
    /* 3 картинки в ряд */
    cursor: pointer;
    position: relative;
    width: 25%;
    height: 25%;
}

/* Адаптивність для мобільних пристроїв */
@media (max-width: 768px) {
    .item_img_gallery {
        flex: 1 1 calc(50% - 10px);
        /* 2 фото в ряд */
        max-width: calc(50% - 10px);
    }
    .menu_gallery{
        font-size: 20px;
    }
    .menu_item_gallery+.menu_item_gallery {
        padding-left: 10px;
    }
    .external_main {        
        padding-top: 10px;        
    }
}

@media (max-width: 480px) {
    .item_img_gallery {
        flex: 1 1 100%;
        /* 1 фото в ряд */
        max-width: 100%;
    }
    .menu_gallery{
        font-size: 16px;
    }
    .menu_item_gallery+.menu_item_gallery {
        padding-left: 10px;
    }
}
/* Lightbox Styles */
.lightbox_item_img_gallery {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.lightbox_item_img_gallery.active {
    display: flex;
}

.lightbox_item_img_gallery img {
    max-width: 90%;
    max-height: 80%;
    border-radius: 8px;
}

.lightbox_item_img_gallery .close,
.lightbox_item_img_gallery .prev,
.lightbox_item_img_gallery .next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.7);
    color: #333;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 18px;
}

.lightbox_item_img_gallery .close {
    top: 10%;
    right: 10%;
    transform: translateY(0);
}

.lightbox_item_img_gallery .prev {
    left: 5%;
}

.lightbox_item_img_gallery .next {
    right: 5%;
}

.one_hall {
    padding: 0px;
}

.two_hall {
    padding: 0px;
}

.various {
    padding: 0px;
}