/* All photo dialogs must sit above the global menu and respect phone safe areas. */
.viewer,.zoom-modal,.lightbox{z-index:2000!important}
.za-photo-close{position:fixed!important;top:calc(env(safe-area-inset-top,0px) + 12px)!important;right:calc(env(safe-area-inset-right,0px) + 12px)!important;left:auto!important;bottom:auto!important;z-index:2100!important;display:flex!important;align-items:center!important;justify-content:center!important;gap:8px!important;min-width:110px!important;min-height:48px!important;padding:10px 14px!important;border:1px solid #aaa!important;border-radius:4px!important;background:#171717!important;color:#fff!important;font:16px/1.2 Arial,sans-serif!important;cursor:pointer!important;text-decoration:none!important;touch-action:manipulation!important}
.za-photo-close[hidden]{display:none!important}
.za-photo-viewer{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;background:#0c0c0c;z-index:2000;overscroll-behavior:contain}
.za-photo-viewer[hidden]{display:none}
.za-photo-viewer img{display:block;max-width:100%;max-height:calc(100dvh - 150px);object-fit:contain}
.za-photo-controls{position:absolute;bottom:calc(env(safe-area-inset-bottom,0px) + 12px);left:0;right:0;display:flex;align-items:center;justify-content:center;gap:20px;color:white;font:14px Arial}
.za-photo-controls button{min-width:48px;min-height:48px;border:1px solid #aaa;background:#171717;color:white;font-size:22px;cursor:pointer}

.lightbox.za-hash-open{display:flex!important}

/* In landscape, controls float over the image instead of consuming its height. */
@media (orientation:landscape) and (max-height:600px){
  .viewer,.lightbox,.za-photo-viewer{padding:0!important}
  .viewer .stage,.viewer .viewer-stage,.viewer .vstage{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;max-height:none!important;min-height:0!important;margin:0!important;padding:0!important;display:flex!important;align-items:center!important;justify-content:center!important}
  .viewer img:not(.zoom),.lightbox img,.za-photo-viewer img{max-width:100vw!important;max-height:100dvh!important;width:auto!important;height:auto!important;object-fit:contain!important}
  .viewer .viewer-top,.viewer .vbar,.viewer .toolbar,.viewer .tools{position:absolute!important;top:env(safe-area-inset-top,0px)!important;left:0!important;right:0!important;z-index:2!important;background:transparent!important}
  .viewer .viewer-bottom,.viewer .vnav{position:absolute!important;bottom:env(safe-area-inset-bottom,0px)!important;left:0!important;right:0!important;z-index:2!important;background:transparent!important}
  .viewer .count,.lightbox .counter,.za-photo-controls{z-index:2}
  .za-photo-close{top:calc(env(safe-area-inset-top,0px) + 6px)!important;right:calc(env(safe-area-inset-right,0px) + 6px)!important;background:rgba(23,23,23,.8)!important}
}

@media (orientation:landscape) and (max-height:600px){
  body.za-photo-controls-hidden :is(.viewer,.lightbox,.zoom-modal,.za-photo-viewer) :is(button,a,.count,.counter,.viewer-top,.viewer-bottom,.vbar,.toolbar,.tools,.vnav,.za-photo-controls,.zoom-hint),
  body.za-photo-controls-hidden .za-photo-close{opacity:0!important;visibility:hidden!important;pointer-events:none!important}
}

/* Consistent, generous touch targets for the mobile site navigation. */
@media(max-width:760px){
  .page>header,header.za-global,header.site{flex-direction:column!important;align-items:flex-start!important;gap:12px!important}
  .page>header nav.toplinks,header.za-global nav.za-links,header.site>nav{width:100%!important;display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:4px 12px!important;font-size:16px!important;white-space:normal!important}
  .page>header nav.toplinks>a,header.za-global nav.za-links>a,header.site>nav>a{display:flex!important;align-items:center!important;min-height:48px!important;padding:10px 0!important;font-size:16px!important;line-height:1.4!important}
  .page>header .lang-toggle,header.za-global .za-lang,header.site .lang{display:flex!important;align-items:center!important;gap:6px!important;margin:0!important;padding:0!important;border:0!important}
  .page>header .lang-toggle button,header.za-global .za-lang button,header.site .lang button{min-height:48px!important;min-width:44px!important;padding:10px 6px!important;font-size:16px!important}
}
