/* Full size view, opened by clicking the large image or movie */

.ab-acf-zoom {
    cursor: zoom-in;
}

html.ab-acf-lightbox-open {
    overflow: hidden;
}

dialog.ab-acf-lightbox {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: rgba(0, 0, 0, 0.92);
    overflow: hidden;
}

/* Only when open, or the closed pop-up would show */
dialog.ab-acf-lightbox[open] {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Shown at its real size, shrunk only if it is bigger than the screen */
dialog.ab-acf-lightbox .ab-acf-lightbox-content img,
dialog.ab-acf-lightbox .ab-acf-lightbox-content video {
    display: block;
    width: auto;
    height: auto;
    max-width: 95vw;
    max-height: 88vh;
    margin: 0;
}

dialog.ab-acf-lightbox .ab-acf-lightbox-content img.ab-acf-lightbox-svg {
    width: 95vw;
    height: 88vh;
    object-fit: contain;
}

dialog.ab-acf-lightbox button.ab-acf-lightbox-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 40px;
    height: 40px;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: none;
    color: #fff;
    font-size: 28px;
    line-height: 40px;
    cursor: pointer;
}

dialog.ab-acf-lightbox button.ab-acf-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Left and right arrows, only for sections with more than one file */
dialog.ab-acf-lightbox button.ab-acf-lightbox-nav {
    display: none;
    position: absolute;
    top: 50%;
    width: 48px;
    height: 48px;
    min-width: 0;
    min-height: 0;
    margin: -24px 0 0;
    padding: 0 0 6px;
    border: 0;
    border-radius: 50%;
    background: rgba(90, 90, 90, 0.65);
    box-shadow: none;
    color: #fff;
    font-size: 36px;
    line-height: 42px;
    cursor: pointer;
}

dialog.ab-acf-lightbox.ab-acf-lightbox-multi button.ab-acf-lightbox-nav {
    display: block;
}

dialog.ab-acf-lightbox button.ab-acf-lightbox-nav:hover {
    background: rgba(130, 130, 130, 0.85);
}

dialog.ab-acf-lightbox button.ab-acf-lightbox-prev {
    left: 8px;
}

dialog.ab-acf-lightbox button.ab-acf-lightbox-next {
    right: 8px;
}

/* On wider screens, leave room so the arrows don't cover the image or movie */
@media (min-width: 601px) {
    dialog.ab-acf-lightbox.ab-acf-lightbox-multi .ab-acf-lightbox-content img,
    dialog.ab-acf-lightbox.ab-acf-lightbox-multi .ab-acf-lightbox-content video {
        max-width: calc(100vw - 128px);
    }

    dialog.ab-acf-lightbox.ab-acf-lightbox-multi .ab-acf-lightbox-content img.ab-acf-lightbox-svg {
        width: calc(100vw - 128px);
    }
}

/* Preview bar for sections with more than one image or movie */

.ab-acf-gallery {
    width: 100%;
}

.ab-acf-gallery .ab-acf-gallery-item[hidden] {
    display: none !important;
}

.ab-acf-gallery .ab-acf-thumbs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
}

/* The longer selectors stop theme button styles from changing the previews */
.ab-acf-gallery .ab-acf-thumbs button.ab-acf-thumb {
    position: relative;
    flex: 0 0 auto;
    width: 80px;
    height: 60px;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 4px;
    background: #f0f0f0;
    box-shadow: none;
    color: #333;
    line-height: 1;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.6;
}

.ab-acf-gallery .ab-acf-thumbs button.ab-acf-thumb:hover {
    opacity: 1;
}

.ab-acf-gallery .ab-acf-thumbs button.ab-acf-thumb[aria-pressed="true"] {
    border-color: #333;
    opacity: 1;
}

.ab-acf-gallery .ab-acf-thumbs button.ab-acf-thumb:focus-visible {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

.ab-acf-gallery .ab-acf-thumbs .ab-acf-thumb img,
.ab-acf-gallery .ab-acf-thumbs .ab-acf-thumb video {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: none;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    object-fit: cover;
    pointer-events: none;
}

/* Play symbol over movie previews */
.ab-acf-gallery .ab-acf-thumb-play {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.65);
    pointer-events: none;
}

.ab-acf-gallery .ab-acf-thumb-play::after {
    content: "";
    position: absolute;
    top: 7px;
    left: 9px;
    border-style: solid;
    border-width: 5px 0 5px 8px;
    border-color: transparent transparent transparent #fff;
}
