/* Screenshot lightbox (pairs with assets/js/lightbox.js). Native <dialog>, no dependencies. */
html.ccms-lb-open { overflow: hidden; }

.ccms-lb {
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
}
.ccms-lb[open] { display: block; }
.ccms-lb::backdrop { background: rgba(8, 12, 20, 0.92); }

.ccms-lb__stage {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 4rem 0.75rem 1rem;
}
.ccms-lb__figure {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 100%;
    margin: 0;
}
.ccms-lb__img {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 8rem);
    max-height: calc(100dvh - 8rem);
    width: auto;
    height: auto;
    flex: 0 0 auto;
    border-radius: 0.5rem;
    background: #fff;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.5);
}
.ccms-lb.is-loading .ccms-lb__img { opacity: 0.35; }
.ccms-lb__caption {
    margin-top: 0.75rem;
    max-width: 60rem;
    font-size: 0.9rem;
    line-height: 1.4;
    text-align: center;
    color: rgba(255, 255, 255, 0.85);
}

.ccms-lb__btn {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    cursor: pointer;
}
.ccms-lb__btn[hidden] { display: none; }
.ccms-lb__btn:hover { background: rgba(255, 255, 255, 0.3); }
.ccms-lb__btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.ccms-lb__close { top: max(0.75rem, env(safe-area-inset-top)); right: max(0.75rem, env(safe-area-inset-right)); }
.ccms-lb__prev,
.ccms-lb__next { top: 50%; transform: translateY(-50%); }
.ccms-lb__prev { left: max(0.5rem, env(safe-area-inset-left)); }
.ccms-lb__next { right: max(0.5rem, env(safe-area-inset-right)); }

@media (max-width: 575.98px) {
    /* Arrows sit below the image on phones so they never cover the screenshot. */
    .ccms-lb__stage { padding-bottom: 4.5rem; }
    .ccms-lb__prev,
    .ccms-lb__next { top: auto; bottom: max(0.75rem, env(safe-area-inset-bottom)); transform: none; }
    .ccms-lb__prev { left: calc(50% - 3.25rem); }
    .ccms-lb__next { right: calc(50% - 3.25rem); }
}

@media (prefers-reduced-motion: no-preference) {
    .ccms-lb[open] { animation: ccms-lb-in 0.18s ease-out; }
    .ccms-lb__img { transition: opacity 0.15s ease; }
    @keyframes ccms-lb-in { from { opacity: 0; } to { opacity: 1; } }
}
