@charset "UTF-8";
/* -------------------------------------------------------------------------------- */
/* カードリストブロック                                        .mgsblk-card-list */
/* -------------------------------------------------------------------------------- */

.editor-styles-wrapper .mgsblk-card-list { border: 1px dashed #ccc; min-height: 40px; }

.mgsblk-card-list--empty {
  padding: 1em;
  text-align: center;
  color: #666;
  border: 1px dashed #ccc;
}

.mgsblk-card-list {
  display: grid;
  gap: 32px;
}
.mgsblk-card-list--pc1 { grid-template-columns: 1fr; }
.mgsblk-card-list--pc2 { grid-template-columns: repeat(2, 1fr); }
.mgsblk-card-list--pc3 { grid-template-columns: repeat(3, 1fr); }

.mgsblk-card-list__card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fff;
  border: 1px solid #e3e3e3;
  border-radius: 8px;
  overflow: hidden;
}
/* 高さを px 固定にすると列が狭まるほど左右が切り取られて見切れるため、比率で持たせる。
   グリッドの各列は等幅なので、比率指定でも同じ行のカードの画像高さは必ず揃う
   （画像の元サイズに左右されない）。素材は 1536×1024 = 3:2 を想定。 */
.mgsblk-card-list__image {
  flex-shrink: 0;
  aspect-ratio: 3 / 2;
  overflow: hidden;
}
/* 1列時だけは 3:2 だと縦に大きすぎるため、横長のバナー比率にする（1200×250 相当） */
.mgsblk-card-list--pc1 .mgsblk-card-list__image {
  aspect-ratio: 24 / 5;
}
.mgsblk-card-list__image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.mgsblk-card-list__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 24px;
}
.mgsblk-card-list__title {
  color: #000;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 12px;
}
.mgsblk-card-list__text {
  color: #444;
  font-size: 14px;
  line-height: 1.8;
  margin-bottom: 16px;
}
.mgsblk-card-list__points {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
}
.mgsblk-card-list__points li {
  position: relative;
  padding-left: 22px;
  color: #444;
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 6px;
}
.mgsblk-card-list__points li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--main-color);
  font-weight: bold;
}
.mgsblk-card-list__note {
  color: #999;
  font-size: 13px;
  line-height: 1.6;
  margin: 0 0 16px;
}
.mgsblk-card-list__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}
.mgsblk-card-list__tag {
  display: inline-block;
  font-size: 12px;
  line-height: 1;
  color: #666;
  background: #f0f0f0;
  border-radius: 20px;
  padding: 5px 12px;
}
.mgsblk-card-list__btn {
  margin-top: auto;
  display: inline-block;
  align-self: flex-start;
  border: 1px solid var(--main-color);
  border-radius: 4px;
  padding: 10px 20px;
  color: var(--main-color);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
}
.mgsblk-card-list__btn:hover {
  background: var(--main-color);
  color: #fff;
}
/* ラベル末尾の矢印はCSSで描画する（クラス付与は card-list-block.php / inc/button-arrow.php）。
   inline-flex にすると矢印が単独で改行しなくなる。 */
.mgsblk-card-list__btn.mgs-arrow-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
}
.mgsblk-card-list__btn.mgs-arrow-btn::after {
  content: "→";
  flex-shrink: 0;
}
.mgsblk-card-list__btn.mgs-arrow-btn--angle::after {
  content: "＞";
}

/* -------------------------------------------------------------------------------- */
/*        TABLET                                                                    */
/* -------------------------------------------------------------------------------- */
@media screen and (min-width: 740px) and (max-width: 899px) {
  .mgsblk-card-list--pc2,
  .mgsblk-card-list--pc3 {
    grid-template-columns: 1fr;
  }
  /* 2件・4件は割り切れて不揃いにならないため2列を維持
     （件数クラス --n2 / --n4 は card-list-block.php で出力） */
  .mgsblk-card-list--n2,
  .mgsblk-card-list--n4 {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  /* 5件・6件は1列にすると縦に長くなりすぎるため2列にする
     （件数クラス --n5 / --n6 は card-list-block.php で出力） */
  .mgsblk-card-list--n5,
  .mgsblk-card-list--n6 {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  .mgsblk-card-list--n5 .mgsblk-card-list__body,
  .mgsblk-card-list--n6 .mgsblk-card-list__body {
    padding: 18px;
  }
}

/* -------------------------------------------------------------------------------- */
/*         MOBILE                                                                   */
/* -------------------------------------------------------------------------------- */
@media only screen and (max-width: 739px) {
  .mgsblk-card-list--pc2,
  .mgsblk-card-list--pc3 {
    grid-template-columns: 1fr;
  }
  .mgsblk-card-list {
    gap: 24px;
  }
  /* 1列時のバナー比率は解除して、他と同じ 3:2 に統一する */
  .mgsblk-card-list--pc1 .mgsblk-card-list__image {
    aspect-ratio: 3 / 2;
  }
}

/* -------------------------------------------------------------------------------- */
/* 3件のときだけタブレット幅（740〜899px）で「左：画像／右：本文＋ボタン」の横並びに  */
/* 1列 × 画像フル幅だと画像が横に間延びして見えるため（2件・4件は現状維持）          */
/* -------------------------------------------------------------------------------- */
@media screen and (min-width: 740px) and (max-width: 899px) {
  .mgsblk-card-list--n3 .mgsblk-card-list__card {
    flex-direction: row;
  }
  .mgsblk-card-list--n3 .mgsblk-card-list__image {
    position: relative;
    align-self: stretch;
    width: 40%;
    max-width: 340px;
    /* 横並び時は本文側の高さに合わせて伸ばすので比率指定は解除する */
    aspect-ratio: auto;
    height: auto;
    min-height: 220px;
  }
  .mgsblk-card-list--n3 .mgsblk-card-list__image img {
    position: absolute;
    top: 0;
    left: 0;
  }
  .mgsblk-card-list--n3 .mgsblk-card-list__body {
    padding: 20px;
  }
}
