/* Wspólny, niezależny od kolorystyki serwisu komponent Lightbox. */
.lightbox-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.lightbox-dialog {
  width: 100%;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  color: #fff;
  background: transparent;
  border: 0;
}

.lightbox-dialog::backdrop {
  background: rgb(12 14 12 / 92%);
}

.lightbox-dialog[open] {
  display: grid;
  overflow: hidden;
}

.lightbox-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100%;
  height: 100%;
  padding: clamp(.65rem, 2vw, 1.5rem);
  gap: .75rem;
  box-sizing: border-box;
  min-height: 0;
  overflow: hidden;
}

.lightbox-toolbar,
.lightbox-footer,
.lightbox-navigation {
  display: flex;
  align-items: center;
  gap: .65rem;
}

.lightbox-toolbar {
  justify-content: space-between;
}

.lightbox-toolbar__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .5rem 1rem;
}

.lightbox-workspace {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  gap: .45rem;
  overflow: hidden;
}

.lightbox-stage {
  display: block;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  /* Symetryczne rynny suwaka utrzymują optyczny środek obrazu także wtedy,
     gdy pionowy pasek przewijania pojawia się tylko po prawej stronie. */
  scrollbar-gutter: stable both-edges;
  overscroll-behavior: contain;
  touch-action: pan-x pan-y;
}

.lightbox-canvas {
  display: grid;
  place-items: center;
  min-width: 100%;
  min-height: 100%;
}

.lightbox-image {
  display: block;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  cursor: zoom-out;
}

.lightbox-zoom {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  position: relative;
  z-index: 2;
}

.lightbox-zoom .lightbox-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  padding: 0;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
}

.lightbox-zoom-level {
  min-width: 5.25rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.lightbox-button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.lightbox-footer {
  justify-content: space-between;
}

.lightbox-caption {
  min-width: 0;
  margin: 0;
  font-size: .95rem;
  line-height: 1.45;
  color: #fff;
}

.lightbox-caption[hidden] {
  display: none;
}

.lightbox-counter {
  flex: 0 0 auto;
  padding: .35rem .65rem;
  font-size: clamp(1.1rem, 1rem + .35vw, 1.4rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.lightbox-button,
.lightbox-link {
  min-height: 2.75rem;
  padding: .55rem .8rem;
  color: #fff;
  background: rgb(255 255 255 / 10%);
  border: 1px solid rgb(255 255 255 / 62%);
  border-radius: .35rem;
  font: inherit;
  line-height: 1.25;
  text-decoration: none;
  cursor: pointer;
}

.lightbox-button:hover,
.lightbox-link:hover {
  background: rgb(255 255 255 / 20%);
}

.lightbox-button:focus-visible,
.lightbox-link:focus-visible {
  outline: 3px solid #ffd45c;
  outline-offset: 3px;
}

.lightbox-home-link {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: .2em;
}

body.lightbox-scroll-lock {
  overflow: hidden;
}

@media (max-width: 700px) {
  .lightbox-shell {
    padding: .55rem;
    gap: .5rem;
  }

  .lightbox-toolbar,
  .lightbox-footer {
    align-items: stretch;
  }

  .lightbox-toolbar {
    flex-direction: column;
  }

  .lightbox-zoom {
    justify-content: center;
  }

  .lightbox-toolbar__links {
    justify-content: space-between;
  }

  .lightbox-footer {
    flex-direction: column;
  }

  .lightbox-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .lightbox-button,
  .lightbox-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 3rem;
    text-align: center;
  }

  .lightbox-caption {
    max-height: 5.5em;
    overflow: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lightbox-dialog,
  .lightbox-dialog::backdrop {
    scroll-behavior: auto;
  }
}

@media (forced-colors: active) {
  .lightbox-button,
  .lightbox-link {
    border: 2px solid ButtonText;
  }
}

@media print {
  .lightbox-dialog {
    display: none !important;
  }
}
