/* =========================================================
   施工事例一覧ページ (/works)
   for archive-case_study.php
========================================================= */

/* ---------------------------
   HEROセクション
--------------------------- */
.works-archive__hero {
  background: #f8f8f8;
  /* ← 固定ヘッダーぶん押し下げる */
  padding: 40px 0 60px;
}

@media (max-width: 768px) {
  .works-archive__hero {
    margin-top: 100px;
    padding: 32px 0 40px;
  }
}

.works-archive__title {
  font-size: 2.2rem;
  color: #0B0A60;
  font-weight: 700;
  margin-bottom: 20px;
  line-height: 1.3;
  letter-spacing: 0.05em;
}

@media (max-width: 768px) {
  .works-archive__title {
    font-size: 1.6rem;
  }
}

.works-archive__lead {
  color: #555;
  font-size: 1rem;
  line-height: 1.8;
  max-width: 720px;
  margin: 0 auto;
  word-break: break-word;
}

/* ---------------------------
     一覧ブロック全体
  --------------------------- */
.works-archive__list {
  background: #fff;
  padding: 80px 0;
}

@media (max-width: 768px) {
  .works-archive__list {
    padding: 60px 0;
  }
}

/* ---------------------------
     カードのグリッド
  --------------------------- */
.works-items {
  display: grid;
  /* 
   * auto-fill: 少数の投稿でもカードサイズを維持
   * minmax(320px, 420px): 最小320px、最大420pxで固定
   * 1frではなく固定値を使うことで、投稿が1件でも拡大されない
   */
  grid-template-columns: repeat(auto-fill, minmax(320px, 420px));
  gap: 36px;
  /* カードの最大幅を設定して、拡大しすぎないようにする */
  max-width: 100%;
}

/* タブレット: 2列表示 */
@media (max-width: 768px) and (min-width: 481px) {
  .works-items {
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
  }

  .works-item {
    max-width: 100%;
  }
}

/* スマホ: 1列表示 */
@media (max-width: 480px) {
  .works-items {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  /* スマホでは全幅表示 */
  .works-item {
    max-width: 100%;
    justify-self: stretch;
  }
}

/* ---------------------------
     ローディング状態
  --------------------------- */
#worksResult {
  position: relative;
  min-height: 200px;
}

#worksResult.is-loading {
  opacity: 0.5;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#worksResult.is-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #0B0A60;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 10;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* ---------------------------
     カード本体
  --------------------------- */
.works-item {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 14px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;

  /* 少数の投稿でもカードが大きくなりすぎないように */
  /* グリッドの最大値と一致させる */
  /* !important で他のCSSが上書きしないようにする */
  max-width: 420px !important;
  width: 100%;
  justify-self: start;
}

.works-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.08);
}

/* リンクラッパー */
.works-item__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
}


/* ---------------------------
     画像
  --------------------------- */
.works-item__image {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 14px 14px 0 0;
}

.works-item__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 16 / 9;
  /* 高さ控えめの横長カード */
  transition: transform 0.4s ease;
  display: block;
}

.works-item:hover .works-item__image img {
  transform: scale(1.03);
}

@media (max-width: 768px) {
  .works-item__image img {
    aspect-ratio: 4 / 3;
  }
}

/* ---------------------------
     本文エリア
  --------------------------- */
.works-item__body {
  padding: 24px 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

@media (max-width: 480px) {
  .works-item__body {
    padding: 18px 20px 22px;
  }
}

/* ---------------------------
     メタ情報 (種別 / エリア)
  --------------------------- */
.works-item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.85rem;
  color: #666;
  line-height: 1.4;
}

.works-item__meta .label {
  background-color: #0B0A60;
  color: #fff;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 1.4;
}

.works-item__meta .area {
  font-size: 0.8rem;
  color: #888;
  line-height: 1.4;
}

/* ---------------------------
     タイトル
  --------------------------- */
.works-item__title {
  font-size: 1.15rem;
  font-weight: 600;
  color: #333;
  line-height: 1.6;
  margin: 0;
  transition: color 0.3s ease;
}

.works-item__link:hover .works-item__title {
  color: #0B0A60;
}

/* ---------------------------
     説明文
  --------------------------- */
.works-item__desc {
  font-size: 0.9rem;
  color: #555;
  line-height: 1.7;
  word-break: break-word;
  /* 必要なら3行でカットするなら↓
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    */
}

/* ---------------------------
     ボタン
  --------------------------- */
.btn-outline.btn-outline--small {
  align-self: flex-start;
  display: inline-block;
  border: 1px solid #0B0A60;
  color: #0B0A60;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.4;
  padding: 7px 14px;
  border-radius: 4px;
  background-color: #fff;
  text-decoration: none;
  transition: all 0.3s ease;
}

.btn-outline.btn-outline--small:hover {
  background-color: #0B0A60;
  color: #fff;
}

/* ---------------------------
     結果なしメッセージ
  --------------------------- */
.works-no-results {
  text-align: center;
  padding: 60px 20px;
  color: #666;
}

.works-no-results p {
  font-size: 1rem;
  margin: 0;
}


/* ---------------------------
     ページネーション
  --------------------------- */
.pagination {
  text-align: center;
  margin-top: 60px;
}

.pagination .page-numbers {
  display: inline-block;
  margin: 0 6px;
  padding: 8px 14px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.9rem;
  color: #333;
  text-decoration: none;
  transition: all 0.3s ease;
}

.pagination .page-numbers:hover {
  background-color: #0B0A60;
  color: #fff;
  border-color: #0B0A60;
}

.pagination .current {
  background-color: #0B0A60;
  color: #fff;
  border-color: #0B0A60;
  pointer-events: none;
}

/* =========================================================
   CTAセクション（施工事例アーカイブ・詳細ページ 共通）
   濃紺の帯 / 白いボタン
========================================================= */

.case-detail__cta,
.works-archive__cta {
  background-color: #05055c;
  /* 濃い紺の帯 */
  color: #fff;
  text-align: center;
  padding: 60px 16px 70px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

@media (max-width: 768px) {

  .case-detail__cta,
  .works-archive__cta {
    padding: 48px 16px 56px;
  }
}

.case-detail__cta .container,
.works-archive__cta .container {
  max-width: 760px;
  /* 真ん中で読みやすい幅 */
  margin: 0 auto;
}

/* 見出し */
.case-detail__cta .cta-box h2,
.works-archive__cta .cta-box h2 {
  font-size: clamp(1.4rem, 0.4vw + 1.3rem, 1.6rem);
  font-weight: 700;
  line-height: 1.5;
  color: #fff;
  letter-spacing: .05em;
  text-align: center;
  margin: 0 0 24px;
}

/* 説明文 */
.case-detail__cta .cta-box p,
.works-archive__cta .cta-box p {
  font-size: 1rem;
  line-height: 1.8;
  color: #fff;
  text-align: center;
  margin: 0 0 28px;
  letter-spacing: .03em;
}

/* ボタン */
.case-detail__cta .btn.btn-main,
.works-archive__cta .btn.btn-main {
  display: inline-block;
  background-color: #fff;
  color: #05055c;
  border: 1px solid #fff;
  border-radius: 6px;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.4;
  padding: 14px 24px;
  min-width: 220px;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  transition: all .25s ease;
  letter-spacing: .03em;
}

.case-detail__cta .btn.btn-main:hover,
.works-archive__cta .btn.btn-main:hover {
  background-color: #f4f4f4;
  color: #05055c;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
  transform: translateY(-2px);
}

/* 一覧ページ側だけ、次の「Contact us」ブロックと
   くっつきすぎないように下にゆとり */
.works-archive__cta {
  margin-bottom: 40px;
}

/* =========================================================
   Works：カテゴリフィルター（チップUI / 横スクロール対応）
   ※ 既存の重複定義は削除して、これだけ残す
========================================================= */

.works-archive__filter-wrap {
  margin-top: 22px;
}

/* nav本体 */
.works-archive__filter {
  display: flex;
  gap: 10px;
  align-items: center;

  /* SP/項目多い時は横スクロール */
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;

  /* 余白（スクロール時に見切れない） */
  padding: 10px 2px 6px;
}

.works-archive__filter::-webkit-scrollbar {
  display: none;
}

/* チップ（リンクとボタン両対応） */
.works-archive__filter a,
.works-archive__filter button,
.works-archive__filter .filter-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  height: 40px;
  padding: 0 16px;

  border-radius: 999px;
  font-size: .92rem;
  font-weight: 700;
  letter-spacing: .02em;
  text-decoration: none;

  background: #fff;
  color: #0B0A60;
  border: 1px solid rgba(11, 10, 96, .18);
  box-shadow: 0 10px 26px rgba(12, 18, 60, .08);
  transition: transform .15s ease, background .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease;
  cursor: pointer;
}

.works-archive__filter a:hover,
.works-archive__filter button:hover,
.works-archive__filter .filter-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(11, 10, 96, .28);
}

/* 選択中 */
.works-archive__filter a.is-active,
.works-archive__filter button.is-active,
.works-archive__filter .filter-btn.is-active {
  background: #0B0A60;
  color: #fff;
  border-color: #0B0A60;
  box-shadow: 0 18px 40px rgba(12, 18, 60, .18);
}

/* PCで横一列に収まる場合は“中央寄せ”の方が綺麗 */
@media (min-width: 901px) {
  .works-archive__filter {
    justify-content: center;
  }
}

/* SPの可読性 */
@media (max-width: 768px) {
  .works-archive__filter-wrap {
    margin-top: 18px;
  }

  .works-archive__filter a,
  .works-archive__filter button,
  .works-archive__filter .filter-btn {
    height: 40px;
    padding: 0 16px;
    font-size: .9rem;
  }
}