/* CMS v0.5.3 — gallery respects image ratio and viewport height; browser-overlay viewer */
/* Grid section: fixed thumbnail strip at the right */
.gallery-layout{display:grid!important;grid-template-columns:minmax(0,1fr) 106px!important;align-items:start!important;gap:12px!important;height:auto!important;min-height:0!important;min-width:0!important;overflow:visible!important}
.gallery-main{position:relative!important;display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;min-width:0!important;min-height:0!important;height:auto!important;max-height:none!important;overflow:hidden!important;background:#edf2f7!important;border-radius:13px}
/* Natural image dimensions; no forced crop; browser-height cap keeps tall photos manageable. */
.gallery-main #gallery-main-image{display:block!important;width:auto!important;height:auto!important;min-width:0!important;min-height:0!important;max-width:100%!important;max-height:min(700px,72vh)!important;max-height:min(700px,72dvh)!important;object-fit:contain!important;object-position:center!important;cursor:zoom-in;background:#edf2f7}
.gallery-main #gallery-main-caption{align-self:stretch;margin:0!important;width:100%!important;max-width:100%!important;box-sizing:border-box;padding:11px 15px!important;background:#fff;color:#34465d;line-height:1.5;font-size:14px;text-align:center}
.gallery-main #gallery-main-caption[hidden]{display:none!important}
.gallery-expand{position:absolute!important;top:14px;right:14px;z-index:3;display:inline-flex;align-items:center;justify-content:center;border:1px solid rgba(255,255,255,.65);border-radius:9px;background:rgba(13,30,52,.86);color:#fff;font-weight:750;font-size:13px;padding:10px 14px;cursor:pointer}
.gallery-thumbs{display:flex;flex-direction:column;gap:8px;max-height:min(700px,72vh)!important;max-height:min(700px,72dvh)!important;height:auto!important;overflow-y:auto!important;overflow-x:hidden!important;scrollbar-width:thin;min-width:0}
.gallery-thumbs .thumb{height:78px!important;min-height:78px!important;flex:0 0 78px!important;cursor:pointer;overflow:hidden;border-radius:9px}
.gallery-thumbs .thumb img{width:100%!important;height:100%!important;object-fit:cover!important}
/* Browser-contained full-screen, distinct from operating-system Fullscreen API. */
.cms-photo-dialog{position:fixed!important;inset:0!important;width:100vw!important;height:100vh!important;height:100dvh!important;z-index:2147483000!important;background:rgba(7,13,24,.97)!important;color:#fff!important;display:none!important;grid-template-rows:64px minmax(0,1fr) auto;grid-template-columns:minmax(0,1fr);overflow:hidden;overscroll-behavior:contain;box-sizing:border-box}
.cms-photo-dialog[aria-hidden="false"]{display:grid!important}
.cms-photo-toolbar{display:flex;align-items:center;justify-content:space-between;gap:15px;padding:12px 22px;box-sizing:border-box}
.cms-photo-counter{font-size:14px;font-variant-numeric:tabular-nums;color:#e7edf6;font-weight:650}
.cms-photo-close{position:static!important;min-width:44px;min-height:42px;padding:3px 13px;border:1px solid #79879d;border-radius:10px;background:#26374d;color:#fff;font-size:19px;cursor:pointer}
.cms-photo-stage{position:relative;display:flex;align-items:center;justify-content:center;min-width:0;min-height:0;padding:0 66px;box-sizing:border-box;overflow:hidden}
.cms-photo-stage img{display:block!important;width:auto!important;height:auto!important;max-width:100%!important;max-height:100%!important;object-fit:contain!important;object-position:center;box-shadow:none!important;user-select:none}
.cms-photo-prev,.cms-photo-next{position:absolute;top:50%;transform:translateY(-50%);min-width:44px;min-height:56px;border:1px solid #6f7c90;border-radius:10px;background:#26364a;color:#fff;font-size:27px;cursor:pointer;z-index:3}
.cms-photo-prev{left:12px}.cms-photo-next{right:12px}
.cms-photo-bottom{padding:8px 18px max(12px,env(safe-area-inset-bottom));display:flex;flex-direction:column;justify-content:center;align-items:center;gap:8px;min-height:60px;max-height:23vh;box-sizing:border-box}
.cms-photo-caption{position:static!important;color:#f1f5fc;font-size:15px;line-height:1.5;text-align:center;max-width:90vw;margin:0;white-space:normal;overflow:auto;max-height:64px}
.cms-photo-caption:empty{display:none}
.cms-photo-strip{display:flex;justify-content:flex-start;align-items:center;gap:7px;max-width:100%;overflow-x:auto;padding:3px 2px;scrollbar-width:thin}
.cms-photo-strip button{flex:0 0 58px;width:58px;height:48px;padding:0;border:2px solid transparent;background:none;border-radius:6px;overflow:hidden;cursor:pointer;opacity:.65}
.cms-photo-strip button.selected{border-color:#f6bf37;opacity:1}
.cms-photo-strip img{display:block;width:100%;height:100%;object-fit:cover}
.cms-photo-dialog :focus-visible{outline:3px solid #ffc53d;outline-offset:2px}
.cms-video-ratio{position:relative;overflow:hidden;max-width:100%;width:100%;height:auto!important;margin:16px 0 10px;border-radius:13px;background:#101820;aspect-ratio:16/9}
.cms-video-ratio.ratio-landscape{aspect-ratio:16/9}
.cms-video-ratio.ratio-portrait{width:min(100%,400px,calc(72vh * 9 / 16));aspect-ratio:9/16;max-height:72vh}
.cms-video-ratio.ratio-square{width:min(100%,600px,72vh);aspect-ratio:1/1;max-height:72vh}
.cms-video-ratio.ratio-classic{width:min(100%,820px,calc(72vh * 4 / 3));aspect-ratio:4/3;max-height:72vh}
.cms-video-ratio iframe{position:absolute!important;inset:0;width:100%!important;height:100%!important;border:0}
.cms-map-unset{padding:20px;background:#f3f7fc;border:1px solid #d9e5f4;border-radius:12px}.cms-map-unset p{font-size:14px;color:#596e86;margin:8px 0 12px}
@media(max-width:740px){.gallery-layout{grid-template-columns:minmax(0,1fr) 72px!important;gap:7px!important}.gallery-main #gallery-main-image{max-height:64vh!important;max-height:64dvh!important}.gallery-thumbs{max-height:64vh!important;max-height:64dvh!important}.gallery-thumbs .thumb{height:62px!important;min-height:62px!important;flex-basis:62px!important}.gallery-expand{top:8px;right:8px;padding:7px 10px;font-size:12px}.cms-photo-toolbar{padding:8px 13px}.cms-photo-dialog{grid-template-rows:56px minmax(0,1fr) auto}.cms-photo-stage{padding:0 39px}.cms-photo-prev,.cms-photo-next{min-width:34px;min-height:48px;font-size:23px}.cms-photo-prev{left:2px}.cms-photo-next{right:2px}.cms-photo-bottom{max-height:26vh}.cms-photo-caption{font-size:13px}.cms-photo-strip button{flex-basis:46px;width:46px;height:38px}}
@media(max-height:560px){.cms-photo-dialog{grid-template-rows:44px minmax(0,1fr) auto}.cms-photo-toolbar{padding:4px 14px}.cms-photo-bottom{padding:3px 12px 5px;min-height:0;gap:3px}.cms-photo-strip button{height:34px;width:45px;flex-basis:45px}.cms-photo-caption{font-size:12px;max-height:35px}}
