.photo-trigger{cursor:zoom-in}.photo-trigger:focus-visible{outline:3px solid #1767cb;outline-offset:4px}.gal .item:focus-visible .cap{opacity:1}
.photo-viewer{position:fixed;inset:0;width:100%;height:100%;height:100dvh;max-width:none;max-height:none;margin:0;padding:0;border:0;background:#080d19;color:#fff;overscroll-behavior:contain}
.photo-viewer::backdrop{background:#080d19}.photo-viewer[open]{display:grid;grid-template-rows:auto minmax(0,1fr) auto}
.viewer-top,.viewer-bottom{display:flex;align-items:center;gap:16px;padding:12px max(18px,env(safe-area-inset-right));flex-shrink:0}
.viewer-top{justify-content:space-between;padding-top:max(12px,env(safe-area-inset-top))}.viewer-title{font-size:1rem;font-weight:700}.viewer-bottom{justify-content:center;padding-bottom:max(14px,env(safe-area-inset-bottom));direction:ltr}
.viewer-button{display:grid;place-items:center;flex-shrink:0;width:48px;height:48px;border:1px solid #687083;border-radius:50%;background:#192235;color:#fff;cursor:pointer;font:28px/1 Arial,sans-serif}.viewer-button:hover{background:#34435c}.viewer-button:focus-visible{outline:3px solid #ffd16f;outline-offset:4px}
.viewer-stage{position:relative;display:grid;place-items:center;min-height:0;overflow:hidden;touch-action:pan-y pinch-zoom;user-select:none}
.viewer-stage img{width:100%;height:100%;min-height:0;object-fit:contain;display:block;pointer-events:none}.viewer-stage img[hidden]{display:none}
.viewer-status{position:absolute;text-align:center;padding:24px;color:#fff;background:#080d19}.viewer-status[hidden]{display:none}
.viewer-caption{margin:0;text-align:center;max-width:65ch;font-size:.9rem;line-height:1.5}.viewer-meta{display:grid;gap:4px;min-width:90px;text-align:center}.viewer-count{font-variant-numeric:tabular-nums;color:#c8d0df;font-size:.85rem}
body.viewer-open{overflow:hidden}body.ur .viewer-caption,body.ur .viewer-title{line-height:2}
@media(min-width:900px){.viewer-stage{margin:0 70px}.viewer-bottom{gap:28px}.viewer-top{padding-inline:28px}}
@media(max-width:600px){.viewer-caption{font-size:.8rem;max-width:210px}.viewer-top,.viewer-bottom{gap:10px}.viewer-title{font-size:.9rem}}
/* Keep navigation anchored while captions wrap or change language. */
.viewer-bottom{display:grid;grid-template-columns:48px minmax(0,360px) 48px;justify-content:center;box-sizing:border-box;height:calc(124px + env(safe-area-inset-bottom));padding-bottom:calc(12px + env(safe-area-inset-bottom))}
.viewer-meta{min-width:0;height:88px;grid-template-rows:64px 20px;gap:4px}
.viewer-caption{align-self:center;justify-self:stretch;max-width:none;max-height:64px;overflow:auto;overflow-wrap:anywhere}
.viewer-count{line-height:20px}

/* Reserve a stable caption area with room for Urdu glyphs on small screens. */
.viewer-bottom{height:calc(156px + env(safe-area-inset-bottom))}
.viewer-meta{height:120px;grid-template-rows:96px 20px}
.viewer-caption{max-height:96px;line-height:1.7;padding-block:8px}
body.ur .viewer-caption{line-height:2.5}

/* Short landscape screens: compact bars leave room for the full photo. */
@media(orientation:landscape) and (max-height:500px){
 .viewer-top{height:48px;padding:4px max(12px,env(safe-area-inset-right));gap:8px}
 .viewer-title{font-size:.8rem}
 .viewer-top .viewer-button{width:40px;height:40px}
 .viewer-bottom{height:calc(68px + env(safe-area-inset-bottom));padding:4px max(12px,env(safe-area-inset-right)) calc(4px + env(safe-area-inset-bottom));grid-template-columns:44px minmax(0,540px) 44px;gap:12px}
 .viewer-bottom .viewer-button{width:44px;height:44px}
 .viewer-meta{height:60px;grid-template-rows:40px 16px;gap:0}
 .viewer-caption{font-size:.8rem;line-height:1.4;min-height:36px;max-height:40px;padding:2px 0;max-width:none}
 body.ur .viewer-caption{line-height:2.2}
 .viewer-count{font-size:.7rem;line-height:16px}
 .viewer-stage{margin:0}
}
