.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
  margin: 20px 0;
}

.gallery-item {
  display: block;
  width: 100%;
  overflow: hidden;
  border: 1px solid rgba(98, 92, 93, .15);
  border-radius: 8px;
  background: #F2EEE9;
  cursor: pointer;
  transition:
  transform .3s ease,
  border-color .3s ease;
}

.gallery-item:hover {
  transform: translateY(-3px);
  border-color: #B48A93;
}

.gallery-item img {
  display: block;
  width: 100%;
  height: 150px;
  object-fit: cover;
}

#lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 25px;
  background: rgba(55, 53, 54, .82);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
  opacity .3s ease,
  visibility .3s ease;
}

#lightbox.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

#lightbox-box {
  position: relative;
  width: 850px;
  max-width: 100%;
  height: 85vh;
  display: flex;
  flex-direction: column;
  padding: 12px;
  border-radius: 12px;
  background: #F2EEE9;
  box-shadow: 0 20px 60px rgba(40, 38, 39, .30);
  transform: translateY(15px);
  transition:     transform .3s ease;
}

#lightbox.open #lightbox-box {
  transform: translateY(0);
}

#toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

#toolbar button {
  padding: 5px 10px;
  border: 0;
  border-radius: 5px;
  background: #C8C0BA;
  color: #555354;
  font-family: Arial, sans-serif;
  font-size: 10px;
  cursor: pointer;
  transition: background .2s ease,
  color .2s ease;
}

#toolbar button:hover {
  background: #8E9A92;
  color: #F2EEE9;
}

#toolbar button.active {
  background: #B48A93;
  color: #F2EEE9;
}

#close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: #B48A93;
  color: #F2EEE9;
  font-family: Arial, sans-serif;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background .2s ease,
  transform .2s ease;
}

#close:hover {
  background: #66776F;
  transform: rotate(90deg);
}

#viewer {
  width: 100%;
  height: 100%;
  overflow: auto;
  cursor: grab;
  background: #E1DBD6;
  border-radius: 8px;
}

#viewer.dragging {
  cursor: grabbing;
}

#image-wrap {
  width: max-content;
  min-width: 100%;
  height: max-content;
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#lightbox-image {
  display: block;
  flex: 0 0 auto;
  max-width: none;
  max-height: none;
  user-select: none;
  -webkit-user-drag: none;
}

#viewer::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

#viewer::-webkit-scrollbar-track {
  background: #C8C0BA;
}

#viewer::-webkit-scrollbar-thumb {
  background: #B48A93;
  border-radius: 10px;
}

.gallery-info {
  margin-top: 7px;
  color: #91898A;
  font-family: Arial, sans-serif;
  font-size: 8px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .5px;
}
