/* ───── タブ ───── */
.category-tabs {
  display: flex;
  gap: 2rem;
  overflow-x: auto;
  /* 上：8px、左右：24px、下：20px */
  padding: 8px 24px 20px;
  white-space: nowrap;
  border-bottom: 2px solid #e5e5e5;
  /* 下の余白もお好みで調整 */
  margin-bottom: 32px;
  scrollbar-width: none;
}


.category-tabs::-webkit-scrollbar {
  display: none;
}
.category-tabs button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: .95rem;
  color: #555;
  padding: 4px 0;
  position: relative;
}
.category-tabs button:hover,
.category-tabs button.active {
  color: #00665e;
}
.category-tabs button.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -10px;
  height: 3px;
  background: #00665e;
  border-radius: 2px;
}

/* ───── カード（グリッド） ───── */
.card-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: clamp(20px, 3vw, 32px);
  /* PC ― 8列（200px×8＋ギャップで 1440px 程度） */
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

/* 共通カードスタイル */
.card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .08);
  transition: transform .2s;
}
.card:hover {
  transform: translateY(-4px);
}
.card a {
  display: block;
  color: inherit;
  text-decoration: none;
}
.card figure {
  margin: 0;
  background: #f2f4f5;
  aspect-ratio: 1/1;
}
.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card time, .card .chapter-name {
  display: block;
  font-size: .78rem;
  color: #777;
  margin: 12px 16px 0;
}

/* ─── ラベル（デフォルト／大画面用） ─── */
.card .label {
  display: inline-block;
  width: auto;
  margin: 4px 16px 12px;  /* 下に余裕をプラス */
  padding: 2px 6px;
  font-size: .7rem;
  border-radius: 6px;
  background: #00857520;
  color: #008575;
  justify-self: auto;
}

.card h3 {
  font-size: 1rem;
  line-height: 1.4;
  margin: 4px 16px 8px;
}
.card .excerpt {
  font-size: .9rem;
  margin: 0 16px 16px;
  color: #444;
}

/* ───── タブレット (≲992px) 4列 ───── */
@media (max-width: 992px) {
  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
}

/* ───── スマホ (≲640px) 横並びカード ───── */
@media (max-width: 640px) {
  /* グリッドの隙間を少し狭く */
  .card-grid {
    gap: 20px;
  }

  /* カード全体はブロックに戻す */
  .card {
    display: block;
  }

  /* aタグをグリッドにして
     左：サムネイル、右：テキスト3行（日付→タイトル→カテゴリ） */
  .card a {
    display: grid;
    grid-template-columns: 96px 1fr;
    grid-template-rows: auto auto auto;
    grid-template-areas:
      "thumb date"
      "thumb title"
      "thumb category";
    column-gap: 12px;
    row-gap: 4px;
    padding: 12px;
    align-items: start;
  }

  .card figure {
    grid-area: thumb;
    width: 96px;
    height: 96px;
    border-radius: 8px;
    overflow: hidden;
    background: #f2f4f5;
    margin: 0;
    aspect-ratio: auto;
  }

  .card time, .card .chapter-name {
    grid-area: date;
    margin: 0;
    font-size: .78rem;
    color: #777;
  }

  .card h3 {
    grid-area: title;
    margin: 0;
    font-size: .95rem;
    line-height: 1.3;
  }

  .card .label {
    grid-area: category;
    width: max-content;     /* テキスト＋padding分の幅 */
    justify-self: start;    /* 左端に寄せる */
    margin: 0;
    padding: 4px 8px;       /* 高さをしっかり確保 */
    font-size: .7rem;
    border-radius: 6px;
    background: #00857520;
    color: #008575;
  }
}


.card .labels {
  display: flex;
  gap: 6px;               /* ← この数値で間隔を調整 */
  padding: 0 16px 12px;   /* 左右の揃えと下余白 */
}

.card .label {
  margin: 0; /* ラベル自身にはmarginを付けない */
}


/* ------------------------- Helpers ------------------------- */
.inner {
  width: min(1200px, 90%);
  margin: 0 auto;
}

/* ------------------------- Magazine ------------------------- */
.magazine {
  padding-top: 100px;
}

.make-line-height {
  line-height: 2;
}