/* All manually opened media share the same bounded stage, including Facebook.
   Header/caption sit outside the player and never cover its picture/controls. */
.gallery-slideshow:not(.is-office) .gallery-slideshow-shell {
  display:grid;grid-template-rows:64px minmax(0,1fr) auto;
  width:100%;height:100vh;height:100dvh;max-height:100dvh;
  padding:env(safe-area-inset-top,0px) clamp(12px,3vw,42px) env(safe-area-inset-bottom,0px);
  box-sizing:border-box;overflow:hidden;
}
.gallery-slideshow:not(.is-office) .gallery-slideshow-shell>header {
  position:relative;inset:auto;height:auto;min-height:0;padding:0;background:#080809;
}
.gallery-slideshow:not(.is-office) .gallery-slideshow-stage {
  position:relative;inset:auto;min-width:0;min-height:0;display:grid;
}
.gallery-slideshow:not(.is-office) .gallery-slideshow-media {
  position:absolute;inset:0;width:100%;height:100%;min-height:0;container-type:size;
}
.gallery-slideshow:not(.is-office) .gallery-slideshow-media :is(img,video,iframe) {
  max-width:100%;max-height:100%;object-fit:contain;animation:none;transform:none;
}
.gallery-slideshow:not(.is-office) .gallery-slideshow-media img {width:100%;height:100%;}
.gallery-slideshow:not(.is-office)[data-orientation="portrait"] .gallery-slideshow-media iframe {
  width:min(100%,calc((100dvh - 240px)*var(--video-ratio,.5625)));height:100%;
}
.gallery-slideshow[data-video-aspect="6/7"] {--video-ratio:.857142857;--video-inverse:1.166666667;}
.event-video-stage--portrait.event-video-stage--compact {aspect-ratio:6/7;}
@supports (width:1cqh) {
  .gallery-slideshow:not(.is-office)[data-orientation="portrait"] .gallery-slideshow-media iframe {
    width:min(100cqw,calc(100cqh * var(--video-ratio,.5625)));height:min(100cqh,calc(100cqw * var(--video-inverse,1.7777778)));
  }
}
.gallery-slideshow:not(.is-office) .gallery-slideshow-shell>footer {
  position:relative;inset:auto;min-height:0;max-height:26dvh;overflow:auto;
  padding:14px 0 18px;background:#080809;gap:16px;
}
.gallery-slideshow:not(.is-office) .gallery-slideshow-shell>footer strong {font-size:clamp(18px,2vw,28px);line-height:1.25;letter-spacing:0;}
.gallery-slideshow:not(.is-office) .gallery-slideshow-shell>footer p {font-size:13px;line-height:1.45;margin-top:6px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
.gallery-slideshow:not(.is-office) .gallery-slideshow-count {position:static;flex:none;}
.gallery-slideshow-external {display:inline-block;margin-top:8px;color:#ffe07c;text-decoration:underline;text-underline-offset:4px;font-size:14px;}
.gallery-slideshow-external[hidden] {display:none;}
.gallery-slideshow-arrow[hidden] {display:none!important;}
.gallery-slideshow:not(.is-office) .gallery-slideshow-arrow {width:44px;height:44px;}
.gallery-slideshow:not(.is-office) .gallery-slideshow-arrow.prev {left:4px;}
.gallery-slideshow:not(.is-office) .gallery-slideshow-arrow.next {right:4px;}
@media(max-width:600px){
  .gallery-slideshow:not(.is-office) .gallery-slideshow-shell {grid-template-rows:56px minmax(0,1fr) auto;padding-inline:10px;}
  .gallery-slideshow:not(.is-office) .gallery-slideshow-shell>footer {padding-bottom:12px;}
  .gallery-slideshow:not(.is-office) .gallery-slideshow-shell>header {font-size:10px;letter-spacing:.08em;}
}
