/**
 * Lightbox styles modal with images thumbnails at the lower section
 * left right navigation, image captions
 */


.chc-gallery {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    /* Allow gallery items to wrap to the next line if needed */
    align-items: center;
    gap: 10px;
    /* Space between gallery items */
}

.chc-gallery figure {
    margin: 0;
    border: 1px solid #ccc;
    border-radius: 5px;
    /* Rounded corners */
    padding: 5px;
    /* Space inside the figure */

    cursor: pointer;
    /* Change cursor to pointer to indicate clickable figure */
    width: calc(50% - 10px) !important;
    /* Set a responsive width with minimum and maximum limits */
}

.chc-gallery figure img {
    width: 100%;
    /* Make the image take the full width of the figure */
    height: clamp(150px, 20vh, 300px);
    /* Set the height relative to the viewport height */
    object-fit: cover;
    /* Ensure the image fits within the area without distortion */
}

.chc-gallery figcaption {
    padding: 5px;
    text-align: left;
}

.chc-gallery-modal {
    display: none;
    /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    /* Semi-transparent background */
    justify-content: center;
    align-items: center;
    z-index: 1000;
    /* Ensure it appears above other content */
}


.chc-gallery-content {
    display: flex;
    flex-direction: column;
    align-items: center;

}

.chc-gallery-content img {
    /* center the image fix scale and within the screen width and height */
    max-width: 100%;
    max-height: calc(100vh - 60px - 60px); 
    padding: 20px 5px 5px;
    display: block;
    margin: 0 auto;
    object-fit: contain;
    /* Ensure the image fits within the area without distortion */
}
.chc-gallery-caption{
    padding: 5px;
    text-align: center;
    color: #fff; 

    font-size: 14px;
    font-weight: 600;
}

.chc-gallery-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #fff;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
}

.chc-gallery-next,
.chc-gallery-prev {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: #fff;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
}

.chc-gallery-next {
    right: 10px;
}

.chc-gallery-prev {
    left: 10px;
}

.chc-gallery-thumbnails {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 10px;
}

.chc-gallery-thumbnails img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    cursor: pointer;
    border: 1px solid #ccc;
    border-radius: 5px;
}