/* =============================
   WY Top Video - style.css
   ============================= */

:root{
  --wytv-header-h: 0px;
  --wytv-header-bg: rgba(255,255,255,0.96);
  --wytv-wrap-left: 0px;
}

/* フルブリード（テーマ差吸収：JSが --wytv-wrap-left を入れる） */
.wytv{
  width: 100vw;
  position: relative;
  left: 0;
  margin: 0 0 24px;
  transform: translateX(calc(-1 * var(--wytv-wrap-left, 0px)));
  will-change: transform;
}

/* iOSなどでより正確なviewport幅が取れる場合 */
@supports (width: 100dvw){
  .wytv{ width: 100dvw; }
}

/* テーマ側の角丸/余白を潰す保険 */
.wytv, .wytv *{
  border-radius: 0 !important;
}
.wytv{
  padding: 0 !important;
}

.wytv__inner{ width: 100%; }

.wytv__item--pc{ display: block; }
.wytv__item--sp{ display: none; }
/* breakpointはJSでstyle挿入して切替 */

.wytv__ratio{
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #000;
}

/* 横16:9 */
.wytv__ratio--pc{ aspect-ratio: 16 / 9; }

/* 縦9:16 */
.wytv__ratio--sp{ aspect-ratio: 9 / 16; }

.wytv__iframe,
.wytv__video,
.wytv__ratio iframe,
.wytv__ratio video{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.wytv__video{ object-fit: cover; }
.wytv__ratio iframe{ display: block; }

/* controls OFF のときは、UI操作させない（見た目も邪魔を減らす） */
.wytv:not(.is-interactive) .wytv__ratio iframe,
.wytv:not(.is-interactive) .wytv__ratio video{
  pointer-events: none;
}

/* Instagram embed を枠に収める（念のため） */
.wytv__ratio .instagram-media{
  margin: 0 !important;
  width: 100% !important;
  max-width: none !important;
}

/* ===== ローディング（再生開始/準備完了まで表示） ===== */
.wytv__loader{
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,.25);
  z-index: 3;
  opacity: 1;
  transition: opacity .18s ease;
}

.wytv__loader::before{
  content: "";
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 4px solid rgba(255,255,255,.35);
  border-top-color: rgba(255,255,255,.95);
  animation: wytv-spin 0.85s linear infinite;
}

@keyframes wytv-spin{
  to { transform: rotate(360deg); }
}

.wytv__ratio.is-ready .wytv__loader{
  opacity: 0;
  pointer-events: none;
}

/* ===== パンサーズ型：固定ヘッダー + スクロールで背景切替 ===== */

/* admin bar 対応 */
body.admin-bar .wytv-sticky-header{ top: 32px; }
@media (max-width: 782px){
  body.admin-bar .wytv-sticky-header{ top: 46px; }
}

/* ヘッダーを固定 */
.wytv-sticky-header{
  position: fixed !important;
  top: 0;
  left: 0; right: 0;
  width: 100%;
  z-index: 9999;
  transition: background-color .18s ease, box-shadow .18s ease, backdrop-filter .18s ease;
}

/* トップ付近（overlay ONの時だけ透明） */
.wytv-sticky-header.wytv-top,
.wytv-sticky-header.wytv-top .inside-header,
.wytv-sticky-header.wytv-top .main-navigation,
.wytv-sticky-header.wytv-top .navigation-search,
.wytv-sticky-header.wytv-top .top-bar{
  background: transparent !important;
  box-shadow: none !important;
}

/* スクロール後（不透明） */
.wytv-sticky-header.wytv-scrolled,
.wytv-sticky-header.wytv-scrolled .inside-header,
.wytv-sticky-header.wytv-scrolled .main-navigation,
.wytv-sticky-header.wytv-scrolled .navigation-search,
.wytv-sticky-header.wytv-scrolled .top-bar{
  background: var(--wytv-header-bg) !important;
}

.wytv-sticky-header.wytv-scrolled{
  box-shadow: 0 6px 18px rgba(0,0,0,.12);
  backdrop-filter: saturate(180%) blur(10px);
}

/* overlay ON時：動画をヘッダー高さ分だけ上に引き上げて “一番上にフィット” */
body.wytv-has-fixed-header .wytv.is-overlay{
  margin-top: calc(-1 * var(--wytv-header-h, 0px));
}