.gt-local-video-frame,
.gt-local-video-host {
  position: relative;
}

.gt-local-video-frame {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  line-height: 0;
  background: #020b17;
}

.gt-local-video-frame > video {
  display: block;
  max-width: 100%;
}

.gt-local-video__center-control {
  position: absolute !important;
  inset: auto !important;
  top: 50% !important;
  right: auto !important;
  bottom: auto !important;
  left: 50% !important;
  z-index: 12;
  display: grid !important;
  width: 54px !important;
  min-width: 54px !important;
  height: 54px !important;
  min-height: 54px !important;
  margin: 0 !important;
  padding: 0 !important;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .42);
  border-radius: 50% !important;
  color: #fff;
  background: rgba(4, 14, 31, .76);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .35);
  opacity: 0 !important;
  transform: translate(-50%, -50%) scale(.9) !important;
  transition: opacity .18s ease, transform .18s ease, background-color .18s ease, border-color .18s ease;
  pointer-events: none !important;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.gt-local-video__center-control.is-visible {
  opacity: 1 !important;
  transform: translate(-50%, -50%) scale(1) !important;
  pointer-events: auto !important;
}

.gt-local-video__center-control:hover,
.gt-local-video__center-control:focus-visible,
.gt-local-video__center-control:active {
  border-color: #ff6a18;
  background: #ff5b0b;
  outline: none;
}

.gt-local-video__center-control svg {
  display: block;
  width: 27px;
  height: 27px;
  fill: currentColor;
}

.gt-local-video__center-control .gt-local-video__pause,
.gt-local-video__center-control.is-playing .gt-local-video__play {
  display: none;
}

.gt-local-video__center-control.is-playing .gt-local-video__pause {
  display: block;
}

/* Preserve the media column of compact product cards after the video gets its overlay frame. */
:is(.gt-rebuild-product-page,.gt-pwa-product-page):has(.gt-six-story) .gt-six-video__mini > .gt-local-video-frame {
  height: 118px;
}

:is(.gt-rebuild-product-page,.gt-pwa-product-page):has(.gt-six-story) .gt-six-video__mini > .gt-local-video-frame > video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gt-pwa-product-video > .gt-local-video-frame,
.gt-alm-video-card__media > .gt-local-video-frame,
.gt-six-video__media > .gt-local-video-frame,
.gt-pwa-six-video__media > .gt-local-video-frame {
  height: 100%;
}

/* The table-driven product video gallery is shared by premium and regular
   product cards. Keep the layout self-contained so regular cards never fall
   back to the browser's native 300x150 video size. */
.gt-alm-video-gallery {
  overflow: hidden;
  width: 100%;
  border-radius: 20px;
  background:
    radial-gradient(circle at 92% 4%, rgba(255, 105, 20, .28), transparent 22%),
    linear-gradient(145deg, #07162d 0%, #0c213f 62%, #182b47 100%);
  color: #fff;
}

.gt-alm-video-gallery__intro {
  max-width: 820px;
  padding: 34px 38px 25px;
}

.gt-alm-video-gallery__intro h3 {
  margin: 7px 0 9px;
  color: #fff;
  font-size: clamp(26px, 3vw, 40px);
  line-height: 1.08;
}

.gt-alm-video-gallery__intro p {
  margin: 0;
  color: rgba(231, 238, 248, .72);
  line-height: 1.6;
}

.gt-alm-video-gallery__section {
  padding: 28px 38px 38px;
  border-top: 1px solid rgba(255, 255, 255, .1);
}

.gt-alm-video-gallery__section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.gt-alm-video-gallery__section-head h4 {
  margin: 5px 0 0;
  color: #fff;
  font-size: 24px;
}

.gt-alm-video-gallery__section-head p {
  max-width: 430px;
  margin: 0;
  color: rgba(231, 238, 248, .6);
  text-align: right;
}

.gt-alm-video-gallery__wide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.gt-alm-video-gallery__wide-grid > .gt-alm-video-card:only-child {
  grid-column: 1 / -1;
  justify-self: center;
  width: min(100%, 960px);
  margin: 0 auto;
}

.gt-alm-video-gallery__wide-grid > .gt-alm-video-card--short {
  justify-self: center;
  width: min(100%, 420px);
}

.gt-alm-video-gallery__shorts-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.gt-alm-video-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 18px;
  background: rgba(255, 255, 255, .06);
}

.gt-alm-video-card__media {
  position: relative;
  overflow: hidden;
  width: 100%;
  background: #020914;
}

.gt-alm-video-card--wide .gt-alm-video-card__media {
  aspect-ratio: 16 / 9;
}

.gt-alm-video-card--short .gt-alm-video-card__media {
  aspect-ratio: 9 / 16;
}

.gt-alm-video-card video,
.gt-alm-video-card__media > .gt-local-video-frame,
.gt-alm-video-card__media > .gt-local-video-frame > video {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  background: #020914;
  object-fit: contain;
}

.gt-alm-video-card__body {
  padding: 17px 19px 20px;
}

.gt-alm-video-card__body h5,
.gt-alm-video-card__title {
  display: block;
  margin: 5px 0 0;
  color: #fff;
  font-size: 16px;
  line-height: 1.35;
}

.gt-alm-video-card__body p {
  margin: 7px 0 0;
  color: rgba(231, 238, 248, .65);
  line-height: 1.5;
}

/* The knowledge libraries used a zero-height padding-ratio shell. Give local
   HTML5 video a real box so the centered control also stays centered. */
.gt-training-video__player.gt-local-video-host {
  height: auto;
  padding-bottom: 0;
  aspect-ratio: 16 / 9;
}

/* File metadata is the source of truth. This corrects legacy cards that were
   manually marked as wide even though the underlying file is vertical. */
.gt-local-video-host[data-gt-video-orientation],
.gt-local-video-frame[data-gt-video-orientation] {
  height: auto !important;
  aspect-ratio: var(--gt-video-aspect);
}

.gt-local-video-host[data-gt-video-orientation="portrait"]:not(.gt-alm-video-card__media),
.gt-local-video-frame[data-gt-video-orientation="portrait"] {
  width: min(100%, 480px);
  margin-right: auto;
  margin-left: auto;
}

video[data-gt-video-orientation] {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  background: #020914;
}

/* The same approved play/pause control is used by every table-driven product
   gallery, including regular cards that do not load the premium stylesheet. */
.gt-alm-video-card__toggle {
  position: absolute !important;
  inset: auto !important;
  top: 50% !important;
  right: auto !important;
  bottom: auto !important;
  left: 50% !important;
  z-index: 12;
  display: grid !important;
  width: 54px !important;
  min-width: 54px !important;
  height: 54px !important;
  min-height: 54px !important;
  margin: 0 !important;
  padding: 0 !important;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .42) !important;
  border-radius: 50% !important;
  transform: translate(-50%, -50%) !important;
  background: rgba(4, 14, 31, .76) !important;
  color: #fff !important;
  font-size: 18px !important;
  line-height: 1 !important;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .35);
  backdrop-filter: blur(10px);
  transition: transform .18s ease, opacity .18s ease, visibility .18s ease, background .18s ease;
  -webkit-tap-highlight-color: transparent;
}

.gt-alm-video-card__toggle:hover,
.gt-alm-video-card__toggle:focus-visible {
  transform: translate(-50%, -50%) scale(1.07) !important;
  background: #ff6814 !important;
  outline: none;
}

.gt-alm-video-card__play {
  margin-left: 4px;
}

.gt-alm-video-card__pause {
  display: none;
  position: relative;
  width: 16px;
  height: 18px;
  overflow: hidden;
  color: transparent;
  font-size: 0;
  line-height: 0;
}

.gt-alm-video-card__pause::before,
.gt-alm-video-card__pause::after {
  position: absolute;
  top: 1px;
  width: 4px;
  height: 16px;
  border-radius: 1.5px;
  background: currentColor;
  content: "";
}

.gt-alm-video-card__pause::before {
  left: 2px;
}

.gt-alm-video-card__pause::after {
  right: 2px;
}

.gt-alm-video-card__media.is-playing .gt-alm-video-card__play {
  display: none;
}

.gt-alm-video-card__media.is-playing .gt-alm-video-card__pause {
  display: block;
  color: #fff;
}

.gt-alm-video-card__media.is-playing .gt-alm-video-card__toggle {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.gt-alm-video-card__media.is-playing:hover .gt-alm-video-card__toggle,
.gt-alm-video-card__media.is-playing .gt-alm-video-card__toggle:focus-visible {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.gt-alm-video-card--short .gt-alm-video-card__toggle {
  width: 48px !important;
  min-width: 48px !important;
  height: 48px !important;
  min-height: 48px !important;
  font-size: 16px !important;
}

@media (max-width: 760px) {
  .gt-local-video__center-control {
    width: 50px !important;
    min-width: 50px !important;
    height: 50px !important;
    min-height: 50px !important;
    border-width: 1px;
    box-shadow: 0 10px 26px rgba(1, 12, 29, .34);
  }

  .gt-local-video__center-control svg {
    width: 25px;
    height: 25px;
  }

  .gt-alm-video-gallery__intro,
  .gt-alm-video-gallery__section {
    padding-right: 18px;
    padding-left: 18px;
  }

  .gt-alm-video-gallery__section-head {
    display: block;
  }

  .gt-alm-video-gallery__section-head p {
    margin-top: 8px;
    text-align: left;
  }

  .gt-alm-video-gallery__wide-grid {
    grid-template-columns: 1fr;
  }

  .gt-alm-video-gallery__shorts-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

:is(.gt-rebuild-product-page,.gt-pwa-product-page):has(.gt-six-story) .gt-six-video__mini > .gt-local-video-frame {
    height: auto;
    aspect-ratio: 16 / 9;
  }
}

@media (max-width: 430px) {
  .gt-alm-video-gallery__shorts-grid {
    grid-template-columns: 1fr;
  }

  .gt-alm-video-card--short {
    width: min(100%, 300px);
    margin: 0 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gt-local-video__center-control {
    transition: none;
  }
}

/* One product-video contract: landscape first, portrait last, up to five portraits per desktop row. */
@media (min-width: 761px) {
  .gt-alm-video-gallery__shorts-grid[data-video-columns="1"] {
    grid-template-columns: minmax(0, 1fr) !important;
    width: min(220px, 100%) !important;
  }

  .gt-alm-video-gallery__shorts-grid[data-video-columns="2"] {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    width: min(456px, 100%) !important;
  }

  .gt-alm-video-gallery__shorts-grid[data-video-columns="3"] {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    width: 100% !important;
  }

  .gt-alm-video-gallery__shorts-grid[data-video-columns="4"] {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    width: 100% !important;
  }

  .gt-alm-video-gallery__shorts-grid[data-video-columns="5"] {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    width: 100% !important;
  }
}
