/* SP専用改行（PCでは無効） */
.br-sp { display: none; }

/* SP専用: hero右下のお問い合わせフローティングボタン（PCでは非表示） */
.hero__contact-float { display: none; }

/* ============================================
   TOPページ SERVICE セクション（3カラム）
   XD: ベージュ背景 #F5F1E4 × 80%
   ============================================ */
.top-services {
  background: rgba(245, 241, 228, 0.80);
  padding: 85px 0 140px;
}

.top-services__inner {
  max-width: 1920px;
  margin: 0 auto;
  padding: 0 316px;
  box-sizing: border-box;
}

.top-services__list {
  display: grid;
  grid-template-columns: repeat(3, 380px);
  gap: 70px;
  margin-top: 100px; /* XD: サブタイトル底〜アイコンtopの間隔 */
}

.top-service-card {
  display: flex;
  flex-direction: column;
}

.top-service-card__icon {
  margin-bottom: 30px;
  min-height: 200px;
  display: flex;
  align-items: flex-end;
  justify-content: center; /* アイコンをセンター揃え */
}

.top-service-card__icon img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
}

/* XD: Barlow Bold 25px #6CABC3 */
.top-service-card__en {
  font-family: var(--font-barlow);
  font-weight: 700;
  font-size: 25px;
  line-height: 1;
  letter-spacing: 0;
  color: #6CABC3;
  margin: 0 0 16px;
}

/* XD: Noto Sans JP Bold 32px #000 */
.top-service-card__ja {
  font-family: var(--font-ja);
  font-weight: 700;
  font-size: 32px;
  line-height: 1;
  color: #000;
  margin: 0 0 22px;
}

/* XD: Noto Sans JP Bold 14px / line-height 28px */
.top-service-card__desc {
  font-family: var(--font-ja);
  font-weight: 700;
  font-size: 14px;
  line-height: 2;
  color: #000;
  margin: 0;
}

/* ============================================
   DX Tour 誘導セクション（白背景・画像左テキスト右）
   ============================================ */
.top-dxtour {
  background: rgba(255, 255, 255, 0.80);
  padding: 100px 0;
}
.top-dxtour__inner {
  max-width: 1920px;
  margin: 0 auto;
  padding: 0 316px;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}
.top-dxtour__image img {
  display: block;
  width: 100%;
  height: auto;
}
.top-dxtour__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.top-dxtour__heading {
  padding: 0;
  margin: 0 0 32px;
}
.top-dxtour__lead {
  font-family: var(--font-ja);
  font-weight: 700;
  font-size: 24px;
  line-height: 2;
  color: #000;
  margin: 0 0 40px;
}
.top-dxtour__more-link {
  display: inline-block;
  font-family: var(--font-nav); /* M PLUS 1p */
  font-weight: 800;             /* ExtraBold */
  font-size: 24px;
  line-height: 1;
  color: #535353;
  text-decoration: none;
  padding: 16px 60px;
  border: 3px solid #535353;
  border-radius: 999px;
  background: #fff;
  transition: background 0.3s, color 0.3s;
}
.top-dxtour__more-link:hover {
  background: #383838;
  color: #fff;
  border-color: #383838;
}

/* ============================================
   CASE STUDY セクション
   XD: ベース＝中間青、左上角＝濃紺三角形（37°・1920px幅の左端基準）
   ============================================ */
.top-casestudy {
  position: relative;
  padding: 100px 0 120px;
  overflow: hidden;
  background: rgba(75, 100, 130, 0.80);
}
/* 1920px幅のキャンバス（中央寄せ）— 三角形配置の基準 */
.top-casestudy__canvas {
  position: absolute;
  inset: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 1920px;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
/* 左上の濃紺三角形（XD実測: W900.5 × H724.15） */
.top-casestudy__canvas::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 900.5px;
  height: 724.15px;
  background: #2D507F;
  clip-path: polygon(0 0, 100% 0, 0 100%);
}
/* 右下の三角形（XD実測: W679.34 × H546.3、180°回転でBR向き） */
.top-casestudy__canvas::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: 0;
  width: 679.34px;
  height: 546.3px;
  background: #2D507F;
  clip-path: polygon(100% 100%, 0 100%, 100% 0);
}
.top-casestudy__inner {
  position: relative;
  z-index: 1;
  max-width: 1920px;
  margin: 0 auto;
  padding: 0 316px;
  box-sizing: border-box;
}
.top-casestudy__heading {
  padding: 0;
  margin: 0 0 60px;
}
.page-heading__title--white {
  color: #fff;
}
.page-heading__subtitle--white {
  color: #fff;
}
.top-casestudy__list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}
.top-casestudy-card {
  background: #fff;
  border-radius: 12px;
  padding: 30px 26px 30px;
  display: flex;
  flex-direction: column;
}
.top-casestudy-card__lead {
  font-family: var(--font-ja);
  font-weight: 700;
  font-size: 24px;
  line-height: 38px;
  letter-spacing: 0;
  color: #2D507F;
  margin: 0 0 22px;
}
.top-casestudy-card__image {
  margin: 0 0 20px;
}
.top-casestudy-card__image img {
  display: block;
  width: 100%;
  aspect-ratio: 340 / 260;
  object-fit: cover;
}
.top-casestudy-card__company {
  font-family: var(--font-ja);
  font-weight: 700;
  font-size: 24px;
  line-height: 40px;
  letter-spacing: 0;
  color: #000;
  margin: 0 0 14px;
}
.top-casestudy-card__label {
  display: block;
  background: #2D507F;
  color: #fff;
  font-family: var(--font-ja);
  font-weight: 700;
  font-size: 14px;
  line-height: 28px;
  letter-spacing: 0;
  padding: 4px 10px;
  margin-bottom: 8px;
}
.top-casestudy-card__system {
  font-family: var(--font-ja);
  font-weight: 700;
  font-size: 20px;
  line-height: 28px;
  letter-spacing: 0;
  color: #2D507F;
  margin: 0;
}
.top-casestudy__more {
  display: flex;
  justify-content: center;
  margin-top: 50px;
}
.top-casestudy__more-link {
  font-family: var(--font-nav);   /* M PLUS 1p */
  font-weight: 800;               /* ExtraBold */
  font-size: 24px;
  line-height: 1;
  color: #535353;
  text-decoration: none;
  padding: 16px 60px;
  border: 3px solid #535353;
  border-radius: 999px;
  background: #fff;
  transition: opacity 0.3s;
}
.top-casestudy__more-link:hover {
  opacity: 0.85;
}

/* ============================================
   EXAMPLE セクション（ベージュ背景・中央寄せ見出し＋画像）
   SERVICEと同じベージュ背景なので padding上だけ
   ============================================ */
.top-example {
  background: rgba(245, 241, 228, 0.80);
  padding: 0 0 80px;
}
.top-example__inner {
  max-width: 1920px;
  margin: 0 auto;
  padding: 0 316px;
  box-sizing: border-box;
}
/* XD: Barlow ExtraBold 50px center #535353 */
.top-example__title {
  font-family: var(--font-barlow);
  font-weight: 800;
  font-size: 50px;
  line-height: 1;
  color: #535353;
  text-align: center;
  margin: 0 0 60px;
}
.top-example__images img {
  display: block;
  width: 100%;
  height: auto;
}

/* ============================================
   CASE STUDY（事例カード2枚・ベージュ続き）
   ============================================ */
.top-cases {
  background: rgba(245, 241, 228, 0.80);
  padding: 0 0 140px;
}
.top-cases__inner {
  max-width: 1920px;
  margin: 0 auto;
  padding: 0 316px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 50px;
}

/* XD: 1284×380 dark #383838 × 80% */
.top-case-card {
  display: grid;
  grid-template-columns: 1fr 560px;
  gap: 0;
  background: rgba(56, 56, 56, 0.80);
  overflow: hidden;
  min-height: 380px;
}
/* 偶数枚目は画像を左に */
.top-case-card--reverse {
  grid-template-columns: 560px 1fr;
}
.top-case-card--reverse .top-case-card__image {
  grid-column: 1;
  grid-row: 1;
}
.top-case-card--reverse .top-case-card__body {
  grid-column: 2;
  grid-row: 1;
}
.top-case-card__body {
  padding: 45px 50px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start; /* テキスト部を上揃え */
  color: #fff;
}
.top-case-card__tags {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}
/* タグ: Noto Sans JP Bold 18px / #383838 / 白ピル */
.top-case-card__tag {
  display: inline-block;
  background: #fff;
  color: #383838;
  font-family: var(--font-ja);
  font-weight: 700;
  font-size: 18px;
  line-height: 1;
  padding: 6px 18px;
}
.top-case-card__title {
  color: #fff;
  margin: 0 0 20px;
}
/* XD: 英語 Barlow Bold 60px */
.top-case-card__title--en {
  font-family: var(--font-barlow);
  font-weight: 700;
  font-size: 60px;
  line-height: 1;
  letter-spacing: 0;
}
/* XD: 日本語 Noto Sans JP Black 45px */
.top-case-card__title--ja {
  font-family: var(--font-ja);
  font-weight: 900;
  font-size: 45px;
  line-height: 1.2;
  letter-spacing: 0;
}
.top-case-card__desc {
  font-family: var(--font-ja);
  font-weight: 500;
  font-size: 20px;
  line-height: 1.8;
  color: #fff;
  margin: 0;
}
.top-case-card__image {
  overflow: hidden;
}
.top-case-card__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* XD: 黒丸 15×15 #383838（3つ、縦並び・中央寄せ） */
.top-cases__dots {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  margin-top: 52px;
}
.top-cases__dot {
  width: 15px;
  height: 15px;
  background: #383838;
  border-radius: 50%;
}

/* and more... ボタン（中央寄せ・ピル型） */
.top-cases__more {
  display: flex;
  justify-content: center;
  margin-top: 40px;
}
.top-cases__more-link {
  font-family: var(--font-nav); /* M PLUS 1p */
  font-weight: 800;             /* ExtraBold */
  font-size: 24px;
  line-height: 1;
  color: #535353;
  text-decoration: none;
  padding: 16px 60px;
  border: 3px solid #535353;
  border-radius: 999px;
  background: #fff;
  transition: background 0.3s, color 0.3s;
}
.top-cases__more-link:hover {
  background: #383838;
  color: #fff;
  border-color: #383838;
}

/* ============================================
   SP対応（〜991.98px）
   --------------------------------------------
   方針: SPレイアウトはセクションごとに一から作る。
   PC版CSSがSP幅に流れ込んでレイアウトを乱すため、
   SP未対応のセクションはここで一旦 display:none で隠す。
   ▼ あるセクションのSP対応が完了したら、
     下の「SP未対応セクション」リストから該当セレクタを外し、
     そのセクション用のSPスタイルを追記していく。
   ============================================ */
@media (max-width: 991.98px) {
  /* --- SP未対応セクション（対応完了したら順次ここから外す） ---
     ※全セクションSP対応済み。新規セクション追加時はここに display:none を足す */

  /* ▼▼▼ セクション別SPスタイル ▼▼▼ */

  /* --------------------------------------------
     Hero（SP）XD実測:
       HEROエリア H520
       黒box 340×140・上端Y159（左右25pxで配置）
       キャッチ 35px / 23px
       subtitle Noto Sans JP Bold 16px / description 12px
     -------------------------------------------- */
  .hero {
    height: 520px;          /* XD: 画面上端Y0からの高さ */
    min-height: 0;
    margin-top: -60px;      /* ヘッダー60pxの裏から開始（hero上端=画面Y0） */
    position: relative;
    overflow: hidden;
  }
  .hero__content {
    height: auto;
    /* 上:159px(黒box上端 画面Y159そのまま) / 左右0(黒boxはX0=左寄せ) */
    padding: 159px 0 0;
  }
  .hero__catch-box {
    width: 340px;          /* XD: W340・X0（左寄せ） */
    height: 140px;
    padding: 22px 12px;    /* PC: 19px 0 0 142px を解除 */
    box-sizing: border-box;
  }
  .hero__catch {
    line-height: 1.25;
  }
  .hero__catch--xl { font-size: 35px; }   /* DX */
  .hero__catch--md { font-size: 23px; }   /* でつなぐ */
  .hero__catch--lg { font-size: 35px; }   /* 日本のものづくり。 */
  .hero__subtitle {
    /* 樋口…: Noto Sans JP Bold 16px（黒box内テキスト左端=12pxに揃える） */
    font-weight: 700;
    font-size: 16px;
    line-height: 1.7;
    margin: 20px 0 0 12px;
  }
  .hero__description {
    font-size: 12px;
    letter-spacing: 0.5px;
    line-height: 1.9;
    margin: 10px 0 0 12px;
  }
  /* SP専用改行を有効化 */
  .br-sp { display: inline; }

  /* hero右下 お問い合わせフローティングボタン（60×60・右下18px） */
  .hero__contact-float {
    display: block;
    position: absolute;
    right: 18px;
    bottom: 18px;
    width: 60px;
    height: 60px;
    z-index: 5;
  }
  .hero__contact-float img {
    display: block;
    width: 100%;
    height: 100%;
  }

  /* --------------------------------------------
     SERVICE（SP）
       ベージュ枠 padding 上下100px / 左右20px
       SERVICE: Barlow ExtraBold 40px 左
       サービス: M PLUS 1p Bold 20px 左
       アイコン: センター
       en(Development)/ja(開発)/desc はPC値が指定どおり(25/32/14px・左)のため継承
     -------------------------------------------- */
  .top-services {
    padding: 100px 20px;
  }
  .top-services__inner {
    padding: 0;
  }
  .top-services .page-heading {
    padding: 0;
  }
  .top-services .page-heading__title {
    font-size: 40px;   /* SERVICE */
  }
  .top-services .page-heading__subtitle {
    font-size: 20px;   /* サービス */
  }
  .top-services__list {
    grid-template-columns: 1fr;   /* 1カラム縦積み */
    gap: 80px;
    margin-top: 60px;
  }
  .top-service-card__icon {
    justify-content: center;      /* アイコン センター */
    min-height: auto;
    margin-bottom: 30px;
  }

  /* --------------------------------------------
     EXAMPLE（SP）
       EXAMPLE: Barlow ExtraBold 36px センター（PCで既にcenter）
       左右余白20px
     -------------------------------------------- */
  .top-example__inner {
    padding: 0 20px;
  }
  .top-example__title {
    font-size: 36px;
    margin-bottom: 32px;
  }
  /* 1枠目: 画像のみ・全幅・高さ300px・高さ一致(cover)・右寄せ */
  .top-example__images img {
    height: 300px;
    object-fit: cover;
    object-position: right center;
  }

  /* --------------------------------------------
     CASE STUDY 事例カード（SP）= 2・3枠目
       カード: 縦積み（body→画像）
       タグ: 100×30 白枠 / Noto Sans JP Bold 18px
       タイトル(en): Barlow Bold 40px ／ (ja)はNoto縮小
       desc: Noto Sans JP 12px
     -------------------------------------------- */
  .top-cases {
    padding: 0 0 60px;
  }
  .top-cases__inner {
    padding: 0 20px;
    gap: 24px;
  }
  .top-case-card,
  .top-case-card--reverse {
    grid-template-columns: 1fr;   /* 1カラム縦積み */
    min-height: 0;
    background: #3B3B3B;          /* カード背景（不透明） */
  }
  /* reverse(画像左)指定を解除し、body→画像のソース順で縦に並べる */
  .top-case-card--reverse .top-case-card__body,
  .top-case-card--reverse .top-case-card__image {
    grid-column: 1;
    grid-row: auto;
  }
  .top-case-card__body {
    padding: 24px 20px;
  }
  .top-case-card__tags {
    margin-bottom: 14px;
  }
  .top-case-card__tag {
    width: 100px;
    height: 30px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;          /* Noto Sans JP Bold 18px */
  }
  .top-case-card__title {
    margin: 0 0 12px;
  }
  .top-case-card__title--en {
    font-size: 40px;          /* CheckMaster: Barlow Bold 40px */
  }
  .top-case-card__title--ja {
    font-size: 26px;          /* SES＋…: Noto Sans JP Black 26px */
  }
  .top-case-card__desc {
    font-size: 12px;          /* Noto Sans JP 12px */
  }
  .top-case-card__image img {
    height: auto;             /* 縦積みなので自然高さ（SES等） */
  }
  /* CheckMaster(非reverse)の画像: 高さ210px・上下は枠に密着・左に少し/右にほんの少し */
  .top-case-card:not(.top-case-card--reverse) .top-case-card__image {
    padding: 0 10px 0 30px;   /* 上下0(枠に密着) 右10 左30 */
  }
  .top-case-card:not(.top-case-card--reverse) .top-case-card__image img {
    height: 210px;
    object-fit: cover;
  }
  /* SES(reverse)の画像: 枠のpadding分を確保（左右・下に余白） */
  .top-case-card--reverse .top-case-card__image {
    padding: 0 20px 20px;
  }
  /* dots / and more（縮小） */
  .top-cases__dots {
    margin-top: 32px;
    gap: 16px;
  }
  .top-cases__dot {
    width: 7.6px;
    height: 7.6px;
  }
  .top-cases__more {
    margin-top: 28px;
  }
  .top-cases__more-link {
    font-family: var(--font-nav);   /* M PLUS 1p */
    font-weight: 800;               /* ExtraBold */
    font-size: 24px;
    padding: 14px 48px;
    border-width: 3px;
  }

  /* --------------------------------------------
     DX Tour（SP）画像上 → テキスト下の縦積み
       DX Tour: 40px / DX講座＋工場見学: 20px / lead: 12px
       書体は他セクション共通（Barlow / M PLUS 1p / Noto）
     -------------------------------------------- */
  .top-dxtour {
    padding: 60px 0;
  }
  .top-dxtour__inner {
    grid-template-columns: 1fr;     /* 1カラム縦積み（画像→body） */
    gap: 0;
    padding: 0 20px;
  }
  .top-dxtour__image {
    margin-bottom: 32px;
  }
  .top-dxtour__heading {
    margin: 0 0 16px;
  }
  .top-dxtour .page-heading__title {
    font-size: 40px;   /* DX Tour */
  }
  .top-dxtour .page-heading__subtitle {
    font-size: 20px;   /* DX講座＋工場見学 */
  }
  .top-dxtour__lead {
    font-size: 12px;
    margin: 0 0 28px;
  }
  .top-dxtour__more-link {
    font-family: var(--font-nav);   /* M PLUS 1p */
    font-weight: 800;               /* ExtraBold */
    font-size: 24px;
    border-width: 3px;
    align-self: center;             /* ボタンは中央寄せ */
  }

  /* --------------------------------------------
     CASE STUDY（青背景・SP）
       CASE STUDY: 40px / お客様の声・導入事例: 20px（書体は他に合わせる）
       斜め装飾は幅いっぱい
       カードは1件のみ表示
       and more は case-study ページへ
     -------------------------------------------- */
  .top-casestudy {
    padding: 60px 0 80px;
  }
  /* 斜め装飾：幅いっぱい（ビューポート基準でスケール） */
  .top-casestudy__canvas {
    max-width: none;
    width: 100%;
    left: 0;
    transform: none;
  }
  .top-casestudy__canvas::before,
  .top-casestudy__canvas::after {
    width: 100%;
    height: 80vw;       /* 三角形の比率(約1.24:1)を維持して全幅に */
  }
  .top-casestudy__inner {
    padding: 0 20px;
  }
  .top-casestudy__heading {
    margin: 0 0 32px;
  }
  .top-casestudy .page-heading__title {
    font-size: 40px;    /* CASE STUDY */
  }
  .top-casestudy .page-heading__subtitle {
    font-size: 20px;    /* お客様の声・導入事例 */
  }
  .top-casestudy__list {
    grid-template-columns: 1fr;   /* 1カラム */
  }
  /* スマホでは1件のみ表示 */
  .top-casestudy-card:nth-child(n+2) {
    display: none;
  }
  /* カード内テキスト（すべてNoto Sans JP） */
  .top-casestudy-card__lead {
    font-size: 20px;
  }
  .top-casestudy-card__company {
    font-size: 24px;
  }
  .top-casestudy-card__label {
    font-size: 14px;
  }
  .top-casestudy-card__system {
    font-size: 20px;
  }
  .top-casestudy__more {
    margin-top: 32px;
  }
  .top-casestudy__more-link {
    font-family: var(--font-nav);   /* M PLUS 1p */
    font-weight: 800;               /* ExtraBold */
    font-size: 24px;
    color: #535353;                 /* ボーダー・フォント・カラー統一 */
    background: #fff;
    border: 3px solid #535353;
    padding: 14px 48px;
  }
}
