/* === BASE === */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
}

/* === GALLERY === */
.gallery {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  /*gap: 15px;
  padding: 20px;*/
}

.thumbnail {
  /*width: 150px;
  height: auto;*/
  cursor: pointer;
  border: 2px solid #ccc;
  transition: 0.3s;
  object-fit: cover;
  border-radius: 4px;
}

.thumbnail:hover {
  border-color: #555;
}

/* === POPUP OVERLAY === */
.popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.popup.hidden {
  display: none;
}

/* === POPUP CONTENT === */
.popup-content {
  background: white;
  padding: 20px;
  position: relative;
  width: 90%;
  max-width: 500px;
  text-align: center;
  border-radius: 8px;
  box-sizing: border-box;
  transform-origin: center;
  animation: zoomIn 0.3s ease-out;
}

.popup-content img {
  max-width: 100%;
  height: auto;
  margin-bottom: 15px;
  border-radius: 4px;
}

.popup-content h2 {
  margin-top: 0;
  margin-bottom: 15px;
}

.popup-content .close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 24px;
  cursor: pointer;
  color: #888;
}

.popup-content .close:hover {
  color: #000;
}

#popup-close-btn {
  margin-top: 10px;
  padding: 10px 20px;
  background-color: #3498db;
  color: white;
  border: none;
  cursor: pointer;
  border-radius: 4px;
  font-size: 16px;
}

#popup-close-btn:hover {
  background-color: #2980b9;
}

/* === ANIMATIONS === */
@keyframes zoomIn {
  0% {
    transform: scale(0.7);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes zoomOut {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(0.7);
    opacity: 0;
  }
}

.popup-content.closing {
  animation: zoomOut 0.3s ease-in forwards;
}

/* === RESPONSIVE === */
@media screen and (max-width: 600px) {
  .thumbnail {
    width: 100px;
  }

  .popup-content {
    padding: 15px;
  }

  #popup-close-btn {
    width: 100%;
    font-size: 18px;
    padding: 12px;
  }

  .popup-content .close {
    font-size: 28px;
  }
}
