.gallery-mosaic {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  grid-auto-rows: 300px;
  grid-auto-flow: dense;
  gap: 10px;
  padding: 80px 5%;
  background-color: #ffffff;
}

.gallery-mosaic-item {
  overflow: hidden;
  cursor: pointer;
}

.gallery-mosaic-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  content-visibility: auto;
}

.gallery-mosaic-item:hover img {
  transform: scale(1.05);
}

.gallery-mosaic-item.item-v2 {
  grid-row: span 2;
}

.gallery-mosaic-item.item-h2 {
  grid-column: span 2;
}

.lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.lightbox-overlay.visible {
  opacity: 1;
}

.lightbox-message {
  color: white;
  font-family: var(--font-family, sans-serif);
  padding: 20px;
  font-size: 1rem;
  text-align: center;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  animation: fadeInMessage 0.5s 0.3s ease-out forwards;
  opacity: 0;
}

@keyframes fadeInMessage {
  to {
    opacity: 0.8;
  }
}

.lightbox-overlay img {
  max-width: 90%;
  max-height: 80%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transform: scale(0.95);
  transition: transform 0.3s ease-in-out;
}

.lightbox-overlay.visible img {
  transform: scale(1);
}

@media (max-width: 768px) {
  .gallery-mosaic {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    grid-auto-rows: 300px;
    gap: 0px;
    padding: 0px 0%;
  }

  .gallery-mosaic-item.item-h2 {
    grid-column: span 1;
  }
}
