/*
  WORKSページ専用のスタイルシート
*/

#works-main {
  padding-top: 70px;
  min-height: 100vh;
  background: #1c1c1c;
}

.works-center {
  width: 80%;
  margin: 0 auto;
  text-align: center;
  padding: 50px 0;
}

.works-center h1 {
  font-size: 100px;
  color: #fff;
  margin-bottom: 60px;
}

.works-section {
  margin-bottom: 80px;
}

.works-section h2 {
  font-size: 40px;
  color: #fff;
  margin-bottom: 20px;
}

/* 学年ブロック */
.year-block {
  margin-top: 40px;
  padding: 30px 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.year-title {
  font-size: 44px;
  color: #fff;
  margin-bottom: 20px;
  letter-spacing: 0.02em;
}

/* サブセクション見出し */
.subsection-title {
  font-size: 40px;
  color: #ffffff;
  margin-top: 30px;
  margin-bottom: 15px;
  font-weight: bold;
}

/* 自動再生動画セクション */
.auto-play-video-section {
  margin-top: 50px;
}

.auto-play-video-section h3 {
  font-size: 40px;
  color: #fff;
  margin-bottom: 20px;
}

/* 自動再生動画コンテナ */
.auto-play-videos {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}

/* 大学作品セクションの自動再生動画と静止画のスタイル */
.university-auto-play .auto-play-videos video,
.university-auto-play .auto-play-videos img {
  width: calc(20% - 20px);
  max-width: 230px;
  height: auto;
  border: 0px solid #fff;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
  display: block;
}

/* =========================================================
   ✅ Self Produced：画像はクリック不要（sp-imageで枠統一）
   - video：640×400
   - image：640×400枠に収める（object-fit: contain）
========================================================= */

/* Self Produced：動画の枠を統一 */
.self-produced-auto-play .auto-play-videos video {
  width: 640px;
  height: 400px;
  max-width: 1000px;
  border: 0px solid #fff;
  display: block;
}

/* Self Produced：画像の枠（クリック不可） */
.self-produced-auto-play .auto-play-videos .sp-image {
  width: 640px;
  height: 400px;
  max-width: 1000px;
  border: 0px solid #fff;

  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;

  pointer-events: none; /* ✅ クリックもホバーも無効 */
}

/* Self Produced：画像は比率維持で全体表示（余白OK） */
.self-produced-auto-play .auto-play-videos .sp-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* ギャラリーコンテナ */
.gallery-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  margin-top: 30px;
  margin-bottom: 50px;
}

/* ギャラリー内の各アイテム（画像サムネの基本サイズ） */
.gallery-item {
  width: 200px;
  height: auto;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  transition: transform 0.3s ease;
}

.gallery-item:hover {
  transform: scale(1.05);
}

/* 動画サムネイルだけを大きくする */
.gallery-item[data-type="video"] {
  width: 640px;
}

/* サムネイル画像 */
.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.3s ease;
}

.gallery-item img:hover {
  transform: scale(1.05);
}

/* 再生アイコン */
.play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 50px;
  color: rgba(255, 255, 255, 0.8);
  pointer-events: none;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.7);
}

/* ✅ 追加：次の要素を必ず次の行へ（単独表示のため） */
.gallery-break {
  flex-basis: 100%;
  height: 0;
}

/* ✅ 追加：画像でも動画サムネと同じ幅にする */
.gallery-item.wide {
  width: 640px;
}

/* ✅ 任意：wide画像の見た目安定 */
.gallery-item.wide img {
  width: 100%;
  height: auto;
  display: block;
}

/* モーダル全体 */
.modal {
  display: none;
  position: fixed;
  z-index: 9999;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  overflow: auto;
}

.modal.show {
  display: block;
}

/* 閉じるボタン */
.close {
  position: absolute;
  top: 30px;
  right: 45px;
  color: #fff;
  font-size: 50px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
}

.close:hover {
  color: #ccc;
}

/* モーダルの中身 */
.modal-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  margin: 5% auto;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.modal.show .modal-content {
  opacity: 1;
  transform: scale(1);
}

.modal-content img,
.modal-content video {
  display: block;
  margin: 0 auto;
  border: 2px solid #fff;
  max-width: 100%;
  height: auto;
}

.modal-content img {
  max-height: 80vh;
}

.modal-content video {
  max-height: 80vh;
}

/* レスポンシブ */
@media (max-width: 1200px) {
  .university-auto-play .auto-play-videos video,
  .university-auto-play .auto-play-videos img {
    width: calc(20% - 20px);
    max-width: 230px;
  }

  .self-produced-auto-play .auto-play-videos video,
  .self-produced-auto-play .auto-play-videos .sp-image {
    width: 640px;
    height: 400px;
    max-width: 100%;
  }
}

@media (max-width: 992px) {
  .university-auto-play .auto-play-videos video,
  .university-auto-play .auto-play-videos img {
    width: calc(25% - 20px);
    max-width: 250px;
  }

  .self-produced-auto-play .auto-play-videos video,
  .self-produced-auto-play .auto-play-videos .sp-image {
    width: 640px;
    height: 400px;
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .gallery-item {
    width: 100%;
  }

  .gallery-item[data-type="video"] {
    width: 100%;
  }

  .gallery-item.wide {
    width: 100%;
  }

  .modal-content {
    max-width: 90%;
    max-height: 90%;
  }

  .close {
    font-size: 40px;
    top: 20px;
    right: 30px;
  }

  .play-icon {
    font-size: 40px;
  }

  .university-auto-play .auto-play-videos video,
  .university-auto-play .auto-play-videos img {
    width: calc(50% - 20px);
    max-width: 400px;
  }

  /* Self Produced：スマホは1列 */
  .self-produced-auto-play .auto-play-videos video,
  .self-produced-auto-play .auto-play-videos .sp-image {
    width: 100%;
    height: auto;
  }

  .self-produced-auto-play .auto-play-videos .sp-image img {
    width: 100%;
    height: auto;
    object-fit: contain;
  }
}

@media (max-width: 480px) {
  .university-auto-play .auto-play-videos video,
  .university-auto-play .auto-play-videos img {
    width: 100%;
    max-width: 600px;
  }

  .self-produced-auto-play .auto-play-videos video,
  .self-produced-auto-play .auto-play-videos .sp-image {
    width: 100%;
    height: auto;
  }

  .self-produced-auto-play .auto-play-videos .sp-image img {
    width: 100%;
    height: auto;
    object-fit: contain;
  }
}
