/* Shared image viewer. Opt in with the native gallery style or data-mpf-gallery. */
[data-mpf-gallery] figure a, .is-style-mpf-lightbox figure a { cursor: zoom-in; }
.mpf-sde-gallery-open { overflow: hidden; }
.mpf-sde-gallery-dialog { width: min(1360px, calc(100vw - 32px)); max-width: calc(100vw - 32px); max-height: calc(100dvh - 32px); padding: 0; margin: auto; border: 1px solid rgb(255 255 255 / 15%); border-radius: 10px; background: #111b29; color: #fff; box-shadow: 0 24px 100px rgb(0 0 0 / 45%); overflow: auto; }
.mpf-sde-gallery-dialog::backdrop { background: rgb(7 14 24 / 90%); }
.mpf-sde-gallery-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .75rem 1rem; }
.mpf-sde-gallery-header h2 { margin: 0; color: #fff; font: 600 1rem/1.3 var(--wp--preset--font-family--display); }
.mpf-sde-gallery-dialog button { display: grid; place-items: center; width: 44px; height: 44px; flex-shrink: 0; padding: .5rem; border: 1px solid rgb(255 255 255 / 35%); border-radius: 50%; background: transparent; cursor: pointer; }
.mpf-sde-gallery-dialog button:hover:not(:disabled) { background: rgb(255 255 255 / 15%); }
.mpf-sde-gallery-dialog button:disabled { opacity: .35; cursor: default; }
.mpf-sde-gallery-dialog button img { display: block; width: 24px; height: 24px; filter: invert(1); }
.mpf-sde-gallery-dialog button:focus-visible, .mpf-sde-gallery-dialog a:focus-visible { outline: 3px solid #7daddd; outline-offset: 3px; }
.mpf-sde-gallery-stage { position: relative; display: grid; place-items: center; background: #060d17; min-height: 150px; touch-action: pan-y pinch-zoom; }
.mpf-sde-gallery-loading { display: none; position: absolute; inset: 0; place-items: center; color: #b3c5d7; font-size: .9rem; }
.mpf-sde-gallery-stage[data-loading] .mpf-sde-gallery-loading { display: grid; }
.mpf-sde-gallery-stage[data-loading] > img { opacity: 0; }
.mpf-sde-gallery-stage > img { display: block; max-width: 100%; width: auto; height: auto; max-height: calc(100dvh - 235px); object-fit: contain; }
.mpf-sde-gallery-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem; }
.mpf-sde-gallery-prev img { transform: rotate(180deg); }
.mpf-sde-gallery-info { min-width: 0; text-align: center; }
.mpf-sde-gallery-counter { color: #b3c5d7; font: 400 .8rem/1.3 var(--wp--preset--font-family--mono); }
.mpf-sde-gallery-caption { margin: .4rem 0; font: 400 1rem/1.4 var(--wp--preset--font-family--body); }
.mpf-sde-gallery-original { display: inline-flex; align-items: center; min-height: 44px; color: #b5d5f3; text-underline-offset: .2em; font-size: .85rem; }
@media (max-width: 600px) {
    .mpf-sde-gallery-dialog { width: calc(100vw - 20px); max-width: calc(100vw - 20px); max-height: calc(100dvh - 20px); }
    .mpf-sde-gallery-header, .mpf-sde-gallery-footer { padding: .7rem; gap: .65rem; }
    .mpf-sde-gallery-header h2 { font-size: .9rem; }
    .mpf-sde-gallery-caption { font-size: .9rem; }
    .mpf-sde-gallery-stage > img { max-height: calc(100dvh - 265px); }
}
@media print { .mpf-sde-gallery-dialog { display: none; } }
