/* Projekte uses the same fullscreen image viewer as Bilder unserer Arbeiten on the homepage. */
body.babin-project-page .gallery-dialog {
  position:fixed;
  inset:0;
  margin:0;
  width:100vw;
  max-width:100%;
  height:100dvh;
  max-height:100dvh;
  padding:0;
  overflow:hidden;
  border:0;
  border-radius:0;
  box-shadow:none;
  background:#071b2bf2;
  color:#fff;
}
body.babin-project-page .gallery-dialog[open]{display:flex;align-items:center;justify-content:center}
body.babin-project-page .gallery-dialog::backdrop{background:#071b2bed;backdrop-filter:none}
/* Image order numbers deliberately omitted across galleries. */
body.babin-project-page .projects-page .project-number,
.othman-gallery .project-number,
.gallery-dialog .gallery-count{display:none!important}
/* Keep captions legible against the fullscreen dark viewer on every screen. */
body.babin-project-page .gallery-dialog .gallery-view-caption{color:#edf3f7;text-align:center}

/* Unified, reliably centered close control on home and Projekte fullscreen galleries. */
.gallery-dialog .gallery-close,
body.babin-project-page .gallery-dialog .gallery-close {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  padding: 0;
  margin: 0;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 50%;
  background: #f8fbfd;
  color: #102e49;
  box-shadow: 0 6px 22px rgba(0,0,0,.32);
  font-size: 0;
  line-height: 1;
  transform: none;
  cursor: pointer;
  transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
  -webkit-tap-highlight-color: transparent;
}
.gallery-dialog .gallery-close .gallery-close-icon {
  display: block;
  width: 22px;
  height: 22px;
  stroke: none;
  flex: none;
  pointer-events: none;
}
.gallery-dialog .gallery-close:hover,
body.babin-project-page .gallery-dialog .gallery-close:hover {
  background: #e3eff7;
  box-shadow: 0 8px 28px rgba(0,0,0,.36);
}
.gallery-dialog .gallery-close:focus-visible {
  outline: 3px solid #83c4e9;
  outline-offset: 3px;
}
@media (max-width:600px) {
  .gallery-dialog .gallery-close,
  body.babin-project-page .gallery-dialog .gallery-close {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    top: max(12px, env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
  }
}
@media (prefers-reduced-motion:reduce) {
  .gallery-dialog .gallery-close {transition: none;}
}
