/* ================================
   Card List Component
================================ */

.cardSection {
  margin-bottom: var(--X3L);
}

.cardSection--mbXL {
  margin-bottom: var(--XL);
}

@media screen and (max-width: 767px) {
  .cardSection {
    margin-bottom: var(--XL);
  }
}

/* セクションタイトル */
.cardSection__title {
  font-size: var(--font-head-m);
  font-weight: 700;
}

/* ===== カードグリッド ===== */
.cardList__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  column-gap: var(--S);
  row-gap: var(--XL);
  margin-top: var(--XL);
}

@media screen and (max-width: 1024px) {
  .cardList__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media screen and (max-width: 767px) {
  .cardList__grid {
    grid-template-columns: 1fr;
    row-gap: var(--S);
    margin-top: var(--S);
  }
}

/* ===== カード本体 ===== */
.card {
  display: block;
  border: 1px solid var(--color-separate-primary);
  border-radius: var(--radius-l);
  text-decoration: none;
  height: 100%;
  overflow: hidden;
}

/* 中身 */
.card__inner {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* タイトル */
.card__title {
  /* 高さは最低でも144px。また、タイトル部分3行のときに例外的に144cx超えるため、Maxも144pxで設定 */
  height: 100%;
  max-height: 144px;
  min-height: 144px;
  color: var(--color-primary);
  text-align: center;
  font-weight: 700;
  font-size: var(--font-xl);
  line-height: 1.4;
  padding: 31px 27px;
  border-bottom: 1px solid var(--color-separate-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

@media screen and (max-width: 767px) {
  .card__title {
    padding: 20px 27px;
    min-height: 0px;
  }

  .card__title img {
    max-height: 100%;
  }
}

.card__title img {
  max-width: 100%;
  height: auto;
  display: block;
}

@media screen and (max-width: 767px) {
  .card__title img {
    max-width: 100%;
    height: auto;
    display: block;
  }
}

/* テキスト */
.card__text {
  flex: 1;
  font-size: var(--font-s);
  line-height: 1.6;
  padding: 18px 24px;
  color: var(--color-text-primary);
  transition: background-color 0.2s ease;
}

.card:hover .card__text {
  background-color: var(--color-bg-secondary);
}

@media screen and (max-width: 767px) {
  .card.is-epacketLight .card__title img {
    padding: 36px;
  }
}