/* ===== Latest posts Section (高さ揃え優先版) ===== */
.latest-section{ 
  max-width:1320px; 
  margin:0 auto; 
  padding:0 16px; 
}
.latest-title{ 
  font-weight:700; 
  font-size:clamp(20px,2.2vw,28px); 
  margin:0 0 1rem; 
  text-align:center; 
}

/* グリッドレイアウト：flex縦並び */
.latest-section .wp-block-latest-posts.is-grid li{ 
  display:flex; 
  flex-direction:column; 
  gap:8px; 
  margin:0; 
}

/* サムネ枠 */
.latest-section .wp-block-latest-posts__featured-image{ 
  margin:0; 
}
.latest-section .wp-block-latest-posts__featured-image a{ 
  display:block; 
  width:100%; 
  aspect-ratio:14/9;         /* 高さ揃えのため比率固定 */
  overflow:hidden; 
  border-radius:8px; 
}

/* サムネ画像（高さ揃え版） */
.latest-section .wp-block-latest-posts__featured-image img{ 
  width:100%; 
  height:100%;               /* 枠にフィット */
  display:block; 
  object-fit:cover;          /* 枠いっぱいに収める（切れるが揃う） */
  object-position:center;    /* 被写体位置を中央基準に */
}

/* グリッド間隔 */
.wp-block-latest-posts.is-grid{ 
  gap:20px; 
}

/* ===== モバイル（≤768px）: 横スクロール対応 ===== */
@media (max-width:768px){
  .latest-carousel{ 
    --peek:12vw; 
    --gap:16px; 
    position:relative; 
  }
  .latest-carousel .wp-block-latest-posts.is-grid,
  .latest-carousel ul.wp-block-latest-posts__list{
    display:flex !important; 
    flex-wrap:nowrap !important; 
    gap:var(--gap);
    margin:0; 
    padding:0 calc(var(--peek) - (var(--gap)/2)) 8px 0;
    list-style:none; 
    overflow-x:auto !important;
    scroll-snap-type:x mandatory; 
    -webkit-overflow-scrolling:touch; 
    scrollbar-width:none; 
    touch-action:pan-x;
  }
  .latest-carousel .wp-block-latest-posts.is-grid::-webkit-scrollbar,
  .latest-carousel ul.wp-block-latest-posts__list::-webkit-scrollbar{ 
    display:none; 
  }
  .latest-carousel .wp-block-latest-posts.is-grid[class*="columns-"],
  .latest-carousel ul.wp-block-latest-posts__list.is-grid[class*="columns-"]{ 
    grid-template-columns:none !important; 
  }
  .latest-carousel .wp-block-latest-posts.is-grid > li,
  .latest-carousel ul.wp-block-latest-posts__list > li{ 
    width:auto !important; 
    flex:0 0 calc(100% - (var(--peek) * 2)) !important; 
    scroll-snap-align:center; 
  }
  .latest-carousel .wp-block-latest-posts.is-grid::after,
  .latest-carousel ul.wp-block-latest-posts__list::after{ 
    content:""; 
    flex:0 0 var(--peek); 
  }

  /* モバイルのサムネ枠 */
  .latest-carousel .wp-block-latest-posts__featured-image a{ 
    display:block; 
    width:100%; 
    aspect-ratio:14/9; 
    overflow:hidden; 
    border-radius:8px; 
  }

  /* モバイルのサムネ画像（高さ揃え） */
  .latest-carousel .wp-block-latest-posts__featured-image img{ 
    width:100%; 
    height:100%; 
    object-fit:cover; 
    object-position:center; 
    display:block; 
  }

  /* タイトル：2行で省略 */
  .latest-carousel .wp-block-latest-posts__post-title a{
    display:-webkit-box; 
    -webkit-line-clamp:2; 
    -webkit-box-orient:vertical; 
    overflow:hidden; 
    font-weight:600; 
    line-height:1.4; 
    text-decoration:none;
  }
}