/* Native classic and Gutenberg galleries, scoped to enhanced galleries only. */
.sunit-native-gallery{--sg-accent:#3360d1;--sg-panel:#f0f2f6;--sg-text:#202733;--sg-line:#dce1eb;display:grid!important;grid-template-columns:repeat(var(--sg-cols,3),minmax(0,1fr))!important;gap:16px!important;margin:32px 0!important;width:100%;align-items:start}
html[data-theme=dark] .sunit-native-gallery{--sg-panel:#191e27;--sg-text:#eaf0fa;--sg-line:#2c3544}
.sunit-native-gallery:before,.sunit-native-gallery:after,.sunit-native-gallery>br{display:none!important}
.sunit-native-gallery>.blocks-gallery-grid{display:contents!important}
.sunit-native-gallery :is(.gallery-item,.wp-block-image,.blocks-gallery-item){float:none!important;width:auto!important;max-width:100%!important;min-width:0;margin:0!important;display:block!important;background:var(--sg-panel);border:1px solid var(--sg-line);border-radius:16px;overflow:hidden;box-sizing:border-box}
.sunit-native-gallery .gallery-icon{margin:0;padding:0}
.sunit-native-gallery .sg-trigger{position:relative;display:block;width:100%;padding:0!important;margin:0!important;border:0!important;border-radius:0!important;overflow:hidden;background:var(--sg-panel)!important;color:var(--sg-text)!important;cursor:zoom-in;box-shadow:none!important;line-height:0;touch-action:manipulation}
.sunit-native-gallery .sg-trigger:after{content:'';position:absolute;right:10px;bottom:10px;display:grid;place-items:center;width:30px;height:30px;border:1px solid #ffffff65;border-radius:10px;background:#101b34a6 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17 17 7M7 7h10v10'/%3E%3C/svg%3E") center/18px no-repeat;backdrop-filter:blur(8px);transition:background .2s}
.sunit-native-gallery .sg-trigger img{display:block!important;width:100%!important;max-width:100%!important;height:auto!important;aspect-ratio:4/3;object-fit:cover!important;margin:0!important;border:0!important;border-radius:0!important;transition:transform .35s}
.sunit-native-gallery .sg-trigger:hover img{transform:scale(1.035)}
.sunit-native-gallery .sg-trigger:focus-visible{outline:3px solid var(--sg-accent)!important;outline-offset:-3px}
.sunit-native-gallery :is(figcaption,.gallery-caption){position:static!important;display:block!important;width:auto!important;max-height:none!important;margin:0!important;padding:12px 14px!important;background:transparent!important;background-image:none!important;color:var(--sg-text)!important;font:500 13px/1.55 system-ui,sans-serif!important;text-align:left!important;overflow:visible!important}
@media(max-width:640px){.sunit-native-gallery{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}.sunit-native-gallery :is(figcaption,.gallery-caption){padding:10px!important;font-size:12px!important}.sunit-native-gallery :is(.gallery-item,.wp-block-image,.blocks-gallery-item){border-radius:12px}}
@media(max-width:359px){.sunit-native-gallery{grid-template-columns:1fr!important}}
/* Full-screen dialog respects the selected SUNIT theme. */
dialog.sunit-gallery-viewer{--sg-bg:#0d111a;--sg-fg:#f3f6fc;--sg-muted:#9cabc1;--sg-border:#ffffff26;--sg-button:#ffffff0d;--sg-active:#82a7ff;box-sizing:border-box;position:fixed;inset:0;width:100vw;max-width:none;height:100dvh;max-height:none;margin:0;padding:max(16px,env(safe-area-inset-top)) max(20px,env(safe-area-inset-right)) max(14px,env(safe-area-inset-bottom)) max(20px,env(safe-area-inset-left));border:0;border-radius:0;background:var(--sg-bg);color:var(--sg-fg);font:15px/1.5 system-ui,sans-serif;overflow:hidden}
dialog.sunit-gallery-viewer[open]{display:grid;grid-template-rows:auto minmax(0,1fr) auto;gap:14px}
dialog.sunit-gallery-viewer[data-theme=light]{--sg-bg:#f5f7fb;--sg-fg:#1c2638;--sg-muted:#5c6b80;--sg-border:#15284a24;--sg-button:#15284a08;--sg-active:#3360d1}
.sunit-gallery-viewer::backdrop{background:#0d111aea;backdrop-filter:blur(12px)}
.sunit-gallery-viewer *{box-sizing:border-box}
.sunit-gallery-viewer .sg-toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px}
.sunit-gallery-viewer .sg-counter{font-size:14px;font-weight:600;letter-spacing:2px;font-variant-numeric:tabular-nums;color:var(--sg-muted)}
.sunit-gallery-viewer .sg-tools{display:flex;gap:10px}
.sunit-gallery-viewer button{display:grid;place-items:center;flex:none;width:46px;height:46px;padding:11px;margin:0;border:1px solid var(--sg-border);border-radius:50%;background:var(--sg-button);color:var(--sg-fg);box-shadow:none;cursor:pointer;touch-action:manipulation;transition:background .2s,border-color .2s}
.sunit-gallery-viewer button:hover{background:var(--sg-border);color:var(--sg-fg);border-color:var(--sg-active)}
.sunit-gallery-viewer button:focus-visible{outline:3px solid var(--sg-active);outline-offset:3px}
.sunit-gallery-viewer button[hidden]{display:none!important}
.sunit-gallery-viewer button svg{display:block;width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.sunit-gallery-viewer .sg-main{min-height:0;display:grid;grid-template-columns:46px minmax(0,1fr) 46px;gap:20px;align-items:center}
.sunit-gallery-viewer .sg-stage{position:relative;display:flex;align-items:center;justify-content:center;height:100%;min-height:0;min-width:0;overflow:auto;overscroll-behavior:contain;touch-action:pan-y pinch-zoom;border-radius:12px}
.sunit-gallery-viewer .sg-photo{display:block;width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain;border-radius:8px;margin:0;padding:0;user-select:none;cursor:zoom-in}
.sunit-gallery-viewer.sg-loading .sg-photo,.sunit-gallery-viewer.sg-error .sg-photo{visibility:hidden}
.sunit-gallery-viewer .sg-status{position:absolute;inset:45% 0 auto;margin:0;text-align:center;color:var(--sg-muted);font-size:15px}
.sunit-gallery-viewer .sg-status:empty{display:none}
.sunit-gallery-viewer.sg-zoomed .sg-stage{display:block;touch-action:pan-x pan-y pinch-zoom}
.sunit-gallery-viewer.sg-zoomed .sg-photo{width:200%;height:200%;max-width:none;max-height:none;object-fit:contain;cursor:zoom-out}
.sunit-gallery-viewer .sg-footer{display:grid;justify-items:center;gap:12px;min-width:0}
.sunit-gallery-viewer .sg-caption{margin:0;max-width:900px;max-height:4.5em;overflow:auto;color:var(--sg-fg);font-size:15px;line-height:1.5;text-align:center}
.sunit-gallery-viewer .sg-caption:empty{display:none}
.sunit-gallery-viewer .sg-thumbs{display:flex;gap:8px;max-width:100%;padding:4px;overflow-x:auto;scrollbar-width:thin;scrollbar-color:var(--sg-border) transparent;overscroll-behavior-x:contain}
.sunit-gallery-viewer .sg-thumbs button{width:70px;height:50px;padding:3px;border-radius:10px;border:2px solid transparent;opacity:.6}
.sunit-gallery-viewer .sg-thumbs button[aria-current=true]{border-color:var(--sg-active);opacity:1}
.sunit-gallery-viewer .sg-thumbs img{display:block;width:100%;height:100%;object-fit:cover;border-radius:5px;margin:0}
.sunit-gallery-viewer .sg-hint{color:var(--sg-muted);font-size:11px;letter-spacing:.3px}
@media(max-width:640px){dialog.sunit-gallery-viewer{padding-inline:12px}.sunit-gallery-viewer .sg-main{position:relative;display:block}.sunit-gallery-viewer .sg-main>button{position:absolute;bottom:8px;z-index:2;background:var(--sg-bg);width:46px;height:46px}.sunit-gallery-viewer .sg-prev{left:8px}.sunit-gallery-viewer .sg-next{right:8px}.sunit-gallery-viewer .sg-caption{font-size:13px}.sunit-gallery-viewer .sg-thumbs button{width:58px;height:44px}.sunit-gallery-viewer .sg-hint{font-size:10px}}
@media(max-height:500px){.sunit-gallery-viewer .sg-thumbs,.sunit-gallery-viewer .sg-hint{display:none}dialog.sunit-gallery-viewer[open]{gap:6px}.sunit-gallery-viewer .sg-caption{max-height:3em;font-size:12px}}
@media(prefers-reduced-motion:reduce){.sunit-native-gallery *,.sunit-gallery-viewer *{transition:none!important;scroll-behavior:auto!important}}
