/* Gallery Modal Styles */

.page-gallery {
    --bs-modal-bg: #000;
    --bs-modal-border-color: #000;
}

    .page-gallery.modal {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        padding: 0 !important;
        margin: 0 !important;
        display: none;
        overflow: hidden;
    }

        .page-gallery.modal.show {
            display: block;
        }

        .page-gallery.modal .modal-dialog {
            margin: 0 !important;
            padding: 0 !important;
            width: 100vw;
            height: 100vh;
            max-width: 100vw;
            max-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
        }

.page-gallery__content {
    background-color: #000;
    border: none;
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    border-radius: 0;
}

.page-gallery .modal-body {
    padding: 0 !important;
    background-color: #000;
    margin: 0;
    flex: 1;
    overflow: hidden;
}

/* Carousel */
.page-gallery .carousel {
    background-color: #000;
    height: 100%;
}

.page-gallery .carousel-inner {
    height: 100%;
}

.page-gallery__item {
    align-items: center;
    justify-content: center;
    background-color: #000;
    height: 100%;
    position: relative;
}

.page-gallery__image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    margin: 0 auto;
}


/* Caption styling */
.page-gallery__caption {
    background: rgba(0, 0, 0, 0.7);
    padding: 15px 20px;
    margin-top: 15px;
    border-radius: 4px;
}

    .page-gallery__caption p {
        color: #fff;
        margin: 0;
        font-size: 14px;
        line-height: 1.5;
    }

/* Overlay for image name and description (bottom-right) */

.carousel-item.active {
    display: flex;
}

.carousel-item {
    margin-top: 0;
}

.carousel-inner__centered {
    display: flex;
    margin-top: 0;
}

.carousel-caption__overlay {
    background-color: rgba(0, 0, 0, 0.7);
    padding: 10px;
    margin-top: 0;

    > * {
        margin: 0;
    }
}

.carousel-caption__overlay-title {
    color: #fff;
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
}

.carousel-caption__overlay-description {
    color: #e0e0e0;
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

/* Close button with FontAwesome icon */
.page-gallery__close {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 4px;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s ease, background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1051;
}

.page-gallery__close:hover {
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.4);
}

/* Bootstrap */

/* ==========================================================
   Bootstrap 5.3 Carousel (standalone)
   ========================================================== */

.carousel {
    position: relative;
}

.carousel-inner {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.carousel-item {
    position: relative;
    display: none;
    float: left;
    width: 100%;
    margin-right: -100%;
    backface-visibility: hidden;
    transition: transform .6s ease-in-out;
}

.carousel-item-next,
.carousel-item-prev {
    display: block;
}



/* Next */

.carousel-item-next:not(.carousel-item-start),
.active.carousel-item-end {
    transform: translateX(100%);
}

/* Previous */

.carousel-item-prev:not(.carousel-item-end),
.active.carousel-item-start {
    transform: translateX(-100%);
}

/* Sliding */

.carousel-item-next.carousel-item-start,
.carousel-item-prev.carousel-item-end {
    transform: translateX(0);
}

/* Fade */

.carousel-fade .carousel-item {
    opacity: 0;
    transition-property: opacity;
    transform: none;
}

    .carousel-fade .carousel-item.active,
    .carousel-fade .carousel-item-next.carousel-item-start,
    .carousel-fade .carousel-item-prev.carousel-item-end {
        opacity: 1;
        z-index: 1;
    }

.carousel-fade .active.carousel-item-start,
.carousel-fade .active.carousel-item-end {
    opacity: 0;
    z-index: 0;
}

/* ==========================================================
   Controls
   ========================================================== */

.carousel-control-prev,
.carousel-control-next {
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 15%;
    padding: 0;
    color: #fff;
    text-align: center;
    background: none;
    border: 0;
    opacity: .5;
    transition: opacity .15s ease;
    cursor: pointer;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    opacity: .9;
}

.carousel-control-prev {
    left: 0;
}

.carousel-control-next {
    right: 0;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100% 100%;
}

.carousel-control-prev-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 16 16'%3e%3cpath d='M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z'/%3e%3c/svg%3e");
}

.carousel-control-next-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 16 16'%3e%3cpath d='M4.646 1.646a.5.5 0 0 0 0 .708L10.293 8l-5.647 5.646a.5.5 0 1 0 .708.708l6-6a.5.5 0 0 0 0-.708l-6-6a.5.5 0 0 0-.708 0z'/%3e%3c/svg%3e");
}

/* ==========================================================
   Indicators
   ========================================================== */

.carousel-indicators {
    position: absolute;
    right: 0;
    bottom: 1rem;
    left: 0;
    z-index: 2;
    display: flex;
    justify-content: center;
    padding-left: 0;
    margin: 0;
    list-style: none;
}

.carousel-indicators [data-bs-target] {
    box-sizing: content-box;
    flex: 0 1 auto;
    width: 30px;
    height: 3px;
    padding: 0;
    margin: 0 3px;
    text-indent: -999px;
    cursor: pointer;
    background-color: #fff;
    background-clip: padding-box;
    border: 0;
    opacity: .5;
    transition: opacity .6s ease;
}

.carousel-indicators .active {
    opacity: 1;
}

/* ==========================================================
   Caption
   ========================================================== */

.carousel-caption {
    position: absolute;
    right: 15%;
    bottom: 1.25rem;
    left: 15%;
    z-index: 10;
    color: #fff;
    text-align: center;
}

/* ==========================================================
   Helpers
   ========================================================== */

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0,0,0,0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}
