/* =============================================================================
 * Gallery cards + lightbox (wall chrome in masonry-wall.css).
 * ============================================================================= */

.gallery-filters-media {
  margin-top: -0.8rem;
  margin-bottom: 1.25rem;
  font-size: 0.85rem;
}

.gallery-card {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: var(--md-code-bg-color);
  color: var(--md-default-fg-color);
}

.gallery-open {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  line-height: 0;
}

.gallery-media {
  position: relative;
  display: block;
  line-height: 0;
}

.gallery-image {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: top;
  background: var(--md-code-bg-color);
}

.gallery-video {
  object-fit: cover;
  pointer-events: none;
}

.gallery-play {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  color: #f5f5f5;
  font-size: 0.95rem;
  line-height: 1;
  pointer-events: none;
  background: rgb(0 0 0 / 55%);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.gallery-card.is-video .gallery-open {
  cursor: pointer;
}

.gallery-meta {
  padding: 0.75rem 0.9rem 0.85rem;
  color: var(--lupaxa-white);
  line-height: 1.2;
  text-align: center;
  background: var(--lupaxa-blue);
}

.gallery-comment {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.85rem;
  line-height: 1.35;
  color: inherit;
}

.gallery-date {
  margin: 0;
  color: inherit;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.65rem;
  text-align: center;
  opacity: 0.55;
}

.gallery-comment + .gallery-date {
  margin-top: 0;
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 1.25rem;
}

.gallery-lightbox[hidden] {
  display: none !important;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  background: rgb(0 0 0 / 85%);
  border: 0;
}

.lightbox-dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  max-width: min(1100px, 100%);
  max-height: 100%;
  color: #f5f5f5;
}

.lightbox-close {
  position: absolute;
  top: -0.25rem;
  right: -0.25rem;
  z-index: 2;
  padding: 0.35rem 0.5rem;
  color: #f5f5f5;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  background: transparent;
  border: 0;
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  z-index: 2;
  top: 50%;
  padding: 0.75rem 0.85rem;
  color: #f5f5f5;
  font-size: clamp(2rem, 5vw, 2.75rem);
  line-height: 1;
  cursor: pointer;
  background: transparent;
  border: 0;
  opacity: 0.75;
  transform: translateY(-50%);
}

.lightbox-prev:hover,
.lightbox-next:hover,
.lightbox-prev:focus-visible,
.lightbox-next:focus-visible {
  opacity: 1;
}

.lightbox-prev {
  left: 0.15rem;
}

.lightbox-next {
  right: 0.15rem;
}

.lightbox-image,
.lightbox-video {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100vh - 6rem);
  margin: 0 auto;
  object-fit: contain;
}

.lightbox-image[hidden],
.lightbox-video[hidden] {
  display: none !important;
}

.lightbox-comment {
  margin: 0.75rem 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.95rem;
  line-height: 1.2;
  text-align: center;
}

.lightbox-date {
  margin: 0.75rem 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.7rem;
  line-height: 1.2;
  text-align: center;
  opacity: 0.55;
}

.lightbox-comment:not([hidden]) + .lightbox-date {
  margin-top: 0;
}

body.lightbox-open {
  overflow: hidden;
}
