/* =========================================================
  PC用デザイン
========================================================= */

/* =============
  ページ全体
============= */
.page-body {
  display: flex;
  max-width: 1200px;
  margin: 0 auto;
}

.main-blocks {
  width: 100%;
  padding: 10px;
  background: #f8f8f8;
  margin: 0 0 0.5em 0;
  box-sizing: border-box;
}

/* =============
  ページタイトル
============= */
.page-title {
  width: 100%;
  height: 56px;
  line-height: 56px;
  padding-left: 24px;
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  background:
    radial-gradient(ellipse at 62% 100%, rgba(120,160,210,.45) 0%, rgba(70,110,170,.35) 28%, transparent 55%),
    repeating-linear-gradient(0deg, transparent 0px, transparent 2px, rgba(255,255,255,.45) 3px, transparent 4px),
    linear-gradient(90deg, #0b2f75 0%, #123b86 45%, #1d4f9a 100%);
  border-radius: 3px 3px 0 0;
  border-bottom: 4px solid #c7d5ea;
  box-sizing: border-box;
  margin: 0 0 10px 0;
}

/* =============
  ページ切替タブ
============= */
.page-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid #005bac;
  width: 100%;
}

.page-tab {
  display: block;
  padding: 10px 20px;
  background: #e9eef5;
  color: #333;
  text-decoration: none;
  font-weight: bold;
  border: 1px solid #ccc;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  width: 50%;
  text-align: center;
}

.page-tab.active {
  background: #005bac;
  color: #fff;
  border-color: #005bac;
}

/* グリッドレイアウト */
.movie-youtube-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding: 20px;
  background-color: #eee;
}

.video-card {
  background: #fff;
  border: 1px solid #ccc;
  cursor: pointer;
  /* クリックできることを示す */
}

.video-title {
  background-color: #1a4a9c;
  color: #fff;
  margin: 0;
  padding: 5px;
  font-size: 14px;
  text-align: center;
  min-height: 3em;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-thumbnail {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  /* ← はみ出しをカット */
  line-height: 0;
  /* ← 文字としての高さをゼロにする */
}

.video-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  /* ← これを追加！隙間が消えます */
}

/* 再生ボタン装飾 */
.play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;

  width: 72px;
  height: 50px;

  transform: translate(-50%, -50%);

  background: rgba(255, 0, 0, 0.9);
  border-radius: 14px;

  pointer-events: none;

  transition:
    transform 0.2s ease,
    background 0.2s ease;
}

/* 白い ▶ */
.play-overlay::before {
  content: "";

  position: absolute;
  top: 50%;
  left: 53%;

  transform: translate(-50%, -50%);

  width: 0;
  height: 0;

  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
  border-left: 18px solid #fff;
}

/* ホバー時 */
.video-thumbnail:hover .play-overlay {
  background: rgb(255, 0, 0);
  transform: translate(-50%, -50%) scale(1.08);
}

/* モーダル（黒マスク）の設定 */
#video-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  /* 画面ぴったりに */
  background: rgba(0, 0, 0, 0.9);
  z-index: 10000;
  justify-content: center;
  align-items: center;
}

/* 動画を包む箱：ここを修正 */
.modal-content {
  position: relative;
  width: 80%;
  /* 横幅を少し抑える（お好みで90%などに） */
  max-width: 900px;
  /* 大きすぎないように制限 */
  aspect-ratio: 16 / 9;
  /* 横16：縦9を強制 */
  background: #000;
  /* 隙間が出ても黒く見えるように */
}

.modal-content iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* 中の動画本体 */
#player-container,
#player-container iframe {
  width: 100%;
  height: 100%;
  display: block;
}

/* 閉じるボタンの位置微調整 */
.close-btn {
  position: absolute;
  top: -50px;
  /* 動画の少し上に配置 */
  right: -10px;
  /* 右端に配置 */
  color: #ffffff;
  font-size: 60px;
  /* 大きくして押しやすくする */
  font-weight: bold;
  cursor: pointer;
  z-index: 10001;
  /* 動画(10000)よりも必ず上に */
  line-height: 1;
  display: block;
  width: 60px;
  height: 60px;
  text-align: center;
  /* デバッグ用：もし場所がわからなければ background: red; を一時的に足すと見えます */
}

/* =========================================================
  スマホ用デザイン
========================================================= */
@media (max-width: 929px) {
  .movie-youtube-container {
    /* 横に1個だけ表示 */
    grid-template-columns: 1fr;
  }
}