/* Thumbnails and lightbox for article screenshots. Loaded only on pages that use them. */

.shot {
  max-width: 100%;
}

.shot-thumb {
  display: block;
  position: relative;
  width: min(12rem, 100%);
  min-width: 0;
  max-width: 100%;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  background: #111;
  line-height: 0;
  cursor: zoom-in;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}

.shot-thumb:hover {
  border-color: var(--accent);
}

.shot-thumb:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.shot-thumb img {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.lightbox {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 4.25rem 1rem 1.25rem;
  border: none;
  background: transparent;
  box-sizing: border-box;
  overflow: auto;
}

.lightbox[open] {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.lightbox::backdrop {
  background: rgba(20, 16, 12, 0.92);
}

.lightbox-close {
  position: fixed;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 1;
  margin: 0;
  min-height: 2.75rem;
  min-width: 2.75rem;
  padding: 0.4rem 0.95rem;
  border: 0;
  border-radius: 0.6rem;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
}

.lightbox-close:hover {
  background: #fff;
}

.lightbox-close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.lightbox-image {
  display: block;
  width: auto;
  height: auto;
  min-width: 0;
  max-width: 100%;
  max-height: calc(100dvh - 13rem);
  object-fit: contain;
  border-radius: 0.5rem;
  background: #111;
}

.lightbox-caption {
  width: min(40rem, 100%);
  max-width: 100%;
  margin: 0.75rem 0 0;
  padding: 0.35rem 0.7rem;
  border-radius: 0.45rem;
  background: rgba(20, 16, 12, 0.78);
  color: #f7f3ec;
  font-size: 0.95rem;
  line-height: 1.45;
}

.lightbox-caption:empty {
  display: none;
}

@media (max-width: 40rem) {
  .lightbox {
    padding: 4rem 0.75rem 1rem;
  }

  .lightbox-close {
    top: 0.5rem;
    right: 0.5rem;
  }

  .lightbox-image {
    max-width: 100%;
    max-height: calc(100dvh - 12rem);
  }
}
