/**
 * Lightbox (js/lightbox.js, PhotoSwipe): own buttons and the caption below the picture
 * Loaded by php/include/header.php after css/vendor/photoswipe/photoswipe.css on the pages with
 * pictures to enlarge.
 */

/* @section Buttons
 * close and arrows with the icons of the website; on wide screens with a mouse they grow while the
 * pointer is on them
 */
.pswp__button--close,
.pswp__button--arrow--prev,
.pswp__button--arrow--next {
  opacity: 1;
}
.pswp__button--close {
  height: 5vw;
  margin: 0;
  min-height: 50px;
  min-width: 50px;
  width: 5vw;
}
.pswp__button--arrow {
  height: 9vw;
  margin-top: 0;
  min-height: 70px;
  min-width: 50px;
  transform: translateY(-50%);
  width: 7vw;
}
.pswp .lightbox-icon {
  background: none center / 70% no-repeat;
  display: block;
  inset: 0.5em;
  position: absolute;
  transition: var(--transition-fast-delay);
}
.pswp__button--close .lightbox-icon {
  background-image: url(assets/close.svg);
}
.pswp__button--arrow--prev .lightbox-icon {
  background-image: url(assets/arrow-left.svg);
}
.pswp__button--arrow--next .lightbox-icon {
  background-image: url(assets/arrow-right.svg);
}
@media (hover: hover) {
  .pswp__button:hover .lightbox-icon,
  .pswp__button:focus-visible .lightbox-icon {
    background-size: 100%;
    transition: var(--transition-fast);
  }
}

/* @section Caption
 * at the bottom of the window, as high as its text (at most 40 %, then it scrolls); the picture keeps
 * clear of it (lightbox.js measures the height on a hidden copy with the same class)
 */
.lightbox-caption {
  background-color: var(--color-darkblue);
  bottom: 0;
  box-sizing: border-box;
  color: var(--color-white);
  left: 0;
  max-height: 40%;
  overflow-y: auto;
  padding: 12px max(16px, calc((100% - 50em) / 2));
  position: absolute;
  right: 0;
}
.lightbox-caption[hidden] {
  display: none;
}
.lightbox-caption-measure {
  max-height: none;
  pointer-events: none;
  position: fixed;
  visibility: hidden;
}
.lightbox-caption a {
  color: inherit;
  font-weight: inherit;
}
.lightbox-caption .info {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  font-size: 0.9em;
  gap: 0.5em;
}
.lightbox-caption .label {
  color: var(--color-yellow);
  flex-shrink: 0;
  font-weight: bold;
  text-align: right;
  width: 6em;
}
.lightbox-caption .value {
  flex-grow: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.lightbox-caption .original.label {
  opacity: 0;
}
.lightbox-caption :first-child > .original.label,
.lightbox-caption .caption.label,
.lightbox-caption .more.label {
  display: none;
}
.lightbox-caption .caption.value {
  border-bottom: solid var(--color-yellow) 1px;
  font-size: 1.2em;
  margin-bottom: 0.5em;
  padding-bottom: 0.5em;
  text-align: center;
}
