/*
       Force the lightbox to be hidden on page load
       (overrides any potential conflicting styles).
     */
.lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8); /* Semi-transparent black background */
    justify-content: center; /* Center horizontally */
    align-items: center;    /* Center vertically */
}

.lightbox.is-open {
    display: flex;
}

/* Enlarge the clicked media in the modal */
img.lightbox-content,
video.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    box-sizing: border-box;
    margin: 0;
    border-radius: 10px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}

/* Close Button */
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #ffffff;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    background: transparent;
    border: 0;
    padding: 0;
    line-height: 1;
    -webkit-appearance: none;
    appearance: none;
}

.lightbox-close:hover,
.lightbox-close:focus {
    color: #cccccc;
    text-decoration: none;
}

/* Caption Text */
.lightbox-caption {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: #ffffff;
    font-size: 18px;
    text-align: center;
    max-width: 90%;
    padding: 0.2em 0.6em;
    word-wrap: break-word;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 6px;
}

/* Help text for keyboard controls */
.lightbox-help {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    color: #ffffff;
    font-size: 14px;
    text-align: center;
}

/* Make sure images set to trigger the lightbox show a pointer cursor */
.lightbox-trigger {
    cursor: pointer;
}

/* Responsive Adjustments */
@media only screen and (max-width: 700px) {
    .lightbox-close {
        font-size: 25px;
        top: 15px;
        right: 20px;
    }

    .lightbox-caption {
        font-size: 16px;
        bottom: 20px;
        max-width: 95%;
    }

    .lightbox-help {
        font-size: 12px;
        bottom: 5px;
    }
}
