/**
 * カードグリッド（design_handoff_wp_blocks block 11：サービスカード）
 */

.cwt-card-item {
  display: flex;
  flex-direction: column;
  border-radius: var(--wp--custom--radius--card, 16px);
  overflow: hidden;
  border: 1px solid var(--wp--preset--color--divider);
  background: var(--wp--preset--color--white);
  height: 100%;
}

.cwt-card-item__photo,
.cwt-card-item__photo-wrap {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  background: var(--wp--preset--color--lavender-bg);
  overflow: hidden;
}

.cwt-card-item__photo img,
.cwt-card-item__photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cwt-card-item__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--wp--preset--color--primary);
  color: var(--wp--preset--color--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
}

.cwt-card-item__body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
}
.cwt-card-item__body--white {
  background: var(--wp--preset--color--white);
}
.cwt-card-item__body--lavender {
  background: var(--wp--preset--color--lavender-bg);
}
/*
 * タグ・タイトル・説明文をひとつの箱にまとめ、flex:1 1 auto で
 * 余った縦スペースを吸収させることでリンクをカード下端に押し出す。
 * リンクとの間隔は cwt-card-item__body の gap（8px）だけで確保し、
 * padding や margin-top:auto をリンク側に個別で足さない。
 */
.cwt-card-item__content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
}

.cwt-card-item__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.cwt-card-item__tag {
  display: inline-block;
  padding: 2px 12px;
  border-radius: 999px;
  background: var(--wp--preset--color--lavender-bg);
  color: var(--wp--preset--color--primary-text);
  font-size: 12px;
  line-height: 1.8;
}
/* 本文エリアが薄紫背景のときはタグの薄紫と同化してしまうため、白背景・紫文字に反転する */
.cwt-card-item__body--lavender .cwt-card-item__tag {
  background: var(--wp--preset--color--white);
  color: var(--wp--preset--color--primary-text);
}

.cwt-card-item__title {
  font-family: var(--wp--preset--font-family--heading);
  font-size: var(--wp--preset--font-size--card-heading);
  color: var(--wp--preset--color--heading-text);
  margin: 0;
}

.cwt-card-item__desc {
  font-size: var(--wp--preset--font-size--base);
  color: var(--wp--preset--color--body-text);
  margin: 0;
}
/* 美容皮膚科の施術カード（cwt_beauty_render_treatment_card 経由）専用の3行クランプ。
   通常のcard-item（美容皮膚科TOPの案内カード等）には適用しない。
   3行までで打ち切り、末尾は「…」ではなく透過グラデーションでフェードアウトさせる。 */
.cwt-card-item__desc--clamp {
  line-height: 1.7;
  max-height: calc(1.7em * 3);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 60%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 60%, transparent 100%);
}

/* 料金目安（任意）。画像なしカード（施術一覧など）で説明文とリンクの
   間の区切りとしても機能するよう、上に罫線を入れる。 */
.cwt-card-item__price-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--wp--preset--color--divider);
}
.cwt-card-item__price-label {
  font-size: 13px;
  color: var(--wp--preset--color--caption-text);
}
.cwt-card-item__price {
  font-family: var(--wp--preset--font-family--heading);
  font-size: 18px;
  font-weight: 700;
  color: var(--wp--preset--color--primary-text);
}

.cwt-card-item__link {
  align-self: flex-end;
  color: var(--wp--preset--color--primary-text);
  font-weight: 700;
  font-size: var(--wp--preset--font-size--base);
  text-decoration: none;
}
.cwt-card-item__link:hover,
.cwt-card-item__link:focus-visible {
  text-decoration: underline;
}
.cwt-card-item__link-arrow {
  display: inline-block;
  transition: transform 0.15s ease;
}
.cwt-card-item__link:hover .cwt-card-item__link-arrow,
.cwt-card-item__link:focus-visible .cwt-card-item__link-arrow {
  transform: translateX(4px);
}

@media (max-width: 767px) {
  .cwt-card-grid {
    grid-template-columns: 1fr !important;
  }
}
