@charset "UTF-8";
/* ==========================================================
  右下に追従する動画ウィジェット＋モーダル
  - .videoWidget : 右下の小さな動画（mp4。クリックでモーダルを開く）
  - .videoModal  : 拡大再生用のモーダル（動画の上に CTA ボタンを重ねる）
  色：#e8452c（吹き出し・CTA）、#0c317c（閉じるボタン・フォーカス枠）
  動画の縦横比は mp4 のサイズに合わせて自動で決まる
========================================================== */

/* ---------- 右下の小さな動画 ---------- */
.videoWidget {
  position: fixed;
  /* 右端の固定ナビ（.fixed_navlist、幅 44px）に重ならない位置 */
  right: 74px;
  bottom: 90px;
  z-index: 210;
  width: 216px;
}

.videoWidget[hidden] {
  display: none;
}

.videoWidget__balloon {
  position: relative;
  margin: 0 0 10px;
  padding: 6px 10px;
  border-radius: 6px;
  background-color: #e8452c;
  color: #fff;
  font-size: 13px;
  font-weight: bold;
  line-height: 1.4;
  text-align: center;
}

.videoWidget__balloon::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 50%;
  border-width: 6px 6px 0;
  border-style: solid;
  border-color: #e8452c transparent transparent;
  transform: translateX(-50%);
}

.videoWidget__frame {
  position: relative;
  border: 3px solid #fff;
  border-radius: 12px;
  background-color: #000;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  transition: transform 0.2s ease;
}

.videoWidget__frame:hover {
  transform: scale(1.04);
}

.videoWidget__video {
  display: block;
  width: 100%;
  height: auto;
}

/* 動画全体に重ねる透明なボタン（クリックでモーダルを開く） */
.videoWidget__open {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: none;
  background-color: transparent;
  cursor: pointer;
}

/* 再生マーク（装飾） */
.videoWidget__open::after {
  content: "";
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.6);
}

.videoWidget__open::before {
  content: "";
  position: absolute;
  right: 16px;
  bottom: 15px;
  z-index: 1;
  border-width: 7px 0 7px 12px;
  border-style: solid;
  border-color: transparent transparent transparent #fff;
}

.videoWidget__open:focus-visible {
  outline: 3px solid #0c317c;
  outline-offset: -3px;
}

/* 動画の下の注記（白い吹き出し。しっぽは上の動画を指す）
   影は drop-shadow にして、しっぽ（::before）にも付ける */
.videoWidget__note {
  position: relative;
  margin: 12px 0 0;
  padding: 6px 8px;
  border-radius: 6px;
  background-color: #fff;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  color: #333;
  font-size: 10px;
  line-height: 1.5;
  text-align: center;
  /* 「オープンキャンパス」などの語の途中で改行しないよう、文節で折り返す（対応ブラウザのみ） */
  word-break: auto-phrase;
}

.videoWidget__note::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 50%;
  border-width: 0 7px 7px;
  border-style: solid;
  border-color: transparent transparent #fff;
  transform: translateX(-50%);
}

.videoWidget__close {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background-color: #0c317c;
  cursor: pointer;
}

.videoWidget__close::before,
.videoWidget__close::after,
.videoModal__close::before,
.videoModal__close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 50%;
  height: 2px;
  background-color: #fff;
}

.videoWidget__close::before,
.videoModal__close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.videoWidget__close::after,
.videoModal__close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.videoWidget__close:focus-visible {
  outline: 3px solid #0c317c;
  outline-offset: 2px;
}

@media screen and (max-width: 767px) {
  .videoWidget {
    right: 10px;
    bottom: 115px;
    width: 128px;
  }

  /* 幅 128px に吹き出しの文言（12文字程度）を1行で収める。文言に合わせて調整する */
  .videoWidget__balloon {
    padding: 4px 3px;
    font-size: 10px;
    letter-spacing: 0;
  }

  .videoWidget__note {
    margin-top: 10px;
    padding: 4px 5px;
    font-size: 9px;
    line-height: 1.4;
  }

  /* 吹き出しの文字に重ならないよう、吹き出しの上に出す */
  .videoWidget__close {
    top: -30px;
    right: -6px;
  }
}

/* ---------- モーダル ---------- */
html:has(.videoModal[open]) {
  overflow: hidden;
}

.videoModal {
  /* 幅・高さは動画に合わせる（画面に収まる大きさまで） */
  width: fit-content;
  max-width: none;
  max-height: none;
  padding: 0;
  border: none;
  border-radius: 12px;
  background-color: #000;
  overflow: visible;
}

.videoModal::backdrop {
  background-color: rgba(0, 0, 0, 0.7);
}

.videoModal__inner {
  position: relative;
}

.videoModal__video {
  display: block;
  width: auto;
  max-width: 90vw;
  height: auto;
  max-height: 85dvh;
  border-radius: 12px;
}

/* 動画の上に重ねる CTA ボタン（位置は --cta-x / --cta-y で指定）
   サイト共通の a:link / a:visited / a:hover より優先させるため、:link・:visited を付けて指定する */
.videoModal__cta:link,
.videoModal__cta:visited {
  position: absolute;
  top: var(--cta-y, 72%);
  left: var(--cta-x, 50%);
  padding: 12px 28px;
  border-radius: 999px;
  background-color: #e8452c;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  letter-spacing: 0.05em;
  white-space: nowrap;
  text-decoration: none;
  transform: translate(-50%, -50%);
  transition: background-color 0.2s ease;
}

.videoModal__cta[hidden] {
  display: none;
}

.videoModal__cta:hover {
  background-color: #c9341d;
  color: #fff;
  text-decoration: none;
  opacity: 1;
}

.videoModal__cta:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

.videoModal__close {
  position: absolute;
  top: -16px;
  right: -16px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background-color: #0c317c;
  cursor: pointer;
}

.videoModal__close:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

@media screen and (max-width: 767px) {
  .videoModal__cta:link,
  .videoModal__cta:visited {
    padding: 8px 18px;
    font-size: 13px;
  }

  .videoModal__close {
    top: -44px;
    right: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .videoWidget__frame {
    transition: none;
  }

  .videoWidget__frame:hover {
    transform: none;
  }
}
