.gb-video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.gb-video-grid .gb-video-card__trigger {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.gb-video-card__media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #111;
}

.gb-video-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gb-video-card__placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: #fff;
  font-weight: 600;
}

.gb-video-card__title {
  display: block;
  margin-top: 0.75rem;
  font-weight: 600;
}

.gb-video-modal[hidden] {
  display: none;
}

.gb-video-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.gb-video-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
}

.gb-video-modal__dialog {
  position: relative;
  z-index: 2;
  width: min(1100px, calc(100vw - 2rem));
  max-height: 90vh;
  margin: 5vh auto;
  background: #000;
  padding: 1rem;
  box-sizing: border-box;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.gb-video-modal__close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  z-index: 3;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

.gb-video-modal__video-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
}

.gb-video-modal__body iframe,
.gb-video-modal__body video {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  margin: 0 auto;
}

body.gb-video-modal-open {
  overflow: hidden;
}

@media (max-width: 767px) {
  .gb-video-modal__dialog {
    width: calc(100vw - 1rem);
    margin: 2vh auto;
    padding: 0.75rem;
  }

  .gb-video-modal__close {
    top: 0.25rem;
    right: 0.5rem;
    font-size: 2.4rem;
    padding: 0.25rem;
  }
}

@media (max-width: 767px) and (orientation: landscape) {
  .gb-video-modal__dialog {
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
  }

  .gb-video-modal__body {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
  }

  .gb-video-modal__video-wrap {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .gb-video-modal__body iframe,
  .gb-video-modal__body video {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    aspect-ratio: auto;
    object-fit: contain;
    margin: 0;
  }

  .gb-video-modal__close {
    position: absolute;
    top: 0.35rem;
    right: 0.5rem;
    font-size: 2rem;
    padding: 0.35rem 0.5rem;
    background: rgba(0, 0, 0, 0.55);
    border-radius: 999px;
  }
}