/*
 * Click-to-play YouTube videos (inc/youtube-privacy.php, js/youtube-privacy.js).
 * A thumbnail stored on this site with a play button; the player replaces it on click.
 *
 * Many properties are !important on purpose. The theme styles every img and iframe in content areas, and Divi
 * resets every element inside its modules ("#et-boc .et-l div, span … { background: transparent; margin: 0 … }",
 * and "height: auto" inside video boxes), which would otherwise hide the play button.
 */

.tp-yt {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #0b2545 !important;
  line-height: 0;
}

.tp-yt--short {
  aspect-ratio: 9 / 16;
  max-width: 360px;
  margin-left: auto !important;
  margin-right: auto !important;
}

.tp-yt .tp-yt__thumb,
.tp-yt .tp-yt__frame {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  aspect-ratio: auto !important;
}

.tp-yt .tp-yt__thumb {
  object-fit: cover !important;
}

.tp-yt .tp-yt__play {
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  cursor: pointer;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.tp-yt .tp-yt__icon {
  position: relative;
  display: block !important;
  width: 72px !important;
  height: 72px !important;
  border-radius: 50% !important;
  background: rgba(11, 37, 69, 0.85) !important;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35) !important;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.tp-yt .tp-yt__icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  margin: -14px 0 0 -8px;
  border-style: solid;
  border-width: 14px 0 14px 24px;
  border-color: transparent transparent transparent #fff;
}

.tp-yt .tp-yt__play:hover .tp-yt__icon,
.tp-yt .tp-yt__play:focus-visible .tp-yt__icon {
  background: #fcaa10 !important;
  transform: scale(1.06);
}

.tp-yt .tp-yt__play:focus {
  outline: none !important;
}

.tp-yt .tp-yt__play:focus-visible {
  outline: 3px solid #fcaa10 !important;
  outline-offset: -3px !important;
}

.tp-yt .tp-yt__note {
  display: block !important;
  max-width: 90%;
  padding: 4px 10px !important;
  border-radius: 3px !important;
  background: rgba(0, 0, 0, 0.6) !important;
  color: #fff !important;
  font-size: 14px !important;
  line-height: 1.4 !important;
  height: auto !important;
}

@media (max-width: 575px) {
  .tp-yt .tp-yt__icon {
    width: 56px !important;
    height: 56px !important;
  }

  .tp-yt .tp-yt__icon::after {
    margin: -11px 0 0 -6px;
    border-width: 11px 0 11px 19px;
  }
}

/* Pillar pages: keep the spacing the video iframes had. */
body.page-template-template-new-pillar-page .tp-yt {
  margin: 38px 0;
}

/* Dealers site pool design gallery: same size as the video iframes it replaces. */
.poolmodels-slider .gallery-top .swiper-slide div.tp-yt {
  display: inline-block;
  width: 70%;
  height: 100%;
  aspect-ratio: auto;
  vertical-align: top;
}

@media (max-width: 768px) {
  .poolmodels-slider .gallery-top .swiper-slide div.tp-yt {
    width: 95%;
    height: 80%;
  }
}

@media (max-width: 576px) {
  .poolmodels-slider .gallery-top .swiper-slide div.tp-yt {
    height: 70%;
  }
}
