/* ======================================= 
   ファイル名: side-content-layout.css
   ======================================= */

.side-content-section {
  max-width: 1200px;
  margin: 20px auto 180px; /* PC版：上下の余白を広く維持 */
  padding: 0 20px;
  box-sizing: border-box;
  font-family: "Yu Mincho", "游明朝体", serif;
  color: #12458f;
}

/* メイン画像 */
.side-content-section .main-image-wrapper img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 4px 15px rgba(18, 69, 143, 0.15);
  display: block;
  margin-bottom: 50px;
  object-fit: cover;
}

/* コンテンツの横並び基本設定 */
.side-content-section .content-wrapper {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
}

/* テキストエリア */
.side-content-section .text-area {
  flex: 0 1 auto;
  max-width: 380px;
  margin: 0;
}

.side-content-section .section-title {
  font-size: 28px;
  font-weight: 600;
  border-bottom: 1px solid #12458f;
  padding-bottom: 6px;
  margin-bottom: 15px;
  position: relative;
  color: #12458f;
}

.side-content-section .section-title .title-ja {
  font-size: 28px;
  margin-right: 10px;
}

.side-content-section .section-title .title-en {
  font-size: 14px;
  letter-spacing: 0.3em;
  font-weight: 600;
  text-transform: uppercase;
  opacity: 0.8;
  border-bottom: none;
  vertical-align: middle;
}

.side-content-section .subtitle {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 15px;
}

.side-content-section .description {
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 30px;
  color: #000;
}

/* 詳しくはこちらボタン */
.side-content-section .btn-detail {
  display: inline-block;
  padding: 10px 35px;
  font-size: 14px;
  font-weight: 600;
  color: #12458f;
  border: 2px solid #12458f;
  background-color: transparent;
  text-decoration: none;
  transition: background-color 0.3s ease, color 0.3s ease;
  border-radius: 4px;
}

.side-content-section .btn-detail:hover {
  background-color: #12458f;
  color: #fff;
}

/* 画像グリッド */
.side-content-section .image-grid {
  display: grid;
  grid-template-columns: 180px 180px;
  grid-template-rows: 250px;
  gap: 20px;
  flex-shrink: 0;
  margin: 0;
  align-items: end; 
}

/* 縦長画像共通スタイル */
.side-content-section .image-vertical {
  width: 180px;
  height: 250px;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 8px 20px rgba(18, 69, 143, 0.18);
}

/* 下部2カラム画像エリア */
.side-content-section .bottom-image-2col {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  max-width: 800px; 
  margin: 80px auto 0;
}

.side-content-section .bottom-item {
  width: calc(50% - 10px);
  margin: 0;
}

.side-content-section .bottom-item img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 4px 15px rgba(18, 69, 143, 0.15);
  object-fit: cover;
  margin-bottom: 15px;
}

.side-content-section .item-title {
  font-size: 18px;
  font-weight: 600;
  color: #12458f;
  margin-bottom: 8px;
  line-height: 1.4;
}

.side-content-section .item-text {
  font-size: 13px;
  line-height: 1.6;
  color: #000;
  margin: 0;
}

/* --- 交互レイアウト設定（PCのみ：ブレイクポイントを1025px以上に引き上げ） --- */
@media (min-width: 1025px) {
  section.side-content-section:nth-of-type(odd) .content-wrapper {
    flex-direction: row-reverse !important;
    gap: 90px; 
  }

  section.side-content-section:nth-of-type(odd) .image-grid img:nth-child(1) { transform: translateY(-110px) !important; }
  section.side-content-section:nth-of-type(odd) .image-grid img:nth-child(2) { transform: translateY(40px) !important; }

  section.side-content-section:nth-of-type(even) .content-wrapper {
    flex-direction: row !important;
    gap: 90px;
  }

  section.side-content-section:nth-of-type(even) .image-grid img:nth-child(1) { transform: translateY(40px) !important; }
  section.side-content-section:nth-of-type(even) .image-grid img:nth-child(2) { transform: translateY(-110px) !important; }
}

/* --- タブレット・スマホ対応（1024px以下：iPad11インチ対応を含む構成へ統合） --- */
@media (max-width: 1024px) {
  .side-content-section {
    display: flex;
    flex-direction: column;
    margin: 20px auto 120px; /* タブレット・SP版：セクション下の余白を短縮 */
  }

  /* タブレット・SP時のみメイン画像自体の下マージンを0に */
  .side-content-section .main-image-wrapper img {
    margin-bottom: 0 !important;
  }

  /* ② メイン画像を2番目に配置 */
  .side-content-section .main-image-wrapper {
    order: 2;
    margin-bottom: 30px; 
  }

  /* 順序制御のためにラッパーを解除 */
  .side-content-section .content-wrapper {
    display: contents !important;
  }

  .side-content-section .text-area {
    display: contents; 
  }

  /* ① テキストグループを1番目に */
  .side-content-section .section-title,
  .side-content-section .subtitle,
  .side-content-section .description {
    order: 1;
    text-align: center;
    max-width: 100%;
  }
  
  .side-content-section .description {
    margin-bottom: 30px;
  }

  /* ③ サブ画像グリッドを3番目に */
  .side-content-section .image-grid {
    order: 3;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
    gap: 15px;
    align-items: stretch;
    margin-bottom: 30px;
    width: 100%;
  }

  /* ④ 下部2カラム画像エリア：スマホ・タブレットでも「横並び」を維持し、4番目に配置 */
  .side-content-section .bottom-image-2col {
    order: 4;
    display: flex;
    flex-direction: row !important;
    justify-content: space-between;
    gap: 20px; /* タブレット幅で窮屈にならないよう元のgap値を維持 */
    margin-top: 20px;
    margin-bottom: 40px; /* 下のボタンとの間隔 */
    max-width: 100%;
  }

  .side-content-section .bottom-item {
    width: calc(50% - 10px);
    text-align: left;
  }

  /* タブレット基準のフォントサイズをベース設定 */
  .side-content-section .item-title {
    font-size: 16px;
    margin-bottom: 8px;
  }

  .side-content-section .item-text {
    font-size: 13px;
    line-height: 1.5;
  }

  /* ⑤ ボタンを5番目（一番最後）に配置 */
  .side-content-section .btn-detail {
    order: 5;
    width: fit-content;
    margin: 0 auto 0; /* 下余白はセクションのmarginで確保するため0 */
  }

  /* スマホ・タブレットでの画像段差・サイズリセット */
  .side-content-section .image-grid img:nth-child(1),
  .side-content-section .image-grid img:nth-child(2) {
    transform: translateY(0) !important; 
  }

  .side-content-section .image-vertical {
    width: 100%;
    height: auto;
    aspect-ratio: 140 / 200;
  }
}

/* --- 小型スマホ専用（480px以下）の微調整（デザイン維持の安全策） --- */
@media (max-width: 480px) {
  .side-content-section .bottom-image-2col {
    gap: 12px;
  }
  
  .side-content-section .bottom-item {
    width: calc(50% - 6px);
  }

  .side-content-section .item-title {
    font-size: 14px;
    margin-bottom: 5px;
  }

  .side-content-section .item-text {
    font-size: 11px;
    line-height: 1.4;
  }
}