div.thumbwrapper {
  float: left;
  margin: 10px;
}

div.thumbwrapper a {
  display: inline-block;
  border: 2px solid #c5c8cc;
  transition: border-color 0.2s ease;
}

div.thumbwrapper a:hover,
div.thumbwrapper a:focus-visible {
  border-color: #8d9299;
  outline: none;
}

div.thumbwrapper img {
  display: block;
  width: 170px;
  height: auto;
}

body.gallery-locked {
  overflow: hidden;
}

.gallery-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 1000;
}

.gallery-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.gallery-dialog {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.gallery-image {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 4px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  background: #1b1b1b;
}

.gallery-caption {
  margin: 0;
  color: #ffffff;
  font-size: 0.95rem;
  text-align: center;
}

.gallery-close {
  position: absolute;
  top: -10px;
  right: -10px;
  border: none;
  background: #8d9299;
  color: #fff;
  border-radius: 999px;
  width: 36px;
  height: 36px;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.gallery-close:hover,
.gallery-close:focus-visible {
  background: #6d7177;
  outline: none;
}
