.mayo-yt-hero {
  --mayo-yt-ar: 16 / 9;
  --mayo-yt-pad: 56.25%;
  position: relative;
  width: 100%;
  aspect-ratio: var(--mayo-yt-ar);
  overflow: hidden;
  background: #000;
}

.mayo-yt-hero__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  /* inactive 卸 iframe 後顯示封面，避免整片黑 */
  background-color: #111;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.mayo-yt-hero__bg iframe {
  position: absolute;
  width: 100%;
  height: 200%;
  border: 0;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* 清掉主題 / Elementor / 全域 button 互動樣式 */
.mayo-yt-hero__play,
.mayo-yt-hero__play:hover,
.mayo-yt-hero__play:focus,
.mayo-yt-hero__play:focus-visible,
.mayo-yt-hero__play:active,
.elementor-widget-html .mayo-yt-hero__play,
.elementor-widget-mayo-yt-hero .mayo-yt-hero__play {
  all: unset;
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: end;
  justify-content: flex-start;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  cursor: pointer;
  background: transparent !important;
  background-image: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  outline: none !important;
  text-decoration: none !important;
  color: inherit !important;
  font: inherit !important;
  line-height: 1 !important;
  padding: 0 !important;
  margin: 0 !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  transform: none !important;
  transition: none !important;
  -webkit-tap-highlight-color: transparent;
}

.mayo-yt-hero__play-icon {
  --mayo-yt-ox: 20px;
  --mayo-yt-oy: -20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.3);
  display: grid;
  place-items: center;
  pointer-events: none;
  transition:
    transform 0.2s ease,
    background 0.2s ease;
  transform: translate(var(--mayo-yt-ox), var(--mayo-yt-oy));
}

.mayo-yt-hero__play:hover .mayo-yt-hero__play-icon {
  background: rgba(0, 0, 0, 0.7);
}

.elementor-widget-mayo-yt-hero .mayo-yt-hero__play-icon svg,
.elementor-widget-html .mayo-yt-hero__play-icon svg,
.mayo-yt-hero__play-icon svg,
.mayo-yt-hero__play-glyph {
  width: 56% !important;
  height: 56% !important;
  margin-left: 6% !important;
  fill: #fff !important;
  display: block !important;
}

/* 原地播放：藏按鈕、iframe 可點、填滿外框（不要用背景裁切） */
.mayo-yt-hero.is-playing .mayo-yt-hero__play {
  display: none !important;
  pointer-events: none !important;
}

.mayo-yt-hero.is-playing .mayo-yt-hero__bg {
  pointer-events: auto;
}

.mayo-yt-hero.is-playing .mayo-yt-hero__bg iframe {
  inset: 0;
  top: auto;
  left: auto;
  width: 100%;
  height: 100%;
  transform: none;
}

/* Modal：掛在 body，避開 Swiper transform */
.mayo-yt-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.75);
}

.mayo-yt-modal.is-open {
  display: flex;
}

.mayo-yt-modal__dialog {
  position: relative;
  width: min(960px, 100%);
  aspect-ratio: 16 / 9;
  background: #000;
}

.mayo-yt-modal__frame,
.mayo-yt-modal__frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.mayo-yt-modal__close,
.mayo-yt-modal__close:hover,
.mayo-yt-modal__close:focus,
.mayo-yt-modal__close:active {
  all: unset;
  position: absolute;
  top: -40px !important;
  right: 0 !important;
  z-index: 1;
  box-sizing: border-box;
  width: 36px;
  height: 36px;
  background: transparent !important;
  color: #fff !important;
  font-size: 22px !important;
  line-height: 36px !important;
  text-align: center;
  cursor: pointer;
  -webkit-appearance: none !important;
  appearance: none !important;
  padding: 8px 20px 8px 20px;
}
