a[data-news-lightbox] {
  display: block;
  cursor: zoom-in;
}

a[data-news-lightbox]:focus-visible {
  outline: 2px solid #23463a;
  outline-offset: 3px;
}

html:has(.news-lightbox[open]) {
  overflow: hidden;
}

.news-lightbox {
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  width: max-content;
  max-width: calc(100% - 24px);
  max-height: calc(100% - 24px);
  margin: auto;
  padding: 12px;
  border: 1px solid #39594d;
  border-radius: 8px;
  background: #18342b;
  color: #fff;
}

.news-lightbox::backdrop {
  background: rgba(13, 25, 21, 0.86);
}

@media (prefers-reduced-motion: no-preference) {
  .news-lightbox[open] {
    animation: news-lightbox-enter 280ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
  }

  .news-lightbox[open]::backdrop {
    animation: news-lightbox-backdrop-enter 220ms ease-out both;
  }
}

@keyframes news-lightbox-enter {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes news-lightbox-backdrop-enter {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.news-lightbox__toolbar,
.news-lightbox__navigation {
  display: flex;
  align-items: center;
  gap: 8px;
}

.news-lightbox__toolbar {
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.news-lightbox__navigation[hidden] {
  display: none;
}

.news-lightbox [data-close] {
  margin-left: auto;
}

.news-lightbox button {
  min-width: 44px;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid #afc9bd;
  border-radius: 5px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.news-lightbox button:hover {
  background: #31584a;
}

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

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