/* =========================================================
  TOPページ専用CSS
  - 読み込み：degic-child/functions.php（is_front_page() のときのみ）
  - 方針：themes/CLAUDE.md「8. TOPページ改修」を参照
  - 書き方：セクションごとに PC の指定 → 直後に SP（max-width: 768px）の差分
  - クラス名：top-ブロック名__要素名
  - 単位：文字サイズ・余白は rem（common.css の html { font-size: 62.5% } により 1rem = 10px）
          文字に連動する細かい間隔は em、画面幅に連動するものは vw、罫線・影は px
          common.css の値を写した位置指定は、元の値と対応がわかるよう px のまま
  - 文字サイズ：既存の基準に合わせる。見出しは common.css の unit-title-01〜03 を HTML に付けて使い、
          本文は body（PC 1.6rem / SP 1.4rem）を継承する（top.css では指定しない）。
          該当するクラスがないものは、近い既存の値を写し、コメントで対応を明記する
========================================================= */


/* ---------------------------------------------------------
  TOPページ内で共通のボタン（枠線つき・右に矢印）
  使用箇所：3つの向き合い方（サポート）、不安に応えます（機能）
  ほかのページでも必要になったら、共通部品にするか検討する。
--------------------------------------------------------- */
.top-link-btn {
  display: inline-flex;
  position: relative;
  align-items: center;
  justify-content: center;
  width: 44rem;
  max-width: 100%;
  min-height: 5.6rem;
  padding: 1rem 5rem;
  border: 1px solid var(--color-secondary);
  border-radius: 999px;
  background: var(--color-white);
  color: var(--color-secondary);
  font-weight: 700;
  font-size: 1.6rem; /* .div-lineup-btn と同じ（PC 16px / SP 1.4rem） */
  letter-spacing: 0.1em;
}

.top-link-btn::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 2.4rem;
  width: 0.8rem;
  height: 0.8rem;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: translateY(-50%) rotate(45deg);
}

/* common.css の a:hover（半透明）を打ち消し、背景色の反転にする */
.top-link-btn:hover {
  opacity: 1;
  background: var(--color-secondary);
  color: var(--color-white);
}

/* common.css の a { outline: none } により消えている、キーボード操作時の枠を表示する */
.top-link-btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

@media screen and (max-width: 768px) {
  .top-link-btn {
    width: 100%;
    max-width: 32rem;
    min-height: 5rem;
    font-size: 1.4rem;
  }
}


/* ---------------------------------------------------------
  メインビジュアル下端の斜めの区切り
  #mainvisual 自身の ::before で、下端に水色の三角を描く。
  （三角をメインビジュアルの中身より奥に置けるよう、
    次のセクション側から重ねる方式にはしない）
  common.css の SP 用 #mainvisual:before（border で三角を作る指定）は
  width・border をここで打ち消す。
  SP では PC画面の画像を次のセクションに食い込ませない。
--------------------------------------------------------- */
#mainvisual::before {
  content: "";
  position: absolute;
  z-index: 1;
  right: 0;
  bottom: 0;
  left: 0;
  width: auto;
  height: calc(100 / 1400 * 100vw);
  border: 0;
  background: var(--color-background-light);
  clip-path: polygon(0 100%, 100% 0, 100% 100%);
  pointer-events: none;
}

@media screen and (max-width: 768px) {
  #mainvisual::before {
    height: calc(60 / 640 * 100vw);
  }

  /* PC画面の画像を次のセクションに食い込ませない（common.css の負の margin-bottom を打ち消す） */
  #mainvisual .imgwrap {
    margin-bottom: 0;
  }
}


/* ---------------------------------------------------------
  私たち自身も、アシストを使う町工場です。（parts/top/factory.php）
--------------------------------------------------------- */
.top-factory {
  position: relative;
  padding: 12rem 0 6rem;
  background: var(--color-background-light);
}

.top-factory__inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 4rem;
}

.top-factory__body {
  flex: 1;
  padding-top: 1rem;
}

/* 文字サイズ・太字・字間は unit-title-01（HTML に付与）。
   unit-title-01 の PC の line-height: 60px は2行だと詰まるため、倍率で上書きする */
.top-factory__heading {
  color: var(--color-text-body);
  line-height: 1.6;
}

.top-factory__accent {
  color: var(--color-primary);
}

.top-factory__text {
  margin-top: 4rem;
  line-height: 2;
  letter-spacing: 0.05em;
}

.top-factory__figure {
  flex: 0 0 50%;
}

.top-factory__img {
  display: block;
  width: 100%;
  height: auto;
}

.top-factory__caption {
  margin-top: 1.2rem;
  font-size: 1.4rem; /* .detail-txt と同じ（PC 1.4rem / SP 1.3rem） */
}

.top-factory__caption::before {
  content: "▲";
  content: "▲" / "";
  margin-right: 0.4em;
}

@media screen and (max-width: 768px) {
  .top-factory {
    padding: 4rem 0;
  }

  .top-factory__inner {
    flex-direction: column;
    gap: 2.4rem;
  }

  .top-factory__body {
    padding-top: 0;
  }

  .top-factory__heading {
    line-height: 1.5;
  }

  .top-factory__text {
    margin-top: 1.6rem;
    line-height: 1.9;
  }

  .top-factory__figure {
    flex: none;
    width: 100%;
  }

  .top-factory__caption {
    font-size: 1.3rem;
  }
}


/* ---------------------------------------------------------
  私たちが大切にしている、3つの向き合い方（parts/top/values.php）
--------------------------------------------------------- */
.top-values {
  padding-bottom: 6rem;
  background: var(--color-background-light);
}

.top-values__card {
  padding: 6rem 6rem 5rem;
  border-radius: 4rem;
  background: var(--color-white);
  box-shadow: 0 4px 20px rgba(0, 17, 30, 0.05);
}

/* 文字サイズ・太字・字間は unit-title-03（HTML に付与） */
.top-values__heading {
  color: var(--color-text-body);
  line-height: 1.5;
}

.top-values__list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4rem;
  margin-top: 5rem;
}

.top-values__title {
  color: var(--color-primary);
  font-weight: 700;
  font-size: 2rem; /* .h3-merit・.point-title と同じ（PC・SP とも 20px） */
  line-height: 1.5;
  letter-spacing: 0.05em;
}

.top-values__text {
  margin-top: 1rem;
  color: var(--color-black-light);
  line-height: 1.8;
  letter-spacing: 0.05em;
}

.top-values__img {
  display: block;
  width: 100%;
  max-width: 32rem;
  height: auto;
  margin-top: 2.4rem;
}

.top-values__more {
  margin-top: 5rem;
  text-align: center;
}

@media screen and (max-width: 768px) {
  .top-values {
    padding-bottom: 4rem;
  }

  .top-values__card {
    padding: 3.6rem 2rem;
    border-radius: 2rem;
  }

  .top-values__list {
    grid-template-columns: 1fr;
    gap: 4rem;
    margin-top: 3rem;
  }

  .top-values__img {
    max-width: 24rem;
    margin: 2rem auto 0;
  }

  .top-values__more {
    margin-top: 4rem;
  }
}


/* ---------------------------------------------------------
  このような不安に、アシストは応えます。（parts/top/concerns.php）
  1組（li）を「不安 → 矢印 → 回答」の grid で並べる。
  矢印は li の ::after を grid-area: arrow に置いて表示する。
--------------------------------------------------------- */
.top-concerns {
  padding: 5rem 0 10rem;
  background: var(--color-background-light);
}

/* 文字サイズ・太字・字間は unit-title-03（HTML に付与） */
.top-concerns__heading {
  color: var(--color-text-body);
  line-height: 1.5;
}

.top-concerns__list {
  display: grid;
  gap: 3rem;
  margin-top: 5rem;
}

.top-concerns__item {
  display: grid;
  grid-template-columns: 38% 3rem 1fr;
  grid-template-areas: "question arrow answer";
  align-items: center;
  gap: 0 2rem;
}

/* 矢印（右向き） */
.top-concerns__item::after {
  content: "";
  grid-area: arrow;
  justify-self: center;
  width: 1.6rem;
  height: 1.6rem;
  border-top: 2px solid var(--color-primary);
  border-right: 2px solid var(--color-primary);
  transform: rotate(45deg);
}

.top-concerns__question {
  display: flex;
  grid-area: question;
  align-items: center;
  gap: 2rem;
  padding: 3.2rem 4rem;
  border-radius: 999px;
  background: var(--color-white);
  box-shadow: 0 4px 20px rgba(0, 17, 30, 0.05);
  color: var(--color-text-body);
  font-weight: 700;
  font-size: 2.6rem; /* unit-title-02 と同じ値（PC 2.6rem / SP 1.9rem）。見出しではないためクラスは付けない */
  line-height: 1.6;
  letter-spacing: 0.05em;
}

/* 「？」アイコン */
.top-concerns__question::before {
  content: "";
  flex: 0 0 auto;
  width: 8rem;
  height: 8rem;
  background: url(../img/top/concerns-question.png) center / contain no-repeat;
}

.top-concerns__answer {
  display: flex;
  grid-area: answer;
  align-items: center;
  gap: 2.4rem;
  padding: 2.4rem 3.2rem 2.4rem 2.4rem;
  border-radius: 2.4rem;
  background: var(--color-white);
  box-shadow: 0 4px 20px rgba(0, 17, 30, 0.05);
}

.top-concerns__icon {
  flex: 0 0 18rem;
  width: 18rem;
  height: auto;
}

/* 文字サイズ・太字・字間は unit-title-02（HTML に付与）。
   unit-title-02 の PC の line-height: 60px は倍率で上書きする */
.top-concerns__title {
  color: var(--color-text-body);
  line-height: 1.5;
}

.top-concerns__accent {
  color: var(--color-primary);
}

.top-concerns__text {
  margin-top: 1.2rem;
  color: var(--color-black-light);
  line-height: 1.9;
  letter-spacing: 0.05em;
}

.top-concerns__more {
  margin-top: 6rem;
  text-align: center;
}

@media screen and (max-width: 768px) {
  .top-concerns {
    padding: 4rem 0 6rem;
  }

  .top-concerns__list {
    gap: 4rem;
    margin-top: 3rem;
  }

  .top-concerns__item {
    grid-template-columns: 1fr;
    grid-template-areas:
      "question"
      "arrow"
      "answer";
    gap: 1.6rem 0;
  }

  /* 矢印を下向きにする */
  .top-concerns__item::after {
    transform: rotate(135deg);
  }

  .top-concerns__question {
    gap: 1.6rem;
    padding: 2rem 2.4rem;
    font-size: 1.9rem;
  }

  .top-concerns__question::before {
    width: 5.6rem;
    height: 5.6rem;
  }

  .top-concerns__answer {
    flex-direction: column;
    gap: 1.6rem;
    padding: 2.4rem 2rem;
    border-radius: 2rem;
  }

  .top-concerns__icon {
    flex: none;
    width: 12rem;
  }

  .top-concerns__more {
    margin-top: 4rem;
  }
}


/* ---------------------------------------------------------
  こんな管理が出来ます・PRODUCTS（parts/top/features.php）
  中の要素（.div-merit-*・.product-img など）は common.css のスタイルを使う。
  ここではセクション自体の背景・余白と、背景の英字「PRODUCTS」だけを指定する。
  値は旧 .top-sec03（common.css）と同じ（余白は rem に換算、位置は px のまま）。
--------------------------------------------------------- */
.top-features {
  position: relative;
  z-index: 1;
  padding-bottom: 12rem;
  background: var(--color-white);
}

.top-features__inner {
  position: relative;
  z-index: 1;
}

.top-features .unit-seccatch-01 {
  position: absolute;
  z-index: 0;
  top: 0;
  right: -25px;
  color: #f0fafe;
}

@media screen and (max-width: 768px) {
  .top-features {
    padding-bottom: 7rem;
  }

  .top-features .unit-seccatch-01 {
    top: 25px;
    right: -127px;
  }
}
