img {
  max-width: 100%;
}

/* gallery グリッド設定 */
ul.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  /* デフォルト3列 */
  gap: 16px;
  list-style: none;
  margin: 50px 0 0 0;
  padding: 0;
  width: 100%;
}

ul.gallery>li {
  width: 100%;
  margin-bottom: 2em;
  text-align: center;
}

/* サムネイル画像サイズ統一 */
ul.gallery li a {
  display: block;
  text-decoration: none;
  color: inherit;
}

.image-container{
  border: 1px solid #ddd;
  padding: 15px;
  text-align: center;
}

ul.gallery li img {
  height: 200px; /* 固定の高さ */
  object-fit: cover; /* アスペクト比を保ちながら領域を埋める */
  object-position: center; /* 画像の中央部分を表示 */
  transition: transform 0.3s ease;
  display: block;
  margin: 0 auto;
}

ul.gallery li a:hover img {
  transform: scale(1.05);
}

ul.gallery>li p {
  line-height: 1;
  padding: 12px 0;
}

/* 980px未満は2列 */
@media (max-width: 979px) {
  .company_detail .contents_body {
    width: 100%;
  }

  ul.gallery {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 600px未満は1列 */
@media (max-width: 599px) {
  ul.gallery {
    grid-template-columns: 1fr;
  }
}

.btn_wrap {
  text-align: center;
}

.contents_body .link {
  position: relative;
  display: inline-block;
  font-size: 15px;
  font-weight: bold;
  line-height: 20px;
  letter-spacing: 0.04em;
  color: #0099D9;
  padding: 12px 12px 12px 35px;
  border: 1px solid #CCCCCC;
  background-color: #fff;
  margin: 0 auto;
}

.contents_body .link:before {
  content: '';
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  background: url(/jp/ja/img/common/arrow.png) no-repeat center center;
  background-size: 100% auto;
}

/*-------------------------------------------------------------------------
ページネーション
-------------------------------------------------------------------------*/
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 40px 0;
  flex-wrap: wrap;
}

.pagination a,
.pagination span {
  padding: 12px 16px;
  text-decoration: none;
  background: white;
  color: #0099D9;
  border: 1px solid #ccc;
  border-radius: 8px;
  transition: all 0.3s ease;
  font-weight: 500;
  min-width: 50px;
  text-align: center;
  font-size: 12px;

}

.pagination a:hover {
  background: #0099D9;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
  border-color: #0099D9 !important;

}

.pagination .current {
  background: #0099D9 !important;
  color: white;
  border-color: #0099D9 !important;
}

.pagination .disabled {
  color: #ccc;
  border-color: #e0e0e0;
  cursor: not-allowed;
}

@media (max-width: 768px) {
  .pagination {
    gap: 5px;
  }

  .pagination a,
  .pagination span {
    padding: 10px 12px;
    min-width: 40px;
  }
}

/*-------------------------------------------------------------------------
動画
-------------------------------------------------------------------------*/
/* 動画コンテナ用のレスポンシブスタイル */
.detail-content iframe {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 16 / 9;
  margin: 30px 0;
}

.detail-content img {
  width: 100% !important;
  height: auto !important;
  margin: 30px 0;
}

/* YouTube動画を含むコンテナ全般に適用 */
.detail-content iframe[src*="youtube.com"],
.detail-content iframe[src*="youtu.be"] {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 16 / 9;
  margin-bottom: 50px;
}

/* その他の動画埋め込みにも適用 */
.detail-content video {
  width: 100%;
  height: auto;
  margin-bottom: 50px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* 古いブラウザ対応（aspect-ratioが使えない場合） */
@supports not (aspect-ratio: 16 / 9) {
  .detail-content iframe {
    height: 56.25vw;
    /* 16:9の比率 */
    max-height: 315px;
  }
}