/* Scoped, low-specificity gallery frontend. No framework, no dependencies. */
.wp-block-smarteditor-gallery.sme-gallery{box-sizing:border-box;display:grid;grid-template-columns:repeat(var(--sme-gallery-columns,4),minmax(0,1fr));gap:var(--sme-gallery-gap,10px);width:100%;min-width:0;margin-block:1em}
.sme-gallery *{box-sizing:border-box}
.sme-gallery .sme-gallery__item{position:relative;min-width:0;margin:0;overflow:hidden;aspect-ratio:var(--sme-gallery-ratio,4/3);border:var(--sme-gallery-border-width,0px) solid var(--sme-gallery-border-color,transparent);border-radius:var(--sme-gallery-radius,0px);background:#eceef1}
.sme-gallery .sme-gallery__link{display:block;position:absolute;inset:0;overflow:hidden}
.sme-gallery .sme-gallery__image{display:block;width:100%;height:100%;object-fit:cover;object-position:center;max-width:none;max-height:none;aspect-ratio:inherit;transform:none;transition:transform 250ms ease}
.sme-gallery--hover-zoom .sme-gallery__link:hover .sme-gallery__image,.sme-gallery--hover-zoom .sme-gallery__link:focus-visible .sme-gallery__image{transform:scale(1.055)}
.sme-gallery .sme-gallery__link:focus-visible{outline:3px solid #1f5cd6;outline-offset:-3px}
.sme-gallery .sme-gallery__caption{position:absolute;bottom:0;left:0;right:0;max-height:55%;overflow:auto;margin:0;padding:18px 9px 8px;color:#fff;font:400 13px/1.4 system-ui,sans-serif;text-shadow:0 1px 2px #000;background:linear-gradient(transparent,rgba(0,0,0,.75));pointer-events:none}
.sme-gallery--justified{display:flex!important;flex-flow:row wrap;align-content:start;justify-content:space-between}
.sme-gallery--justified .sme-gallery__item{flex:1 1 calc((100% - (var(--sme-gallery-columns,4) - 1)*var(--sme-gallery-gap,10px))/var(--sme-gallery-columns,4));max-width:100%;min-width:0;}
.sme-gallery--justified::after{content:'';flex:1000 1 0;height:0}
.sme-gallery--masonry{display:block!important;columns:var(--sme-gallery-columns,4);column-gap:var(--sme-gallery-gap,10px)}
.sme-gallery--masonry .sme-gallery__item{display:block;break-inside:avoid;page-break-inside:avoid;overflow:hidden;margin:0 0 var(--sme-gallery-gap,10px);width:100%}
/* All masonry crops remain landscape; alternate between the two user-requested landscape ratios. */
.sme-gallery--masonry .sme-gallery__item:nth-child(3n+2){aspect-ratio:16/9}
.sme-gallery--masonry .sme-gallery__item:nth-child(3n+1){aspect-ratio:4/3}
@media(max-width:1000px){.wp-block-smarteditor-gallery.sme-gallery:not(.sme-gallery--masonry){grid-template-columns:repeat(min(var(--sme-gallery-columns,4),4),minmax(0,1fr))}.sme-gallery--masonry{columns:min(var(--sme-gallery-columns,4),4)}.sme-gallery--justified .sme-gallery__item{flex-basis:calc((100% - 3*var(--sme-gallery-gap,10px))/min(var(--sme-gallery-columns,4),4))}}
@media(max-width:680px){.wp-block-smarteditor-gallery.sme-gallery:not(.sme-gallery--masonry){grid-template-columns:repeat(min(var(--sme-gallery-columns,4),2),minmax(0,1fr))}.sme-gallery--masonry{columns:min(var(--sme-gallery-columns,4),2)}.sme-gallery--justified .sme-gallery__item{flex-basis:calc((100% - var(--sme-gallery-gap,10px))/min(var(--sme-gallery-columns,4),2))}}
@media(max-width:400px){.wp-block-smarteditor-gallery.sme-gallery:not(.sme-gallery--masonry){grid-template-columns:1fr}.sme-gallery--masonry{columns:1}.sme-gallery--justified .sme-gallery__item{flex-basis:100%}}
.sme-gallery-lightbox{position:fixed;inset:0;z-index:2147483640;display:grid;grid-template-rows:auto 1fr auto;background:rgba(12,15,21,.97);color:#fff;padding:12px max(12px,env(safe-area-inset-right)) 20px max(12px,env(safe-area-inset-left));font:400 15px/1.45 system-ui,sans-serif}
.sme-gallery-lightbox[hidden]{display:none}
.sme-gallery-lightbox__toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:40px}
.sme-gallery-lightbox__button{display:inline-flex;align-items:center;justify-content:center;border:1px solid #ffffff60;border-radius:6px;background:#ffffff10;color:#fff;min-width:42px;min-height:42px;cursor:pointer;font-size:25px;line-height:1}
.sme-gallery-lightbox__button:hover,.sme-gallery-lightbox__button:focus-visible{background:#ffffff35}
.sme-gallery-lightbox__stage{display:grid;grid-template-columns:46px minmax(0,1fr) 46px;align-items:center;justify-items:center;min-height:0;gap:6px}
.sme-gallery-lightbox__image{display:block;max-width:100%;max-height:calc(100dvh - 150px);width:auto;height:auto;object-fit:contain;grid-column:2;grid-row:1}
.sme-gallery-lightbox__prev{grid-column:1;grid-row:1}.sme-gallery-lightbox__next{grid-column:3;grid-row:1}
.sme-gallery-lightbox__caption{text-align:center;max-width:80ch;margin:8px auto 0;max-height:5em;overflow:auto;overflow-wrap:anywhere}
@media(max-width:550px){.sme-gallery-lightbox__stage{grid-template-columns:35px minmax(0,1fr) 35px;gap:2px}.sme-gallery-lightbox__button{min-width:34px}.sme-gallery-lightbox__image{max-height:calc(100dvh - 185px)}}
@media(prefers-reduced-motion:reduce){.sme-gallery .sme-gallery__image{transition:none!important}}
/* Animation only after opt-in and intersection; stays visible without JavaScript. */
@media(prefers-reduced-motion:no-preference){.sme-gallery--entrance-fade.sme-gallery--observed .sme-gallery__item,.sme-gallery--entrance-up.sme-gallery--observed .sme-gallery__item,.sme-gallery--entrance-zoom.sme-gallery--observed .sme-gallery__item{opacity:0}.sme-gallery--entrance-fade.sme-gallery--inview .sme-gallery__item{animation:sme-gallery-fade var(--sme-gallery-duration,600ms) ease both}.sme-gallery--entrance-up.sme-gallery--inview .sme-gallery__item{animation:sme-gallery-up var(--sme-gallery-duration,600ms) ease both}.sme-gallery--entrance-zoom.sme-gallery--inview .sme-gallery__item{animation:sme-gallery-zoom var(--sme-gallery-duration,600ms) ease both}.sme-gallery--inview .sme-gallery__item:nth-child(n){animation-delay:0ms}}
@keyframes sme-gallery-fade{from{opacity:0}to{opacity:1}}@keyframes sme-gallery-up{from{opacity:0;translate:0 15px}to{opacity:1;translate:0 0}}@keyframes sme-gallery-zoom{from{opacity:0;scale:.96}to{opacity:1;scale:1}}
