.gallery-title {
  width: 100%;
  text-align: center;
  font-size: clamp(24px, 3vw, 40px);
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 40px 20px 20px;
}

[data-theme=dark] .gallery-content .masonry-gallery .gallery-item::before {
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.1) 50%, rgba(0, 0, 0, 0.8) 100%);
}

.gallery-content {
  padding: 20px;
}
.gallery-content .masonry-gallery {
  column-count: 5;
  gap: 20px;
}
@media (max-width: 1400px) {
  .gallery-content .masonry-gallery {
    column-count: 4;
  }
}
@media (max-width: 1200px) {
  .gallery-content .masonry-gallery {
    column-count: 3;
  }
}
@media (max-width: 900px) {
  .gallery-content .masonry-gallery {
    column-count: 2;
  }
}
.gallery-content .masonry-gallery img {
  width: 100%;
  transition: all 0.3s ease-in-out;
}
.gallery-content .masonry-gallery .gallery-item {
  position: relative;
  cursor: pointer;
  page-break-inside: avoid;
  margin-bottom: 20px;
  overflow: hidden;
  border-radius: 8px;
}
.gallery-content .masonry-gallery .gallery-item::before {
  content: "";
  inset: 0;
  z-index: 1;
  position: absolute;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.8) 100%);
  opacity: 0;
  transition: all 0.3s ease-in-out;
  pointer-events: none;
}
.gallery-content .masonry-gallery .gallery-item:hover::before {
  opacity: 1;
}
.gallery-content .masonry-gallery .gallery-item:hover img {
  transform: scale3d(1.2, 1.2, 1.2);
}
.gallery-content .masonry-gallery .gallery-item:hover .gallery-item__overlay {
  opacity: 1;
  transform: scale(1);
  z-index: 1;
}
.gallery-content .masonry-gallery .gallery-item__overlay {
  display: flex;
  flex-direction: column;
  position: absolute;
  bottom: 0px;
  left: 0px;
  right: 0px;
  padding: 12px;
  gap: 6px;
  opacity: 0;
  transform: scale(0);
  transition: all 0.3s ease-in-out;
}
.gallery-content .masonry-gallery .gallery-item__overlay .gallery-item__title {
  font-size: 1.125rem;
  font-weight: 600;
}
.gallery-content .masonry-gallery .gallery-item__overlay .gallery-item__description {
  font-size: 1rem;
  font-weight: 400;
}

.gallery-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: 0.3s ease;
  z-index: 999999;
  padding-inline: 5px;
}

.gallery-modal.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.gallery-modal.active .gallery-modal__content {
  transform: scale(1);
  opacity: 1;
}

.gallery-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
}

.gallery-modal__content {
  transform: scale(0.5);
  opacity: 0;
  transition: 0.25s ease;
  position: relative;
  max-width: 900px;
  margin: 5vh auto;
  background: var(--surface);
  border-radius: 12px;
  z-index: 2;
  transition: 0.3s;
}

.gallery-modal__content img {
  width: 100%;
  display: block;
  max-height: 80vh;
  object-fit: cover;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

.gallery-modal__text {
  padding: 15px;
  line-height: 1.15;
  font-size: 1rem;
  background: #1e1e1e;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
}
[data-theme=light] .gallery-modal__text {
  background: #ffffff;
}
.gallery-modal__text #modal-desc {
  font-size: 0.928rem;
  font-weight: 400;
  margin-top: 2px;
}

.gallery-modal__close {
  position: absolute;
  top: -40px;
  right: -8px;
  background: none;
  border: 0;
  font-size: 1.875rem;
  cursor: pointer;
  color: white;
}

.gallery-modal__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(203, 203, 203, 0.7490196078);
  border: 0;
  color: #000;
  font-size: clamp(16px, 1vw, 30px);
  min-width: 40px;
  width: 2.5vw;
  aspect-ratio: 1/1;
  border-radius: 50%;
  cursor: pointer;
  z-index: 3;
  transition: 0.3s;
}
.gallery-modal__nav:hover {
  background: rgba(203, 203, 203, 0.9921568627);
}

.gallery-modal__nav.prev {
  left: 10px;
}

.gallery-modal__nav.next {
  right: 10px;
}