/* MPD Image Gallery & Lightbox: intentionally scoped to avoid theme conflicts. */
.mpd-gallery{width:100%;max-width:100%;box-sizing:border-box}
.mpd-gallery *, .mpd-lightbox *{box-sizing:border-box}
.mpd-gallery-cell,.mpd-feature{margin:0;min-width:0}
.mpd-gallery .mpd-gallery-list{display:grid;grid-template-columns:repeat(var(--mpd-cols,4),minmax(0,1fr));gap:var(--mpd-gap,12px);align-items:start}
.mpd-gallery .mpd-gallery-item{display:block;width:100%;min-width:0;position:relative;cursor:zoom-in;color:inherit;text-decoration:none;overflow:hidden;line-height:0;background:#eee}
.mpd-gallery .mpd-gallery-image{display:block;width:100%;height:auto;aspect-ratio:1/1;object-fit:cover;transition:transform .22s ease}
.mpd-gallery .mpd-gallery-item:hover .mpd-gallery-image{transform:scale(1.035)}
.mpd-gallery .mpd-gallery-item:focus-visible,.mpd-gallery .mpd-feature-link:focus-visible{outline:3px solid #1877d2;outline-offset:3px}
.mpd-gallery--rounded .mpd-gallery-item,.mpd-gallery--rounded .mpd-feature-link{border-radius:10px}
.mpd-gallery--ratio-landscape .mpd-gallery-image{aspect-ratio:4/3}
.mpd-gallery--ratio-portrait .mpd-gallery-image{aspect-ratio:3/4}
.mpd-gallery--ratio-natural .mpd-gallery-image{aspect-ratio:auto}
.mpd-gallery .mpd-gallery-caption,.mpd-gallery .mpd-feature-caption{font-size:.875rem;line-height:1.45;margin:7px 0 0;color:inherit;overflow-wrap:anywhere}
.mpd-gallery--row .mpd-gallery-list{display:flex;flex-wrap:nowrap;overflow-x:auto;scroll-snap-type:x proximity;overscroll-behavior-inline:contain;scrollbar-width:thin;padding:3px 2px 10px;align-items:flex-start}
.mpd-gallery--row .mpd-gallery-cell{flex:0 0 clamp(136px,18vw,235px);scroll-snap-align:start}
.mpd-gallery--masonry .mpd-gallery-list{display:block;columns:var(--mpd-cols,4);column-gap:var(--mpd-gap,12px)}
.mpd-gallery--masonry .mpd-gallery-cell{break-inside:avoid;margin:0 0 var(--mpd-gap,12px)}
.mpd-gallery--masonry .mpd-gallery-image{height:auto;aspect-ratio:auto}
.mpd-gallery--filmstrip .mpd-feature-link{display:block;line-height:0;cursor:zoom-in;overflow:hidden;background:#111}
.mpd-gallery--filmstrip .mpd-feature-image{width:100%;max-height:70vh;height:auto;object-fit:contain;display:block;margin-inline:auto}
.mpd-gallery--filmstrip .mpd-filmstrip-thumbs{display:flex;gap:var(--mpd-gap,12px);overflow-x:auto;padding:12px 2px 8px;scrollbar-width:thin}
.mpd-gallery--filmstrip .mpd-filmstrip-thumb{flex:0 0 90px;min-width:90px;width:90px;border:2px solid transparent;padding:0;appearance:none;cursor:pointer}
.mpd-gallery--filmstrip .mpd-filmstrip-thumb.is-selected{border-color:#2682d5}
.mpd-gallery--filmstrip .mpd-filmstrip-thumb:focus-visible{outline:3px solid #1877d2;outline-offset:2px}
.mpd-gallery--filmstrip .mpd-filmstrip-thumb .mpd-gallery-image{aspect-ratio:1/1;object-fit:cover}
@media(max-width:700px){
 .mpd-gallery .mpd-gallery-list{grid-template-columns:repeat(var(--mpd-cols-mobile,2),minmax(0,1fr))}
 .mpd-gallery--masonry .mpd-gallery-list{columns:var(--mpd-cols-mobile,2)}
 .mpd-gallery--row .mpd-gallery-cell{flex:0 0 min(45vw,210px)}
 .mpd-gallery--filmstrip .mpd-filmstrip-thumb{flex-basis:72px;min-width:72px;width:72px}
}
.mpd-lightbox{position:fixed;inset:0;z-index:2147483000;display:none;align-items:center;justify-content:center;background:rgba(0,0,0,.94);color:#fff;padding:58px 62px 72px}
.mpd-lightbox.is-open{display:flex}
.mpd-lightbox-content{display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;height:100%;max-width:1500px;min-width:0;min-height:0}
.mpd-lightbox-image{display:block;max-width:100%;max-height:100%;min-height:0;width:auto;height:auto;object-fit:contain;box-shadow:0 0 38px #0006}
.mpd-lightbox-caption{position:absolute;bottom:20px;left:70px;right:70px;text-align:center;font-size:15px;line-height:1.4;color:#fff;max-height:3em;overflow-y:auto}
.mpd-lightbox-counter{position:absolute;top:21px;left:24px;color:#ddd;font:500 14px/1.4 system-ui,sans-serif}
.mpd-lightbox-button{position:absolute;appearance:none;border:0;background:rgba(255,255,255,.14);color:white;cursor:pointer;font:400 27px/1 system-ui,sans-serif;display:flex;align-items:center;justify-content:center;border-radius:50%;width:45px;height:45px;transition:background .15s}
.mpd-lightbox-button:hover,.mpd-lightbox-button:focus-visible{background:rgba(255,255,255,.33)}
.mpd-lightbox-button:focus-visible{outline:2px solid white;outline-offset:3px}
.mpd-lightbox-close{right:20px;top:14px;font-size:31px}
.mpd-lightbox-prev{left:12px;top:50%;transform:translateY(-50%)}
.mpd-lightbox-next{right:12px;top:50%;transform:translateY(-50%)}
@media(max-width:650px){.mpd-lightbox{padding:52px 12px 88px}.mpd-lightbox-prev,.mpd-lightbox-next{top:auto;bottom:22px;transform:none}.mpd-lightbox-prev{left:14px}.mpd-lightbox-next{right:14px}.mpd-lightbox-caption{left:60px;right:60px;bottom:31px;font-size:13px;max-height:4em}.mpd-lightbox-close{right:12px;top:8px}}
@media(prefers-reduced-motion:reduce){.mpd-gallery .mpd-gallery-image{transition:none}.mpd-gallery .mpd-gallery-item:hover .mpd-gallery-image{transform:none}}
.mpd-gallery .mpd-row-controls:not([hidden]){display:flex;justify-content:flex-end;gap:7px;margin-top:7px}
.mpd-gallery .mpd-row-controls button{appearance:none;cursor:pointer;border:1px solid currentColor;border-radius:999px;color:inherit;background:transparent;width:34px;height:34px;font:500 19px/1 system-ui,sans-serif}
.mpd-gallery .mpd-row-controls button:disabled{opacity:.32;cursor:default}
.mpd-gallery .mpd-row-controls button:focus-visible{outline:3px solid #1877d2;outline-offset:2px}
