.tscsw-gallery-trigger {
    cursor: zoom-in;
}

button.tscsw-gallery-trigger {
    display: inline-block;
    max-width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    vertical-align: top;
}

.tscsw-lightbox-open {
    overflow: hidden;
}

.tscsw-lightbox {
    box-sizing: border-box;
    position: fixed;
    inset: 0;
    width: min(74rem, calc(100% - 2rem));
    height: min(52rem, calc(100% - 2rem));
    max-width: none;
    max-height: none;
    margin: auto;
    padding: 0;
    border: 1px solid #4c5965;
    border-radius: .75rem;
    background: #0e1e30;
    color: #fff9ef;
    font: 400 1rem/1.5 'TSC Instrument Sans', Arial, sans-serif;
    color-scheme: dark;
    overscroll-behavior: contain;
}

.tscsw-lightbox::backdrop {
    background: rgba(5, 12, 22, .86);
}

.tscsw-lightbox [hidden] {
    display: none;
}

.tscsw-lightbox-layout {
    box-sizing: border-box;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: .5rem;
    height: 100%;
    padding: .75rem;
}

.tscsw-lightbox-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    min-height: 2.75rem;
    padding-inline-start: .5rem;
}

.tscsw-lightbox-position {
    color: #e0e7eb;
    font-size: .875rem;
    font-variant-numeric: tabular-nums;
}

.tscsw-lightbox-stage {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: minmax(0, 1fr);
    align-items: center;
    gap: clamp(.25rem, 1.25vw, 1rem);
    min-height: 0;
}

.tscsw-lightbox-figure {
    display: grid;
    grid-column: 2;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: .5rem;
    align-self: stretch;
    width: 100%;
    min-height: 0;
    margin: 0;
}

.tscsw-lightbox-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.tscsw-lightbox-caption {
    max-height: min(8rem, 25vh);
    padding: .25rem 0;
    overflow: auto;
    overflow-wrap: anywhere;
    color: #fff9ef;
    font-size: .9375rem;
    text-align: center;
}

.tscsw-lightbox button {
    box-sizing: border-box;
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border: 1px solid #77818c;
    border-radius: 50%;
    background: transparent;
    color: #fff9ef;
    font: 400 1.8rem/1 Arial, sans-serif;
    cursor: pointer;
}

.tscsw-lightbox button:hover {
    border-color: #f2b277;
    color: #f2b277;
}

.tscsw-lightbox button:focus-visible {
    outline: 2px solid #f2b277;
    outline-offset: 2px;
}

@media (max-width: 34rem) {
    .tscsw-lightbox {
        width: calc(100% - 1rem);
        height: calc(100% - 1rem);
    }

    .tscsw-lightbox-layout {
        padding: .5rem;
    }

    .tscsw-lightbox-stage {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: minmax(0, 1fr) auto;
    }

    .tscsw-lightbox-figure {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    .tscsw-lightbox-previous {
        grid-row: 2;
        justify-self: end;
    }

    .tscsw-lightbox-next {
        grid-row: 2;
        justify-self: start;
    }
}
