/* =========================================================
   space-gallery.css — NASA APOD Gallery
   ========================================================= */

.sg-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
}

.sg-overlay.sg-open {
  opacity: 1;
  pointer-events: auto;
}

/* ── header ── */
.sg-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  flex-shrink: 0;
}

.sg-counter {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.sg-close-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sg-close-btn:active {
  background: rgba(255, 255, 255, 0.2);
}

/* ── image area ── */
.sg-image-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
  min-height: 0;
}

.sg-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 200ms ease;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

/* ── info panel ── */
.sg-info {
  padding: 16px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  max-height: 35vh;
  overflow-y: auto;
  flex-shrink: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.sg-title {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}

.sg-date {
  margin: 0 0 10px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.4);
}

.sg-desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.7);
}

/* ── nav buttons ── */
.sg-nav {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  display: flex;
  justify-content: space-between;
  padding: 0 8px;
  pointer-events: none;
}

.sg-nav-btn {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sg-nav-btn:active {
  background: rgba(255, 255, 255, 0.2);
}

.sg-nav-btn:disabled {
  opacity: 0.2;
  cursor: default;
}
