body.lightbox-open {
  overflow: hidden;
}

.lightbox-trigger {
  cursor: zoom-in;
}

.lightbox-trigger::after {
  content: "View larger ↗";
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 12px;
  padding: 7px 9px;
  border-radius: 4px;
  background: rgba(18, 21, 19, 0.82);
  color: #fff;
  font: 500 0.64rem/1 "DM Mono", monospace;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.lightbox-trigger:hover::after,
.lightbox-trigger:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.lightbox-trigger:focus-visible {
  outline: 3px solid #dfff00;
  outline-offset: 3px;
}

.photo-lightbox {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(10, 12, 11, 0.98);
  color: #f4f1e9;
}

.photo-lightbox::backdrop {
  background: rgba(10, 12, 11, 0.96);
}

.lightbox-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100%;
  height: 100%;
  padding: 18px 24px 20px;
}

.lightbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  font: 500 0.72rem/1 "DM Mono", monospace;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.lightbox-header button,
.lightbox-step {
  border: 1px solid rgba(244, 241, 233, 0.5);
  background: transparent;
  color: #f4f1e9;
  cursor: pointer;
}

.lightbox-header button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 5px;
  font: 500 0.69rem/1 "DM Mono", monospace;
  text-transform: uppercase;
}

.lightbox-header button span {
  color: #dfff00;
  font-size: 1.2rem;
}

.lightbox-header button:hover,
.lightbox-header button:focus-visible,
.lightbox-step:hover,
.lightbox-step:focus-visible {
  border-color: #dfff00;
  outline: none;
  color: #dfff00;
}

.lightbox-stage {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 54px;
  align-items: center;
  gap: 20px;
  min-height: 0;
}

.lightbox-stage figure {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: center;
  justify-items: center;
  min-width: 0;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

.lightbox-stage img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: calc(100dvh - 190px);
  object-fit: contain;
}

.lightbox-stage figcaption {
  max-width: 760px;
  margin: 12px auto 0;
  color: #d5d6d1;
  font-size: 0.88rem;
  line-height: 1.4;
  text-align: center;
}

.lightbox-step {
  display: grid;
  width: 54px;
  height: 54px;
  padding: 0;
  place-items: center;
  border-radius: 6px;
  font: 500 1.4rem/1 "DM Mono", monospace;
}

.lightbox-filmstrip {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  max-width: min(900px, 82vw);
  margin: 14px auto 0;
  padding: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.lightbox-filmstrip::-webkit-scrollbar {
  display: none;
}

.lightbox-filmstrip button {
  flex: 0 0 auto;
  width: 72px;
  height: 52px;
  padding: 2px;
  border: 2px solid transparent;
  border-radius: 5px;
  background: transparent;
  cursor: pointer;
  opacity: 0.55;
}

.lightbox-filmstrip button:hover,
.lightbox-filmstrip button:focus-visible,
.lightbox-filmstrip button.is-current {
  border-color: #dfff00;
  outline: none;
  opacity: 1;
}

.lightbox-filmstrip img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 2px;
  object-fit: cover;
}

@media (max-width: 620px) {
  .lightbox-trigger::after {
    content: "↗";
    opacity: 0.9;
    transform: none;
  }

  .lightbox-shell {
    padding: 10px 12px 14px;
  }

  .lightbox-stage {
    position: relative;
    display: block;
  }

  .lightbox-stage figure {
    padding: 0 4px;
  }

  .lightbox-stage img {
    max-height: calc(100dvh - 180px);
  }

  .lightbox-step {
    position: absolute;
    z-index: 2;
    top: 50%;
    width: 44px;
    height: 44px;
    border-color: rgba(244, 241, 233, 0.75);
    background: rgba(18, 21, 19, 0.72);
    transform: translateY(-50%);
  }

  .lightbox-previous {
    left: 4px;
  }

  .lightbox-next {
    right: 4px;
  }

  .lightbox-filmstrip {
    max-width: 100%;
    margin-top: 10px;
  }

  .lightbox-filmstrip button {
    width: 60px;
    height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lightbox-trigger::after {
    transition: none;
  }
}
