/* ===================  ベース  =================== */
.custom-gallery-slider {
    width: 100%;
    overflow: hidden;
    margin: auto;
    /*position: relative;*/ /* ← 矢印の絶対位置の基準に */
  }
  
  .portfolio-slider {
    display: flex;
    /* gap: 1rem; */
    gap: 16px;
    transition: transform 0.5s ease;
    /* position: relative; */
  }
  
  /* .portfolio-slide {
    flex-shrink: 0;
    width: 100%;
  } */
  /* モバイル 1枚 */
  .portfolio-slide{flex:0 0 100%;}
  
  .portfolio-slide img {
    width: 100%;
    object-fit: cover;
    border-radius: 8px;
  }
  
  /* ================  レスポンシブ幅  ================= */
  /* タブレット 2枚 (gap=16px) */
@media (min-width:768px){
  .portfolio-slide{flex:0 0 calc((100% - 16px)/2);}
}

/* PC 3枚 */
@media (min-width:1025px){
  .portfolio-slide{flex:0 0 calc((100% - 32px)/3);} /* (gap*2) */
}

  /* @media (min-width: 1025px) {
    .portfolio-slide {
      width: calc(100% / 3);
    }
  }
  
  @media (min-width: 768px) and (max-width: 1024px) {
    .portfolio-slide {
      width: calc(100% / 2);
    }
  } */
  
  /* 〜767px は 1枚表示なので .main-slide { width: 100%; } でOK */
  
  /* =============  サムネイル（ギャラリー）  ============= */
  .wp-block-gallery {
    display: flex !important;  /* Gutenberg のレイアウトを上書き */
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .wp-block-gallery figure {
    margin: 0;
    border: 2px solid transparent;
    transition: border-color 0.3s;
    /*flex: 0 1 80px;*/            /* 幅80px程度の正方サムネ */
    flex: 0 0 80px !important;   /* grow 0, basis 80px */
  }
  
  .wp-block-gallery figure.active {
    border-color: tomato;      /* 現在スライドをハイライト */
  }
  
  .wp-block-gallery img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
  }
  
  /* ===========  ナビゲーション矢印  =========== */
  .slider-frame {
    position: relative;
  }
  
  .slider-controls {
    position: absolute;
    /* top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%); */
    inset: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;   /* 子ボタンだけクリック可能に */
    z-index: 20;
    margin-bottom: 0.5rem;
  }
  
  .slider-controls button {
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    padding: 0.4em 1em;
    font-size: 1.4rem;
    border-radius: 4px;
    cursor: pointer;
    pointer-events: auto;   /* ボタンはクリック可 */
  }
  
  .slider-controls button:hover {
    background: rgba(0, 0, 0, 0.7);
  }
  
  /* ==============  キャプション  ============== */
  .slider-caption {
    text-align: center;
    font-style: italic;
    color: #555;
    margin-bottom: 1rem;
  }
  
  /* ==============  モーダル拡大表示  ============== */
  .image-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    align-items: center;
    justify-content: center;
  }
  
  .image-modal.open {
    display: flex;
    background: rgba(0, 0, 0, 0.7);
  }
  
  .modal-content {
    position: relative;
    background: #fff;
    padding: 1rem;
    border-radius: 8px;
    max-width: 90%;
    max-height: 90%;
    text-align: center;
  }
  
  .modal-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
  }
  
  .modal-caption {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #333;
  }
  
  .modal-close {
    position: absolute;
    top: 0.2em;
    right: 0.5em;
    background: transparent;
    border: none;
    font-size: 2rem;
    color: #666;
    cursor: pointer;
  }
  
  .modal-overlay {
    position: absolute;
    inset: 0;
    background: transparent;
  }

