/* 全体の基本設定 */
body {
  font-family: "Helvetica", "Noto Sana JP", sans-serif;
  background-color: #f9f9f9;
  color: #2d2d2d;
  line-height: 2.0;
  margin: 0;
  font-size: 28px; /* ← ここで全体の文字サイズを指定 */
  margin-top: 0px; /* 固定ヘッダー分の余白 */
}

.back-to-top {
  position: fixed;
  right: 60px;      /* 右端から少し離して目立たせる */
  bottom: 60px;     /* 下からも離して独立感を出す */
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: #1a1a1a;   /* 文字色を濃くしてハッキリと */
  z-index: 9999;
  transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(30px);
}

/* スクロール時に現れる動き */
.back-to-top.is-show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* 垂直バー：太さを3pxに、長さを120pxへ拡大 */
.top-line {
  width: 3px;       /* 1pxから3pxへ太く */
  height: 120px;    /* 80pxから120pxへ長く */
  background-color: #d11; /* 力強い赤 */
  margin-bottom: 20px;
  transition: all 0.5s ease;
  position: relative;
  overflow: hidden;
}

/* バーに「光が走る」ような演出（2025年トレンド） */
.top-line::after {
  content: "";
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, transparent, #fff, transparent);
  animation: line-shine 3s infinite;
}

@keyframes line-shine {
  0% { top: -100%; }
  50% { top: 100%; }
  100% { top: 100%; }
}

/* 文字部分：サイズを上げ、間隔を広く */
.top-text {
  font-family: 'Arial Black', sans-serif; /* より太いフォント */
  font-size: 14px;    /* 10pxから14pxへ拡大 */
  font-weight: 900;
  letter-spacing: 0.3em;
  writing-mode: vertical-rl;
  text-transform: uppercase;
}

/* ホバー時の圧倒的インパクト */
.back-to-top:hover {
  transform: translateY(-15px); /* 大きく浮き上がる */
}

.back-to-top:hover .top-line {
  height: 160px;    /* 120pxからさらにスッと伸びる */
  width: 5px;       /* さらに太くなる */
  background-color: #000; /* 色を黒に変えて変化を強調 */
}

.back-to-top:hover .top-text {
  color: #d11;      /* 文字色を赤に変える */
}

/* スマホ対応：スマホでも存在感を維持 */
@media (max-width: 767px) {
  .back-to-top {
    right: 25px;
    bottom: 25px;
  }
  .top-line {
    height: 80px;
    width: 2px;
  }
  .top-text {
    font-size: 11px;
  }
}

/* ヘッダー */
/* ヘッダー全体 */
header {
  background-color: #f9f9f9; /*  */
  color: #000;
  width: 100%;
  height: 80px;             /* 60pxから少し広げてゆとりを出す */
  position: relayive;          /* 上部に固定 */
  top: 0;
  left: 0;
  z-index: 2000;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;      /* 垂直中央揃え */
}

header .container {
  width: 100%;
  max-width: 1800px;        /* フッターの幅と統一 */
  margin: 0 auto;
  padding: 0 40px;
}

.header-inner {
  display: flex;
  justify-content: space-between; /* ロゴは左、ナビは右 */
  align-items: center;
  width: 100%;
}

/* --- ロゴエリア --- */
.logo {
  display: flex;
  align-items: center;
  transition: opacity 0.3s ease;
  text-decoration: none;
}

.logo:hover {
  opacity: 0.8;
}

.logo-img {
  height: 50px;             /* 高さを固定してヘッダー内に収める */
  width: auto;
  display: block;
}

/* --- 右側エリア（ナビ + SNS） --- */
.nav-sns {
  display: flex;
  align-items: center;      /* 横一列に並べる */
  gap: 40px;                /* ナビとSNSの間隔 */
}

/* ナビゲーション（横並び） */
.global-nav ul {
  list-style: none;
  display: flex;
  gap: 2rem;
  margin: 0;
  padding: 0;
}

.global-nav a {
  color: #000;           /* 文字 */
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.05em;
  transition: color 0.3s ease;
}

.global-nav a:hover {
  color: #cccccc;
}

/* --- サブメニュー設定 --- */
.has-submenu {
  position: relative; /* 子要素（サブメニュー）の基準点 */
}

/* --- サブメニューの初期状態（隠す） --- */
.global-nav .has-submenu .submenu {
  display: block;        /* 構造は維持しつつ */
  visibility: hidden;    /* 見えなくする */
  opacity: 0;           /* 透明にする */
  position: absolute;
  top: 100%;            /* 親メニューの真下 */
  left: 50%;
  transform: translateX(-50%) translateY(10px); /* 少し下にずらしておく */
  background: #ffffff;  /* 背景は白が見やすい */
  list-style: none;
  margin: 0;
  padding: 10px 0;
  min-width: 180px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  transition: all 0.3s ease; /* ふわっと出すためのアニメーション */
  pointer-events: none; /* 隠れている時はクリック反応させない */
  z-index: 9999;
}

/* --- ホバー時に表示（出す） --- */
.global-nav .has-submenu:hover .submenu {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(0); /* 定位置に戻る */
  pointer-events: auto; /* 表示されたらクリックを有効にする */
}

/* --- サブメニュー内のリンク装飾 --- */
.global-nav .submenu li a {
  display: block;
  padding: 12px 20px !important;
  color: #333333 !important; /* 文字色は黒 */
  font-size: 14px;
  text-decoration: none;
  line-height: 1.4 !important; /* 行の高さをリセット */
  text-align: left;
  transition: background 0.2s;
  border: none !important; /* 余計な線を消す */
}

.global-nav .submenu li a:hover {
  background: #f5f5f5;
  color: #d11 !important; /* ホバーで赤に */
  text-decoration: none;
}

/* --- 【重要】スマホでの開きっぱなし防止 --- */
@media (max-width: 991px) {
  /* スマホ版でホバーが効かないようにリセット */
  .global-nav .has-submenu:hover .submenu {
    display: none; /* スマホ用ハンバーガーメニュー等を作るまでは隠す設定が安全 */
  }
}
/* --- SNSリンク（横並び） --- */
.sns-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  border-left: 1px solid rgba(255,255,255,0.3); /* ナビとの境界線 */
  padding-left: 30px;
}

.sns-links a {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #000;
  text-decoration: none;
  font-size: 13px;
  font-weight: bold;
}

.sns-links svg {
  vertical-align: middle;
}

/* お問い合わせボタン（CTA）だけ強調 */
.cta {
  background-color: #009e6f;   /* 強調 */
  padding: 10px 20px !important;
  border-radius: 2px;
}

.cta:hover {
  background-color: #d9f1ea;
  color: #000 !important;
}
/* --- ハンバーガーボタンの基本スタイル（PCでは隠す） --- */
.menu-trigger {
  display: none;
  width: 40px;
  height: 40px;
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 3000;
}

.menu-trigger span {
  display: block;
  position: absolute;
  left: 10px;
  width: 20px;
  height: 2px;
  background-color: #000;
  transition: all 0.4s;
}

.menu-trigger span:nth-child(1) { top: 13px; }
.menu-trigger span:nth-child(2) { top: 19px; }
.menu-trigger span:nth-child(3) { top: 25px; }

/* ボタンが押された（active）時のアニメーション */
.menu-trigger.is-active span:nth-child(1) { transform: translateY(6px) rotate(-45deg); }
.menu-trigger.is-active span:nth-child(2) { opacity: 0; }
.menu-trigger.is-active span:nth-child(3) { transform: translateY(-6px) rotate(45deg); }

/* --- スマホ対応 (1024px以下) --- */
@media (max-width: 1024px) {
  .menu-trigger {
    display: block; /* ボタンを表示 */
  }

  .nav-sns {
    display: flex; /* noneから変更 */
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    position: fixed; /* 画面に固定 */
    top: 0;
    right: -100%; /* 最初は画面の右に隠す */
    width: 80%; /* 画面の8割を覆う */
    height: 100vh;
    background-color: #fff;
    padding: 100px 20px;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    transition: right 0.5s ease; /* スライドアニメーション */
    z-index: 2500;
    overflow-y: auto;
  }

  /* メニューが開いた時（is-active） */
  .nav-sns.is-active {
    right: 0;
  }

  /* スマホ時のナビを縦並びに */
  .global-nav ul {
    flex-direction: column;
    gap: 0;
    width: 100%;
    text-align: center;
  }

  .global-nav a {
    display: block;
    padding: 15px 0;
    font-size: 18px;
    border-bottom: 1px solid #eee;
  }

  /* スマホ時のサブメニュー（常に表示、またはタップで展開） */
  .global-nav .has-submenu .submenu {
    position: static;
    display: block;
    visibility: visible;
    opacity: 1;
    transform: none;
    box-shadow: none;
    background: #f9f9f9;
    min-width: 100%;
    pointer-events: auto;
  }

  .sns-links {
    border-left: none;
    padding-left: 0;
    margin-top: 30px;
    flex-direction: column;
  }
}

/* --- 基本リセットと共通コンテナ --- */
body {
    font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
    background-color: #f8f9fa;
    margin: 0;
    padding: 0; /* bodyのpaddingは0にし、セクションで調整 */
    color: #333;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 共通セクションコンテナ（上下の余白と背景色） */
.workflow-section { padding: 80px 0; background: #fff; }


/* --- ヒーローセクション --- */
.process-hero {
  background-color: #1a1a1a;
  padding: 120px 20px;
  text-align: center;
  color: #fff;
}

.process-hero .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.process-hero .en-sub {
  color: #009e6f; /* アクセントカラー */
  font-weight: bold;
  letter-spacing: 0.2em;
  margin-bottom: 15px;
}

.process-hero .hero-title {
  font-size: 3rem;
  font-weight: 700;
  margin: 0 0 20px 0;
  line-height: 1.4;
  position: relative;
  display: inline-block;
  padding-bottom: 20px;
}

.process-hero .hero-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: #009e6f;
}

.process-hero .hero-lead {
  font-size: 1.1rem;
  opacity: 0.9;
  margin: 20px 0 0 0;
}
/* --- タイトルセクション全体 --- */
.flow-section {
    width: 100%;
    text-align: center;
    /* 上下の余白を広めにとると、高級感が出ます */
    margin-top: 100px; 
    margin-bottom: 60px;
}

.flow-title {
    display: inline-block;
    position: relative;
    padding-bottom: 20px;
    margin: 0 auto;
}

/* 英語：小さく、広く、アクセントカラーで */
.flow-title .en {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: #009e6f; /* アクセントの緑 */
    letter-spacing: 0.3em; /* 字間を広くするのがコツ */
    margin-bottom: 8px;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

/* 日本語：太く、どっしりと */
.flow-title .jp {
    display: block;
    font-size: 1.75rem;
    font-weight: bold;
    color: #222;
    letter-spacing: 0.05em;
}



/* --- 水平フロー図（S字折り返しスタイル） --- */
.workflow-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    max-width: 700px; /* 130px + マージン × 5個分 */
    margin: 0 auto 60px;
    padding-top: 80px;
}

.step {
    position: relative;
    width: 130px;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: bold;
    font-size: 0.75rem;
    margin-bottom: 20px; /* 行間の隙間 */
    text-align: center;
    line-height: 1.3;
}

/* 共通：疑似要素（矢印）の基本設定 */
.step::after, .step::before {
    content: '';
    position: absolute;
    top: 0;
    border-top: 27.5px solid transparent;
    border-bottom: 27.5px solid transparent;
    display: block;
}

/* --- 1行目（1〜5番）：右向きの矢印 --- */
.step:nth-child(-n+5) {
    margin-right: 10px;
}
.step:nth-child(-n+5)::after { /* 右先端 */
    right: -10px;
    border-left: 10px solid;
    border-left-color: inherit; /* 背景色を継承 */
    z-index: 2;
}
.step:nth-child(-n+5)::before { /* 左切り欠き */
    left: 0;
    border-left: 10px solid #f8f9fa;
    z-index: 1;
}
.step:first-child::before { display: none; } /* 1番の左は消す */

/* --- 2行目（6〜10番）：左向き・逆順に配置 --- */
/* 6番〜10番をひとまとめにして右から左へ並べる */
.step:nth-child(n+6) {
    float: right; /* レイアウト調整用 */
}

/* 2行目を右から左に並べるためのコンテナ制御（重要） */
.workflow-container {
    display: block; /* 混合レイアウトのため block に変更 */
    overflow: hidden;
}
.step {
    float: left; /* 基本は左並び */
}
/* 6番目以降を右寄せで逆順に */
.step:nth-child(n+6) {
    float: right;
    margin-left: 10px;
    margin-right: 0;
}

/* 2行目の矢印形状（左向き） */
.step:nth-child(n+6)::after { /* 左先端 */
    left: -10px;
    border-right: 10px solid;
    border-right-color: inherit;
    z-index: 2;
}
.step:nth-child(n+6)::before { /* 右切り欠き */
    right: 0;
    border-right: 10px solid #f8f9fa;
    z-index: 1;
}

/* 6番目（2行目の右端・開始点）の右切り欠きを消す */
.step:nth-child(6)::before { display: none; }

/* 色の定義（継承させるために修正） */
.step.main-color { background-color: #444; border-left-color: #444; border-right-color: #444; }
.step.accent-color { background-color: #009e6f; border-left-color: #009e6f; border-right-color: #009e6f; }
.step.light-color { background-color: #777; border-left-color: #777; border-right-color: #777; }

/* --- 垂直フロー構造のスタイル --- */

/* 垂直ラインの軸 */
.vertical-flow {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 0;
}

/* 中央を通る縦線 */
.vertical-flow::before {
  content: "";
  position: absolute;
  top: 0;
  left: 45px; /* 番号の真ん中に合わせる */
  width: 2px;
  background: #eee;
  z-index: 1;
  /* height: 100%; は各要素の配置により自動調整されます */
}

/* 各ステップのブロック */
.flow-step {
  position: relative;
  display: flex;
  flex-direction: column;
  margin-bottom: 50px;
  z-index: 2;
}

/* 番号とラベル */
.step-label {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
}

.step-label .no {
  background: #009e6f; /* 新しいアクセントカラー */
  color: #fff;
  width: 90px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.2rem;
  border-radius: 4px;
}

.step-label .label-text {
  margin-left: 20px;
  font-size: 1.4rem;
  font-weight: bold;
  color: #000;
  letter-spacing: 0.05em;
}

/* カード部分 */
.flow-card {
  margin-left: 110px; /* 番号の幅＋余白 */
  display: flex;
  background: #fdfdfd;
  border: 1px solid #eee;
  box-shadow: 0 4px 10px rgba(0,0,0,0.03);
  transition: 0.3s;
}

.flow-card:hover {
  transform: translateX(10px);
  border-color: #d7000f; /* ホバー時の強調色 */
  box-shadow: 0 10px 20px rgba(215, 0, 15, 0.1);
}

.flow-img {
  width: 250px;
  overflow: hidden;
}

.flow-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.flow-text {
  padding: 30px;
  flex: 1;
}

.flow-text h3 {
  color: #d7000f; /* 新しいアクセントカラー */
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.flow-text p {
  font-size: 0.95rem;
  line-height: 1.8;
  color: #444;
  margin: 0;
}

/* --- レスポンシブ対応 --- */
@media (max-width: 768px) {
  /* ヒーローセクション */
  .process-hero { padding: 80px 20px; }
  .process-hero .hero-title { font-size: 1.8rem; }
  
  /* 水平フロー図 (スマホでは縦積み) */
  .step { width: 100%; margin-right: 0; margin-bottom: 10px; }
  .step::after, .step::before { display: none; }
  /* 折り返し矢印もスマホでは非表示 */
  .step.start-new-row::after { display: none; }

  /* 垂直フロー図 */
  .vertical-flow::before { left: 20px; }
  .step-label .no { width: 50px; font-size: 1rem; }
  .step-label .label-text { font-size: 1.1rem; }
  .flow-card { margin-left: 0; flex-direction: column; }
  .flow-img { width: 100%; height: 180px; }
  .flow-text { padding: 20px; }
}


/* フッター */
footer {
  /* 背景を少し薄いグレーに変更 */
  background-color: #77787B; 
  /* 文字色 */
  color: #ffffff; 
  /* 上下余白はしっかり、左右は詰め気味に */
  padding: 4rem 1.5rem; 
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  /* 両横いっぱいに広げるため、最大幅を大きくし、横幅を96%程度に設定 */
  max-width: 1600px; 
  width: 96%;
  margin: 0 auto;
}

.footer-info p {
  margin: 0.3rem 0;
  font-size: 0.9rem;
  line-height: 1.6;
}

/* リンク文字色を白に */
.footer-nav a {
  color: #ffffff; 
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  transition: opacity 0.3s ease;
}

.footer-nav a:hover {
  opacity: 0.6;
  text-decoration: none;
}

/* ナビゲーションの間隔 */
.footer-nav ul {
  list-style: none;
  display: flex;
  gap: 2.5rem; /* 項目間の間隔を少し広げてゆとりを出す */
  margin: 0;
  padding: 0;
}

/* 下部のコピーライトなどの装飾（必要に応じて） */
.footer-copy {
  max-width: 1600px;
  width: 96%;
  margin: 3rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid #ddd; /* 背景より少しだけ濃い線 */
  font-size: 0.8rem;
  color: #888;
}
.footer-nav ul {
  display: grid;
  /* 4項目ずつ2行に並べる設定（画面幅に合わせて自動調整） */
  grid-template-columns: repeat(4, auto); 
  gap: 1rem 2.5rem; /* 上下の間隔1rem、左右の間隔2.5rem */
  justify-content: flex-end;
}

/* スマホやタブレットでは2列にする */
@media (max-width: 1024px) {
  .footer-nav ul {
    grid-template-columns: repeat(2, auto);
  }
}
/* スマホ対応：横幅いっぱいを維持 */
@media (max-width: 767px) {
  .footer-inner {
    flex-direction: column;
    gap: 2rem;
    width: 100%;
  }
}

/*レスポジ対応*/
/* 1. 全体文字サイズの強制修正（28px対策） */
@media (max-width: 768px) {
  html { font-size: 16px; } /* 基準を16pxに */
  body {
    font-size: 1rem !important; /* 16px相当 */
    line-height: 1.7 !important;
  }
}

/* 2. ヘッダー：ハンバーガーメニュー化 */
@media (max-width: 1024px) {
  header { position: sticky !important; top: 0; height: 70px !important; }
  .header-inner { padding: 0 20px; }
  
  /* ボタンを表示させる（HTMLに .menu-toggle が必要） */
  .menu-toggle { display: flex !important; }

  /* メニューを右側に隠す */
  .nav-sns {
    display: flex !important; 
    flex-direction: column;
    position: fixed;
    top: 0; right: -100%; /* 画面外 */
    width: 80%; height: 100vh;
    background: #f9f9f9;
    padding: 80px 30px;
    transition: 0.4s ease;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    z-index: 2500;
  }
  
  /* 開いた時のクラス */
  .nav-sns.is-active { right: 0; }

  .global-nav ul { flex-direction: column; gap: 1.5rem; }
  .sns-links { border: none; padding: 0; flex-direction: row; justify-content: center; }
}

/* 3. ヒーローエリア：高さと文字の調整 */
@media (max-width: 768px) {
  .hero { height: 70vh !important; } /* 120vhから短縮 */
  .hero h1 { font-size: clamp(1.5rem, 8vw, 2.5rem) !important; letter-spacing: 0.1em !important; }
  .hero p { font-size: 1.1rem !important; }
}

/* 4. メインセクション：カードを1列に強制 */
@media (max-width: 1024px) {
  main section { margin-bottom: 4rem !important; padding: 0 20px; }
  
  /* すべてのグリッド・フレックス要素を1列化 */
  .three-cards, 
  .p-home-service__unit,
  .p-home-quality__unit {
    display: flex !important;
    flex-direction: column !important;
    gap: 1.5rem !important;
  }

  .three-cards .card,
  .p-home-service__unit-item,
  .p-home-quality__unit-item {
    width: 100% !important;
    flex: none !important;
    min-width: 0 !important;
  }

  /* スタッフアコーディオンのレイアウト調整 */
  .staff-detail { flex-direction: column !important; align-items: center; text-align: center; }
}

/* 5. フッター：縦並びと色の修正 */
@media (max-width: 767px) {
  footer { padding: 3rem 1rem !important; text-align: center; }
  .footer-inner { flex-direction: column !important; gap: 2rem !important; align-items: center !important; }
  .footer-nav ul { flex-direction: column !important; gap: 1rem !important; }
  .footer-copy { color: #ccc !important; } /* 背景と同化するのを防止 */
}

/* 6. ページトップボタン：位置調整 */
@media (max-width: 767px) {
  .back-to-top { right: 20px !important; bottom: 20px !important; }
  .top-line { height: 60px !important; }
}
@media (max-width: 1024px) {
  /* PC用のホバー効果を強制解除 */
  .global-nav .has-submenu:hover .submenu {
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
    display: block !important;
  }

  /* サブメニューを浮かさない（重なりの原因） */
  .global-nav .has-submenu .submenu {
    position: static !important; /* 絶対配置をやめて、メニューの下に並べる */
    width: 100% !important;
    pointer-events: auto !important; /* タップ可能にする */
    box-shadow: none !important;
    background: #f5f5f5 !important; /* 少し色を変えて区別 */
  }

  /* リンクのクリックエリアを広げる */
  .global-nav a {
    display: block !important;
    width: 100%;
    padding: 15px 20px !important;
    z-index: 10;
  }
}
