/* "See it in action" section: theme-matched demo videos and screenshots. */

.demo-row + .demo-row {
  margin-top: 4rem;
}

.demo-frame {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid var(--bs-border-color);
  background: var(--bs-tertiary-bg);
  box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.18);
}

.demo-frame video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.demo-shot a {
  border-radius: 0.5rem;
  overflow: hidden;
  border: 1px solid var(--bs-border-color);
  box-shadow: 0 0.5rem 1.25rem rgba(0, 0, 0, 0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.demo-shot a:hover,
.demo-shot a:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 0.75rem 1.75rem rgba(0, 0, 0, 0.2);
}

.demo-shot img {
  display: block;
  width: 100%;
  height: auto;
}

/* Only the screenshot matching the active site theme is shown. */
html[data-bs-theme="light"] .theme-only-light,
html[data-bs-theme="dark"] .theme-only-dark {
  display: block;
}

html[data-bs-theme="light"] .theme-only-dark,
html[data-bs-theme="dark"] .theme-only-light {
  display: none;
}

@media (max-width: 991.98px) {
  .demo-row + .demo-row {
    margin-top: 3rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .demo-shot a {
    transition: none;
  }
}

/* Screenshot lightbox (only opacity/transform animate: GPU-composited, no blur). */
.demo-shot a {
  cursor: zoom-in;
}

.lb {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3.25rem 1.5rem 0.75rem;
  background: rgba(8, 10, 12, 0.92);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.lb[hidden] {
  display: none;
}

.lb.lb-open {
  opacity: 1;
}

.lb-figure {
  margin: 0;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lb-img {
  display: block;
  max-width: min(100%, 1600px);
  /* viewport minus top padding (close button), the caption row and bottom padding */
  max-height: calc(100vh - 6.5rem);
  max-height: calc(100dvh - 6.5rem);
  width: auto;
  height: auto;
  border-radius: 0.5rem;
  box-shadow: 0 1.5rem 3rem rgba(0, 0, 0, 0.45);
  transform: scale(0.94);
  opacity: 0.6;
  transition: transform 0.22s ease, opacity 0.22s ease;
  will-change: transform;
}

.lb.lb-open .lb-img.lb-loaded {
  transform: scale(1);
  opacity: 1;
}

.lb-stage {
  position: relative;
  max-width: 100%;
}

.lb-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 0.6rem;
}

/* Prev/next float over the picture's edges, translucent so the image shows through. */
.lb-stage .lb-prev,
.lb-stage .lb-next {
  position: absolute;
  top: 50%;
  margin-top: -1.5rem;
  width: 3rem;
  height: 3rem;
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(8, 10, 12, 0.45);
  font-size: 1.35rem;
  opacity: 0.8;
}

.lb-stage .lb-prev {
  left: 0.75rem;
}

.lb-stage .lb-next {
  right: 0.75rem;
}

.lb-stage .lb-prev:hover,
.lb-stage .lb-next:hover,
.lb-stage .lb-prev:focus-visible,
.lb-stage .lb-next:focus-visible {
  background: rgba(8, 10, 12, 0.7);
  opacity: 1;
}

.lb-cap {
  color: #e9ecef;
  font-size: 0.95rem;
  text-align: center;
  min-width: 0;
}

.lb-btn {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.lb-btn:hover,
.lb-btn:focus-visible {
  background: rgba(255, 255, 255, 0.2);
  outline: none;
}

.lb-btn[hidden] {
  display: none;
}

.lb-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
}

html.lb-lock,
html.lb-lock body {
  overflow: hidden;
}

@media (max-width: 575.98px) {
  .lb {
    padding: 3.25rem 0.25rem 0.75rem;
  }

  .lb-img {
    border-radius: 0.25rem;
  }

  .lb-cap {
    font-size: 0.85rem;
  }

  .lb-stage .lb-prev,
  .lb-stage .lb-next {
    width: 2.25rem;
    height: 2.25rem;
    margin-top: -1.125rem;
    font-size: 1rem;
  }

  .lb-stage .lb-prev {
    left: 0.35rem;
  }

  .lb-stage .lb-next {
    right: 0.35rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lb,
  .lb-img {
    transition: none;
  }
}
