/* ===========================
   Gallery Page Base
   =========================== */

/* Apply background to the entire page */
body {
  margin: 0; /* remove default browser margins */
  background-image: url("images/SeasaltBleed.png");
  background-size: cover; /* scales to cover whole screen */
  background-position: center;
  background-repeat: repeat;
  font-family: 'Montserrat', sans-serif;
}

/* -------------------------------
   Top icons layout
---------------------------------*/
.top-icons {
  display: flex;
  align-items: center;
  justify-content: center; 
  gap: 15px;                 /* spacing between icons */
  padding: 25px;
}

.top-icons img {
  width: 150px;  /* adjust size */
  height: auto;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.top-icons img:hover {
  transform: scale(1.1); /* little zoom on hover */
}

/* ===========================
   Floating Letters Gallery Title
   =========================== */
.gallery-title {
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 900;
  text-transform: uppercase;
  text-align: center;
  display: inline-block;
  margin-bottom: 2rem;
  position: relative;
}

.gallery-title span {
  display: inline-block;
  position: relative;
  animation: float-letter 5s ease-in-out infinite;
}

/* Offset animations for each letter */
.gallery-title span:nth-child(1) { animation-delay: 0s; }
.gallery-title span:nth-child(2) { animation-delay: 0.2s; }
.gallery-title span:nth-child(3) { animation-delay: 0.4s; }
.gallery-title span:nth-child(4) { animation-delay: 0.6s; }
.gallery-title span:nth-child(5) { animation-delay: 0.8s; }
.gallery-title span:nth-child(6) { animation-delay: 1s; }
.gallery-title span:nth-child(7) { animation-delay: 1.2s; }
.gallery-title span:nth-child(8) { animation-delay: 1.4s; }
.gallery-title span:nth-child(9) { animation-delay: 1.6s; }
.gallery-title span:nth-child(10) { animation-delay: 1.8s; }

/* Keyframes for floating letters */
@keyframes float-letter {
  0%   { transform: translateY(0) rotate(0deg); }
  25%  { transform: translateY(-8px) rotate(-45deg); }
  50%  { transform: translateY(-12px) rotate(5deg); }
  75%  { transform: translateY(-8px) rotate(-1deg); }
  100% { transform: translateY(0) rotate(0deg); }
}

/* ===========================
   Gallery Section
   =========================== */
#gallery-404 {
  padding: var(--sectionPadding, 2rem);
  overflow: hidden;
  position: relative;
  margin-top: 0;
  padding-top: 0;
}

#gallery-404 .cs-container {
  width: 100%;
  max-width: 80rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(3rem, 6vw, 4rem);
  position: relative;
}

#gallery-404 .cs-gallery {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  row-gap: 1.5rem;
  column-gap: 1rem;
}

#gallery-404 .cs-image {
  width: calc(33.33% - 0.67rem);
  overflow: hidden;
  border-radius: 1rem;
  display: block;
  position: relative;
}

#gallery-404 .cs-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.cs-image iframe {
  aspect-ratio: 16 / 9;
  width: 100%;
  height: auto;
}

#gallery-404 .cs-gallery.cs-hidden {
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
  position: absolute;
  top: 0;
  left: 0;
  transform: scaleY(0) scaleX(0);
  transition: transform 0.7s, opacity 0.3s, visibility 0.5s;
}

#gallery-404 .cs-gallery.cs-hidden .cs-image {
  transform: translateY(2.2rem);
  opacity: 0;
}

/* Lightbox overlay */
.lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.85);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.lightbox-overlay img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 1rem;
  box-shadow: 0 0 30px rgba(0,0,0,0.8);
  object-fit: contain;
  cursor: zoom-out;
  transition: transform 0.3s;
}

/* Tablet */
@media only screen and (min-width: 48rem) {
  #gallery-404 .cs-image { width: 31.8%; }
}

/* Desktop */
@media only screen and (min-width: 81.25rem) {
  #gallery-404 .cs-image { width: 30%; }
}

/* Responsive Top Icons & Gallery Title */
@media (max-width: 768px) {
  .top-icons {
    flex-direction: column;
    gap: 10px;
    padding: 15px;
  }

  .top-icons img {
    width: 120px;
  }

  .gallery-title {
    font-size: clamp(1.5rem, 8vw, 3rem);
  }
}