/* Taevaskoja – Galerii lightbox (js/lightbox.js) polish on top of the Breakdance .tvk-lightbox* rules:
   - the caption sits below the picture outside the figure's box, so the figure (= the picture) is centred in the
     viewport and the side arrows line up with the middle of the picture;
   - arrows are placed with top: calc() instead of translate(-50%), so the :active scale from motion.css no longer
     wipes the centring transform (that made them jump/flicker on every click);
   - SVG icons instead of font glyphs, so they sit dead centre in the round buttons;
   - .is-loading dims the current picture while the next one decodes (no blank frame / size jump). */

body .tvk-lightbox__figure {
  position: relative;
  gap: 0;
}
body .tvk-lightbox__img {
  transition: opacity .18s ease;
}
body .tvk-lightbox__img.is-loading {
  opacity: .55;
}
body .tvk-lightbox__caption {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin: .75rem 0 0;
}

body .tvk-lightbox__btn {
  width: 3.5rem;
  height: 3.5rem;
  padding: 0;
  font-size: 0;
  line-height: 0;
}
body .tvk-lightbox__btn svg {
  display: block;
  width: 1.5rem;
  height: 1.5rem;
  pointer-events: none;
}
body .tvk-lightbox__close {
  top: 1rem;
  right: 1rem;
}
body .tvk-lightbox__counter {
  top: 1rem;
  left: 1.5rem;
  line-height: 3.5rem;
}
body .tvk-lightbox__prev,
body .tvk-lightbox__next {
  top: calc(50% - 1.75rem);
  transform: none;
}
body .tvk-lightbox__prev { left: 1rem; }
body .tvk-lightbox__next { right: 1rem; }
body .tvk-lightbox__btn:active {
  transform: scale(.9);
}

@media (max-width: 767px) {
  body .tvk-lightbox__btn {
    width: 2.75rem;
    height: 2.75rem;
  }
  body .tvk-lightbox__btn svg {
    width: 1.25rem;
    height: 1.25rem;
  }
  body .tvk-lightbox__close {
    top: .625rem;
    right: .625rem;
  }
  body .tvk-lightbox__counter {
    top: .625rem;
    left: 1rem;
    line-height: 2.75rem;
  }
  /* phones: arrows at the bottom corners, caption between them */
  body .tvk-lightbox__prev,
  body .tvk-lightbox__next {
    top: auto;
    bottom: .375rem;
  }
  body .tvk-lightbox__prev { left: .625rem; }
  body .tvk-lightbox__next { right: .625rem; }
  body .tvk-lightbox__caption {
    padding: 0 3.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  body .tvk-lightbox__img { transition: none; }
}
