.modern-slider {box-sizing:border-box;touch-action:pan-x pan-y;}
.modern-stage {position:absolute;inset:8px 40px;display:flex;align-items:center;justify-content:center;overflow:hidden;touch-action:none;}
.modern-stage img {display:block;max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain;user-select:none;-webkit-user-drag:none;}
.modern-slider button,.modern-menu {background:none;color:inherit;border:0;border-radius:0;padding:0;font:inherit;cursor:pointer;}
.modern-slider button:hover,.modern-menu:hover {background:none;}
.modern-slider button:focus-visible,.modern-menu:focus-visible {outline:2px solid #555;outline-offset:3px;}
.modern-slider button[hidden],.modern-slider [hidden] {display:none!important;}
.modern-play {position:absolute!important;left:50%;top:50%;width:64px;height:64px;transform:translate(-50%,-50%);}
.modern-play .play-button {margin:0;}
.modern-arrow {width:48px;height:48px;}
.modern-arrow:disabled {cursor:default;}
.modern-slider .modern-info {display:inline;font-size:12px;font-weight:bold;border-bottom:1px solid #aaa;margin-right:.5em;}
.modern-slider .album-info-block:not([hidden]) {display:block;}
.modern-close-info {float:right;font-size:13px!important;}
.modern-video {position:absolute;inset:0;width:100%;height:100%;max-width:none;max-height:none;box-sizing:border-box;margin:0;border:0;padding:48px;background:white;}
.modern-video::backdrop {background:#fff;}
.modern-video-frame {height:100%;display:flex;align-items:center;justify-content:center;}
.modern-video iframe {width:100%;max-height:100%;aspect-ratio:16/9;border:0;}
.modern-video-close {position:absolute!important;top:16px;right:16px;}
.ds-gallery-page .footer-copy {display:none;}
.modern-menu {display:none;}
@media(max-width:849px){.modern-menu{display:block;float:right;padding:12px;font-size:13px;font-weight:bold;}.collapsed-gallery-page .main-header{width:calc(100% - 32px);box-sizing:border-box;}.collapsed-gallery-page .main-header .menus-container{background:white;max-height:65vh;overflow:auto;}.collapsed-gallery-page .main-header #gallery-menu{display:block;}.modern-stage{inset:70px 32px 40px;}.modern-video{padding:40px 8px;}.collapsed-gallery-page .album-info-block{width:auto;}}

/* Keep the video inside the gallery, not the viewport. */
.modern-video[open] {z-index:26;display:block;padding:3em;overflow:hidden;}
.modern-video-frame {width:100%;height:100%;container-type:size;}
.modern-video iframe {width:min(100%, calc(100cqh * 16 / 9));height:auto;aspect-ratio:16/9;max-height:100%;display:block;}
.modern-slider .modern-video-close {top:16px;right:16px;font-size:.875em;border-bottom:1px solid #aaa;}
@media(max-width:849px){.modern-video[open]{padding:70px 8px 40px;}}

/* Hide stationary play control while both slides move. */
.modern-stage.modern-sliding .modern-play {visibility:hidden;}

/* Typographic underlines for gallery text controls. */
.modern-slider button.modern-info,
.modern-slider button.modern-close-info,
.modern-slider button.modern-video-close {
  border-bottom: 0;
  text-decoration: underline;
  text-decoration-color: #aaa;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  text-decoration-skip-ink: auto;
}
.modern-slider button.modern-info:hover,
.modern-slider button.modern-close-info:hover,
.modern-slider button.modern-video-close:hover {
  color: #cc0000;
  text-decoration-color: currentColor;
  background: none;
}

/* Integrate project information into the bottom edge. */
.modern-slider .album-info-block {
  bottom: 0;
  right: 0;
  width: 35%;
  max-width: 40em;
  max-height: 100%;
  box-sizing: border-box;
}
.modern-slider .album-info-block .info-container {
  position: relative;
  padding: 1.5em 1.5em 5.5em;
}
.modern-slider button.modern-close-info {
  position: absolute;
  float: none;
  right: 24px;
  bottom: 56px;
}
@media (max-width: 849px) {
  .modern-slider .album-info-block { width: auto; max-width: none; }
  .modern-slider .album-info-block .info-container { padding: 1em 1em 4em; }
  .modern-slider button.modern-close-info { right: 16px; bottom: 20px; }
}


/* Mobile header: symmetric margins and a shared control position. */
@media (max-width: 849px) {
  .collapsed-gallery-page .main-header,
  .collapsed-layout .main-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    height: auto;
    left: 0;
    top: 0;
    margin: 0;
    padding: 8px 20px 0;
    overflow: visible;
    z-index: 30;
  }
  .collapsed-gallery-page .main-header .top-logo-group,
  .collapsed-layout .main-header .top-logo-group { float: none; }
  .collapsed-gallery-page .main-header .logo,
  .collapsed-layout .main-header .logo { width: 100px; margin: 0; }
  .collapsed-gallery-page .main-header .logo a,
  .collapsed-layout .main-header .logo a { margin: 0; padding: 0; }
  .main-header .modern-menu {
    float: none;
    justify-self: end;
    padding: 0;
    min-height: 44px;
    min-width: 44px;
    text-align: right;
  }
  .collapsed-gallery-page .main-header .menus-container,
  .collapsed-layout .main-header .menus-container {
    grid-column: 1 / -1;
    position: static;
    float: none;
    margin: 0;
    max-height: 65vh;
    overflow: auto;
    background: white;
  }
  .collapsed-gallery-page:has(.modern-video[open]) .main-header {
    pointer-events: none;
    background: transparent;
  }
  .collapsed-gallery-page:has(.modern-video[open]) .main-header .modern-menu,
  .collapsed-gallery-page:has(.modern-video[open]) .main-header .menus-container {
    visibility: hidden;
  }
  .collapsed-gallery-page .modern-slider .modern-video-close {
    top: 8px;
    right: 20px;
    min-height: 44px;
    font-size: 13px;
    white-space: nowrap;
  }
}

/* Full-height mobile navigation. */
@media (max-width: 849px) {
  body.modern-menu-open .main-header { position: fixed; inset: 0; height: 100%; background: white; grid-template-rows: 44px minmax(0, 1fr); align-content: start; }
  body.modern-menu-open .main-header .menus-container { align-self: stretch; height: auto; min-height: 0; max-height: none; overflow-y: auto; padding-bottom: 24px; box-sizing: border-box; overscroll-behavior: contain; }
  body.modern-menu-open .main-header .menu, body.modern-menu-open .main-header .menu ul { max-height: none; height: auto; overflow: visible; }
  body.modern-menu-open .modern-slider { visibility: hidden; }
  body.modern-menu-open .main-header .menu a:hover { background: transparent; color: #cc0000; }
}

/* Mobile navigation: vertical scrolling only, with single-line labels. */
@media (max-width: 849px) {
  body.modern-menu-open .main-header .menus-container {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-x: none;
    touch-action: pan-y;
  }
  body.modern-menu-open .main-header .menu,
  body.modern-menu-open .main-header .menu ul,
  body.modern-menu-open .main-header .menu li {
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
    padding-inline: 0;
    margin-inline: 0;
  }
  body.modern-menu-open .main-header .menu a {
    display: block;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    padding-inline: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
