.msp-youtube-facade {
  --msp-youtube-poster: linear-gradient(135deg, #10273d 0%, #075d96 100%);
  position: relative;
  display: block;
  width: 100%;
  min-height: 240px;
  overflow: hidden;
  isolation: isolate;
  background: #10273d;
  aspect-ratio: 16 / 9;
  contain: layout paint;
}

.msp-youtube-facade::before {
  position: absolute;
  z-index: 0;
  inset: 0;
  background-image: var(--msp-youtube-poster);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  content: "";
  opacity: .74;
  transform: scale(1.01);
  transition: opacity .2s ease, transform .35s ease;
}

.msp-youtube-facade::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  background: linear-gradient(180deg, rgba(16,39,61,.08), rgba(16,39,61,.45));
  content: "";
  pointer-events: none;
}

.msp-youtube-facade.has-poster::before {
  opacity: .82;
}

.msp-youtube-facade:hover::before {
  transform: scale(1.025);
}

.msp-youtube-facade__button {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  width: 100%;
  height: 100%;
  padding: 24px;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font: inherit;
  text-align: center;
}

.msp-youtube-facade__play {
  display: block;
  width: clamp(58px, 6vw, 82px);
  height: clamp(58px, 6vw, 82px);
  filter: drop-shadow(0 10px 24px rgba(0,0,0,.24));
  transition: transform .2s ease;
}

.msp-youtube-facade__play svg {
  display: block;
  width: 100%;
  height: 100%;
}

.msp-youtube-facade__play circle {
  fill: rgba(7,93,150,.94);
  stroke: rgba(255,255,255,.9);
  stroke-width: 1.5;
}

.msp-youtube-facade__play path {
  fill: #fff;
}

.msp-youtube-facade__button:hover .msp-youtube-facade__play,
.msp-youtube-facade__button:focus-visible .msp-youtube-facade__play {
  transform: scale(1.08);
}

.msp-youtube-facade__button:focus-visible {
  outline: 3px solid #fff;
  outline-offset: -6px;
}

.msp-youtube-facade__label {
  padding: 7px 11px;
  background: rgba(16,39,61,.78);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  line-height: 1.2;
  text-transform: uppercase;
}

.msp-youtube-facade.is-loaded::before,
.msp-youtube-facade.is-loaded::after {
  display: none;
}

.msp-youtube-facade iframe {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Materiały w sliderze Avady zachowują pełną wysokość istniejącego hero. */
.msp-force-video-section .msp-youtube-facade,
.msp-force-youtube-slider .msp-youtube-facade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 100%;
  aspect-ratio: auto;
}

.msp-force-video-section [data-msp-youtube-video-id],
.msp-force-youtube-slider [data-msp-youtube-video-id] {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
}

@media (max-width: 640px) {
  .msp-youtube-facade {
    min-height: 210px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .msp-youtube-facade::before,
  .msp-youtube-facade__play {
    transition: none;
  }
}


.msp-force-video-section .overlay {
  pointer-events: none !important;
}

.msp-force-video-section .msp-youtube-facade__button {
  place-content: end center;
  padding-bottom: clamp(26px, 4vw, 48px);
}


/* MSP 4.6.1: materiał startuje automatycznie po wejściu w pobliże ekranu. */
.msp-youtube-facade {
  cursor: default;
}
.msp-youtube-facade__button,
.msp-youtube-facade__play,
.msp-youtube-facade__label {
  display: none !important;
}
.msp-youtube-facade__loader {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border: 3px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: msp-youtube-spin .8s linear infinite;
  opacity: .9;
}
.msp-youtube-facade.is-loaded .msp-youtube-facade__loader {
  display: none;
}
@keyframes msp-youtube-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .msp-youtube-facade__loader { animation: none; }
}
