/* ======= Photo Grid Layout ======= */
.photo-grid {
  column-count: 4;
  column-gap: 1rem;
  width: 100%;
}

@media (max-width: 1200px) {
  .photo-grid {
    column-count: 3;
  }
}
@media (max-width: 768px) {
  .photo-grid {
    column-count: 2;
  }
}
@media (max-width: 480px) {
  .photo-grid {
    column-count: 2;
  }
}

.photo-item {
  display: inline-block;
  margin-bottom: 1rem;
  width: 100%;
  position: relative;
  break-inside: avoid;
}

.photo-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  transition: transform 0.3s ease;
}

.photo-item:hover .photo-img {
  transform: scale(1.03);
}

/* ======= Caption on Hover ======= */
.photo-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  padding: 0.5rem;
  font-size: 14px;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.photo-item:hover .photo-caption {
  opacity: 1;
}

/* ======= Modal Styles ======= */
.photo-modal {
  display: none;
  visibility: hidden;
  opacity: 0;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  justify-content: center;
  align-items: center;
  flex-direction: column;
  padding: 20px;
  box-sizing: border-box;
  transition: opacity 0.3s ease;
}

.photo-modal.active {
  display: flex;
  visibility: visible;
  opacity: 1;
}

.photo-modal img {
  max-width: 90vw;
  max-height: 80vh;
  height: auto;
  width: auto;
  object-fit: contain;
  border-radius: 10px;
}

/* ======= Modal Caption ======= */
.modal-caption {
  margin-top: 10px;
  color: #ccc;
  font-size: 16px;
  text-align: center;
  max-width: 90%;
}

/* ======= Modal Close Button ======= */
.modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  color: white;
  font-size: 32px;
  font-weight: bold;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  line-height: 36px;
  text-align: center;
  cursor: pointer;
  z-index: 10000;
  transition: background-color 0.2s ease;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
}
