.news-post img {
  display: block;
  width: auto;
  max-width: min(100%, 44rem);
  height: auto;
  max-height: min(34rem, 70vh);
  margin: 1.25rem auto;
  object-fit: contain;
}

.news-post figure {
  margin: 1.25rem 0;
}

.news-post figure img {
  margin-top: 0;
  margin-bottom: 0;
}

.news-post figcaption {
  margin: 0.5rem auto 0;
  font-size: 1rem;
  line-height: 1.5;
  text-align: center;
}

.news-post img[data-lightbox-ready] {
  cursor: zoom-in;
}

.news-post img[data-lightbox-ready]:focus-visible {
  outline: 3px solid #0969da;
  outline-offset: 3px;
}

body.news-lightbox-open {
  overflow: hidden;
}

.news-lightbox {
  width: auto;
  max-width: none;
  height: auto;
  max-height: none;
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
}

.news-lightbox::backdrop {
  background: rgba(13, 17, 23, 0.9);
}

.news-lightbox__surface {
  position: relative;
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr) 3rem;
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: center;
  width: min(96vw, 1200px);
  height: min(94vh, 900px);
}

.news-lightbox__figure {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  min-height: 0;
  margin: 0;
  text-align: center;
}

.news-lightbox__image {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: calc(94vh - 5rem);
  margin: auto;
  object-fit: contain;
}

.news-lightbox__caption {
  max-width: 55rem;
  margin: 0.65rem auto 0;
  color: #fff;
  font-size: 0.95rem;
  line-height: 1.4;
  text-align: center;
}

.news-lightbox__button {
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0.35rem 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 4px;
  background: rgba(13, 17, 23, 0.72);
  color: #fff;
  font: inherit;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.news-lightbox__button:hover,
.news-lightbox__button:focus-visible {
  background: #fff;
  color: #24292f;
}

.news-lightbox__button:focus-visible {
  outline: 3px solid #58a6ff;
  outline-offset: 2px;
}

.news-lightbox__close {
  position: absolute;
  z-index: 1;
  top: 0;
  right: 0;
}

.news-lightbox__previous {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
}

.news-lightbox__next {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
}

.news-lightbox__position {
  grid-column: 1 / -1;
  grid-row: 2;
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  text-align: center;
}

@media (max-width: 600px) {
  .news-lightbox__surface {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: minmax(0, 1fr) auto auto;
    gap: 0.65rem;
    width: 94vw;
    height: 92vh;
  }

  .news-lightbox__figure {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .news-lightbox__image {
    max-height: calc(92vh - 8rem);
  }

  .news-lightbox__previous,
  .news-lightbox__next {
    grid-row: 2;
    width: 100%;
  }

  .news-lightbox__previous {
    grid-column: 1;
  }

  .news-lightbox__next {
    grid-column: 2;
  }

  .news-lightbox__position {
    grid-column: 1 / -1;
    grid-row: 3;
    margin-top: 0;
  }
}
