/* OneTrust YouTube Embed styles - loaded only when widget is present */

/* Responsive wrapper */
.youtube-responsive {
  position: relative;
  width: 100%;
  max-width: 100%;
}

.youtube-responsive.ratio-16x9 {
  padding-bottom: 56.25%; /* 16:9 */
}

/* Placeholder fills the responsive box */
.youtube-responsive .youtube-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  cursor: pointer;
  overflow: hidden;
}

/* Thumbnail covers the box */
.youtube-placeholder > img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

/* Centered play button */
.youtube-placeholder .play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 68px;
  height: 48px;
  z-index: 2;
}

/* Consent message bar at the bottom */
.youtube-placeholder .consent-message {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  text-align: center;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 10px;
  font-size: 14px;
  z-index: 2;
}

.youtube-placeholder .consent-message a {
  color: #fff;
  text-decoration: underline;
}

/* Iframe occupies the box but is hidden until consent and load */
.youtube-placeholder .youtube-iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none; /* default hidden; shown when otc-loaded */
}

/* State-based styling from JS */
.youtube-placeholder.otc-blocked .play-button,
.youtube-placeholder.otc-blocked .consent-message {
  z-index: 3; /* ensure UI is on top when blocked to avoid z-fighting */
}

.youtube-placeholder.otc-loaded .youtube-iframe {
  display: block;
}

.youtube-placeholder.otc-loaded > img,
.youtube-placeholder.otc-loaded .play-button,
.youtube-placeholder.otc-loaded .consent-message {
  display: none;
}

/* State-based styling from JS */
.youtube-placeholder.otc-consented .play-button,
.youtube-placeholder.otc-consented .consent-message {
    z-index: 0; /* ensure UI is on top when blocked to avoid z-fighting */
    display: none;
}
.youtube-placeholder.otc-consented > img {
    display: none;
}
.youtube-placeholder.otc-consented > iframe {
    display: block;
}

/* Error state when URL is invalid */
.youtube-placeholder.youtube-error {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: #000;
  cursor: default;
}
