/* works.css 完全修正済み・Ajax対応 + 余白対応 */

/* 上下全体の余白 */
section.works-archive {
    padding: 60px 20px;
    box-sizing: border-box;
  }
  
  /* グリッド全体 */
  .works-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
  }
  
  /* 各アイテム */
  .works-item {
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease-in-out;
  }
  
  /* 画像を正方形に */
  .works-thumbnail {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    transition: transform 0.3s ease-in-out;
    display: block;
  }
  
  /* ホバー時に画像が少し右に */
  .works-link:hover .works-thumbnail {
    transform: translateX(2px);
  }
  
  /* 黒カバー */
  .works-hover-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0,0,0,0.4);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    display: flex;
    align-items: flex-end;
    z-index: 2;
  }
  
  /* ホバー時に表示 */
  .works-link:hover .works-hover-overlay {
    opacity: 1;
  }
  
  /* テキストエリア */
  .hover-meta {
    width: 100%;
    padding: 0 0 30px 0;
    box-sizing: border-box;
    color: #fff;
    text-align: left;
  }
  
  /* 白い横ライン */
  .hover-line {
    height: 1px;
    width: 0;
    background-color: #fff;
    transition: width 0.4s ease-in-out;
    margin-bottom: 10px;
  }
  
  .works-link:hover .hover-line {
    width: 100%;
  }
  
  /* テキスト要素 */
  .hover-category,
  .hover-title {
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    padding: 0 20px;
  }
  
  .works-link:hover .hover-category {
    opacity: 1;
    transform: translateX(0);
    transition-delay: 0.2s;
  }
  
  .works-link:hover .hover-title {
    opacity: 1;
    transform: translateX(0);
    transition-delay: 0.4s;
  }
  
  .hover-category {
    font-size: 16px;
    margin-top: 10px;
    margin-bottom: 8px;
  }
  
  .hover-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 10px;
  }
  
  /* カテゴリフィルター中央寄せ */
  .works-filter ul {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    list-style: none;
    padding: 0;
    margin-bottom: 30px;
  }
  
  .works-filter ul li a {
    white-space: nowrap;
    padding: 6px 12px;
    border: 1px solid #000;
    color: #000;
    text-decoration: none;
    font-size: 14px;
    display: inline-block;
    transition: all 0.3s ease;
  }
  
  .works-filter ul li a.active,
  .works-filter ul li a:hover {
    background-color: #000;
    color: #fff;
  }
  
  /* 「もっと見る」ボタン */
  .load-more-wrap {
    text-align: center;
    margin-top: 40px;
  }
  
  #load-more {
    border: 1px solid #999;
    background: transparent;
    padding: 12px 36px;
    font-size: 13px;
    letter-spacing: 1px;
    cursor: pointer;
    color: #333;
    transition: all 0.3s ease-in-out;
  }
  
  #load-more:hover {
    background-color: #333;
    color: #fff;
  }
  
  /* --- スマホ対応（768px以下）--- */
  @media screen and (max-width: 768px) {
    .works-grid {
      grid-template-columns: 1fr;
      gap: 20px;
      padding: 0 16px;
    }
  
    section.works-archive {
      padding: 40px 16px;
    }
  }
  
 /* ===============================
   WORKS 詳細ページ（single）
================================= */

.works-single {
    padding: 60px 20px;
    background: #fff;
  }
  
  .works-two-column {
    display: flex;
    flex-wrap: nowrap;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
  }
  
  .works-left,
  .works-right {
    width: 50%;
    max-width: 50%;
  }
  
  /* 全体コンテナに左右余白を（PC時） */
  .works-single .container {
    padding: 0 20px;
    box-sizing: border-box;
  }

  .works-title {
    font-size: 28px;
    margin-bottom: 24px;
  }

  .works-text {
    font-size: 16px;
    line-height: 2;
  }
  
  /* PC表示時の右カラムに余白追加 */
  @media screen and (min-width: 1201px) {
    .works-right {
      padding-left: 20px;
    }
  }
  
  /* ===== 1200px以下：スマホ・タブレット対応レイアウト ===== */
  @media screen and (max-width: 1200px) {
    .works-two-column {
      flex-direction: column;
      gap: 40px;
    }
  
    .works-left,
    .works-right {
      width: 100% !important;
      max-width: 100% !important;
    }
  
    .works-single .container {
      padding: 0 16px;
    }
  
    .works-right {
      padding: 0;
    }
  
    .works-title,
    .works-text {
      text-align: left;
    }
  }
  
/* ===============================
    WORKS詳細ページ 画像表示エリア内のスタイル (Step2 追加)
================================= */
.works-left .work-image-gallery {
    display: flex;
    flex-wrap: wrap; /* 複数の画像がある場合に折り返す */
    gap: 20px; /* 画像間の余白 */
}

.works-left .work-single-image-wrapper {
    width: 100%; /* これで1カラム表示を強制 */
    margin-bottom: 20px; /* 各画像の下に余白 */
}

.works-left .work-single-image-inner {
    width: 100%;
    /* 画像を中央に寄せたい場合、ここに最大幅とmargin: autoを追加 */
    /* max-width: 800px; */ /* 例: 画像の最大幅を800pxにする */
    /* margin: 0 auto; */ /* 中央寄せにしたい場合 */
}

.works-left .work-single-image {
    width: 100%;
    height: auto;
    border-radius: 0;
    display: block; /* imgタグはインライン要素なのでブロック要素に */
}

/* 必要であれば、スマホでの調整 */
@media screen and (max-width: 1200px) { /* 1200px以下でworks-two-columnが縦並びになるので、ここではworks-leftの幅を調整する必要なし */
    .works-left .work-single-image-wrapper {
        /* スマホで特に調整が必要なければ不要です */
        margin-bottom: 15px; /* スマホでの余白を調整する場合 */
    }
    .works-left .work-image-gallery {
        gap: 15px; /* スマホでの画像間の余白を調整する場合 */
    }
}