@charset "UTF-8";
/*
Theme Name: law_tcd031_child2
Template: law_tcd031
Version: 1.0.0
*/

/* ============================================
   #index_content1_top グリッドレイアウト (PC only)
   ============================================ */
@media screen and (min-width: 769px) {

  /* float を無効化してグリッドに切り替え */
  #index_content1_top {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  /* clearfix の擬似要素がグリッドアイテムになるのを防ぐ */
  #index_content1_top::before,
  #index_content1_top::after {
    content: none;
  }

  #index_content1_top .box {
    float: none;
    width: auto;
  }

  /* 2件: 2列・中央揃え */
  #index_content1_top:has(.box:nth-child(2):last-child) {
    grid-template-columns: repeat(2, 1fr);
    max-width: 800px;
  }
  
  /* 4件: 2×2 */
  #index_content1_top:has(.box:nth-child(4):last-child) {
    grid-template-columns: repeat(2, 1fr);
    max-width: 800px;
  }

  /* 5件: 6等分グリッドで各アイテムが2列分を占め、2行目の2件を中央揃え */
  #index_content1_top:has(.box:nth-child(5):last-child) {
    grid-template-columns: repeat(6, 1fr);
  }
  #index_content1_top:has(.box:nth-child(5):last-child) .box {
    grid-column: span 2;
  }
  /* 4・5番目を明示的に配置して中央揃え（左右に1列ずつ余白） */
  #index_content1_top:has(.box:nth-child(5):last-child) .box:nth-child(4) {
    grid-column: 2 / 4;
  }
  #index_content1_top:has(.box:nth-child(5):last-child) .box:nth-child(5) {
    grid-column: 4 / 6;
  }

}
