/* Shared photo, video, live and messenger viewer controls. */
.lightbox .lightbox-viewer-controls {
  position: absolute;
  inset-block-start: max(12px, env(safe-area-inset-top));
  inset-inline-end: max(12px, env(safe-area-inset-right));
  z-index: 60;
  display: flex;
  gap: 8px;
}
.lightbox .lightbox-viewer-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgb(0 0 0 / 65%);
  color: white;
  cursor: pointer;
  backdrop-filter: blur(12px);
}
.lightbox .lightbox-viewer-button:hover { background: rgb(60 60 60 / 90%); }
.lightbox .lightbox-viewer-button:focus-visible,
.lightbox .lightbox-sheet-handle:focus-visible { outline: 2px solid white; outline-offset: -3px; }
.lightbox .lightbox-viewer-button[aria-expanded="true"] { background: white; color: #171717; }
.lightbox .lightbox-data { padding-block-start: 64px; }
.lightbox .lightbox-preview .lightbox-toolbar {
  top: auto;
  bottom: max(16px, env(safe-area-inset-bottom));
  inset-inline: 12px auto;
  max-width: calc(100% - 24px);
  flex-wrap: wrap;
}
.lightbox .lightbox-video-stage ~ .lightbox-toolbar { top: 16px; bottom: auto; }
.lightbox .lightbox-comments-backdrop,
.lightbox .lightbox-sheet-handle { display: none; }
@media (min-width: 1024px) {
  .lightbox.media-focus { padding: 0; }
  .lightbox.media-focus > div:not(.lightbox-viewer-controls) { max-width: none; border-radius: 0; }
  .lightbox.media-focus .lightbox-data { display: none; }
}
@media (max-width: 1023px) {
  .lightbox { padding: 0 !important; }
  .lightbox > div:not(.lightbox-viewer-controls) { max-width: none; border-radius: 0; }
  .lightbox .lightbox-data {
    position: absolute;
    inset: auto 0 0;
    z-index: 50;
    width: 100%;
    height: 72%;
    max-height: 80%;
    padding-top: 0;
    padding-bottom: env(safe-area-inset-bottom);
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
    visibility: hidden;
    transition: transform 220ms ease, visibility 220ms;
    overscroll-behavior: contain;
  }
  .lightbox.comments-open .lightbox-data { transform: translateY(0); visibility: visible; }
  .lightbox.comments-open .lightbox-comments-backdrop {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 45;
    border: 0;
    background: rgb(0 0 0 / 50%);
  }
  .lightbox .lightbox-sheet-handle {
    display: flex;
    flex-shrink: 0;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 36px;
    border: 0;
    background: transparent;
    touch-action: none;
    cursor: pointer;
  }
  .lightbox .lightbox-sheet-handle span { width: 40px; height: 4px; border-radius: 4px; background: currentColor; opacity: .4; }
}
@media (prefers-reduced-motion: reduce) {
  .lightbox .lightbox-data { transition: none; }
}
