.screenshot-gallery {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-regular);
  margin: 0 auto var(--space-regular);
}

.screenshot-gallery > input[type="radio"] {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip: rect(0 0 0 0);
  overflow: hidden;
}

.screenshot-gallery .ss-main {
  position: relative;
  width: 100%;
  max-width: 360px;
  aspect-ratio: 3 / 4;
}

.screenshot-gallery .ss-main img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: var(--border-radius-regular);
  margin: 0;
  display: none;
}

.screenshot-gallery > input[type="radio"]:nth-of-type(1):checked ~ .ss-main img:nth-child(1),
.screenshot-gallery > input[type="radio"]:nth-of-type(2):checked ~ .ss-main img:nth-child(2),
.screenshot-gallery > input[type="radio"]:nth-of-type(3):checked ~ .ss-main img:nth-child(3),
.screenshot-gallery > input[type="radio"]:nth-of-type(4):checked ~ .ss-main img:nth-child(4),
.screenshot-gallery > input[type="radio"]:nth-of-type(5):checked ~ .ss-main img:nth-child(5),
.screenshot-gallery > input[type="radio"]:nth-of-type(6):checked ~ .ss-main img:nth-child(6),
.screenshot-gallery > input[type="radio"]:nth-of-type(7):checked ~ .ss-main img:nth-child(7),
.screenshot-gallery > input[type="radio"]:nth-of-type(8):checked ~ .ss-main img:nth-child(8) {
  display: block;
}

.screenshot-gallery .ss-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-small);
  justify-content: center;
}

.screenshot-gallery .ss-thumbs label {
  display: block;
  width: 56px;
  aspect-ratio: 1;
  cursor: pointer;
  border-radius: var(--border-radius-regular);
  overflow: hidden;
  border: 2px solid transparent;
  opacity: 0.6;
  transition: opacity 0.2s, border-color 0.2s;
}

.screenshot-gallery .ss-thumbs label:hover {
  opacity: 0.85;
}

.screenshot-gallery .ss-thumbs label img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  margin: 0;
  display: block;
}

.screenshot-gallery > input[type="radio"]:nth-of-type(1):checked ~ .ss-thumbs label:nth-child(1),
.screenshot-gallery > input[type="radio"]:nth-of-type(2):checked ~ .ss-thumbs label:nth-child(2),
.screenshot-gallery > input[type="radio"]:nth-of-type(3):checked ~ .ss-thumbs label:nth-child(3),
.screenshot-gallery > input[type="radio"]:nth-of-type(4):checked ~ .ss-thumbs label:nth-child(4),
.screenshot-gallery > input[type="radio"]:nth-of-type(5):checked ~ .ss-thumbs label:nth-child(5),
.screenshot-gallery > input[type="radio"]:nth-of-type(6):checked ~ .ss-thumbs label:nth-child(6),
.screenshot-gallery > input[type="radio"]:nth-of-type(7):checked ~ .ss-thumbs label:nth-child(7),
.screenshot-gallery > input[type="radio"]:nth-of-type(8):checked ~ .ss-thumbs label:nth-child(8) {
  border-color: #ffffff;
  opacity: 1;
  cursor: default;
}

.screenshot-gallery > input[type="radio"]:nth-of-type(1):focus-visible ~ .ss-thumbs label:nth-child(1),
.screenshot-gallery > input[type="radio"]:nth-of-type(2):focus-visible ~ .ss-thumbs label:nth-child(2),
.screenshot-gallery > input[type="radio"]:nth-of-type(3):focus-visible ~ .ss-thumbs label:nth-child(3),
.screenshot-gallery > input[type="radio"]:nth-of-type(4):focus-visible ~ .ss-thumbs label:nth-child(4),
.screenshot-gallery > input[type="radio"]:nth-of-type(5):focus-visible ~ .ss-thumbs label:nth-child(5),
.screenshot-gallery > input[type="radio"]:nth-of-type(6):focus-visible ~ .ss-thumbs label:nth-child(6),
.screenshot-gallery > input[type="radio"]:nth-of-type(7):focus-visible ~ .ss-thumbs label:nth-child(7),
.screenshot-gallery > input[type="radio"]:nth-of-type(8):focus-visible ~ .ss-thumbs label:nth-child(8) {
  outline: 2px solid var(--brand-color-brown-light);
  outline-offset: 2px;
}
