/* ========================================
   HERO
   左側の大型球体／右側の本文
======================================== */

.hero {
  --hero-content-width: 1100px;
  --hero-offset-y: 0px;

  display: grid;
  min-height: 85svh;
  grid-template-columns: minmax(0, 42%) minmax(0, 58%);
  align-items: center;

  margin-top: calc(var(--header-height) * -1);

  padding: calc(clamp(64px, 7vw, 96px) + var(--header-height))
    clamp(18px, 3vw, 54px) clamp(78px, 8vw, 120px);
}

.hero__inner {
  position: relative;
  top: var(--hero-offset-y);
  z-index: 2;

  grid-column: 2;
  justify-self: center;

  width: min(var(--hero-content-width), calc(100% - 24px));

  margin: 0 auto;
  text-align: center;
}

.hero__eyebrow {
  margin: 0 0 18px;
  color: var(--color-accent);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.hero h1 {
  margin: 0;
  color: var(--color-main);
  font-family: var(--font-serif);
  font-size: clamp(2.45rem, 4.8vw, 5rem);
  font-weight: normal;
  line-height: 1.14;
  letter-spacing: -0.025em;
}

.hero__lead {
  width: min(680px, 100%);
  margin: 24px auto 0;
  color: var(--color-text-light);
  font-size: clamp(0.94rem, 1.2vw, 1.05rem);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 32px;
}

@media (max-width: 1180px) {
  .hero {
    --hero-content-width: 680px;
    grid-template-columns: minmax(0, 38%) minmax(0, 62%);
  }

  .hero h1 {
    font-size: clamp(2.15rem, 4.2vw, 3.65rem);
  }
}

@media (max-width: 900px) {
  .hero {
    --hero-content-width: 620px;
    grid-template-columns: minmax(0, 32%) minmax(0, 68%);
  }

  .hero h1 {
    font-size: clamp(1.9rem, 4.5vw, 2.85rem);
    letter-spacing: -0.035em;
  }
}

@media (max-width: 767px) {
  .hero {
    --hero-content-width: 680px;
    --hero-offset-y: clamp(34px, 8vw, 68px);

    min-height: 92svh;
    grid-template-columns: minmax(0, 1fr);
    padding-right: 16px;
    padding-bottom: 82px;
    padding-left: 16px;
  }

  .hero__inner {
    grid-column: 1;
    width: 100%;
  }

  .hero h1 {
    font-size: clamp(1.35rem, 7vw, 3rem);
    line-height: 1.18;
    letter-spacing: -0.045em;
    white-space: nowrap;
  }
  .hero__lead {
    width: min(560px, 100%);
  }

  .hero__actions {
    align-items: stretch;
    flex-direction: column;
    width: min(360px, 100%);
    margin-right: auto;
    margin-left: auto;
  }

  .hero__actions .button {
    width: 100%;
  }
}

.services {
  margin-top: clamp(64px, 6vw, 88px);
}

.section-copy {
  margin-top: clamp(64px, 6vw, 88px);
}

.contact {
  padding: 0 0 clamp(64px, 6vw, 88px);
}

.contact-guide,
.contact-form-wrap {
  width: var(--content-width);
  margin: 0 auto;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: var(--shadow);
}

/* ========================================
   SITE GUIDE
======================================== */

.section-heading {
  text-align: center;
}

.service-card-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: stretch;
  gap: clamp(16px, 1.55vw, 22px);
  margin: clamp(28px, 3.5vw, 50px);
}

/* 1段目：3カラム */
.service-card:nth-child(-n + 3) {
  grid-column: span 4;
}

/* 2段目：4カラム */
.service-card:nth-child(n + 4) {
  grid-column: span 3;
}

.service-card {
  display: grid;
  min-width: 0;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: 0 8px 22px rgba(16, 40, 46, 0.07);
  transition:
    transform 0.35s ease,
    box-shadow 0.35s ease,
    border-color 0.35s ease;
}

.service-card:hover,
.service-card:focus-visible {
  border-color: var(--color-accent);
  box-shadow: 0 18px 38px rgba(16, 40, 46, 0.14);
  transform: translateY(-7px);
}

/*
 * 画像は全カード共通で約2.22:1。
 * 画像そのものを切り替えず、枠だけ画面幅に応じて収縮させる。
 */
.service-card__image {
  width: 100%;
  min-width: 0;
  aspect-ratio: 20 / 9;
  overflow: hidden;
  background: var(--color-border) url("../img/imgmain/dummy.webp") center /
    cover no-repeat;
}

.service-card__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.55s ease;
}

.service-card:hover .service-card__image img,
.service-card:focus-visible .service-card__image img {
  transform: scale(1.045);
}

/*
 * 7枚すべてで同じテキスト領域を確保する。
 * 一つでも見出しが2行になっても、全カードの高さは揃ったまま。
 */
.service-card__body {
  display: grid;
  min-width: 0;
  height: 100%;
  grid-template-rows:
    auto
    auto
    auto;
  align-content: start;
  padding: clamp(11px, 1.2vw, 15px) clamp(12px, 1.35vw, 17px)
    clamp(12px, 1.25vw, 16px);
}

.service-card__body h3 {
  display: -webkit-box;
  min-height: 2.9em;
  margin: 0;
  overflow: hidden;
  color: var(--color-main);
  font-size: clamp(0.95rem, 1.35vw, 1.16rem);
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.service-card__body p {
  display: -webkit-box;
  min-height: 3.3em;
  margin: 7px 0 9px;
  overflow: hidden;
  color: var(--color-text-light);
  font-size: 0.78rem;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.service-card__body span {
  align-self: end;
  color: var(--color-accent);
  font-size: 0.78rem;
  font-weight: 700;
}

/* ========================================
   SITE DETAIL
   ブレークポイントで構造を切り替えず、
   PCからスマホまで同じ重なり構造を維持
======================================== */

.feature {
  /*
   * 画面が狭くなるにつれて、
   * 画像とテキストカードが横方向に広がり、
   * 縦方向ではカードが画像の下側へ近づく。
   */
  --feature-media-width: clamp(66.666%, calc(40% + 300px), 96%);

  --feature-card-width: clamp(50%, calc(35% + 280px), 94%);

  --feature-card-top: clamp(120px, calc(200px - 12vw), 145px);

  position: relative;
  display: grid;
  width: min(1400px, calc(100% - clamp(12px, 4vw, 64px)));
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto;
  align-items: start;
  margin: 0 auto clamp(64px, 10vw, 180px);
}

/*
 * 画像と文章カードを同じグリッドセルへ置く。
 * これにより画面幅に応じて滑らかに重なり方が変化する。
 */

.feature__media,
.feature__content {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
}

/*
 * feature--image-left：
 * 文章カード左／画像右
 */

.feature--image-left .feature__media {
  width: var(--feature-media-width);
  justify-self: end;
}

.feature--image-left .feature__content {
  width: var(--feature-card-width);
  justify-self: start;
}

/*
 * feature--image-right：
 * 画像左／文章カード右
 */

.feature--image-right .feature__media {
  width: var(--feature-media-width);
  justify-self: start;
}

.feature--image-right .feature__content {
  width: var(--feature-card-width);
  justify-self: end;
}

/* 大きい画像 */

.feature__media {
  position: relative;
  z-index: 1;
}

.feature__media img {
  display: block;
  width: 100%;
  height: clamp(145px, calc(34vw - 40px), 525px);
  object-fit: cover;
  object-position: center;
  background: var(--color-border);
}

/* 小さいテキストカード */

.feature__content {
  position: relative;
  z-index: 2;
  margin-top: var(--feature-card-top);
  padding: clamp(15px, 3.4vw, 55px) clamp(16px, 3vw, 48px)
    clamp(18px, 3.4vw, 55px);
  border: 1px solid rgba(217, 214, 207, 0.75);
  background: var(--color-surface);
  box-shadow:
    4px 5px 0 rgba(16, 40, 46, 0.08),
    0 16px 35px rgba(16, 40, 46, 0.1);
}

.feature__number {
  margin: 0 0 clamp(1px, 0.2vw, 3px);
  color: var(--color-main);
  font-size: clamp(0.58rem, 0.9vw, 0.77rem);
  font-weight: 700;
}

.feature__label {
  margin: 0 0 clamp(8px, 1.2vw, 17px);
  color: var(--color-main);
  font-size: clamp(0.58rem, 0.9vw, 0.78rem);
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.04em;
}

.feature__content h2 {
  margin: 0;
  color: var(--color-main);
  font-size: clamp(1.4rem, 4vw, 4rem);
  font-family: "Noto Serif JP", serif;
  font-weight: 700;
  line-height: 1.13;
  letter-spacing: -0.03em;
}

.feature__content > p:last-of-type {
  margin: clamp(10px, 1.7vw, 24px) 0 clamp(14px, 2.2vw, 31px);
  color: var(--color-text);
  font-size: clamp(0.62rem, 1vw, 0.9rem);
  line-height: clamp(1.6, calc(1.5 + 0.4vw), 2);
}

/* 参考画像にある線付きボタン */

.feature .button-link {
  position: relative;
  display: inline-flex;
  width: clamp(140px, 19vw, 240px);
  min-width: 0;
  min-height: clamp(40px, 4.5vw, 58px);
  align-items: center;
  justify-content: center;
  padding: 0 clamp(24px, 3vw, 42px) 0 clamp(10px, 2vw, 24px);
  border: 1px solid var(--color-main);
  background: var(--color-surface);
  color: var(--color-main);
  font-size: clamp(0.6rem, 0.9vw, 0.83rem);
  font-weight: 700;
}

.feature .button-link::after {
  content: "";
  position: absolute;
  top: 50%;
  right: clamp(-20px, -1.4vw, -12px);
  width: clamp(26px, 3vw, 40px);
  height: 1px;
  background: var(--color-main);
  transition:
    right 0.3s ease,
    width 0.3s ease;
}

.feature .button-link:hover,
.feature .button-link:focus-visible {
  background: var(--color-main);
  color: var(--color-surface);
}

.feature .button-link:hover::after,
.feature .button-link:focus-visible::after {
  right: clamp(-28px, -2vw, -18px);
  width: clamp(34px, 3.5vw, 48px);
}

/* ========================================
   CONTACT
======================================== */

.contact-guide {
  padding: 28px;
  margin-bottom: 28px;
}

.contact-guide__lead {
  margin: 0 0 18px;
}

.contact-guide__links li + li {
  margin-top: 10px;
}

.contact-guide__links a {
  color: #1756a9;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.contact-form-wrap {
  padding: 28px;
}

.contact-form {
  display: grid;
  gap: 18px;
}

.form-field label {
  display: block;
  margin-bottom: 8px;
  color: var(--color-main);
  font-weight: 700;
}

.form-field label span {
  color: var(--color-accent);
  font-size: 0.9rem;
}

.form-field input,
.form-field textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--color-border);
  background: #fff;
}

.form-action {
  margin-top: 8px;
}

/* ========================================
   TABLET：SITE GUIDE
   2カラム固定／7枚目中央
======================================== */

@media (max-width: 1024px) {
  .service-card-grid {
    --guide-gap: clamp(10px, 1.7vw, 16px);

    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--guide-gap);
    margin: clamp(30px, 4vw, 40px) clamp(8px, 2.5vw, 24px) 0;
  }

  /* PC用の12カラム指定を解除 */
  .service-card:nth-child(n) {
    grid-column: auto;
  }

  /* 7枚目を通常カード1枚分の幅で中央配置 */
  .service-card:last-child {
    width: calc((100% - var(--guide-gap)) / 2);
    grid-column: 1 / -1;
    justify-self: center;
  }
}

/* ========================================
   SMARTPHONE
======================================== */

@media (max-width: 767px) {
  .services,
  .contact {
    padding-bottom: 64px;
  }
}

@media (max-width: 560px) {
  /*
   * SITE GUIDE
   * スマホでも2カラムを維持
   */
  .service-card-grid {
    --guide-gap: 10px;

    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--guide-gap);
    margin: 30px 8px 0;
  }

  .service-card__body {
    padding: 10px 9px 11px;
  }

  .service-card__body h3 {
    min-height: 2.9em;
    font-size: clamp(0.72rem, 3.2vw, 0.9rem);
    line-height: 1.45;
  }

  .service-card__body p {
    min-height: 3em;
    margin: 5px 0 7px;
    font-size: clamp(0.6rem, 2.5vw, 0.72rem);
    line-height: 1.5;
    -webkit-line-clamp: 2;
  }

  .service-card__body span {
    font-size: clamp(0.6rem, 2.4vw, 0.7rem);
  }

  /*
   * CONTACT
   */
  .contact-guide,
  .contact-form-wrap {
    width: calc(100% - 16px);
    padding: 20px 16px;
  }
}
/* ========================================
   GEOMETRIC REVEAL
   画像カードの三角幾何学アニメ
======================================== */

:root {
  --reveal-cover: #071a3a;
}

.feature-animate .feature__content {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.7s ease,
    transform 0.7s ease;
  transition-delay: 0.22s;
}

.feature-animate.is-inview .feature__content {
  opacity: 1;
  transform: translateY(0);
}

.reveal {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.reveal img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;

  opacity: 0;
  transform: scale(1.04);
  transition:
    opacity 0.45s ease,
    transform 0.85s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.feature-animate.is-inview .reveal img {
  opacity: 1;
  transform: scale(1);
}

/*
 * 被せる幾何学カバー
 * JSで .reveal__slice を自動生成する
 */
.reveal__slice {
  position: absolute;
  top: -1px;
  bottom: -1px;
  z-index: 2;
  width: calc(12.5% + 2px);
  background: var(--reveal-cover);
  transition:
    transform 0.75s cubic-bezier(0.22, 0.61, 0.36, 1),
    opacity 0.45s ease;
  transition-delay: calc(var(--i) * 55ms);
  pointer-events: none;
}

/*
 * 三角っぽい幾何学ライン
 * 完全三角だけにすると隙間が出やすいから
 * 三角連結の多角形で安定させる
 */
.reveal__slice::before {
  content: "";
  position: absolute;
  inset: 0;
  background: inherit;
  clip-path: polygon(0 0, 100% 0, 76% 50%, 100% 100%, 0 100%, 24% 50%);
}

/* 左から右へ抜ける */
.reveal--to-right .reveal__slice {
  left: calc(var(--i) * 12.5% - 1px);
  transform: translateX(0);
}

.feature-animate.is-inview .reveal--to-right .reveal__slice {
  transform: translateX(112%);
  opacity: 0;
}

/* 右から左へ抜ける */
.reveal--to-left .reveal__slice {
  right: calc(var(--i) * 12.5% - 1px);
  transform: translateX(0);
}

.feature-animate.is-inview .reveal--to-left .reveal__slice {
  transform: translateX(-112%);
  opacity: 0;
}

/* 少しアクセント線を入れるとそれっぽく見える */
.reveal__slice:nth-child(odd)::after {
  content: "";
  position: absolute;
  top: 18%;
  bottom: 18%;
  right: 0;
  width: 1px;
  background: rgba(255, 255, 255, 0.18);
}

/* スマホでは分割数が多すぎると汚くなるので少し軽く */
@media (max-width: 640px) {
  .reveal__slice {
    width: calc(16.666% + 2px);
  }

  .reveal--to-right .reveal__slice {
    left: calc(var(--i) * 16.666% - 1px);
  }

  .reveal--to-left .reveal__slice {
    right: calc(var(--i) * 16.666% - 1px);
  }
}

/* ========================================
   CATEGORY BACKGROUND ZONES
======================================== */

.detail-zone {
  position: relative;
  padding: clamp(72px, 8vw, 120px) 0 clamp(64px, 7vw, 110px);
  border-block: 1px solid rgba(23, 54, 61, 0.07);
}

/* 現在のベース #F3F0E9 より少し濃い背景 */
.detail-zone--consultation {
  background: #e9e4da;
}

.detail-zone--creative-support {
  background: #e7e1d7;
}

.detail-zone .section-copy {
  margin-bottom: clamp(48px, 6vw, 88px);
}

/* グループ末尾に既存の大きなmargin-bottomを残さない */
.detail-zone .feature:last-child {
  margin-bottom: 0;
}

@media (max-width: 767px) {
  .detail-zone {
    padding: 56px 0 64px;
  }

  .detail-zone .section-copy {
    margin-bottom: 40px;
  }
}

/* PC版だけテキストカードを大きく下げる */
@media (min-width: 1025px) {
  .feature {
    --feature-card-top: clamp(220px, 18vw, 300px);
  }
}

.service-card__image,
.feature__media {
  position: relative;
}

.start-schedule-overlay {
  position: absolute;
  z-index: 10;
  inset: 0;

  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: clamp(4px, 0.8vw, 10px);

  padding: clamp(10px, 2vw, 24px);

  background: rgba(0, 0, 0, 0.52);
  color: #fff;
  text-align: center;

  pointer-events: none;
}

.start-schedule-overlay strong,
.start-schedule-overlay span {
  display: block;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.78);
}

.start-schedule-overlay strong {
  font-family: "Noto Sans JP", sans-serif;
  font-size: clamp(0.78rem, 1.7vw, 1.5rem);
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: 0.04em;
}

.start-schedule-overlay span {
  font-size: clamp(0.58rem, 0.9vw, 0.84rem);
  font-weight: 700;
  line-height: 1.6;
  letter-spacing: 0.02em;
}

/* 上部「7つの活動・支援・事業」カード用 */
.service-card__image .start-schedule-overlay {
  gap: 3px;
  padding: 8px;
}

.service-card__image .start-schedule-overlay strong {
  font-size: clamp(0.66rem, 1.25vw, 1rem);
}

.service-card__image .start-schedule-overlay span {
  font-size: clamp(0.5rem, 0.75vw, 0.68rem);
}

/* 詳細画像用 */
.feature__media .start-schedule-overlay strong {
  font-size: clamp(1rem, 2.7vw, 2.3rem);
}

.feature__media .start-schedule-overlay span {
  font-size: clamp(0.66rem, 1.15vw, 1rem);
}

@media (max-width: 560px) {
  .service-card__image .start-schedule-overlay strong {
    font-size: clamp(0.58rem, 2.8vw, 0.76rem);
  }

  .service-card__image .start-schedule-overlay span {
    font-size: clamp(0.46rem, 2.2vw, 0.58rem);
  }
}
