dialog {
  border: none;
  padding: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

dialog:not([open]) {
  visibility: hidden;
  pointer-events: none;
  width: 0;
  height: 0;
}

dialog[open] {
  visibility: visible;
  pointer-events: auto;
  width: 100vw;
  height: 100vh;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.65);
}

.lightbox-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.lightbox-top {
  display: flex;
  justify-content: flex-end;
  width: 100%;
  margin-bottom: 8px;
}

.close {
  font-size: 28px;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 8px;
  opacity: 0.9;
}

.close:hover {
  opacity: 1;
}

.lightbox-body {
  display: flex;
  align-items: center;
  gap: 16px;
}

#lightbox-img {
  display: block;
  max-height: calc(100vh - 200px);
  max-width: calc(100vw - 160px);
  width: auto;
  object-fit: contain;
  background: #111;
  border-radius: 8px;
}

.nav {
  font-size: 48px;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  opacity: 0.8;
  padding: 8px;
  flex-shrink: 0;
  line-height: 1;
}

.nav:hover {
  opacity: 1;
}

.counter {
  color: white;
  font-size: 14px;
  opacity: 0.9;
  margin-top: 8px;
}
