.ex_recruit_images {
	display: flex;
	justify-content: center;
	align-items: flex-start;
	flex-wrap: wrap;
	gap: 20px 10px;
	margin-bottom: 50px;
}
.ex_recruit_images img {
	display: block;
	width: 100%;
	height: auto;
}

@media screen and (min-width: 769px) {
	.ex_recruit_images img {
		width: calc(50% - 10px);
	}
}

/* モーダル表示用CSS */
.modal-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: none;
}

.modal-wrapper.is-open {
  display: flex !important;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 0, 0, 0.1);
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  cursor: pointer;
}

.modal-content {
  position: relative;
  width: 90%;
  max-width: 800px;
  max-height: 90%;
  background-color: #fff;
  border-radius: 8px;
  overflow: hidden;
  z-index: 10000;
}

.modal-close-button {
  position: absolute;
  top: 10px;
  right: 15px;
  background: none;
  border: none;
  font-size: 24px;
  color: #fff;
  cursor: pointer;
  z-index: 10001;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
}

.modal-close-button:hover {
  background-color: rgba(0, 0, 0, 0.7);
}

/* フォーカス時のアウトラインを無効化 */
.modal-close-button:focus,
.js-modal-trigger:focus {
  outline: none;
}

/* モーダル全体のアウトラインを無効化 */
.modal-content:focus {
  outline: none;
}

#modalVideoPlayer {
  width: 100%;
  height: 0;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  position: relative;
}

#modalVideoPlayer iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* モバイル対応 */
@media screen and (max-width: 768px) {
  .modal-content {
    width: 95%;
    margin: 20px;
  }
  
  .modal-close-button {
    top: 5px;
    right: 10px;
    font-size: 20px;
    width: 25px;
    height: 25px;
  }
}

/* 動画セクション用CSS - top_movie_summary用の画像リサイズ設定 */
.top_movie_section .tile .bg img {
  position: absolute;
  margin: auto;
  width: 100%;
  height: 100%;
  object-fit: contain; /* 画像全体を表示（見切れを防ぐ） */
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  background-color: transparent; /* 余白部分の背景色を透明に */
}

/* top_movie_section専用のグリッドレイアウト設定 */
.top_movie_section .acms-admin-grid-r {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -15px; /* グリッドのマージンを調整 */
}

.top_movie_section .acms-admin-col-md-4 {
  flex: 0 0 33.333%;
  max-width: 33.333%;
  padding: 0 15px; /* カラム間のスペースを確保 */
  margin-bottom: 30px; /* 行間のスペースを確保 */
}

.top_movie_section .tile {
  height: auto;
  min-height: 140px; /* 最小高さを設定 */
}

/* 既存のtileスタイルを上書きして画像が見切れないように調整 */
.top_movie_section .tile .bg {
  position: absolute;
  width: 100%;
  height: 250px;
  z-index: 1;
  overflow: hidden;
}

.top_movie_section .tile .bg span {
  display: block;
  position: absolute;
  width: 100%;
  height: 250px;
  top: 0;
  left: 0;
  z-index: 1;
  background: transparent;
}

/* YouTube再生ボタンのスタイル */
.youtube-play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  transition: transform 0.2s ease;
}

.youtube-play-button:hover {
  transform: translate(-50%, -50%) scale(1.1);
}

.youtube-play-button svg {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* モバイル対応 */
@media screen and (max-width: 768px) {
  .top_movie_section .tile .bg {
    height: 115px;
  }
  
  .top_movie_section .tile .bg span {
    height: 115px;
  }
  
  .youtube-play-button svg {
    width: 48px;
    height: 34px;
  }
  
  /* スマートフォンでのグリッドレイアウト修正 */
  .top_movie_section .acms-admin-grid-r {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px; /* グリッドのマージンを調整 */
  }
  
  .top_movie_section .acms-admin-col-6 {
    flex: 0 0 50%;
    max-width: 50%;
    padding: 0 10px; /* カラム間のスペースを確保 */
    margin-bottom: 20px; /* 行間のスペースを確保 */
  }
  
  /* タイルの高さを自動調整 */
  .top_movie_section .tile {
    height: auto;
    min-height: 100px; /* 最小高さを設定 */
  }
}