.gallery-item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease, filter 0.4s ease;
  filter: brightness(0.85);
}
.gallery-item:hover img {
  transform: scale(1.07);
  filter: brightness(1);
}
.gallery-item .lb-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.65);
  color: #e8e2d9;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  padding: 4px 8px;
  border-radius: 2px;
  pointer-events: none;
}
.gallery-item.lb-hidden {
  display: none;
}
#lb-overlay {
  position: fixed;
  inset: 0;
  z-index: 1500;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
#lb-overlay svg {
  color: white;
}
#lb-overlay.open {
  opacity: 1;
  pointer-events: all;
}
#lb-overlay.open #lb-modal {
  transform: scale(1);
  opacity: 1;
}
#lb-modal {
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: scale(0.92);
  transition: transform 0.32s cubic-bezier(0.34, 1.28, 0.64, 1), opacity 0.3s ease;
  opacity: 0;
}
#lb-img {
  max-width: 80vw;
  max-height: 70vh;
  object-fit: contain;
  display: block;
  transition: opacity 0.2s ease;
}
#lb-img.fade {
  opacity: 0;
}
#lb-caption {
  margin-top: 18px;
  color: #9e9890;
  font-style: italic;
  font-size: 1rem;
  letter-spacing: 0.05em;
  text-align: center;
}
#lb-counter {
  margin-top: 6px;
  color: #524d48;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-align: center;
  font-family: sans-serif;
}
#lb-close {
  position: fixed;
  top: 24px;
  right: 28px;
  background: none;
  border: none;
  color: #6b6560;
  cursor: pointer;
  padding: 6px;
  line-height: 1;
  z-index: 1001;
}
.lb-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: 1px solid #2e2a26;
  border-radius: 50%;
  color: #7a7268;
  width: 50px;
  height: 50px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  z-index: 1001;
}
.lb-nav:hover {
  border-color: #8a7d6e;
  color: #e8e2d9;
  background: rgba(255, 255, 255, 0.04);
}
.lb-nav.hidden {
  display: none;
}
#lb-prev {
  left: 20px;
}
#lb-next {
  right: 20px;
}
#lb-thumbs {
  display: flex;
  gap: 6px;
  margin-top: 16px;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 88vw;
}
#lb-thumbs img {
  width: 52px;
  height: 38px;
  object-fit: cover;
  cursor: pointer;
  opacity: 0.45;
  border: 1px solid transparent;
  transition: opacity 0.2s, border-color 0.2s;
}
#lb-thumbs img:hover {
  opacity: 0.8;
}
#lb-thumbs img.active {
  opacity: 1;
  border-color: #9e9890;
}
#lb-thumbs.hidden {
  display: none;
}
