/* =========================
  カードレイアウト
========================= */

/* グリッド */
.service-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 36px;
  list-style: none;
  padding: 0;
  margin: 0;
}

/* カード */
.service-item a {
  display: flex;
  flex-direction: column;
  height: 100%;

  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;

  border: 1px solid rgba(0,0,0,0.05);
  box-shadow: 0 20px 40px rgba(0,0,0,0.06);

  transition: all 0.4s ease;
  position: relative;
  cursor: pointer;

  backdrop-filter: blur(2px);
}

/* アクセントライン */
.service-item a::before {
  content: "";
  height: 4px;
  width: 100%;
  background: linear-gradient(
    90deg,
    var(--wp--preset--color--primary, #0073aa),
    rgba(0,0,0,0)
  );
}

/* hover */
.service-item a:hover {
  transform: translateY(-10px);
  box-shadow:
    0 30px 60px rgba(0,0,0,0.12),
    0 0 0 1px rgba(0,0,0,0.02);
}

/* 画像 */
.service-img {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.service-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

/* オーバーレイ */
.service-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.45),
    rgba(0,0,0,0)
  );
  opacity: 0.6;
  transition: 0.4s;
}

/* hover時 */
.service-item a:hover .service-img img {
  transform: scale(1.1);
}

.service-item a:hover .service-overlay {
  opacity: 0.8;
}

/* ボディ */
.service-body {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  padding: 22px;
}

/* タイトル周り */
.title-text {
  margin-bottom: 16px;
}

/* タイトル */
.service-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 10px;
  letter-spacing: 0.02em;

  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* hoverカラー */
.service-item a:hover .service-title {
  color: var(--wp--preset--color--primary, #0073aa);
}

/* テキスト */
.service-text {
  font-size: 14px;
  line-height: 1.9;
  color: #555;

  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* CTA */
.service-cta {
  margin-top: auto;

  display: inline-flex;
  align-items: center;
  justify-content: space-between;

  font-size: 14px;
  font-weight: 600;

  padding: 12px 16px;
  border-radius: 8px;

  background: #f7f9fb;
  color: #222;

  border: 1px solid rgba(0,0,0,0.08);

  transition: all 0.3s ease;

  position: relative;
  overflow: hidden;
}

/* CTAエフェクト */
.service-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.15);
  opacity: 0;
  transition: 0.3s;
}

/* 矢印 */
.service-cta::after {
  content: "→";
  margin-left: 10px;
  font-size: 16px;
  transition: transform 0.3s;
}

/* hover CTA */
.service-item a:hover .service-cta {
  background: var(--wp--preset--color--primary, #0073aa);
  color: #fff;
  border-color: transparent;
}

.service-item a:hover .service-cta::after {
  transform: translateX(6px);
}

.service-item a:hover .service-cta::before {
  opacity: 1;
}

/* レスポンシブ */
@media (max-width: 1024px) {
  .service-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .service-list {
    grid-template-columns: 1fr;
  }
}


/* =========================
  メディアレイアウト（強化版）
========================= */

.service-media-list {
  display: flex;
  flex-direction: column;
  gap: 28px;
  list-style: none;
  padding: 0;
  margin: 0;
}

/* カード */
.service-media-item a {
  display: flex;
  gap: 28px;
  align-items: stretch;

  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;

  border: 1px solid rgba(0,0,0,0.05);
  box-shadow: 0 15px 35px rgba(0,0,0,0.06);

  transition: all 0.35s ease;
  position: relative;
}

/* 左アクセント */
.service-media-item a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 5px;
  height: 100%;
  background: var(--wp--preset--color--primary, #0073aa);

  transform: scaleY(0);
  transform-origin: top;
  transition: 0.35s;
}

.service-media-item a:hover::before {
  transform: scaleY(1);
}

/* hover */
.service-media-item a:hover {
  transform: translateY(-6px);
  box-shadow: 0 25px 50px rgba(0,0,0,0.12);
}

/* 画像 */
.service-media-img {
  width: 42%;
  min-width: 260px;
  overflow: hidden;
  position: relative;
}

/* 画像 */
.service-media-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

/* 画像 overlay */
.service-media-img::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(0,0,0,0.25),
    rgba(0,0,0,0)
  );
  opacity: 0.4;
  transition: 0.3s;
}

/* hover時 */
.service-media-item a:hover .service-media-img img {
  transform: scale(1.08);
}

.service-media-item a:hover .service-media-img::after {
  opacity: 0.6;
}

/* ボディ */
.service-media-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 26px;
  flex: 1;
}

/* タイトル */
.service-media-title {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 12px;
  letter-spacing: 0.02em;
}

/* hoverカラー */
.service-media-item a:hover .service-media-title {
  color: var(--wp--preset--color--primary, #0073aa);
}

/* テキスト */
.service-media-text {
  font-size: 14px;
  line-height: 1.9;
  color: #555;
  margin-bottom: 25px;
}

/* CTA（ボタン化） */
.service-media-cta {
  align-self: flex-start;

  display: inline-flex;
  align-items: center;

  font-size: 14px;
  font-weight: 600;

  padding: 8px 50px;
  border-radius: 8px;

  background: #f4f6f8;
  color: #222;

  border: 1px solid rgba(0,0,0,0.08);

  transition: all 0.3s ease;
}

/* 矢印 */
.service-media-cta::after {
  content: "→";
  margin-left: 8px;
  transition: transform 0.25s;
}

/* hover CTA */
.service-media-item a:hover .service-media-cta {
  background: var(--wp--preset--color--primary, #0073aa);
  color: #fff;
  border-color: transparent;
}

.service-media-item a:hover .service-media-cta::after {
  transform: translateX(6px);
}

/* =========================
  SP時：メディア → カード化
========================= */
@media (max-width: 768px) {

  /* レイアウトをカードと同じに */
  .service-media-item a {
    flex-direction: column;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.06);
  }

  /* 画像をカードと同じ比率に */
  .service-media-img {
    width: 100%;
    min-width: auto;
    aspect-ratio: 4 / 3;
  }

  /* 画像オーバーレイをカード仕様に寄せる */
  .service-media-img::after {
    background: linear-gradient(
      to top,
      rgba(0,0,0,0.45),
      rgba(0,0,0,0)
    );
    opacity: 0.6;
  }

  /* ボディもカードと近い余白に */
  .service-media-body {
    padding: 22px;
  }

  /* タイトルサイズ揃える */
  .service-media-title {
    font-size: 18px;
    font-weight: 700;
  }

  /* CTAをカード風に */
  .service-media-cta {
    margin-top: auto;

    width: 100%;
    justify-content: space-between;

    padding: 12px 16px;
    border-radius: 8px;

    background: #f7f9fb;
    border: 1px solid rgba(0,0,0,0.08);
    color: #222;
  }

  /* hoverもカードと揃える */
  .service-media-item a:hover .service-media-cta {
    background: var(--wp--preset--color--primary, #0073aa);
    color: #fff;
    border-color: transparent;
  }

  /* 左アクセントは消す（カードと統一） */
  .service-media-item a::before {
    display: none;
  }

}