/* GALLERY.CSS */

#page-heading {
  margin-bottom: 40px;
}

.masonry {
    column-count: 4;
    column-gap: 16px;
    max-width: 1200px; 
    margin: 0 auto;
    padding: 0 40px;
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: 0.2s;
    will-change: opacity, transform;
}

#gallery .masonry {
  padding-bottom: 60px;
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: 16px;
}

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

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

/* Responsive */
@media (max-width: 1200px) {
    .masonry {
        column-count: 3;
        padding: 0 32px;
    }
}

@media (max-width: 900px) {
    .masonry {
        column-count: 2;
        padding: 0 24px;
    }
}

@media (max-width: 600px) {
    .masonry {
        column-count: 1;
        padding: 0 16px;
    }
}

/* Lightbox */
.lightbox {
    display: flex;
    position: fixed;
    z-index: 9999;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    justify-content: center;
    align-items: center;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

#lightbox-img {
    max-width: 90%;
    max-height: 80vh;
    margin-bottom: 10px;
    opacity: 1;
    transition: opacity 0.4s ease;
}

.caption-container {
    color: #f1f1f1;
    text-align: center;
    padding: 10px;
}

.close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: white;
    cursor: pointer;
}

.prev, .next {
    position: absolute;
    top: 50%;
    font-size: 40px;
    color: white;
    padding: 16px;
    cursor: pointer;
    user-select: none;
}

.prev { left: 20px; }
.next { right: 20px; }


.caption-container a {
  color: #d87a5f; /* match fun button*/
  text-decoration: underline;
  transition: color 0.3s ease;
}

.caption-container a:hover {
  color: #fef3ef; /* soft peach/pink */
}

@media (max-width: 600px) {
  .prev, .next {
    top: auto;
    bottom: 20px;
    font-size: 32px;
    background-color: rgba(0, 0, 0, 0.5); /* optional: improve visibility */
    padding: 12px;
    border-radius: 50%;
  }

  .prev {
    left: 20px;
  }

  .next {
    right: 20px;
  }
}
