@import "../components/image-lightbox.css";

/* Catalogue owns the shared palette, hero, shell, cards and grid breakpoints. */
.ota-gallery__heading { padding-bottom:18px; border-bottom:1px solid var(--ota-cat-border); }
.ota-gallery__heading h2 { margin:0; color:var(--ota-cat-green); font:600 17px/1.4 var(--ota-cat-serif); letter-spacing:.05em; text-transform:uppercase; }
.ota-gallery__heading p { margin:0; color:var(--ota-cat-muted); font-size:14px; line-height:1.6; }
.ota-gallery__card { margin:0; }
.ota-gallery__media-link { flex-shrink:0; }
.ota-gallery__card--image-only .ota-gallery__media-link { flex:1; display:flex; }
.ota-gallery__card--image-only .ota-gallery__media { height:100%; }
.ota-gallery__title { margin:0; color:var(--ota-cat-green); font:600 17px/1.25 var(--ota-cat-serif); letter-spacing:.05em; text-transform:uppercase; overflow-wrap:anywhere; }
.ota-gallery__caption { margin:10px 0 0; color:var(--ota-cat-muted); font-size:15px; line-height:1.65; overflow-wrap:anywhere; }
.ota-gallery__caption:first-child { margin-top:0; }
.ota-gallery__card:focus-within,
.ota-gallery__empty a:focus-visible { outline:2px solid var(--ota-cat-green); outline-offset:4px; }
.ota-gallery__lightbox {
    --ota-detail-green: var(--ota-cat-green);
    --ota-detail-paper-2: var(--ota-cat-paper-2);
    --ota-detail-muted: var(--ota-cat-muted);
    width: min(1040px, calc(100% - 1.5rem));
    max-width: none;
    max-height: calc(100dvh - 1.5rem);
    padding: 0;
    border: 0;
    background: transparent;
    overflow: auto;
}

.ota-gallery__lightbox::backdrop {
    background: rgba(6, 27, 19, .82);
    backdrop-filter: blur(7px);
}

html:has(.ota-gallery__lightbox[open]) { overflow: hidden; }

.ota-gallery__lightbox .ota-detail__lightbox-panel {
    box-sizing: border-box;
    margin: 0;
}

.ota-gallery__lightbox .ota-detail__lightbox-frame { isolation: isolate; }
.ota-gallery__lightbox .ota-detail__lightbox-frame form { margin: 0; }
.ota-gallery__lightbox .ota-detail__lightbox-image { max-height: min(72dvh, 100dvh - 7rem); }
.ota-gallery__lightbox .ota-detail__lightbox-image[hidden] { display: none; }
.ota-gallery__lightbox .ota-detail__lightbox-footer:not(:has(> :not([hidden]))) { display: none; }
.ota-gallery__lightbox-error { margin: 0; padding: 4.5rem 3.5rem; text-align: center; }
.ota-gallery__lightbox [data-gallery-caption] { overflow-wrap: anywhere; white-space: pre-line; }
.ota-gallery__lightbox-count { margin-inline-start: auto; flex: 0 0 auto; font-variant-numeric: tabular-nums; }

.ota-gallery--mosaic .ota-gallery__grid { grid-auto-flow:dense; }
.ota-gallery--mosaic .ota-gallery__card:nth-child(5n + 1) { grid-column:span 2; grid-row:span 2; }
.ota-gallery--mosaic .ota-gallery__card:nth-child(5n + 1) .ota-gallery__media { aspect-ratio:1 / 1; }
@media (max-width:780px) {
 .ota-gallery__heading h2,.ota-gallery__title { font-size:14px; }
}
@media (max-width:480px) {
 .ota-gallery--mosaic .ota-gallery__card:nth-child(5n + 1) { grid-column:auto; grid-row:auto; }
 .ota-gallery--mosaic .ota-gallery__card:nth-child(5n + 1) .ota-gallery__media { aspect-ratio:1 / .70; }
}
@media (prefers-reduced-motion:reduce) {
 .ota-gallery__card,.ota-gallery__media,.ota-gallery__media-link::after,.ota-gallery__empty a { transition:none; }
 .ota-gallery__card:hover,.ota-gallery__card:hover .ota-gallery__media { transform:none; }
}
