/* Shared video feature: the click-to-play lightbox overlay for any
   page with `.js-video` triggers (currently /sermons/; the old
   /resources/ table styling that lived here left with that page). */

/* ---- Video lightbox overlay ---- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lightbox[hidden] {
  display: none;
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  cursor: pointer;
}

.lightbox__dialog {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: min(96vw, 1000px);
}

.lightbox__player {
  flex: 1 1 auto;
  min-width: 0;
}

.lightbox__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  background: #000;
  border-radius: 6px;
  overflow: hidden;
}

.lightbox__frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Bar under the player: centred title with the share button beside it. */
.lightbox__bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 10px;
}

.lightbox__title {
  margin: 0;
  text-align: center;
  color: #fff;
  font-size: 15px;
}

.lightbox__share {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding: 6px 12px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.lightbox__share:hover {
  background: var(--color-brand);
}

.lightbox__share:focus-visible {
  background: var(--color-brand);
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.lightbox__close,
.lightbox__nav {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.lightbox__nav {
  width: 44px;
  height: 44px;
}

.lightbox__close {
  position: absolute;
  top: -52px;
  right: 0;
  width: 40px;
  height: 40px;
}

.lightbox__close:hover,
.lightbox__nav:hover {
  background: var(--color-brand);
}

/* Keyboard users need to see where they are on the near-black overlay:
   brand fill plus a white ring, never outline: none. */
.lightbox__close:focus-visible,
.lightbox__nav:focus-visible {
  background: var(--color-brand);
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.lightbox__nav[disabled] {
  opacity: 0.3;
  cursor: default;
}

.lightbox__nav[disabled]:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* Lock the page behind the overlay. */
body.has-lightbox {
  overflow: hidden;
}

@media (max-width: 560px) {
  .lightbox {
    padding: 12px;
  }
  /* Flanking arrows would squeeze the player to ~200px on a small
     phone; overlay them on the video edges instead so the video gets
     the full width. */
  .lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.55);
  }
  .lightbox__nav--prev { left: 4px; }
  .lightbox__nav--next { right: 4px; }
  .lightbox__close {
    top: -46px;
  }
}

