/* Large YouTube viewer + compact popup video launcher */

.summitPopup__videoLaunch {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 10px 0 8px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  background: #05070a;
  cursor: pointer;
}

.summitPopup__videoLaunch:hover {
  border-color: rgba(255, 255, 255, 0.38);
}

.summitPopup__videoLaunch:focus-visible {
  outline: 3px solid #ff9800;
  outline-offset: 2px;
}

.summitPopup__videoThumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.summitPopup__videoShade {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.08),
    rgba(0, 0, 0, 0.26)
  );
}

.summitPopup__playButton {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -54%);
  display: grid;
  place-items: center;
  width: 62px;
  height: 44px;
  border-radius: 13px;
  background: #ff0033;
  color: #fff;
  font-size: 24px;
  line-height: 1;
  padding-left: 4px;
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.38);
}

.summitPopup__playLabel {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.videoViewer {
  position: fixed;
  z-index: 2147483000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(3, 5, 9, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.videoViewer__dialog {
  width: min(1200px, 96vw);
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 18px;
  background: #0c1118;
  color: #f5f7fb;
  box-shadow: 0 26px 90px rgba(0, 0, 0, 0.58);
}

.videoViewer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px 12px 20px;
}

.videoViewer__headingWrap {
  min-width: 0;
}

.videoViewer__title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: clamp(16px, 2vw, 22px);
  font-weight: 800;
}

.videoViewer__meta {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 13px;
}

.videoViewer__close {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  font-size: 32px;
  font-weight: 300;
  line-height: 36px;
}

.videoViewer__close:hover {
  background: rgba(255, 255, 255, 0.18);
}

.videoViewer__close:focus-visible {
  outline: 3px solid #ff9800;
  outline-offset: 2px;
}

.videoViewer__frameWrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.videoViewer__iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.videoViewer__footer {
  display: flex;
  justify-content: flex-end;
  padding: 12px 18px 14px;
}

.videoViewer__youtubeLink {
  color: #ff9d18;
  font-weight: 800;
  text-decoration: none;
}

.videoViewer__youtubeLink:hover {
  text-decoration: underline;
}

@media (max-width: 700px) {
  .videoViewer {
    padding: 10px;
  }

  .videoViewer__dialog {
    width: 100%;
    border-radius: 14px;
  }

  .videoViewer__header {
    padding: 10px 10px 9px 14px;
  }

  .videoViewer__close {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .videoViewer__footer {
    padding: 10px 14px 12px;
  }
}


/* ===== Centered, fully-contained Mapbox video popups ===== */

.mapboxgl-popup {
  width: min(760px, calc(100vw - 40px)) !important;
  max-width: min(760px, calc(100vw - 40px)) !important;
}

/*
  The dark Mapbox content panel now owns the entire popup width.
  This prevents the video/thumbnail from spilling beyond the black box.
*/
.mapboxgl-popup-content {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  padding: 20px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  max-height: calc(100vh - 36px);
}

.summitPopup,
.otherPopup {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

/* Keep every popup child inside the dark panel. */
.summitPopup *,
.otherPopup * {
  box-sizing: border-box;
  max-width: 100%;
}

.summitPopup__videoLaunch,
.summitPopup__iframe {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

.summitPopup__videoThumb {
  display: block;
  width: 100% !important;
  max-width: 100% !important;
  height: 100%;
  object-fit: cover;
}

/* Give the close X breathing room without shrinking the video. */
.summitPopup__title {
  padding-right: 32px;
}

/* The pointer remains aligned with the selected marker. */
.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip {
  border-top-color: rgba(11, 15, 20, 0.92) !important;
}

/* Responsive sizing on smaller screens. */
@media (max-width: 800px) {
  .mapboxgl-popup {
    width: min(94vw, 680px) !important;
    max-width: min(94vw, 680px) !important;
  }

  .mapboxgl-popup-content {
    padding: 16px !important;
  }
}

@media (max-width: 520px) {
  .mapboxgl-popup {
    width: calc(100vw - 20px) !important;
    max-width: calc(100vw - 20px) !important;
  }

  .mapboxgl-popup-content {
    padding: 14px !important;
    max-height: calc(100vh - 20px);
  }
}
