/* Project photo viewer: native modal, keyboard controls and original image fallback. */
.ks-gallery-dialog{box-sizing:border-box;position:fixed;inset:0;width:100vw;height:100vh;height:100dvh;max-width:none;max-height:none;margin:0;padding:0;border:0;background:#17201c;color:#f1f1e9;overflow:hidden;font-family:Manrope,Arial,sans-serif;overscroll-behavior:contain}
.ks-gallery-dialog[open]{display:grid;grid-template-rows:auto minmax(0,1fr) auto}
.ks-gallery-dialog::backdrop{background:#111a16f5}
.ks-gallery-dialog [hidden]{display:none!important}
.ks-gallery-toolbar{display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:24px;padding:18px 28px;border-bottom:1px solid #e4eadb20}
.ks-gallery-toolbar h2{font-size:13px;font-weight:400;line-height:1.6;letter-spacing:.015em;margin:0;color:#e5e8db;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ks-gallery-counter{font-size:11px;letter-spacing:.1em;color:#b7c4b1;white-space:nowrap}
body .ks-gallery-dialog .ks-gallery-button{box-sizing:border-box;display:grid;place-items:center;width:46px;height:46px;min-width:46px;min-height:46px;padding:0;margin:0;border:1px solid #dbe5d438;border-radius:50%;background:#1b2821de;color:#f1f1e9;cursor:pointer;font-family:inherit;font-size:23px;font-weight:300;line-height:1;transition:background .18s,border-color .18s}
body .ks-gallery-dialog .ks-gallery-button:hover{background:#44523d;border-color:#d5c6a9}
body .ks-gallery-dialog .ks-gallery-button:focus-visible,body .ks-gallery-dialog .ks-gallery-original:focus-visible{outline:2px solid #d5c6a9!important;outline-offset:4px!important}
body .ks-gallery-dialog .ks-gallery-button:disabled{opacity:.3;cursor:default;background:#1b2821de;border-color:#dbe5d438}
body .ks-gallery-dialog .ks-gallery-close{font-size:29px}
.ks-gallery-stage{position:relative;display:flex;align-items:center;justify-content:center;min-width:0;min-height:0;padding:24px 90px;touch-action:pan-y pinch-zoom}
.ks-gallery-stage .ks-gallery-image{display:block;width:auto;height:auto;max-width:100%;max-height:100%;object-fit:contain;margin:0;user-select:none;-webkit-user-select:none}
body .ks-gallery-dialog .ks-gallery-previous,body .ks-gallery-dialog .ks-gallery-next{position:absolute;top:50%;transform:translateY(-50%);z-index:1}
body .ks-gallery-dialog .ks-gallery-previous{left:24px}
body .ks-gallery-dialog .ks-gallery-next{right:24px}
.ks-gallery-loading,.ks-gallery-error{position:absolute;inset:24px 86px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:18px;text-align:center;margin:0;font-size:12px;line-height:1.9;color:#d0d8c7;pointer-events:none}
.ks-gallery-error p{max-width:390px;margin:0}.ks-gallery-error p+p{font-size:11px;color:#adbba4}
.ks-gallery-spinner{display:block;width:28px;height:28px;border:1px solid #cbd7bd44;border-top-color:#d5c6a9;border-radius:50%;animation:ks-gallery-spin .85s linear infinite}
@keyframes ks-gallery-spin{to{transform:rotate(360deg)}}
.ks-gallery-footer{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:28px;padding:19px 30px 24px;border-top:1px solid #e4eadb20}
.ks-gallery-caption{font-size:12px;line-height:1.8;font-weight:400;color:#d9e1d0;letter-spacing:.01em;margin:0;max-width:950px}
.ks-gallery-dialog .ks-gallery-original{display:inline-flex;align-items:center;gap:20px;font-size:11px;line-height:1.8;color:#c8b99b;text-decoration:none;white-space:nowrap;min-height:44px;padding-block:10px}
.ks-gallery-dialog .ks-gallery-original:hover{color:#f1e1bd;text-decoration:underline;text-underline-offset:5px}.ks-gallery-original span{font-size:18px}
@media(max-width:760px){.ks-gallery-toolbar{padding:12px 18px;gap:16px}.ks-gallery-stage{padding:18px 72px}body .ks-gallery-dialog .ks-gallery-previous{left:14px}body .ks-gallery-dialog .ks-gallery-next{right:14px}.ks-gallery-footer{padding:14px 20px;gap:20px}.ks-gallery-caption{font-size:11px}.ks-gallery-loading,.ks-gallery-error{inset-inline:68px}}
@media(max-width:480px){.ks-gallery-toolbar{padding:10px 14px;gap:12px}.ks-gallery-toolbar h2{font-size:11px}.ks-gallery-counter{font-size:10px}.ks-gallery-stage{padding:10px 12px}body .ks-gallery-dialog .ks-gallery-button{width:44px;height:44px;min-width:44px;min-height:44px}body .ks-gallery-dialog .ks-gallery-previous{left:8px}body .ks-gallery-dialog .ks-gallery-next{right:8px}.ks-gallery-footer{display:block;padding:12px 18px 16px}.ks-gallery-caption{font-size:10px;line-height:1.8}.ks-gallery-dialog .ks-gallery-original{font-size:10px;margin-top:6px;min-height:44px}.ks-gallery-loading,.ks-gallery-error{inset-inline:48px;font-size:11px}.ks-gallery-error p+p{font-size:10px}}
@media(prefers-reduced-motion:reduce){body .ks-gallery-dialog .ks-gallery-button{transition:none}.ks-gallery-spinner{animation:none}}

/* A compact contact sheet for albums; mobile arrows no longer cover the photo. */
.ks-gallery-footer{display:block;min-width:0;padding-top:12px}
.ks-gallery-description{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:28px}
.ks-gallery-thumbnails{box-sizing:border-box;display:flex;gap:8px;width:100%;min-width:0;max-width:100%;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:thin;scrollbar-color:#68765c #17201c;padding:6px 4px 10px;margin:0 0 8px}
body .ks-gallery-dialog .ks-gallery-thumb{box-sizing:border-box;display:block;flex:0 0 68px;width:68px;height:54px;min-width:68px;min-height:54px;margin:0;padding:3px;border:1px solid #cbd7bd38;border-radius:0;background:#253229;cursor:pointer;opacity:.65;touch-action:manipulation}
body .ks-gallery-dialog .ks-gallery-thumb img{display:block;width:100%;height:100%;object-fit:cover}
body .ks-gallery-dialog .ks-gallery-thumb:hover{opacity:1;border-color:#e3dbc8}
body .ks-gallery-dialog .ks-gallery-thumb[aria-current="true"]{opacity:1;border-color:#d5c6a9;background:#4a4c3b}
body .ks-gallery-dialog .ks-gallery-thumb:focus-visible{outline:2px solid #d5c6a9;outline-offset:2px}
.ks-gallery-nav-hint{display:none}
@media(max-width:760px){
 .ks-gallery-footer{padding:8px 16px 14px}
 .ks-gallery-description{gap:18px}
}
@media(max-width:480px){
 .ks-gallery-stage{display:grid;grid-template-columns:44px minmax(0,1fr) 44px;grid-template-rows:minmax(0,1fr) 44px;gap:10px 16px;padding:10px 16px 14px}
 .ks-gallery-stage .ks-gallery-image{grid-column:1/-1;grid-row:1;justify-self:center;min-width:0;min-height:0}
 body .ks-gallery-dialog .ks-gallery-previous,body .ks-gallery-dialog .ks-gallery-next{position:static;transform:none;grid-row:2;align-self:center}
 body .ks-gallery-dialog .ks-gallery-previous{grid-column:1}
 body .ks-gallery-dialog .ks-gallery-next{grid-column:3}
 .ks-gallery-nav-hint{display:block;grid-row:2;grid-column:2;text-align:center;font-size:10px;line-height:1.6;color:#adbba4}
 .ks-gallery-loading,.ks-gallery-error{inset:10px 18px 68px}
 .ks-gallery-footer{padding:8px 14px max(12px,env(safe-area-inset-bottom))}
 .ks-gallery-thumbnails{gap:7px;padding-block:5px 9px;margin-bottom:7px}
 body .ks-gallery-dialog .ks-gallery-thumb{flex-basis:60px;width:60px;min-width:60px;height:48px;min-height:48px}
 .ks-gallery-description{display:block}
 .ks-gallery-description .ks-gallery-original{margin-top:4px;padding-block:8px}
}
