/* ============================================
   style.css - Bootstrap overrides & global styles
   ============================================ */

/* --- CSS Variables --- */
:root {
  --color-primary: #DE0514;
  --color-primary-dark: #B8040F;
  --color-text: #333333;
  --color-text-light: #666666;
  --color-bg: #FFFFFF;
  --color-bg-gray: #F5F5F5;
  --color-dark: #1A2A4A;
  --font-ja: "Noto Sans JP", "Yu Gothic", "YuGothic", "Hiragino Kaku Gothic ProN", sans-serif;
  --font-en: "Montserrat", sans-serif;
  --font-nav: "M PLUS 1p", sans-serif;
  --font-barlow: "Barlow", sans-serif; /* CONTACT見出し・TEL用 */
}

/* --- Scaling strategy ---
   992px〜1920px : JS zoom で縮小（common.js）
   1920px超      : max-width: 1920px で中央寄せ
   〜991px       : zoom解除、SPレイアウト
   ============================================ */

/* --- Base --- */
body {
  font-family: var(--font-ja);
  color: var(--color-text);
  line-height: 1.8;
  overflow-x: hidden;
}

/* 1920px超: 背景は全幅、コンテンツは各要素内のコンテナでmax-width:1920px制御 */

img {
  max-width: 100%;
  height: auto;
}

/* PC専用改行（SPでは無効） */
.br-pc { display: inline; }
@media (max-width: 991.98px) {
  .br-pc { display: none; }
}

/* SP専用改行（PCでは無効）。全ページ共通 */
.br-sp { display: none; }
@media (max-width: 991.98px) {
  .br-sp { display: inline; }
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: opacity 0.3s;
}

a:hover {
  opacity: 0.7;
}

/* --- Section heading (EN + JP) --- */
.section-heading {
  margin-bottom: 2rem;
}

.section-heading__en {
  font-family: var(--font-en);
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.2;
  margin-bottom: 0.25rem;
}

.section-heading__ja {
  font-size: 0.875rem;
  color: var(--color-text-light);
}

/* ============================================
   Header
   XD: W1920 H180 不透明度80% 角丸0,0,40,40
   ロゴ: X80 Y54 W582 H63
   NAV: X1016 Y72 M PLUS 1p 20px Bold
   ============================================ */
.site-header {
  background: rgba(255, 255, 255, 0.80);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  border-radius: 0 0 40px 40px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.161);
  height: 180px;
}

.site-header .navbar {
  height: 100%;
  padding: 0;
}

.site-header .navbar > .container {
  max-width: 1920px;
  padding-left: 80px;
  padding-right: 80px;
}

.site-header .navbar-brand {
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.site-header .navbar-brand img {
  height: 63px;
  width: auto;
}

/* Nav links */
.site-header .navbar-nav {
  align-items: center;
  gap: 0.5rem;
}

.site-header .navbar-nav .nav-link {
  font-family: var(--font-nav);
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text);
  padding: 0.5rem 1.5rem;
  line-height: 27px;
  transition: color 0.3s;
}

.site-header .navbar-nav .nav-link:hover,
.site-header .navbar-nav .nav-link.active {
  color: var(--color-primary);
}

/* CTA button in header */
.site-header .btn-contact {
  background-color: var(--color-primary);
  color: #fff;
  border: 2px solid var(--color-primary);
  border-radius: 45px;
  padding: 0.75rem 2.5rem;
  font-family: var(--font-nav);
  font-size: 20px;
  font-weight: 700;
  margin-left: 1.5rem;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.161);
  transition: background-color 0.3s, color 0.3s;
  display: inline-block;
}

.site-header .btn-contact:hover {
  background-color: #fff;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}

/* Hamburger (SP) — XD: W30 H20, 線の太さ3px */
.site-header .navbar-toggler {
  width: 30px;
  height: 20px;
  padding: 0;
  border: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.site-header .navbar-toggler:focus {
  box-shadow: none;
}

.site-header .navbar-toggler-bar {
  display: block;
  width: 30px;
  height: 3px;
  background: var(--color-text);
}

/* PC幅(992px〜)ではハンバーガーを非表示（SPドロワー用なので）
   ※base の display:flex が Bootstrap の navbar-expand-lg 非表示を
     上書きしてしまうため、明示的に打ち消す */
@media (min-width: 992px) {
  .site-header .navbar-toggler {
    display: none;
  }
}

/* ============================================
   SP ドロワーメニュー（フルスクリーン）
   ============================================ */
.sp-drawer {
  display: none;                    /* PCでは非表示 */
  position: fixed;
  inset: 0;
  z-index: 2000;                    /* ヘッダー(1000)より前面 */
  background: #F5F4F1;
  transform: translateX(100%);     /* 右外に待機 */
  transition: transform 0.3s ease;
}
.sp-drawer.is-open {
  transform: translateX(0);
}
.sp-drawer__close {
  position: absolute;
  top: 18px;
  right: 24px;
  background: none;
  border: none;
  padding: 0;
  font-size: 40px;
  line-height: 1;
  color: #000;
  cursor: pointer;
}
.sp-drawer__nav {
  margin-top: 200px;
  padding: 0 40px;
}
.sp-drawer__nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid #999;      /* HOME上の罫線 */
}
.sp-drawer__nav li {
  border-bottom: 1px solid #999;   /* 各項目下の罫線 */
}
.sp-drawer__nav a {
  display: block;
  font-family: var(--font-nav);    /* M PLUS 1p */
  font-weight: 500;
  font-size: 16px;
  color: #000;
  text-decoration: none;
  padding: 11.5px 0;               /* 罫線との距離 11.5px */
}

/* SP nav drawer */
@media (max-width: 991.98px) {
  /* XD: ヘッダー枠 390×60・角丸なし */
  .site-header {
    height: 60px;
    border-radius: 0;
  }

  .site-header .navbar > .container {
    /* XD: ロゴ左20px / ハンバーガー右20px。
       高さ60px内で上下センター → ロゴtop≈16px, ハンバーガーtop=20px に一致 */
    padding-left: 20px;
    padding-right: 20px;
  }

  .site-header .navbar-brand img {
    /* XD: ロゴ 291.75 × 27.56 */
    height: 27.56px;
    width: auto;
  }

  /* SPドロワーを有効化 */
  .sp-drawer {
    display: block;
  }

  .site-header .navbar-collapse {
    background: var(--color-bg);
    padding: 1rem 0;
    border-top: 1px solid #eee;
    margin-top: 0.5rem;
  }

  .site-header .navbar-nav {
    gap: 0;
  }

  .site-header .navbar-nav .nav-link {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f0f0f0;
  }

  .site-header .btn-contact {
    margin: 1rem 1rem 0;
    display: block;
    text-align: center;
  }

  .page-header {
    margin-top: -60px;
    height: 300px;
  }

  .page-header > .container {
    padding-left: 20px;
    padding-right: 20px;
  }
}

/* ============================================
   Page Header (下層ページ共通)
   ============================================ */
.page-header {
  background: url('../images/common/lv2_header_bg.jpg') center top / cover no-repeat;
  margin-top: -180px;          /* ヘッダー(180px)の裏に潜り込む */
  height: 480px;               /* XD: H480 */
  display: flex;
  align-items: flex-end;
  padding-bottom: 3rem;
}

.page-header > .container {
  padding-left: 80px;
  padding-right: 80px;
  max-width: 1920px;
}

.page-header__title {
  font-family: var(--font-en);
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
  margin-bottom: 0.25rem;
}

.page-header__subtitle {
  font-size: 0.875rem;
  color: var(--color-text-light);
}

/* ============================================
   Page Heading（下層ページ共通：左寄せ見出しブロック）
   XD: 左余白 X:316、タイトル Y:575 / サブタイトル Y:651
   タイトル: Barlow ExtraBold 800 60px / #535353 / line-height:138px
   サブタイトル: M PLUS 1p Bold 28px / #000 / line-height:50px
   ※レイアウトに応じて説明文や表などを下に続ける。
     ページによっては右カラムに表を並べる(COMPANY)／下に説明文(SERVICE/DX)の2パターンあり。
     本クラスは見出し部のみを担当。
   ============================================ */
.page-heading {
  max-width: 1920px;
  margin: 0 auto;
  padding: 0 316px;
  box-sizing: border-box;
}

/* XD: SERVICE Y:575 → サービス Y:651 → 76px間隔
   font-sizeが60px、サブタイトル先頭まで76px。
   line-height:1で余計な行ボックスを作らず、margin-bottomで間隔制御 */
.page-heading__title {
  font-family: var(--font-barlow);
  font-size: 60px;
  font-weight: 800;
  color: #535353;
  line-height: 1;
  text-align: left;
  margin: 0 0 16px 0; /* XD: 16px = 76px - 60px(font-size) */
}

.page-heading__subtitle {
  font-family: var(--font-nav);
  font-size: 28px;
  font-weight: 700;
  color: #000;
  line-height: 1;
  text-align: left;
  margin: 0;
}

/* page-heading SP対応（〜991.98px）
   PC版 padding:0 316px がSP幅で効くと右端に潰れるため左右余白を縮小。
   見出し共通: 英語(Barlow) 40px / 日本語(M PLUS 1p) 20px（下層ページ共通ルール）。 */
@media (max-width: 991.98px) {
  .page-heading {
    padding: 0 20px;
  }
  .page-heading__title {
    font-size: 40px;
    margin-bottom: 8px;
  }
  .page-heading__subtitle {
    font-size: 20px;
  }
}

/* ============================================
   TOPページ ビューポート固定 背景動画
   （bodyに .is-top がある時だけ表示想定）
   ============================================ */
.top-bg-video {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.top-bg-video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* TOPページでは各セクション背景を80%アルファに（XD仕様） */
.is-top {
}

.is-top .contact-cta {
  background-color: rgba(222, 5, 20, 0.80); /* #DE0514 × 80% */
}
/* フッターは透過せず通常の白背景のまま */

/* ============================================
   Hero（TOPページ メインビジュアル 動画は背景側）
   ============================================ */
.hero {
  position: relative;
  width: 100%;
  height: 1190px; /* デザイナ案: ブラウザ0座標からH1190（1920px基準・zoomで縮小） */
  overflow: hidden;
  margin-top: -180px; /* ヘッダーの裏から開始 */
}

.hero__content {
  position: relative;
  z-index: 2;
  height: 100%;
  padding-top: 500px; /* 黒ボックス Y:500 */
  max-width: 1920px;
  margin: 0 auto;
}

/* 黒ボックス W1000 H300 X0 Y500、背景#000。キャッチは上下中央 */
.hero__catch-box {
  width: 1000px;
  height: 300px;
  background: #000;
  padding: 0 0 0 142px; /* 左:142px。上下はflexで中央寄せ */
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* M PLUS 1p ExtraBold 白 line-height:90px */
.hero__catch {
  font-family: var(--font-nav);
  font-weight: 800;
  color: #FFFFFF;
  line-height: 90px;
  margin: 0;
}

.hero__catch--xl { font-size: 96px; }   /* XD: "DX" */
.hero__catch--md { font-size: 64px; }   /* XD: "でつなぐ" */
.hero__catch--lg { font-size: 88px; }   /* XD: "日本のものづくり。" */

/* XD: Noto Sans JP Black 40px line-height:70px、X:142 Y:847（黒ボックス下端から44px下）*/
.hero__subtitle {
  font-family: var(--font-ja);
  font-weight: 900;
  font-size: 40px;
  line-height: 70px;
  color: #000;
  margin: 44px 0 0 142px;
}

/* XD: Noto Sans JP Bold 24px letter-spacing:1.92px line-height:60px、Y:1004（subtitle下端Y:975から29px下）*/
.hero__description {
  font-family: var(--font-ja);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: 1.92px;
  line-height: 60px;
  color: #000;
  margin: 29px 0 0 142px;
}

/* ============================================
   CONTACT CTA セクション（全ページ共通）
   XD: 背景 #DE0514、中央揃え
   ============================================ */
.contact-cta {
  background-color: var(--color-primary);
  color: #fff;
}

/* 背景は全幅・コンテンツは1920px上限で中央寄せ */
.contact-cta__inner {
  max-width: 1920px;
  margin: 0 auto;
  padding: 80px;
  text-align: center;
}

.contact-cta__title {
  /* XD: Barlow ExtraBold 800 60px #FFFFFF */
  font-family: var(--font-barlow);
  font-size: 60px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.contact-cta__subtitle {
  /* XD: M PLUS 1p Bold 28px #FFFFFF */
  font-family: var(--font-nav);
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2rem;
}

.contact-cta__text {
  /* XD: Noto Sans JP Bold 24px #FFFFFF */
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2rem;
}

.contact-cta__btn {
  display: inline-block;
  background: #595959;            /* SP仕様: ダークグレー */
  color: #fff;
  border: none;                  /* 枠なし */
  border-radius: 45px;
  padding: 0.75rem 3rem;
  /* M PLUS 1p ExtraBold 800 24px */
  font-family: var(--font-nav);
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 2.5rem;
  transition: background 0.3s;
  text-decoration: none;
}

.contact-cta__btn:hover {
  background: #6e6e6e;
  color: #fff;
  opacity: 1;
}

.contact-cta__tel {
  /* XD: Barlow ExtraBold 800 50px #FFFFFF */
  font-family: var(--font-barlow);
  font-size: 50px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.contact-cta__hours {
  /* XD: Noto Sans JP Bold 16px #FFFFFF */
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

/* ============================================
   CONTACT CTA SP対応（〜991.98px）
   全要素センター揃え。ボタンはダークグレーのピル型。
   ============================================ */
@media (max-width: 991.98px) {
  .contact-cta__inner {
    padding: 56px 16px;
  }
  .contact-cta__title {
    /* CONTACT: Barlow ExtraBold 40px */
    font-size: 40px;
    margin-bottom: 0.25rem;
  }
  .contact-cta__subtitle {
    /* お問い合わせ: M PLUS 1p Bold 20px */
    font-size: 20px;
    margin-bottom: 2.5rem;
  }
  .contact-cta__text {
    /* 製品やサービス…: Noto Sans JP Bold 15px */
    font-family: var(--font-ja);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.9;
    /* ブロックのまま中央寄せ・中の行は左揃え（2行の左端を揃える）。
       inline-block にするとボタンと横並びになるため block + fit-content + auto margin */
    display: block;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto 2.5rem;
    text-align: left;
  }
  .contact-cta__btn {
    /* お問い合わせフォーム: M PLUS 1p ExtraBold 24px / ダークグレー */
    background: #595959;
    border: none;
    border-radius: 45px;
    padding: 22px 40px;
    font-size: 24px;
    margin-bottom: 2.5rem;
  }
  .contact-cta__btn:hover {
    background: #6e6e6e;
  }
  .contact-cta__tel {
    /* TEL: Barlow ExtraBold 40px */
    font-size: 40px;
    margin-bottom: 0.5rem;
  }
  .contact-cta__hours {
    /* 受付時間…: Noto Sans JP Bold 16px */
    font-family: var(--font-ja);
    font-size: 16px;
    font-weight: 700;
  }
}

/* ============================================
   フッター
   XD: 白背景、左:会社情報、右:ナビ
   ============================================ */
.site-footer {
  background: #fff;
}

/* 背景は全幅・コンテンツは1920px上限で中央寄せ */
/* XD: H305px, padding top:90 left/right:130 bottom:27 */
.site-footer__container {
  max-width: 1920px;
  margin: 0 auto;
  padding: 90px 130px 27px;
}

.site-footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center; /* XD: nav と会社情報を垂直センター */
  margin-bottom: 57px; /* XD: 情報行下端〜Copyright上端 */
}

.site-footer__company {
  /* XD: M PLUS 1p Bold 25px, 会社名〜住所間:7px */
  font-family: var(--font-nav);
  font-size: 25px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 7px;
}

.site-footer__address,
.site-footer__tel {
  /* XD: Noto Sans JP Medium (500) 20px line-height:30px */
  font-size: 20px;
  font-weight: 500;
  line-height: 30px;
  color: var(--color-text);
  margin-bottom: 0;
}

.site-footer__nav {
  display: flex;
  gap: 2.5rem;
  align-items: center;
}

.site-footer__nav a {
  /* XD: M PLUS 1p Bold 20px */
  font-family: var(--font-nav);
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text-light);
  text-decoration: none;
  transition: color 0.3s;
}

.site-footer__nav a:hover {
  color: var(--color-primary);
  opacity: 1;
}

.site-footer__copy {
  /* XD: M PLUS 1p ExtraBold 800 24px #7E7E7E
     ※XD環境にM PLUS 1p未インストールでプレビューは細く見えるが、
       インスペクターの800が正しい */
  font-family: var(--font-nav);
  font-size: 24px;
  font-weight: 800;
  text-align: center;
  color: #7E7E7E;
  margin: 0;
  padding-top: 30px;
}

/* ============================================
   フッター SP対応（〜991.98px）
   PC版の padding:0 130px と大きいフォントで横はみ出し
   → 余白縮小・縦積み・フォント縮小で横スクロール解消
   ============================================ */
@media (max-width: 991.98px) {
  .site-footer__container {
    padding: 40px 20px 20px;
  }
  .site-footer__inner {
    flex-direction: column;
    align-items: center;
    gap: 24px;
    margin-bottom: 24px;
  }
  .site-footer__info {
    text-align: center;
  }
  .site-footer__nav {
    justify-content: center;
  }
  .site-footer__company {
    /* 社名: M PLUS 1p Bold 19px */
    font-family: var(--font-nav);
    font-size: 19px;
    font-weight: 700;
    margin-bottom: 6px;
  }
  .site-footer__address,
  .site-footer__tel {
    /* 住所: Noto Sans JP Medium 16px */
    font-family: var(--font-ja);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.8;
  }
  .site-footer__nav {
    flex-wrap: wrap;
    gap: 16px 20px;
  }
  .site-footer__nav a {
    /* リンク: M PLUS 1p Bold 10px */
    font-family: var(--font-nav);
    font-size: 10px;
    font-weight: 700;
  }
  .site-footer__copy {
    /* Copyright: M PLUS 1p ExtraBold 10px */
    font-family: var(--font-nav);
    font-size: 10px;
    font-weight: 800;
    padding-top: 16px;
    word-break: break-word;
  }
}

/* ============================================
   ページトップボタン
   XD: 赤丸・上矢印・右下固定
   ============================================ */
/* 上に戻るボタン: SVG(赤丸60px+白矢印+影)。画面に追従(fixed)
   デザイン: 1920px幅で X1780（右端から約80px）、画面追従 */
.page-top {
  position: fixed;
  bottom: 40px;
  right: 80px;        /* XD: X1780 → 右端から 1920-1780-60 = 80px */
  width: 78px;        /* SVGキャンバス（赤丸は60px、残りは影の余白） */
  height: 78px;
  display: block;
  text-decoration: none;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.page-top.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.page-top:hover {
  opacity: 0.85;
}

.page-top img {
  display: block;
  width: 100%;
  height: 100%;
}

/* スマホでは「上に戻る」ボタンは非表示 */
@media (max-width: 991.98px) {
  .page-top,
  .page-top.is-visible {
    display: none;
  }
}

/* ============================================
   Responsive Breakpoints
   ============================================
   1921px〜    : CSS max-width中央寄せ（JS zoom解除）
   992px〜     : PC表示（JS zoomで1920px基準縮小）
   〜991px     : SPレイアウト（zoom解除）
   ============================================ */
