body {
  padding-left: 0;
  padding-right: 0; !important
}

/* ------ Header / Navigation ----------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(2px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding: 0.5rem 2rem;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  transition: all 0.3s ease;
  z-index: 1000;
}
/* -------------------------------------------------------------------------- */

/* ----- Masonry Photo Gallery ---------------------------------------------- */
main {
  padding-left: 0.8rem;
  padding-right: 0.8rem;
}

.photo-gallery {
  margin-top: 1rem;
}

.photo-gallery h2 {
  font-size: 2.5rem;
  margin-bottom: 0.8rem;
  text-align: center;
}

#masonry {
  position: relative;
  min-height: 100vh;
  width: 100%;
  visibility: hidden;
}

.grid-sizer {
  width: calc(33.333% - 10.666px); /* 16px gutter split over 3 columns */
}

.gallery-item {
  float: left;
  margin-bottom: 16px;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeIn 0.6s ease forwards;
  border: 1px solid black;
  box-sizing: border-box;
  animation-delay: var(--fade-delay, 0s); /* dynamic delay */
  visibility: hidden;
}

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  max-width: 100%;
}

.gallery-item.loading {
  opacity: 0;
  visibility: hidden;
}

@keyframes fadeIn {
  0% {
    opacity: 0;
    transform: translateY(20px);
    visibility: visible;
  }

  100% {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
  }
}

.gallery-item:hover img {
  transform: scale(1.02);
}

.gallery-item figcaption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(17, 17, 17, 0.75);
  color: #fff;
  font-size: 0.9rem;
  padding: 0.5rem;
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-item:hover figcaption {
  opacity: 1;
}
/* -------------------------------------------------------------------------- */


/* -------------------------------------------------------------------------- */
.scroll-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: black;
  color: white;
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font-size: 1.5rem;
  cursor: pointer;
  opacity: 0.7;
  z-index: 999;
  transition: opacity 0.2s ease;
}

.scroll-top:hover {
  opacity: 1;
}

.scroll-top.hidden {
  display: none;
}
/* -------------------------------------------------------------------------- */


/* Loading spinner -----------------------------------------------------------*/
#loader {
  text-align: center;
  padding: 2rem;
  font-size: 1rem;
  color: #333;
  display: none;
}
/* ---------------------------------------------------------------------------*/

/* ----- Modal for Fullscreen Image ----------------------------------------- */
.modal {
  position: absolute;
  top: 0; /* Dynamically adjusted via JS, so that it's always positioned... */
  /* ...where the user is currently looking (along the vertical... */
  /* ...axis of the page */
  left: 0;
  width: 100%;
  height: 100vh;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.modal.hidden {
  display: none;
}

.modal img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 0.5rem;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.4);
  object-fit: contain;
  background: #fff;
  padding: 0.5rem;
}
/* ---------------------------------------------------------------------------*/

@media (max-width: 900px) {
  .grid-sizer,
  .gallery-item {
    width: calc(50% - 8px); /* 2 columns on medium screens */
  }
}

@media (max-width: 600px) {
  .grid-sizer,
  .gallery-item {
    width: 100%; /* 1 column on small screens */
  }
}
