/* =========================================================
   Company page ( /company/ )  統合版CSS
   - 重複定義を排除
   - PC: ヘッダー固定 / SP: ヘッダー固定解除（ハンバーガーは右上固定）
   - SPドロワー（overlay + close）対応
   - Hero 背景差し替え（2レイヤー）対応
   ========================================================= */


/* ==== Companyページ専用フォント指定 ==== */
#company-page,
#company-page * {
  font-family: "Kozuka Gothic Pr6N", "小塚ゴシック Pr6N", sans-serif !important;
}


/* ---- 見出し共通 ---- */
.cp-sec h2 {
  text-align: center !important;
}
.cp-sec h2 span {
  display: block;
  font-size: 0.8em;
  opacity: 0.6;
  color: #fbb03b;
}


/* =========================================================
   Header (PC fixed)
   ========================================================= */

body.company-page {
  padding-top: 76px; /* 固定ヘッダー分 */
}

.company-page .cp-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 76px;
  background: rgba(255, 255, 255, 0.96);
  z-index: 999;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.company-page .cp-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.company-page .cp-header-logo {
.cptsu-site-title__main{ font-size: 1.1rem; color: #000;}
.cptsu-site-title__sub{ font-size: 0.9rem; opacity: .95; color: #000; }
}




/* 768px以下：SPレイアウト */
@media (max-width: 768px){
.cptsu-site-title__main{ font-size: 1.2rem; }
.cptsu-site-title__sub{ font-size: 0.8rem; opacity: .85; }
}


/* ---- PC Global Nav ---- */
.company-page .cp-global-nav ul {
  display: flex;
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.company-page .cp-global-nav a {
  font-size: 14px;
  text-decoration: none;
  color: #333;
  position: relative;
  padding-bottom: 2px;
}

.company-page .cp-global-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: #c47a3a;
  transition: width 0.2s ease;
}

.company-page .cp-global-nav a:hover::after {
  width: 100%;
}

.cp-global-nav li.nav-ig a img {
  width: 18px;
  height: auto;
  display: block;
  margin-top: 7px;
}

.cp-global-nav li.nav-ig a:hover img {
  opacity: 0.7;
}


/* =========================================================
   Accessibility helper
   ========================================================= */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


/* =========================================================
   SP Drawer (hamburger + overlay + drawer)
   - body.is-nav-open で開閉
   ========================================================= */

.cp-nav-toggle {
  display: none; /* PCでは非表示 */
  border: 0;
  background: transparent;
  width: 44px;
  height: 44px;
  cursor: pointer;
}

.cp-nav-toggle__bars {
  display: block;
  width: 22px;
  height: 2px;
  background: #333;
  position: relative;
  margin: 0 auto;
}

.cp-nav-toggle__bars::before,
.cp-nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 22px;
  height: 2px;
  background: #333;
  transition: transform 0.2s ease, top 0.2s ease, opacity 0.2s ease;
}

.cp-nav-toggle__bars::before {
  top: -7px;
}
.cp-nav-toggle__bars::after {
  top: 7px;
}

/* overlay */
.cp-nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 998;
}

/* drawer */
.cp-sp-nav {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(82vw, 320px);
  background: rgba(255, 255, 255, 0.98);
  z-index: 999;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.12);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  padding: 80px 20px 24px; /* ヘッダー分を避ける */
}

.cp-sp-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cp-sp-nav a {
  color: #333;
  text-decoration: none;
  font-size: 16px;
}

.cp-sp-nav li.nav-ig img {
  width: 22px;
  height: auto;
  display: block;
}

/* close button */
.cp-sp-nav__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  line-height: 1;
  color: #333;
}

/* open state */
body.is-nav-open .cp-sp-nav {
  transform: translateX(0);
}

body.is-nav-open .cp-nav-toggle__bars {
  background: transparent;
}

body.is-nav-open .cp-nav-toggle__bars::before {
  top: 0;
  transform: rotate(45deg);
}

body.is-nav-open .cp-nav-toggle__bars::after {
  top: 0;
  transform: rotate(-45deg);
}


/* =========================================================
   Hero
   ========================================================= */

.cp-hero {
  position: relative;
  overflow: hidden;
  min-height: 620px;
  background: #ffffff;
  padding-bottom: 120px;
}

/* inner：画像幅と揃える（PC） */
.cp-hero .inner {
  position: relative;
  z-index: 2;
  max-width: min(1200px, calc(100% - 96px));
  margin: 0 auto;
  height: 100%;
  padding: 40px 0 40px;
}

/* BG layers（2枚でクロスフェード） */
.cp-hero__bg {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  transition: opacity 1s ease;
  opacity: 0;
  z-index: 0;

  /* PC：中央寄せの箱 */
  left: 50%;
  transform: translateX(-50%);
  width: min(1200px, calc(100% - 96px));
}

.cp-hero__bg.is-show {
  opacity: 1;
}

/* caption（PC） */
.cp-hero-caption {
  position: absolute;
  left: 0;
  top: 60%;
  transform: translateY(250%);
  background: rgba(255, 255, 255, 0.78);
  padding: 24px 40px;
  max-width: 650px;
  text-align: left;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.cp-hero-title {
  font-size: 26px;
  margin: 0 0 10px;
}

.cp-hero-lead {
  font-size: 16px;
  line-height: 1.8;
  margin: 0;
}


/* =========================================================
   SP adjustments
   - ヘッダー帯：固定解除（ページ上で自然配置）
   - ハンバーガー：右上に固定
   - Hero：全幅＆captionを下寄せ
   ========================================================= */

@media (max-width: 768px) {

  /* 固定ヘッダー分の余白を消す */
  body.company-page {
    padding-top: 0 !important;
  }

  /* ヘッダー帯を固定解除 */
  .company-page .cp-header {
    position: static !important;
    height: auto !important;
    box-shadow: none;
  }

  .company-page .cp-header-inner {
    height: auto !important;
    padding: 12px 16px;
  }

  /* PCメニューは消す、ハンバーガーを出す */
  .company-page .cp-global-nav {
    display: none;
  }

  .cp-nav-toggle {
    display: block;
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 1100;
  }

  /* Hero高さ（必要ならここで調整） */
  .cp-hero {
    min-height: 560px;
    padding-bottom: 0;
  }

  /* BG：SPは全幅 */
  .cp-hero__bg {
    width: 100%;
    left: 0;
    transform: none;
  }

  .cp-hero .inner {
    position: static;
    max-width: none;
    padding: 0;
  }

  /* caption：下寄せでベタっと */
  .cp-hero-caption {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 56px;
    top: auto;
    transform: none;

    width: auto;
    max-width: 520px;
    margin: 0 auto;

    padding: 18px 20px;
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    z-index: 3;
  }

  .cp-hero-title {
    font-size: 20px;
  }

  .cp-hero-lead {
    font-size: 14px;
  }
}

/* =========================================================
   FIX: 1) WP管理バー（admin-bar）との干渉
   ========================================================= */

/* 管理バー表示時：固定ヘッダーを下げる（PC: 32px） */
body.admin-bar.company-page .cp-header{
  top: 32px !important;
}

/* 管理バー表示時：bodyの上余白も増やす（ヘッダー分 + 管理バー分） */
body.admin-bar.company-page{
  padding-top: calc(76px + 32px) !important;
}

/* SP管理バーは高さが違う（だいたい 46px） */
@media (max-width: 782px){
  body.admin-bar.company-page .cp-header{
    top: 46px !important;
  }
  body.admin-bar.company-page{
    padding-top: calc(76px + 46px) !important;
  }
}


/* =========================================================
   FIX: 2) フォントが店舗ページ側の指定に負けている
   - 会社ページ内だけ、より強い詳細度で上書き
   ========================================================= */

/* 会社ページ全体（ただし wpadminbar には適用しない） */
body.company-page :not(#wpadminbar):not(#wpadminbar *) {
  font-family: "Kozuka Gothic Pr6N", "小塚ゴシック Pr6N", sans-serif !important;
}


/* =========================================================
   FIX 3: SP時、FV上の余白を完全に消す
   ========================================================= */

@media (max-width: 768px) {

  /* ヘッダーを「場所を取らない」配置にする */
  .company-page .cp-header {
    position: absolute !important;
    top: 0;
    left: 0;
    right: 0;
    height: auto !important;
  }

  /* main 側に余白を作らせない */
  body.company-page {
    padding-top: 0 !important;
  }

  /* 念のため hero 直前も潰す */
  body.company-page #company-page,
  body.company-page .cp-hero {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }
}

/* =========================
   Company SP：ヘッダーとFVの間の余白を消す（管理バー対策）
   ========================= */
@media (max-width: 768px){

  /* ★ここが本丸：admin-bar側の padding-top を打ち消す */
  body.company-page,
  body.admin-bar.company-page{
    padding-top: 0 !important;
  }

  /* 念のため：FV側に上マージン/パディングがあれば潰す */
  .company-page .cp-hero{
    margin-top: 0 !important;
    padding-top: 0 !important;
  }
}

/* =========================
   Company PC：管理バー分の余白を作らない
   ========================= */
body.admin-bar.company-page{
  padding-top: 76px !important; /* ← ヘッダー高さのみ */
}



/* =========================================================
   Service Block（過去デザイン踏襲・整理版）
   ========================================================= */

/* --- Service セクションの器（cp-secは使うが、service専用で整える） */
.company-page #service.cp-sec{
  padding: 72px 5%;
  max-width: 1100px;
  margin: 120px auto 0; /* ← 過去CSS踏襲（上余白あり） */
}

.company-page #service.service-block{
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
}

/* --- 見出し（過去CSSの意図を崩さず、壊れてた記述だけ修正） --- */
.company-page #service h2{
  text-align: center !important;
  margin: 0 0 80px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.company-page #service h2 span{
  display: block;
  font-size: .8em;      /* ← 過去CSS踏襲 */
  opacity: .6;          /* ← 過去CSS踏襲 */
  color: #fbb03b;       /* ← 過去CSS踏襲 */
  margin-top: 8px;      /* ← 過去CSS内にあった要素を自然に統合 */
}

/* --- 行コンテンツ --- */
.company-page #service .svc-row{
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 40px;
  align-items: center;
  padding: 80px 40px;
  position: relative;
  z-index: 2;
  background: transparent;
}

/* PC：奇数行だけフル幅クリーム背景（踏襲） */
.company-page #service .svc-row:nth-of-type(odd)::before{
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  width: 100vw;
  height: 100%;
  background: #fbf9ef; /* ← 過去CSS踏襲 */
  z-index: -1;
}

/* 偶数行は背景なし（踏襲） */
.company-page #service .svc-row:nth-of-type(even)::before{
  content: none;
}

/* --- 並び順（過去CSSの「oddで反転」を踏襲） --- */
.company-page #service .svc-row .svc-img{ order: 1; }
.company-page #service .svc-row .svc-text{ order: 2; }

.company-page #service .svc-row:nth-of-type(odd) .svc-text{ order: 1; }
.company-page #service .svc-row:nth-of-type(odd) .svc-img { order: 2; }

/* ※PHP側の .reverse は不要（付いてても見た目は崩れにくいが、管理が二重になるので外す推奨） */

/* --- 画像 --- */
.company-page #service .svc-img{
  position: relative;
  z-index: 2;
}

.company-page #service .svc-img img{
  width: 100%;
  border-radius: 2px;
  display: block;
}

/* 画像装飾（オレンジ線） */
.company-page #service .svc-img::after{
  content:"";
  position:absolute;
  width: 100%;
  height: 100%;
  border: 1.5px solid #dca65a;
  z-index: -1;
  pointer-events:none;

  /* デフォルト：右上（画像が“右に来る”行） */
  inset: -20px -20px auto auto;
}

/* 偶数行（画像が“左に来る”行）は左上へ */
.company-page #service .svc-row:nth-of-type(even) .svc-img::after{
  inset: -20px auto auto -20px;
}




/* --- テキスト --- */
.company-page #service .svc-text h3{
  font-size: 22px;
  margin-bottom: 16px;
}

.company-page #service .svc-text p{
  line-height: 1.9;
  color: #444;
  margin: 0;
}

/* =========================================================
   Service：見出しまわりの線を全部オフ（過去CSS踏襲）
   ※ cp-sec 全体ではなく #service に閉じる（他セクション保護）
   ========================================================= */
.company-page #service,
.company-page #service h2,
.company-page #service h3{
  border: none !important;
  box-shadow: none !important;
}

.company-page #service::before,
.company-page #service::after,
.company-page #service h2::before,
.company-page #service h2::after,
.company-page #service h3::before,
.company-page #service h3::after{
  content: none !important;
  display: none !important;
}

/* ==============================
   SP（768px以下）踏襲＋最低限調整
============================== */
@media (max-width: 768px){

  .company-page #service.cp-sec{
    margin-top: 48px !important;   /* ← 過去CSS踏襲（詰める） */
    padding: 48px 5% !important;   /* ← 過去CSS踏襲 */
  }

  .company-page #service .svc-row{
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 40px 20px;
  }

  /* SPは全部「画像→文章」（過去CSS踏襲） */
  .company-page #service .svc-row .svc-img{ order: 1 !important; }
  .company-page #service .svc-row .svc-text{ order: 2 !important; }

  /* フル幅背景はSPでも維持（踏襲） */
  .company-page #service .svc-row:nth-of-type(odd)::before{
    width: 100vw;
    left: 50%;
    transform: translateX(-50%);
  }
}

/* Service 上部の不要な余白を消す */
.company-page #service.cp-sec{
  margin-top: 0 !important;        /* ← オレンジ帯の原因 */
  padding-top: 72px;               /* ← 中の余白は padding で確保 */
}

/* =========================
   Company / Service 余白を詰める（強制）
   ========================= */
body.company-page section#service.cp-sec{
  margin-top: 0 !important;              /* ← 120px を潰す（上のオレンジ帯が消える） */
  padding-top: 56px !important;          /* 見出しの上は少しだけ残す */
  padding-bottom: 25px !important;       /* 下のオレンジ帯を詰める */
}

/* 見出し下の余白（ここが大きいと「帯」に見える） */
body.company-page section#service.cp-sec > h2{
  margin: 0 0 25px !important;           /* 80px → 48px */
}



/* =========================================================
   Works（ご対応事例）— 事業内容と同じ思想で踏襲（整理版）
   ========================================================= */

/* セクション器（cp-sec思想踏襲） */
body.company-page section#works.cp-sec{
  max-width: 1100px;
  margin: 120px auto 0;
  padding: 72px 5%;
  background: transparent !important;
}

/* alt 由来の背景・線を無効化（事故防止） */
body.company-page section#works.alt{
  background: transparent !important;
}
body.company-page section#works.alt::before,
body.company-page section#works.alt::after{
  content: none !important;
  display: none !important;
}

/* 見出し（装飾線を完全OFF＋過去仕様） */
body.company-page #works h2{
  text-align: center !important;
  margin: 0 0 64px;            /* 80pxだと大きく見えやすいので少し控えめ */
  font-weight: 600;
  letter-spacing: 0.08em;
  border: none !important;
  box-shadow: none !important;
}
body.company-page #works h2::before,
body.company-page #works h2::after{
  content: none !important;
  display: none !important;
}

body.company-page #works h2 span{
  display: block;
  margin-top: 8px;
  font-size: 20px;             /* 過去踏襲 */
  font-weight: 600;
  color: #fbb03b;
}

/* ==== Works：グリッド（1100基準に統一） ==== */
body.company-page #works .works-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px 28px;              /* 40/32 → 少し詰める（“大きい感”を軽減） */
  list-style: none;
  margin: 32px auto 0;         /* 40px → 少し詰める */
  padding: 0;
  max-width: 1100px;           /* ★ここ重要：1200をやめて器と同じにする */
}

/* 各アイテム */
body.company-page #works .work-item{
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* サムネ */
body.company-page #works .work-thumb{
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 2px;
  position: relative;
  background: #f6f6f6;
}

body.company-page #works .work-thumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease, opacity .3s ease;
}

body.company-page #works .work-thumb:hover img{
  transform: scale(1.05);
  opacity: 0.9;
}

/* キャプション */
body.company-page #works .work-caption{
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.6;
  text-align: center;
}

/* 事故防止：汎用grid系が残っててもWorks内では使わせない */
body.company-page #works .grid,
body.company-page #works .cp-works-grid{
  display: none !important;
}

/* ===== レスポンシブ ===== */
@media (max-width: 1024px){
  body.company-page #works .works-grid{
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }
}

@media (max-width: 680px){
  body.company-page #works .works-grid{
    grid-template-columns: repeat(2, 1fr);
    gap: 20px 16px;
  }

  /* SPはcp-secの余白も事業内容と同じノリで */
  body.company-page section#works.cp-sec{
    margin-top: 48px;
    padding: 48px 5%;
  }

  body.company-page #works .work-caption{
    font-size: 13px;
  }
}


/* Works 上部余白を控えめに調整 */
body.company-page section#works.cp-sec{
  margin-top:40px;   /* ← 120px → 72px に縮小 */
}

/* Works：セクションタイトル下の余白を調整 */
body.company-page #works h2{
  margin-bottom: 25px; /* ← 80px → 48px */
}




/* =========================================================
   Machines（設備紹介）— Works踏襲（干渉しない版 / 整理済み）
   ========================================================= */

/* セクションの器：cp-secの思想を踏襲 */
body.company-page section#machines.cp-sec{
  max-width: 1100px;
  margin: 48px auto 0;       /* ← 上部余白：控えめ（必要なら 40〜65px） */
  padding: 40px 5%;          /* ← 72px→40pxへ統一（下の重複を解消） */
  background: transparent !important;
}

/* 見出し：装飾線などテーマ由来を無効化して、Worksと同じ */
body.company-page #machines h2{
  text-align: center !important;
  margin: 0 0 60px;          /* ← 80px→60pxへ（下の重複を解消） */
  font-weight: 600;
  letter-spacing: 0.08em;
  border: none !important;
  box-shadow: none !important;
}
body.company-page #machines h2::before,
body.company-page #machines h2::after{
  content: none !important;
  display: none !important;
}
body.company-page #machines h2 span{
  display: block;
  margin-top: 8px;
  font-size: 20px;
  font-weight: 600;
  color: #fbb03b;
}

/* グリッド：Worksと同じ 3×n */
body.company-page #machines .machines-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px 32px;
  list-style: none;
  margin: 40px auto 0;
  padding: 0;
  max-width: 1200px;
}

/* カード */
body.company-page #machines .machine-item{
  display: flex;
  flex-direction: column;
  align-items: center;
}

body.company-page #machines .machine-card{
  width: 100%;
  margin: 0;
  text-align: center;
}

/* figure自体は高さ固定しない（＝キャプションが表示される） */
body.company-page #machines .machine-card{
  width: 100%;
  margin: 0;
  text-align: center;
}

/* 画像を正方形にしてトリミング */
body.company-page #machines .machine-card img{
  width: 100%;
  aspect-ratio: 1 / 1;   /* 正方形 */
  height: auto;          /* 高さ固定しない */
  object-fit: cover;
  border-radius: 2px;
  display: block;
  background: #f6f6f6;
}


/* キャプション */
body.company-page #machines .machine-cap{
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.6;
}

/* タブレット */
@media (max-width: 1024px){
  body.company-page #machines .machines-grid{
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }
}

/* スマホ：2列 + 余白調整 */
@media (max-width: 680px){
  body.company-page section#machines.cp-sec{
    margin-top: 40px;
    padding-top: 32px;
    padding-bottom: 32px;
  }
  body.company-page #machines h2{
    margin-bottom: 40px;      /* SPはさらに詰める */
  }
  body.company-page #machines .machines-grid{
    grid-template-columns: repeat(2, 1fr);
    gap: 20px 16px;
  }
  body.company-page #machines .machine-cap{
    font-size: 14px;
  }
}


/* =========================
   Contact（/company/ #contact）
   - 背景を“帯”ではなく“中央ボックス”にする
   - Lightning見出し装飾を#contact内だけOFF
   - 既存レイアウトは踏襲、重複は整理
========================= */

/* ---------------------------------
   Section base + Cream background box
--------------------------------- */
body.company-page section#contact.cp-contact{
  position: relative;
  z-index: 0;          /* 擬似要素をセクション内の背面へ固定 */
  isolation: isolate;  /* z-index:-1 が外へ逃げない */
  padding: 72px 5%;
  margin: 40px auto 0;
  background: transparent !important; /* Lightningの“帯”を潰す */
}

body.company-page section#contact.cp-contact::before{
  content:"";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(1200px, calc(100% - 96px)); /* heroと同じ思想 */
  background: #fbf7e6;
  z-index: -1;
  pointer-events: none;
}

/* ---------------------------------
   Section title (Lightning decoration OFF)
--------------------------------- */
body.company-page #contact h2{
  text-align: center !important;
  margin: 0 0 18px !important;
  font-weight: 600 !important;
  letter-spacing: 0.08em;
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
}
body.company-page #contact h2::before,
body.company-page #contact h2::after{
  content: none !important;
  display: none !important;
}
body.company-page #contact h2 span{
  display: block;
  margin-top: 8px;
  font-size: 0.8em;
  opacity: 0.6;
  color: #fbb03b;
  font-weight: 600;
}

.cp-contact-lead{
  text-align: center;
  margin: 0 0 32px;
  font-size: 14px;
}

/* ---------------------------------
   Form white box (PC)
--------------------------------- */
.cp-contact-form .wpcf7-form{
  max-width: 900px;
  margin: 0 auto 40px;
  background: #fff;
  padding: 36px 48px;
  border-radius: 4px;
  box-sizing: border-box;
}

/* rows (PC) */
.cp-contact-form .cp-row{
  display: flex;
  align-items: flex-start;
  gap: 32px;
  margin: 0 0 18px;
}
.cp-contact-form .cp-row__label{
  flex: 0 0 140px;
  font-size: 14px;
  padding-top: 8px;
}
.cp-contact-form .cp-row__label .req{
  color: #f29c1f;
  margin-left: 4px;
  font-size: 12px;
}
.cp-contact-form .cp-row__field{ flex: 1; }

/* input parts */
.cp-contact-form .wpcf7-text,
.cp-contact-form .wpcf7-tel,
.cp-contact-form .wpcf7-email,
.cp-contact-form .wpcf7-textarea{
  width: 100%;
  max-width: 100%;
  background: #f5f5f5;
  border: 1px solid #e2e2e2;
  border-radius: 0;
  padding: 10px 12px;
  font-size: 14px;
  box-sizing: border-box;
}
.cp-contact-form .wpcf7-textarea{ min-height: 180px; }

/* submit */
.cp-contact-form p.submit-area{
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin: 28px 0 0 !important;
  padding: 0 !important;
  text-align: center;
}
.cp-contact-form .wpcf7-submit{
  display: inline-block;
  margin: 0 auto !important;
  padding: 10px 60px;
  border-radius: 5px;
  background: #f2a620;
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 14px;
}

/* CF7 extra spacing reset */
.cp-contact-form fieldset{
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}
.cp-contact-form .wpcf7-spinner{ display:none; }

/* ---------------------------------
   Tel box (PC)
--------------------------------- */
.cp-contact-telbox{
  max-width: 900px;
  margin: 40px auto 0;
  background: #fff;
  padding: 36px 48px;
  border-radius: 4px;
  text-align: center;
  box-sizing: border-box;
}

/* Lightning decoration OFF for h3 (unified) */
body.company-page #contact .cp-contact-telbox h3{
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 0 8px !important;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-align: center;
  font-size: 18px;
}
body.company-page #contact .cp-contact-telbox h3::before,
body.company-page #contact .cp-contact-telbox h3::after{
  content: none !important;
  display: none !important;
}

.cp-contact-telbox .cp-contact-tel{
  font-size: 32px;
  font-weight: 700;
  margin: 12px 0 20px;
}
.cp-contact-telbox .cp-contact-tel a{
  color: inherit;
  text-decoration: none;
}
.cp-contact-telbox .cp-contact-tel a:hover{ opacity: 0.7; }

.cp-contact-info{
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px 20px;
  margin-top: 10px;
}
.cp-contact-info .tag{
  background: #f2b33d;
  color: #fff;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 13px;
}
.cp-contact-info .info{
  font-size: 14px;
  padding-top: 4px;
}

/* ---------------------------------
   CF7 message (PC)
--------------------------------- */
#contact .wpcf7-response-output{
  white-space: pre-line;
  border: 2px solid #f5b461 !important;
  background: #fff9e8 !important;
  color: #333 !important;
  padding: 16px 24px;
  margin: 24px auto 0;
  max-width: 900px;
  box-sizing: border-box;
}

/* ---------------------------------
   SP (<=768px) : layout + white box gutters
--------------------------------- */
@media (max-width: 768px){

  /* セクション余白 */
  body.company-page section#contact.cp-contact{
    padding: 56px 16px;
    margin-top: 32px;
  }
  body.company-page section#contact.cp-contact::before{
    width: calc(100% - 32px);
  }

  /* 白BOXの左右余白量（好みで調整） */
  :root{
    --contact-box-gutter: 16px; /* 16〜20px */
  }

  /* フォーム白BOX：左右に余白を残す + 縦並び */
  .cp-contact-form .wpcf7-form{
    width: calc(100% - (var(--contact-box-gutter) * 2));
    max-width: 520px;          /* 不要なら削除OK */
    margin: 0 auto 28px;
    padding: 20px 16px;
    box-sizing: border-box;
  }

  .cp-contact-form .cp-row{
    flex-direction: column;
    gap: 8px;
  }
  .cp-contact-form .cp-row__label{
    flex: 0 0 auto;
    padding-top: 0;
  }

  /* 入力要素：はみ出し事故を潰す */
  .cp-contact-form .cp-row__field,
  .cp-contact-form .wpcf7-form-control-wrap,
  .cp-contact-form input,
  .cp-contact-form textarea{
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* 電話BOX：左右に余白を残す */
  .cp-contact-telbox{
    width: calc(100% - (var(--contact-box-gutter) * 2));
    max-width: 520px;          /* 不要なら削除OK */
    margin: 0 auto;
    padding: 28px 20px;
    box-sizing: border-box;
  }
  .cp-contact-telbox .cp-contact-tel{
    font-size: 26px;
  }
  .cp-contact-info{
    flex-direction: column;
    gap: 10px;
  }

  /* 送信後メッセージも白BOX幅に揃える */
  #contact .wpcf7-response-output{
    width: calc(100% - (var(--contact-box-gutter) * 2));
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
  }
}

.sp-only{ display: none; }

@media (max-width: 768px){
  .sp-only{ display: inline; }

  .cp-contact-lead{
    padding: 0 8px;
    line-height: 1.8;
  }
}



/* ---------------------------------
   企業情報
--------------------------------- */

/* セクション全体 */
#profile.cp-sec{
  background: #fff;
  padding: 120px 0 80px;
}

.profile-sec h2{
  text-align: center;
  margin-bottom: 50px;
}

/* レイアウト本体（PC） */
.profile-wrap{
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 60px;
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 40px;
  align-items: start;

  position: relative;
  z-index: 0;
}

/* ずらして敷くクリーム色BOX（PCのみ） */
.profile-wrap::before{
  content: "";
  position: absolute;
  top: -8%;
  bottom: 3%;
  left: 30%;
  transform: translateX(-50%);
  width: 60%;
  height: 350px;
  background: #faf8e9;
  z-index: -1;
}

/* 左：企業情報リスト */
.profile-left .profile-list{
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 15px;
  line-height: 2;
  font-weight: 500;
}

/* 右：写真 */
.profile-right{
  position: relative;
}

.big-photo img{
  width: 75%;
  border-radius: 2px;
  object-fit: cover;
  display: block;
}

.sub-photos{
  position: absolute;
  right: 60px;
  top: 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sub-photos img{
  width: 160px;
  height: auto;
  border-radius: 2px;
  object-fit: cover;
  display: block;
}

/* --------- キャプション＆ボタン（PC：右側寄せの見た目を維持） --------- */
.profile-caption{
  position: relative;
  z-index: 1;
  text-align: right;
  margin: 20px 0 10px;
  width: fit-content;
  margin-left: 68%; /* 現状の見た目踏襲：右側へ寄せる */
  font-size: 16px;
}

.profile-btn-wrap{
  position: relative;
  z-index: 1;
  text-align: right;
  margin: 0 0 30px 65%;
  width: fit-content;
}

.profile-btn{
  background: #8b5a30;
  color: #fff;
  padding: 10px 36px;
  border-radius: 6px;
  font-size: 14px;
  display: inline-block;
}

/* ========= タブレット調整（～860px） ========= */
@media (max-width: 860px){
  .profile-wrap{
    grid-template-columns: 1fr;
    padding: 0 24px;
  }

  /* サブ写真は横並びへ（この幅帯の破綻防止） */
  .sub-photos{
    position: relative;
    right: 0;
    top: 0;
    flex-direction: row;
    margin-top: 12px;
  }
  .sub-photos img{
    width: 48%;
  }

  /* キャプション＆ボタン：寄せ量を弱めて破綻防止（見た目は右寄せ維持） */
  .profile-caption{
    margin-left: auto;
    margin-right: 24px;
  }
  .profile-btn-wrap{
    margin-left: auto;
    margin-right: 24px;
  }
}

/* ========= SP調整（～768px） ========= */
@media (max-width: 768px){

  /* レイアウトを縦並びに */
  .profile-wrap{
    display: block;
    padding: 0 16px;
  }

  /* PC用のずらし背景を無効化 */
  .profile-wrap::before{
    content: none;
  }

  /* 会社情報リスト側に背景を直接付ける */
  .profile-left{
    background: #faf8e9;
    padding: 24px 20px;
    margin-bottom: 24px;
  }

  /* 文字サイズ・行間をSP向けに */
  .profile-left .profile-list{
    font-size: 14px;
    line-height: 1.9;
  }

  /* 写真まわり */
  .profile-right{
    position: static;
  }
  .big-photo img{
    width: 100%;
  }

  .sub-photos{
    position: static;
    flex-direction: row;
    gap: 12px;
    margin-top: 12px;
  }
  .sub-photos img{
    width: 48%;
  }

  /* キャプション＆ボタン：SPは自然な縦積み（ズラし無効） */
  .profile-caption{
    text-align: left;
    width: auto;
    margin: 16px 0 12px;
    margin-left: 0;
    margin-right: 0;
    padding: 0 16px; /* 端末で詰まらないように */
  }

  .profile-btn-wrap{
    text-align: right;
    width: 100%;
    margin: 0;
    padding: 0 16px;
  }
}

/* =========================
   企業情報：タイトル装飾OFF（Lightning対策）
========================= */
body.company-page #profile h2{
  text-align: center !important;
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
}

/* Lightningの疑似要素（線・装飾）を完全に無効化 */
body.company-page #profile h2::before,
body.company-page #profile h2::after{
  content: none !important;
  display: none !important;
}

/* 企業情報：SPでも設備紹介と同じ太さに揃える */
body.company-page #profile h2{
  font-weight: 600 !important;
}



/* =========================
  フローティングボタン
========================= */
/* ========== スクロール追従 お問い合わせボタン ========== */

.cp-float-contact{
  position: fixed;
  right: 50px;
  bottom: 220px;
  z-index: 60;
}

.cp-float-contact a{
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 120px;
  height: 120px;
  text-align: center;
  border-radius: 50%;
  background: #f8eed6;
  color: #333;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  overflow: hidden;
  padding-top: 15px;
}

.cp-float-contact__text{
  font-size: 14px;
  line-height: 1.3;
  font-weight: 600;
  margin-bottom: 6px;
}

.cp-float-contact__icon img{
  width: 50px;
  height: 50px;
  object-fit: contain;
  display: block;
  margin-top: 4px;
}

/* hover overlay */
.cp-float-contact a::before{
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none; /* ← 追加：クリック阻害防止 */
}
.cp-float-contact a:hover::before{ opacity: 1; }

/* SP */
@media (max-width: 768px){
  .cp-float-contact{
    right: 16px;
    bottom: 16px;  /* 被るなら 84px などに */
    z-index: 60;
  }

  .cp-float-contact a{
    width: 95px;
    height: 95px;
    padding-top: 8px;
  }

  .cp-float-contact__text{
    font-size: 11px;
    line-height: 1.2;
    margin-bottom: 2px;
  }

  .cp-float-contact__icon img{
    width: 30px;
    height: 30px;
    margin-top: 3px;
  }
}

/* SP：×（Close）だけ消して、ハンバーガーボタンは残す */
@media (max-width: 768px){
  /* ×に見えているのは bars の疑似要素で作られていることが多い */
  .cp-nav-toggle[aria-expanded="true"] .cp-nav-toggle__bars::before,
  .cp-nav-toggle[aria-expanded="true"] .cp-nav-toggle__bars::after{
    display: none !important;
  }
}

