body.onecat-site [data-ocm-gallery] [data-ocm-item] { display: block; padding: 0; border: 0; background: #f2f4f3; color: inherit; cursor: pointer; overflow: hidden; }
body.onecat-site [data-ocm-gallery] [data-ocm-item] img, body.onecat-site [data-ocm-gallery] [data-ocm-item] video { display: block; width: 100%; height: auto; max-height: 460px; object-fit: contain; }
/* The media buttons, rather than their nested images, are the grid items.
   Preserve the existing food layout and crew mosaic for editable galleries. */
body.onecat-site [data-ocm-gallery] > [data-ocm-item] { position: relative; min-width: 0; min-height: 0; border-radius: 0; }
body.onecat-site [data-ocm-gallery] > [data-ocm-item] > span { position: absolute; bottom: 12px; left: 12px; padding: 7px 10px; background: #102720; color: #fff; font: inherit; font-size: .8rem; }
body.onecat-site [data-ocm-gallery="food"] { min-height: 0; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-rows: none; grid-auto-rows: auto; gap: 18px; align-items: start; }
body.onecat-site [data-ocm-gallery="food"] > [data-ocm-item] { grid-column: span 4; grid-row: auto; width: 100%; height: 320px; }
body.onecat-site [data-ocm-gallery="food"] > [data-ocm-item]:nth-child(n+4) { grid-column: span 3; height: auto; aspect-ratio: 1; }
body.onecat-site [data-ocm-gallery="food"] > [data-ocm-item] > img,
body.onecat-site [data-ocm-gallery="food"] > [data-ocm-item] > video { width: 100%; height: 100%; max-height: none; object-fit: cover; }
body.onecat-site [data-ocm-gallery="food"] > [data-ocm-item]:nth-child(n+4) > img,
body.onecat-site [data-ocm-gallery="food"] > [data-ocm-item]:nth-child(n+4) > video { object-fit: contain; }
body.onecat-site [data-ocm-gallery="crew"] { min-height: 0; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-rows: repeat(3, 170px); grid-auto-rows: 170px; gap: 12px; }
body.onecat-site [data-ocm-gallery="crew"] > [data-ocm-item] { grid-column: span 3; grid-row: auto; width: 100%; height: 100%; }
body.onecat-site [data-ocm-gallery="crew"] > [data-ocm-item]:nth-child(1) { grid-column: 1 / span 7; grid-row: 1 / span 2; }
body.onecat-site [data-ocm-gallery="crew"] > [data-ocm-item]:nth-child(2) { grid-column: 8 / span 5; grid-row: 1; }
body.onecat-site [data-ocm-gallery="crew"] > [data-ocm-item]:nth-child(3) { grid-column: 8 / span 5; grid-row: 2; }
body.onecat-site [data-ocm-gallery="crew"] > [data-ocm-item] > img,
body.onecat-site [data-ocm-gallery="crew"] > [data-ocm-item] > video { width: 100%; height: 100%; max-height: none; object-fit: cover; }
/* A destination keeps its original full-size figure. Any additional media
   remain reachable by scrolling and through the existing full-screen viewer. */
body.onecat-site .destination-row .ocm-destination-gallery { display: flex; width: 100%; height: 100%; min-height: 0; gap: 0; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; }
body.onecat-site .destination-row .ocm-destination-gallery > [data-ocm-item] { flex: 0 0 100%; width: 100%; height: 100%; scroll-snap-align: start; }
body.onecat-site .destination-row .ocm-destination-gallery > [data-ocm-item] > img,
body.onecat-site .destination-row .ocm-destination-gallery > [data-ocm-item] > video { width: 100%; height: 100%; max-height: none; object-fit: cover; }
/* Journal previews retain the original 330px/260px card row while showing
   the whole image, including portrait-format covers. */
body.onecat-site .oc-logbook-article-grid > article > .oc-logbook-card-image { height: 100%; min-height: 0; aspect-ratio: auto; align-self: stretch; background: #ede9e2; }
body.onecat-site .oc-logbook-article-grid > article > .oc-logbook-card-image img { display: block; position: static; width: 100%; height: 100%; max-height: 100%; object-fit: contain; object-position: center; transform: none; aspect-ratio: auto; }
body.onecat-site [data-ocm-gallery] [data-ocm-item]:focus-visible, [data-ocm-plan] button:focus-visible { outline: 3px solid #1c6557; outline-offset: 4px; }
[data-ocm-plan] .zone-gallery-open { background: #102720; }
[data-ocm-plan] .zone-gallery-open > img { object-fit: contain; }
.ocm-video-placeholder { display: flex; min-height: 240px; width: 100%; align-items: center; justify-content: center; color: #fff; font-size: 1.2rem; }
[data-ocm-plan] .zone-gallery-open > .ocm-video-placeholder { position: static; background: none; }
.ocm-video-thumb { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; background: #193d32; color: #fff; }
.ocm-dialog { position: fixed; inset: 0; width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 64px 70px 34px; border: 0; background: rgba(5,16,13,.97); color: white; box-sizing: border-box; }
.ocm-dialog:not([open]) { display: none; }
.ocm-dialog[open] { display: grid; align-items: center; }
.ocm-dialog::backdrop { background: rgba(0,0,0,.8); }
.ocm-dialog-figure { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; min-height: 0; height: 100%; margin: 0; gap: 14px; }
.ocm-dialog-stage { display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 0; flex: 1 1 auto; width: 100%; }
.ocm-dialog-stage img, .ocm-dialog-stage video { display: block; width: auto; height: auto; max-width: 100%; max-height: calc(100dvh - 155px); object-fit: contain; }
.ocm-dialog-stage video { width: min(1200px,100%); }
.ocm-dialog-caption { display: flex; width: min(1100px,100%); justify-content: space-between; gap: 20px; font-size: .9rem; line-height: 1.5; flex: 0 0 auto; }
.ocm-dialog-caption span:first-child { overflow-wrap: anywhere; }
.ocm-dialog-caption span:last-child { flex-shrink: 0; }
.ocm-dialog button { position: absolute; width: 46px; height: 46px; padding: 0; border: 1px solid rgba(255,255,255,.55); border-radius: 50%; background: #193d32; color: white; cursor: pointer; font-size: 25px; }
.ocm-dialog button:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.ocm-dialog button[hidden] { display: none; }
.ocm-dialog-close { top: 12px; right: 18px; }
.ocm-dialog-prev { left: 14px; top: calc(50% - 23px); }
.ocm-dialog-next { right: 14px; top: calc(50% - 23px); }
@media(max-width:760px) {
 body.onecat-site [data-ocm-gallery="food"] { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
 body.onecat-site [data-ocm-gallery="food"] > [data-ocm-item]:nth-child(n) { grid-column: auto; grid-row: auto; height: auto; aspect-ratio: 1; }
 body.onecat-site [data-ocm-gallery="food"] > [data-ocm-item]:first-child { grid-column: 1 / -1; max-height: 380px; aspect-ratio: 4 / 3; }
 body.onecat-site [data-ocm-gallery="crew"] { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: 360px; grid-auto-rows: 190px; gap: 10px; }
 body.onecat-site [data-ocm-gallery="crew"] > [data-ocm-item]:nth-child(n) { grid-column: auto; grid-row: auto; }
 body.onecat-site [data-ocm-gallery="crew"] > [data-ocm-item]:first-child { grid-column: 1 / -1; grid-row: 1; }
 .ocm-dialog { padding: 65px 10px 78px; }
 .ocm-dialog-stage img, .ocm-dialog-stage video { max-height: calc(100dvh - 200px); }
 .ocm-dialog-prev,.ocm-dialog-next { top: auto; bottom: 14px; }
 .ocm-dialog-prev { left: calc(50% - 58px); }
 .ocm-dialog-next { right: calc(50% - 58px); }
 .ocm-dialog-caption { font-size: .8rem; }
}
/* Events keep their cover and copy. Every managed media item also appears
   in an expanded grid, without changing the stored gallery or its order. */
body.onecat-site .oc-events-cards { align-items: start; }
body.onecat-site .oc-events-cards > article[data-ocm-expanded-event] { grid-template-rows: 310px auto auto; min-height: 0; }
body.onecat-site .oc-events-cards > article[data-ocm-expanded-event] > .oc-events-card-copy { min-height: 300px; box-sizing: border-box; }
body.onecat-site .oc-events-cards > article > .ocm-event-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 12px; padding: 0 24px 24px; }
body.onecat-site .oc-events-cards .ocm-event-gallery > [data-ocm-item] { display: flex; align-items: center; justify-content: center; width: 100%; height: auto; aspect-ratio: 4 / 3; text-decoration: none; background: #ede9e2; }
body.onecat-site .oc-events-cards .ocm-event-gallery > [data-ocm-item] > img,
body.onecat-site .oc-events-cards .ocm-event-gallery > [data-ocm-item] > video { display: block; position: static; width: 100%; height: 100%; max-height: 100%; object-fit: contain; object-position: center; transform: none; }
@media (max-width: 760px) {
 body.onecat-site .oc-events-cards > article[data-ocm-expanded-event] { grid-template-rows: 270px auto auto; }
 body.onecat-site .oc-events-cards > article[data-ocm-expanded-event] > .oc-events-card-copy { min-height: 0; }
}
@media (max-width: 520px) {
 body.onecat-site .oc-events-cards > article > .ocm-event-gallery { grid-template-columns: minmax(0, 1fr); }
}
