/* Dv253: strict mockup-style gallery viewer across all project pages. */

/* Global viewer shell */
html body.project-page .modal-shell {
  width: min(1500px, calc(100% - 72px)) !important;
  height: min(900px, 92vh) !important;
  display: grid !important;
  grid-template-rows: auto 1fr auto !important;
  row-gap: 18px !important;
  position: relative !important;
}

/* Top / bottom bars */
html body.project-page .modal-top,
html body.project-page .modal-bottom {
  color: #fff !important;
  background: rgba(15, 15, 18, 0.72) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  border-radius: 14px !important;
  padding: 12px 22px !important;
  position: relative !important;
  z-index: 5 !important;
}
html body.project-page .modal-top { min-height: 56px !important; }
html body.project-page .modal-bottom { min-height: 44px !important; }

/* Reset previous experimental layers */
html body.project-page .modal::before,
html body.project-page .modal-stage::before,
html body.project-page .modal-pan::before,
html body.project-page .modal-pan::after {
  content: none !important;
  display: none !important;
  background: none !important;
}

/* Stage */
html body.project-page .modal-stage {
  min-height: 0 !important;
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: visible !important;
  padding: 0 86px !important;
}

/* Center panel around the image */
html body.project-page .modal-pan {
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 auto !important;
  padding: 28px !important;
  position: relative !important;
  isolation: isolate !important;
  overflow: visible !important;
  border-radius: 28px !important;
  background: rgba(15, 15, 18, 0.38) !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.02) !important;
}
html body.project-page .modal-pan::before {
  content: '' !important;
  display: block !important;
  position: absolute !important;
  inset: 0 !important;
  z-index: -1 !important;
  pointer-events: none !important;
  border-radius: inherit !important;
  background: rgba(15, 15, 18, 0.32) !important;
  filter: blur(18px) !important;
  transform: scale(1.05) !important;
  transform-origin: center center !important;
}

/* Image sizing, stable for ships and Alice II drawings */
html body.project-page .modal-pan img {
  display: block !important;
  width: auto !important;
  height: auto !important;
  max-width: min(100%, 1240px) !important;
  max-height: min(66vh, calc(100vh - 250px)) !important;
  object-fit: contain !important;
  box-shadow: none !important;
}

/* Controls */
html body.project-page .zoom-controls button,
html body.project-page .modal-close,
html body.project-page .modal-arrow {
  border-color: rgba(255,255,255,.22) !important;
  background: rgba(255,255,255,.05) !important;
  border-radius: 999px !important;
}

/* Arrows placed cleanly beside the central panel */
html body.project-page .modal-arrow {
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 56px !important;
  height: 72px !important;
  z-index: 6 !important;
  font-size: 29px !important;
}
html body.project-page .modal-arrow.prev { left: 18px !important; }
html body.project-page .modal-arrow.next { right: 18px !important; }

@media (max-width: 900px) {
  html body.project-page .modal-shell {
    width: calc(100% - 18px) !important;
    height: 96vh !important;
    row-gap: 10px !important;
  }
  html body.project-page .modal-top,
  html body.project-page .modal-bottom {
    border-radius: 10px !important;
    padding: 8px 10px !important;
  }
  html body.project-page .modal-top { min-height: auto !important; }
  html body.project-page .modal-bottom { min-height: auto !important; }
  html body.project-page .modal-stage {
    padding: 0 50px !important;
  }
  html body.project-page .modal-pan {
    padding: 14px !important;
    border-radius: 16px !important;
  }
  html body.project-page .modal-pan::before {
    filter: blur(10px) !important;
    transform: scale(1.04) !important;
  }
  html body.project-page .modal-pan img {
    max-height: min(70vh, calc(100vh - 210px)) !important;
  }
  html body.project-page .modal-arrow {
    width: 42px !important;
    height: 54px !important;
  }
  html body.project-page .modal-arrow.prev { left: 6px !important; }
  html body.project-page .modal-arrow.next { right: 6px !important; }
}
