/* Popup overlay */
.popup {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.85);
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.3s ease;
}

/* Popup container for image + nav buttons */
.popup-inner {
  position: relative;
  display: inline-block; /* Shrinks to image size */
}

/* Popup image */
.popup-content {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(0,0,0,0.6);
  display: block;
  animation: scaleIn 0.3s ease;
  transition: transform 0.3s ease;
  user-select: none;
  margin: auto;
}

/* Close button */
.close {
  position: absolute;
  top: 20px;
  right: 35px;
  color: white;
  background-color: var(--text-color-blue);
  border-radius: 10px;
  font-size: 2rem;
  font-weight: bold;
  cursor: pointer;
  padding: 0 0.5rem 0.5rem 0.5rem;
  line-height: 1;
}

.close:hover {
  color: #bbb;
}

/* Navigation buttons */
.popup-prev,
.popup-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-color-white);
  font-size: 2rem;
  padding: 0.5rem;
  cursor: pointer;
  border-radius: 10%;
  transition: background 0.3s, color 0.3s;
  user-select: none;
}

.popup-prev:hover,
.popup-next:hover {
  background: var(--text-color-blue);
  color: var(--text-color-white);
}

.popup-prev { left: -2rem; }   /* outside img */
.popup-next { right: -2rem; }  /* outside img */

/* Blur background when popup active */
body.blur-background main,
body.blur-background section,
body.blur-background header,
body.blur-background footer {
  filter: blur(5px);
  pointer-events: none;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes scaleIn {
  from { transform: scale(0.9); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}


/* Mobile overrides */
@media (max-width: 768px) {
  .popup-prev { left: -5px; }   /* inside img */
  .popup-next { right: -5px; }  /* inside img */

  .popup-prev
  .popup-next {
    background: transparent;
    color: var(--text-color-white);
  }

  .popup-prev:hover,
  .popup-next:hover {
    background: transparent;
    color: var(--text-color-blue);
  }
  
}