/* Dataset-rendered project stream ---------------------------------------- */
.gallery-stream-app,
.gallery-stream-stage,
.gallery-stream-columns {
  width: 100%;
  background: var(--bg);
}

.gallery-scroll-column {
  position: relative;
  min-width: 0;
  overflow: hidden;
}

.gallery-scroll-track {
  width: 100%;
  will-change: transform;
  backface-visibility: hidden;
  transform: translate3d(0, 0, 0);
}

.gallery-mobile-stream { display: none; }

.project-gallery-card {
  position: relative;
  width: 100%;
  margin: 0 0 -1px;
  padding: 0;
  background: var(--bg);
}

.project-slider {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  overflow: hidden;
  background: var(--bg);
  cursor: pointer;
  outline: none;
}

.project-slider.is-keyboard-active { outline: none; }

.project-slider-media {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  background: var(--bg);
}

.project-slide {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  overflow: hidden;
  background: var(--bg);
}

.project-slide[hidden] { display: none !important; }


.project-slide img,
.project-slide video {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: calc((100vh - 1em - (6 * 7px)));
  max-height: calc((100svh - 1em - (6 * 7px)));
  object-fit: cover;
  object-position: center center;
  background: transparent;
  color: transparent;
}


.project-video-frame {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: var(--bg);
}

.project-video-frame.has-poster .project-video-poster {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  object-position: center center;
}

.project-video-frame.has-poster video {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  max-height: none;
  opacity: 1;
}

.project-video-frame:not(.has-poster) video {
  position: relative;
  z-index: 2;
  opacity: 1;
}

.project-slider-nav {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr 1fr;
  pointer-events: auto;
}

.project-slider-nav-button {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent !important;
  color: transparent;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
  touch-action: pan-y;
}

.project-slider-prev { cursor: w-resize; }
.project-slider-next { cursor: e-resize; }

.project-gallery-info {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 8;
  display: grid;
  gap: 0;
  padding: 7px;
  color: var(--text);
  background: transparent;
  pointer-events: auto;
  cursor: pointer;
}

.project-gallery-info-row {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 14px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: 1.2;
  text-align: left;
  cursor: inherit;
  pointer-events: none;
}

.project-gallery-title,
.project-gallery-status {
  display: inline-block;
  color: inherit;
  font-size: var(--ui-font-size);
  line-height: 1.2;
  font-weight: 550;
  letter-spacing: 0.005em;
  white-space: nowrap;
}

.project-gallery-title {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  max-width: none;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-gallery-status {
  flex: 0 0 auto;
  width: auto;
  min-width: max-content;
  max-width: none;
}


.project-gallery-status-slash {
  display: inline-block;
  padding: 0 0.1em;
}

.project-gallery-details {
  width: min(100%, 350px);
  max-width: 350px;
  margin-top: 0;
  color: var(--text);
  font-size: var(--ui-font-size);
  line-height: 1.2;
  font-weight: 550;
  letter-spacing: 0.005em;
  pointer-events: none;
}

.project-gallery-details[hidden] { display: none !important; }
.project-gallery-description-text,
.project-gallery-credits { display: block; }
.project-gallery-description-text { margin-top: 1em; }
.project-gallery-credits { margin-top: 1em; }

.video-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9;
  width: 100%;
  padding: 7px;
  color: var(--text);
  pointer-events: none;
  touch-action: manipulation;
}

.video-controls[hidden],
.video-controls:not(.is-visible) { display: none !important; }

.video-controls-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 14px;
  width: 100%;
}

.video-controls-actions {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  pointer-events: auto;
}

.video-control-button,
.video-time {
  color: var(--text);
  font-size: var(--ui-font-size);
  line-height: 1.2;
  font-weight: 550;
  letter-spacing: 0.005em;
}

.video-control-button { cursor: pointer; }

.video-controls-timeline {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-width: 0;
  pointer-events: auto;
}

.video-progress {
  position: relative;
  display: block;
  width: 100%;
  height: 14px;
  cursor: pointer;
}

.video-progress-track,
.video-progress-fill {
  position: absolute;
  left: 0;
  top: 50%;
  display: block;
  height: 1px;
  background: currentColor;
  transform: translate3d(0, -50%, 0);
  transform-origin: left center;
}

.video-progress-track { width: 100%; opacity: 0.35; }
.video-progress-fill { width: 100%; transform: translate3d(0, -50%, 0) scaleX(0); }

@media (min-width: 701px) {
  html.is-gallery-page,
  html.is-gallery-page body {
    width: 100%;
    height: var(--page-height);
    min-height: var(--page-height);
    overflow: hidden;
    overscroll-behavior: none;
  }

  html.is-gallery-page body { touch-action: none; }

  body[data-page="selected"] .gallery-stream-app,
  body[data-page="corporate"] .gallery-stream-app,
  .gallery-stream-stage,
  .gallery-stream-columns,
  .gallery-scroll-column {
    width: 100%;
    height: var(--page-height);
    min-height: var(--page-height);
  }

  .gallery-stream-app,
  .gallery-stream-stage,
  .gallery-stream-columns,
  .gallery-scroll-column { overflow: hidden; }

  .gallery-stream-stage { position: relative; }

  .gallery-stream-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gallery-mobile-stream { display: none !important; }
}


/* Mobile gallery: normal document scroll only ----------------------------- */
@media (max-width: 700px) {
  html.is-gallery-page {
    height: auto !important;
    min-height: 100% !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
  }

  html.is-gallery-page::-webkit-scrollbar { display: none; }

  html.is-gallery-page body {
    height: auto !important;
    min-height: 100% !important;
    overflow: visible !important;
    touch-action: auto;
  }

  html.is-gallery-page body::-webkit-scrollbar { display: none; }

  html.is-gallery-page .gallery-stream-app,
  html.is-gallery-page .gallery-stream-stage,
  html.is-gallery-page .gallery-stream-columns,
  html.is-gallery-page .gallery-mobile-stream {
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  html.is-gallery-page .gallery-scroll-column { display: none !important; }
  html.is-gallery-page .gallery-mobile-stream { display: block !important; }
  html.is-gallery-page .project-gallery-details { width: 100%; max-width: none; }
}


.project-slider.is-single-slide {
  cursor: default;
}

.project-slider.is-single-slide .project-slider-nav,
.project-slider.is-single-slide .project-slider-nav-button {
  pointer-events: none;
  cursor: default;
}

.project-gallery-info {
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.project-gallery-info::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.project-gallery-info-row {
  position: sticky;
  top: 0;
  z-index: 1;
}

.project-gallery-card.is-details-open .project-gallery-info {
  pointer-events: auto;
}

/* Safari-safe custom video control hit testing --------------------------- */
.project-video-frame video {
  pointer-events: none;
}

.video-controls {
  z-index: 30;
  pointer-events: auto;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

.video-controls-row,
.video-controls-actions,
.video-controls-timeline,
.video-control-button,
.video-progress {
  pointer-events: auto;
  touch-action: manipulation;
}

.video-control-button,
.video-progress {
  position: relative;
  z-index: 1;
  touch-action: manipulation;
}

/* Safari interaction refinement for custom video controls ---------------- */
.video-control-button {
  display: inline-flex;
  align-items: center;
  min-height: 1.8em;
  margin: -0.35em 0;
  padding: 0.35em 0;
  -webkit-user-select: none;
  user-select: none;
}
