/**
 * Lightbox gallery — assets/js/lightbox.js
 *
 * Classes: .lightbox-trigger, .lightbox, .lightbox__header, .lightbox__caption,
 * .lightbox__inner, .lightbox__close, .lightbox__prev, .lightbox__next,
 * .lightbox__figure, .lightbox__image
 */

 .lightbox-trigger {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: none;
    cursor: zoom-in;
    border-radius: var(--border-radius-s);
    text-align: inherit;
    transition: opacity 0.15s ease;
}

.lightbox-trigger:hover,
.lightbox-trigger:focus-visible {
    opacity: 0.9;
}

.lightbox-trigger:focus-visible {
    outline: 2px solid var(--brand-colour-link-dark);
    outline-offset: 2px;
}

.lightbox {
    width: min(100vw, 100%);
    max-width: none;
    height: 100%;
    max-height: none;
    padding: 0;
    margin: 0;
    border: 0;
    background: rgb(15 20 30 / 97%);
    color: var(--brand-colour-text);
}

.lightbox::backdrop {
    background: transparent;
}

.lightbox__header {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1;
    padding: 1.75rem 4.5rem 1rem;
    pointer-events: none;
}

.lightbox__caption {
    max-width: min(1200px, 100%);
    margin: 0 auto;
    text-align: center;
    font-size: 1.125rem;
    line-height: 1.4;
}

.lightbox__caption:empty {
    display: none;
}

.lightbox__inner {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 100%;
    padding: 6.5rem 1rem 2rem;
    box-sizing: border-box;
}

.lightbox__figure {
    margin: 0;
    max-width: min(1200px, 100%);
}

.lightbox__image {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 8rem);
    width: auto;
    height: auto;
    margin: 0 auto;
    object-fit: contain;
}

.lightbox__close,
.lightbox__prev,
.lightbox__next {
    position: fixed;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border: 0;
    border-radius: var(--border-radius-s);
    background: #fff;
    color: #000;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.lightbox__close:hover,
.lightbox__close:focus-visible,
.lightbox__prev:hover,
.lightbox__prev:focus-visible,
.lightbox__next:hover,
.lightbox__next:focus-visible {
    background: var(--brand-colour-surface-hover);
    color: #fff;
}

.lightbox__close:focus-visible,
.lightbox__prev:focus-visible,
.lightbox__next:focus-visible {
    outline: 2px solid var(--brand-colour-link-light);
    outline-offset: 2px;
}

.lightbox__close {
    top: var(--space-block);
    right: var(--space-block);
    background-color: #fff;
    color: var(--brand-colour-primary);
}

.lightbox__prev {
    top: 50%;
    left: var(--space-block);
    transform: translateY(-50%);
}

.lightbox__next {
    top: 50%;
    right: var(--space-block);
    transform: translateY(-50%);
}

.lightbox__close svg,
.lightbox__prev svg,
.lightbox__next svg {
    width: 1.25rem;
    height: 1.25rem;
}
