/* Navigation follows the artwork's middle, while the dots keep their own row. */
.site-main .carousel[data-image-gallery] .carousel-item { transition: transform .32s cubic-bezier(.2,.65,.25,1); }
.site-main .carousel > :is(.carousel-control-prev, .carousel-control-next) {
    position: relative;
    grid-row: 1;
    align-self: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    opacity: 1;
    z-index: 3;
    transition: opacity .15s ease;
}
.site-main .carousel > :is(.carousel-control-prev, .carousel-control-next)::before { content: ''; position: absolute; width: 22px; height: 22px; border: 1px solid #ffffff40; border-radius: 50%; background: #080808cc; box-shadow: 0 2px 8px #0005; transition: background-color .18s ease, border-color .18s ease; }
.site-main .carousel > .carousel-control-prev { justify-self: start; margin-left: 12px; }
.site-main .carousel > .carousel-control-next { justify-self: end; margin-right: 12px; }
.site-main :is(.carousel-control-prev-icon, .carousel-control-next-icon) { position: relative; z-index: 1; width: 9px; height: 9px; background-size: 9px 9px; }
.site-main .carousel > :is(.carousel-control-prev, .carousel-control-next):is(:hover, :focus-visible)::before { background: #151515f0; border-color: #ffffffa0; }
.site-main .carousel[tabindex="-1"]:focus { outline: none; }
.image-modal .modal-body { position: relative; display: flex; align-items: center; justify-content: center; height: min(82svh, 1000px); padding: 0; touch-action: pan-y; }
.image-modal img.modal-image, .image-modal img.modal-image.image-fade { position: relative; z-index: 2; width: 100%; height: 100%; max-height: 100%; object-fit: contain; opacity: 1; transition: none; }
.image-modal .gallery-outgoing { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.image-modal .gallery-outgoing img { position: absolute; inset: 0; width: 100%; height: 100%; max-height: 100%; object-fit: contain; }
/* Show the artwork directly over the backdrop, without a surrounding panel. */
.image-modal .modal-content,
.image-modal .modal-body,
.image-modal :is(.modal-image, .gallery-outgoing, .gallery-snapshot-image) { background: transparent; border: 0; box-shadow: none; }
.image-modal .modal-content { border-radius: 0; padding: 0; }
body.mgn-cutout-viewer-open > .modal-backdrop { background-color: #0009; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
body.mgn-cutout-viewer-open > .modal-backdrop.show { opacity: 1; }
.image-modal-close { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; top: 14px; right: 14px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #fff; z-index: 5; }
.image-modal-close::before { content: ''; position: absolute; width: 20px; height: 20px; border: 1px solid #777; border-radius: 50%; background: #000d; transition: background-color .18s ease, border-color .18s ease; }
.image-modal-close span { position: relative; z-index: 1; font-size: 13px; line-height: 1; }
.image-modal-close:hover::before { background: #222e; border-color: #bbb; }
.image-modal :is(.image-modal-prev, .image-modal-next) {
    position: absolute; top: 50%; transform: translateY(-50%);
    display: flex; align-items: center; justify-content: center;
    width: 48px; height: 48px; padding: 0; z-index: 3;
    border: 0; border-radius: 50%;
    color: #fff; background: transparent;
    cursor: pointer; transition: opacity .15s ease;
}
.image-modal :is(.image-modal-prev, .image-modal-next)::before { content: ''; position: absolute; width: 24px; height: 24px; border: 1px solid #ffffff50; border-radius: 50%; background: #080808d9; box-shadow: 0 2px 8px #0006; transition: background-color .18s ease, border-color .18s ease; }
.image-modal-prev { left: 8px; }
.image-modal-next { right: 8px; }
.image-modal :is(.image-modal-prev, .image-modal-next):hover::before { background: #222e; border-color: #fff9; }
.image-modal :is(.image-modal-prev, .image-modal-next, .image-modal-close):focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.image-modal :is(.image-modal-prev, .image-modal-next) svg { position: relative; z-index: 1; width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.image-modal .image-modal-position { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); padding: 6px 12px; margin: 0; border: 1px solid #ffffff30; border-radius: 20px; background: #000c; color: #ddd; font-size: 12px; font-variant-numeric: tabular-nums; pointer-events: none; z-index: 3; }
.image-modal [data-gallery-message]:not(.visually-hidden) { position: absolute; left: 50%; bottom: 50px; transform: translateX(-50%); z-index: 3; width: max-content; max-width: calc(100% - 24px); margin: 0; padding: 8px 12px; border-radius: 9px; color: #eee; background: #000e; font-size: 12px; text-align: center; }
.image-modal [hidden] { display: none !important; }
@media (hover: hover) and (pointer: fine) {
    .site-main .carousel > :is(.carousel-control-prev, .carousel-control-next), .image-modal :is(.image-modal-prev, .image-modal-next) { opacity: 0; pointer-events: none; }
    .site-main .carousel:hover > :is(.carousel-control-prev, .carousel-control-next), .image-modal .modal-body:hover :is(.image-modal-prev, .image-modal-next),
    .site-main .carousel > :is(.carousel-control-prev, .carousel-control-next):focus-visible, .image-modal :is(.image-modal-prev, .image-modal-next):focus-visible { opacity: 1; pointer-events: auto; }
}
@media (max-width: 600px) {
    .site-main .carousel > .carousel-control-prev { margin-left: 8px; }
    .site-main .carousel > .carousel-control-next { margin-right: 8px; }
    .image-modal { --bs-modal-width: calc(100vw - 24px); }
    .image-modal .modal-dialog { margin: 12px; min-height: calc(100% - 24px); }
    .image-modal .modal-content { padding: 0; border-radius: 0; }
    .image-modal .modal-body { height: 80svh; }
    .image-modal :is(.image-modal-prev, .image-modal-next) { width: 44px; height: 44px; }
    .image-modal-close { top: 8px; right: 8px; }
    .image-modal-close::before { width: 18px; height: 18px; }
    .image-modal-close span { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
    .site-main .carousel[data-image-gallery] .carousel-item { transition: none; }
    .site-main .carousel > :is(.carousel-control-prev, .carousel-control-next), .site-main .carousel > :is(.carousel-control-prev, .carousel-control-next)::before,
    .image-modal :is(.image-modal-prev, .image-modal-next, .image-modal-close)::before,
    .image-modal :is(.image-modal-prev, .image-modal-next), .image-modal img.modal-image, .image-modal img.modal-image.image-fade { transition: none; }
}
