/* ============================================================
   archives/style.css — 記事一覧（/archives）＋ カテゴリ別一覧（/category/*）共通
   PCは1240固定px、SPは可変。カードは PC縦組み / SP横組み（Figma Blog post card）。
   差分（カテゴリ見出し等）はページ側のクラスで上書き。
   ============================================================ */

/* --- ヒーロー帯（お役立ち記事 / カテゴリ名） --------------- */
.archives-hero {
  position: relative;
  overflow: hidden;
  background: var(--color-gold-bg-pale, #fffbeb);
}
/* 和柄装飾（PCのみ。TOPお役立ち記事と共通の波柄を流用） */
.archives-hero-deco {
  position: absolute;
  top: -33px;
  left: 50%;
  transform: translateX(-50%);
  width: 1460px;
  max-width: none;
  z-index: 0;
  pointer-events: none;
  opacity: 0.7;
}
.archives-hero-inner {
  position: relative;
  z-index: 1;
  width: min(var(--container-w), calc(100% - var(--pc-gutter) * 2));
  margin-inline: auto;
  padding-block: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
/* common-h2 のSP縮小を打ち消し、36px固定（Figma） */
.archives-hero-title.common-h2 {
  font-size: 36px;
  line-height: 56px;
  margin-bottom: 40px;       /* 新規ページ共通：common-h2 下マージン PC 40px */
}
.archives-hero-sub {
  font-family: var(--font-jp);
  font-weight: 700;
  font-size: 22px;
  line-height: 42px;
  color: var(--color-text);
  text-align: center;
}

/* --- メイン本文ラッパ（パンくず〜ページネーション） -------- */
.archives-main {
  background: #fff;
  padding-bottom: 100px;       /* ページネーション → CV帯 の余白（Figma 100px） */
}
.archives-inner {
  width: min(var(--container-w), calc(100% - var(--pc-gutter) * 2));
  margin-inline: auto;
}

/* --- パンくず --------------------------------------------- */
.archives-pan {
  padding: 20px 0;
  font-size: 14px;
  line-height: 19px;
  color: var(--color-text-secondary, #4a5568);
}
.archives-pan a {
  color: inherit;
  text-decoration: none;
}
.archives-pan a:hover { text-decoration: underline; }
.archives-pan a.archives-pan-home { text-decoration: underline; }   /* 先頭「Home」のみ常時下線 */
.archives-pan-sep { margin: 0 8px; }

/* --- カテゴリーチップ ------------------------------------- */
.archives-cat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0 30px;
}
.archives-cat-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-text-secondary, #4a5568);
  border-radius: 60px;
  padding: 10px 60px;
  font-family: var(--font-jp);
  font-weight: 700;
  font-size: 22px;
  line-height: 42px;
  color: var(--color-text-secondary, #4a5568);
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.2s, background 0.2s, color 0.2s;
}
.archives-cat-chip:hover { opacity: 0.7; }
/* アクティブ主チップ：すべて=黒 / 各カテゴリ=カテゴリ色 */
.archives-cat-chip--active {
  color: #fff;
  padding: 10px 40px;
}
.archives-cat-chip--active.archives-cat-chip--all {
  background: var(--color-text-sub);
  border-color: var(--color-text-sub);
}
.archives-cat-chip--active.archives-cat-chip--nayami {
  background: #dc2626;
  border-color: #dc2626;
}
.archives-cat-chip--active.archives-cat-chip--industry {
  background: #16a34a;
  border-color: #16a34a;
}
.archives-cat-chip--active.archives-cat-chip--budget {
  background: #2563eb;
  border-color: #2563eb;
}
.archives-cat-chip--active.archives-cat-chip--subsidy {
  background: #b45309;
  border-color: #b45309;
}
.archives-cat-chip--active.archives-cat-chip--type {
  background: #7c3aed;
  border-color: #7c3aed;
}

/* --- カテゴリ別一覧：SEO見出し（/category/* のみ） ---------- */
.archives-lead {
  font-family: var(--font-jp);
  font-weight: 700;
  font-size: 22px;
  line-height: 42px;
  color: var(--color-text);
  padding-bottom: 30px;
}
.archives-lead .em { color: var(--color-brand); }
/* 見出し強調はカテゴリ色 */
.archives-lead--nayami .em   { color: #dc2626; }
.archives-lead--industry .em { color: #16a34a; }
.archives-lead--budget .em   { color: #2563eb; }
.archives-lead--subsidy .em  { color: #b45309; }
.archives-lead--type .em     { color: #7c3aed; }

/* --- カテゴリ別一覧：子カテゴリーチップ（/category/* のみ） -- */
.archives-subcat {
  display: flex;
  flex-wrap: wrap;
  gap: 0 10px;
  padding-bottom: 20px;
}
.archives-subcat-chip {
  display: inline-flex;
  align-items: center;
  margin-bottom: 20px;
  padding: 10px 20px;
  border: 1px solid var(--color-text-secondary, #4a5568);
  border-radius: 60px;
  font-family: var(--font-jp);
  font-weight: 700;
  font-size: 18px;
  line-height: 28px;
  color: var(--color-text-secondary, #4a5568);
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.2s, background 0.2s, color 0.2s;
}
.archives-subcat-chip:hover { opacity: 0.7; }
.archives-subcat-chip--active {
  background: #a0aec0;
  border-color: #a0aec0;
  color: #fff;
}

/* --- 記事カードグリッド ----------------------------------- */
.archives-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 25px;
}
.archives-card {
  background: #fff;
  box-shadow: 0 4px 6px -2px rgba(16, 24, 40, 0.03), 0 12px 16px -4px rgba(16, 24, 40, 0.08);
}
.archives-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 20px;
  gap: 20px;
  text-decoration: none;
  color: inherit;
}
.archives-card-thumb {
  background: #e2e8f0;
  height: 138px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}
.archives-card-thumb-logo {
  width: 200px;
  height: auto;
}
/* WP: アイキャッチ画像はサムネ枠いっぱいにカバー */
.archives-card-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.archives-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.archives-card-cat {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  height: 23px;
  padding: 0 10px;
  border-radius: 8px;
  font-family: var(--font-jp);
  font-weight: 700;
  font-size: 14px;
  line-height: 22px;
  color: #fff;
  background: var(--color-brand);
  margin-bottom: 12px;
}
.archives-card-cat--nayami   { background: #dc2626; }
.archives-card-cat--industry { background: #16a34a; }
.archives-card-cat--budget   { background: #2563eb; }
.archives-card-cat--subsidy  { background: #b45309; }
.archives-card-cat--type     { background: #7c3aed; }
.archives-card-title {
  font-family: var(--font-jp);
  font-weight: 700;
  font-size: 18px;
  line-height: 28px;
  color: #101828;
  min-height: 90px;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.archives-card-tags {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 0;
}
.archives-card-tag-icon {
  width: 25px;
  height: 25px;
  flex-shrink: 0;
}
.archives-card-tag {
  border: 1px solid var(--color-text-secondary, #4a5568);
  border-radius: 60px;
  padding: 0 10px;
  font-family: var(--font-jp);
  font-size: 14px;
  line-height: 26px;
  color: var(--color-text-secondary, #4a5568);
}
.archives-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}
.archives-card-date {
  font-family: var(--font-jp);
  font-size: 14px;
  line-height: 26px;
  color: #101828;
}
.archives-card-arrow {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  background: url(../../img/common/link-arrow.svg) center / contain no-repeat;
}

/* --- ページネーション ------------------------------------- */
.archives-pagination {
  display: flex;
  gap: 16px;
  justify-content: center;
  padding-top: 100px;
}
.archives-pg-group {
  display: flex;
  gap: 8px;
}
.archives-pg {
  min-width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  border: 1px solid #d6d3d0;
  border-radius: 6px;
  background: #fff;
  color: #23221e;
  font-family: var(--font-jp);
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
  text-decoration: none;
  transition: opacity 0.2s;
}
.archives-pg:hover { opacity: 0.7; }
.archives-pg--active {
  background: var(--color-brand);
  border-color: var(--color-brand);
  color: #fff;
}
.archives-pg--ico { font-size: 16px; }
.archives-pg--disabled {
  opacity: 0.4;
  pointer-events: none;
}
.archives-pg-dots {
  display: inline-flex;
  align-items: flex-end;
  padding: 0 4px;
  font-size: 16px;
  color: #23221e;
}
/* 数字グループはPC用（±2）とSP用（カレント中心3個）を両方出力し表示切替 */
.archives-pg-group--sp { display: none; }

/* ============================================================
   SP（≤749px）
   ============================================================ */
@media (max-width: 749px) {
  .archives-hero-deco { display: none; }
  .archives-hero-inner { padding-inline: calc(40/750 * 100vw);    width:100%;
   }
  .archives-hero-title.common-h2 { margin-bottom: min(calc(100 / 750 * 100vw), 100px); }
  .archives-hero-sub {
    font-size: min(calc(44 / 750 * 100vw), 44px);
    line-height: 1.5;
  }
  .archives-inner {
    width: 100%;
    padding-inline: calc(40 / 750 * 100vw);
  }
  .archives-main { padding-bottom: min(calc(200 / 750 * 100vw), 100px); }
  .archives-pan {
    padding: calc(40 / 750 * 100vw) 0;
    font-size: min(calc(28 / 750 * 100vw), 28px);
    line-height: 1.4;
  }
  .archives-pan-sep { margin: 0 calc(16 / 750 * 100vw); }

  /* チップ：折返し（左寄せ） */
  .archives-cat {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: calc(20 / 750 * 100vw) calc(40 / 750 * 100vw);
    padding: calc(40 / 750 * 100vw) 0 calc(60 / 750 * 100vw);
  }
  .archives-cat-chip {
    font-size: min(calc(32 / 750 * 100vw), 32px);
    line-height: min(calc(56 / 750 * 100vw), 56px);
    padding: calc(10 / 750 * 100vw) calc(48 / 750 * 100vw);
  }
  .archives-cat-chip--active { padding: calc(10 / 750 * 100vw) calc(48 / 750 * 100vw); }

  /* カテゴリ別：SEO見出し・子カテゴリ */
  .archives-lead {
    font-size: min(calc(36 / 750 * 100vw), 36px);
    line-height: 1.6;
    padding-bottom: calc(48 / 750 * 100vw);
  }
  .archives-subcat {
    gap: 0 calc(16 / 750 * 100vw);
    padding-bottom: calc(32 / 750 * 100vw);
  }
  .archives-subcat-chip {
    font-size: min(calc(28 / 750 * 100vw), 28px);
    line-height: min(calc(48 / 750 * 100vw), 48px);
    padding: calc(12 / 750 * 100vw) calc(32 / 750 * 100vw);
    margin-bottom: calc(24 / 750 * 100vw);
  }

  /* 記事カード：1カラム・縦組み（Figma更新: PCカードと同型／画像166px・タイトル最小高さ112）。
     旧SPの横組み（サムネ左・本文右）は廃止し、フォント・余白・タグアイコン等はPC基底を継承。 */
  .archives-grid {
    grid-template-columns: 1fr;
    gap: calc(64 / 750 * 100vw);   /* ≒32px（375時） */
  }
  .archives-card-thumb { height: min(calc(332/750 * 100vw), 332px) }
  .archives-card-title { 
    min-height: auto;
   }

  /* ページネーション（Figma SP は « ‹ 1 2 3 … 99 › »：数字は3つ。
     5数字＋両側省略だと335pxに収まらないため、SPはカレント中心3個の
     専用グループ（--sp）に切り替える。PHP側で両リストを出力済み */
  .archives-pagination {
    gap: calc(16 / 750 * 100vw);
    padding-top: calc(120 / 750 * 100vw);
  }
  .archives-pg-group { gap: calc(12 / 750 * 100vw); }
  .archives-pg {
    min-width: min(calc(60 / 750 * 100vw), 60px);
    height: min(calc(64 / 750 * 100vw), 64px);
    padding: 0 calc(14 / 750 * 100vw);
    font-size: min(calc(28 / 750 * 100vw), 28px);
  }
  .archives-pg-group--pc { display: none; }
  .archives-pg-group--sp { display: flex; }
}
