.weddings {
    display: flex;
    flex-direction: column;
    align-items: center;    
    margin: auto;
    padding: 20px;
    max-width: 800px;;
}
/* ============================
   GALLERY GRID
   ============================ */
.row {
  display: flex;
  flex-wrap: wrap;
  padding: 0 4px;
  position: relative;
  z-index: 0;
  overflow: visible;
  max-width: 1200px;
  margin: auto;
}

/* Mobile-first: single column */
.column {
  flex: 100%;
  max-width: 100%;
  position: relative;
  overflow: visible;
  z-index: 1;
}

.column img {
  width: 100%;
  max-width: 1200px;
  margin-top: 8px;
  padding: .5rem;
  vertical-align: middle;
  transform-origin: center center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  z-index: 2;
}

.column img:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  z-index: 3;
}

/* Two columns */
@media screen and (min-width: 600px) {
  .column {
    flex: 50%;
    max-width: 50%;
  }
}

/* Four columns */
@media screen and (min-width: 800px) {
  .column {
    flex: 25%;
    max-width: 25%;
    padding: 0 4px;
  }
}
.gallery {
  column-count: 4;
  column-gap: 16px;
  max-width: 1200px;
  margin: 0 auto;
}

.gallery picture {
  break-inside: avoid;
  display: block;
  margin-bottom: 16px;
}

.gallery img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.gallery img:hover {
  transform: scale(1.03);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

@media (max-width: 1200px) {
  .gallery {
    column-count: 3;
  }
}
@media (max-width: 800px) {
  .gallery {
    column-count: 2;
  }
}
@media (max-width: 500px) {
  .gallery {
    column-count: 1;
  }
}

/* ============================
   MODAL OVERLAY
   ============================ */
.modal {
  display: none;
  position: fixed;
  z-index: 99999; /* raise above mobile nav */
  padding-top: 40px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: rgba(0, 0, 0, 0.9);
}

/* ============================
   MODAL CONTENT
   ============================ */
.modal-content {
  position: relative;
  margin: auto;
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: 90%;
  height: 80%;
}

.modal-content img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* ============================
   CLOSE BUTTON (X)
   ============================ */
.close {
  position: absolute;
  top: 15px;
  right: 20px;
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  z-index: 100000; /* stays above modal content */
  line-height: 1;
  user-select: none;
  transition: opacity 0.2s ease;
}

.close:hover {
  opacity: 0.7;
}

/* Mobile adjustments */
@media screen and (max-width: 599px) {
  .close {
    font-size: 32px;
    top: 10px;
    right: 15px;
  }
}

/* ============================
   NAVIGATION ARROWS
   ============================ */
.navigation {
  position: absolute;
  top: 50%;
  width: 100%;
  display: flex;
  justify-content: space-between;
  transform: translateY(-50%);
  z-index: 1000;
}

.prev,
.next {
  cursor: pointer;
  color: white;
  font-size: 40px;
  padding: 16px;
  user-select: none;
  transition: opacity 0.2s ease;
}

.prev:hover,
.next:hover {
  opacity: 0.7;
}

/* Mobile arrow adjustments */
@media screen and (max-width: 599px) {
  .prev,
  .next {
    font-size: 32px;
    padding: 12px;
  }
}

/* ============================
   MOBILE MODAL OPTIMIZATION
   ============================ */
@media screen and (max-width: 599px) {
  .modal-content {
    max-width: 95%;
    height: 70%;
  }
}