@charset "UTF-8";
/* =============================================================
   casestory.css
   専用ページ : page ID 4242 「サイポチ」M&A成約インタビュー
   テンプレート : page-4242.php
   読み込み : functions.php → add_stylesheet() で当ページのみ
   ベース : 1rem = 10px / メイン緑 #13692b / SP ブレイク 767px
   ============================================================= */

/* ---------- カラートークン ---------- */
.p-casestory {
  --cs-green: #13692b;
  --cs-green-bright: #00a05c;
  --cs-tint: #f1f8f5;
  --cs-tint2: #e7f0e9;
  --cs-ink: #38281e;
  --cs-ink-soft: #2d2a28;
  --cs-muted: #887e78;
  --cs-line: #e3efe3;
  --cs-bg: #f6f7f9;
}

/* =============================================================
   1. ヒーロー
   ============================================================= */
.p-casestory__hero {
  position: relative;
  overflow: hidden;
  padding: 88px 0 64px;
  background: radial-gradient(120% 120% at 100% 0%, var(--cs-tint) 0%, #ffffff 60%);
  border-bottom: 1px solid var(--cs-line);
}

.p-casestory__hero .l-wrapper {
  position: relative;
  z-index: 1;
}

.p-casestory__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  letter-spacing: 0.22em;
  color: var(--cs-green);
}
.p-casestory__eyebrow::before {
  content: '';
  width: 48px;
  height: 1px;
  background: var(--cs-green);
}

.p-casestory__category {
  display: inline-block;
  margin-top: 18px;
  padding: 6px 18px;
  background: var(--cs-green);
  color: #fff;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  border-radius: 100px;
}

.p-casestory__title {
  max-width: 1024px;
  margin: 22px auto 0;
  font-size: 2.6rem;
  line-height: 1.6;
  font-weight: 700;
  color: var(--cs-green);
}

.p-casestory__subTitle {
  display: block;
  max-width: 1024px;
  margin: 12px auto 0;
  font-size: 2.6rem;
  line-height: 1.6;
  font-weight: 500;
  color: var(--cs-green);
}

/* =============================================================
   2. パンくず（共通スタイルに最小の余白調整のみ）
   ============================================================= */
.p-casestory__breadcrumb {
  margin: 22px auto 0 0;
}

/* =============================================================
   3. 本文ラッパー
   ============================================================= */
.p-casestory__content {
  padding: 0 0 104px;
}
.p-casestory__body {
  max-width: 860px;
  margin: 0 auto;
  font-size: 1.6rem;
  line-height: 2.05;
  letter-spacing: 0.03em;
  color: var(--cs-ink);
}

/* 空の段落（エディタ由来の <p></p>）は詰める */
.p-casestory__body > p:empty {
  display: none;
}

/* 通常段落 */
.p-casestory__body > p {
  margin: 0 0 1.5em;
}
.p-casestory__body strong {
  font-weight: 700;
}
.p-casestory__body a {
  color: var(--cs-green);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* =============================================================
   4. 冒頭ビジュアル & リード文
   ============================================================= */
/* 先頭の集合写真をヒーロー画像として大きく */
.p-casestory__body > figure:first-child {
  margin: 0 0 44px;
}
.p-casestory__body > figure:first-child img {
  width: 100%;
  border-radius: 16px;
}

/* リード文（先頭画像の直後の段落／企業概要テーブル直後の段落）。
   テーブルブロック挿入時はリード文がテーブルの後ろに来るため両方を対象にする。 */
.p-casestory__body > figure:first-child + p,
.p-casestory__body > .wp-block-columns:has(.wp-block-table) + p {
  margin: 0 0 1.4em;
  font-size: 1.85rem;
  line-height: 1.95;
  font-weight: 500;
  color: var(--cs-ink-soft);
  text-align: left;
}

/* =============================================================
   5. セクション見出し（h2）
   ============================================================= */
.p-casestory__body > h2.wp-block-heading {
  position: relative;
  margin: 2.6em 0 1.1em;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--cs-line);
  font-size: 2.7rem;
  line-height: 1.5;
  font-weight: 700;
  color: var(--cs-green);
  letter-spacing: 0.05em;
}
.p-casestory__body > h2.wp-block-heading::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 88px;
  height: 3px;
  background: var(--cs-green);
}

/* =============================================================
   6. 質問見出し（h3 = インタビュアーの問い）
   ============================================================= */
.p-casestory__body > h3.wp-block-heading {
  margin: 2.6em 0 1.3em;
  padding: 20px 28px;
  background: var(--cs-bg);
  border-radius: 12px;
  font-size: 1.9rem;
  line-height: 1.65;
  font-weight: 700;
  color: var(--cs-ink-soft);
  letter-spacing: 0.03em;
}
.p-casestory__body > h3.wp-block-heading strong {
  font-weight: 700;
}

/* =============================================================
   7. 回答段落 & 話者ラベル
      <p><strong>田中様：</strong><br>…</p> の strong を緑のタグ化
   ============================================================= */
/* 新しい話者の段落だけ手前に余白を足して発話を区切る（:has 対応ブラウザ） */
.p-casestory__body > p:has(> strong:first-child) {
  margin-top: 2.2em;
}
.p-casestory__body > p > strong:first-child {
  display: inline-block;
  color: var(--cs-green);
}

/* =============================================================
   8. 本文中の画像とキャプション
   ============================================================= */
.p-casestory__body figure.wp-block-image {
  margin: 44px auto;
  text-align: center;
}
.p-casestory__body figure.wp-block-image img {
  max-width: 100%;
  height: auto;
  border-radius: 14px;
  box-shadow: 0 14px 36px rgba(19, 105, 43, 0.1);
}
.p-casestory__body .wp-element-caption {
  margin-top: 14px;
  font-size: 1.3rem;
  line-height: 1.7;
  color: var(--cs-muted);
  text-align: center;
}

/* 画像直後の手書きキャプション段落（例:「(左から)…」）。
   先頭リード文はより詳細度の高い :first-child ルールが優先される。 */
.p-casestory__body > figure + p {
  margin: 10px auto 48px;
  font-size: 1.3rem;
  line-height: 1.7;
  color: var(--cs-muted);
  text-align: center;
}

/* =============================================================
   8.5 企業概要 比較テーブル（譲渡企業 → 譲受企業）
       マークアップ : 3カラムの wp-block-columns
       [会社カラム] [空カラム(80px)=矢印] [会社カラム]
       各社カラムは <h4> + <figure.wp-block-table>
   ============================================================= */
.p-casestory__body > .wp-block-columns:has(.wp-block-table) {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0;
  margin: 40px 0 48px;
}

/* 会社カード（中身のあるカラム） */
.p-casestory__body > .wp-block-columns:has(.wp-block-table) > .wp-block-column:not(:empty) {
  flex: 1 1 0;
  margin: 0;
  padding: 30px 34px 34px;
  background: #fff;
  border: 1px solid #e2e5ea;
  border-radius: 10px;
  box-shadow: 0 8px 26px rgba(19, 105, 43, 0.06);
  box-sizing: border-box;
}

/* 中央の矢印（空カラム = flex-basis:80px） */
.p-casestory__body > .wp-block-columns:has(.wp-block-table) > .wp-block-column:empty {
  flex: 0 0 80px;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
}
.p-casestory__body > .wp-block-columns:has(.wp-block-table) > .wp-block-column:empty::before {
  content: '→';
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  font-size: 2.8rem;
  font-weight: 400;
  line-height: 1;
  color: var(--cs-green);
}

/* カード見出し（譲渡企業 / 譲受企業） */
.p-casestory__body > .wp-block-columns:has(.wp-block-table) h4 {
  margin: 0 0 18px;
  padding: 0 0 16px;
  border-bottom: 1px solid #e2e5ea;
  text-align: center;
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--cs-ink-soft);
}

/* テーブル本体 */
.p-casestory__body > .wp-block-columns:has(.wp-block-table) .wp-block-table {
  margin: 0;
}
.p-casestory__body > .wp-block-columns:has(.wp-block-table) table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1.5rem;
  line-height: 1.7;
}
.p-casestory__body > .wp-block-columns:has(.wp-block-table) td {
  padding: 9px 0;
  border: none;
  vertical-align: top;
  text-align: left;
}
/* 項目名（左セル） */
.p-casestory__body > .wp-block-columns:has(.wp-block-table) td:first-child {
  width: 6em;
  padding-right: 18px;
  white-space: nowrap;
  font-weight: 700;
  color: var(--cs-ink-soft);
}
/* 内容（右セル） */
.p-casestory__body > .wp-block-columns:has(.wp-block-table) td:last-child {
  color: var(--cs-ink);
}

/* =============================================================
   9. 末尾「コンサルタントより」カード（wp-block-columns:has(h2)）
   ============================================================= */
.p-casestory__body > .wp-block-columns:has(h2) {
  display: flex;
  gap: 44px;
  align-items: flex-start;
  margin: 72px 0 0;
  padding: 64px 48px 48px;
  background: linear-gradient(135deg, var(--cs-tint) 0%, var(--cs-tint2) 100%);
  border-radius: 18px;
  position: relative;
}
.p-casestory__body > .wp-block-columns:has(h2)::before {
  content: "CONSULTANT'S VOICE";
  position: absolute;
  top: 28px;
  left: 48px;
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  letter-spacing: 0.18em;
  color: var(--cs-green);
}
.p-casestory__body > .wp-block-columns:has(h2) > .wp-block-column {
  margin: 0;
}
.p-casestory__body > .wp-block-columns:has(h2) figure {
  margin: 0;
}
.p-casestory__body > .wp-block-columns:has(h2) img {
  width: 100%;
  height: auto;
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(19, 105, 43, 0.14);
}
/* 役職ラベル（右カラム先頭の段落） */
.p-casestory__body > .wp-block-columns:has(h2) > .wp-block-column > p:first-child {
  margin: 0;
  color: var(--cs-muted);
  font-size: 1.3rem;
  letter-spacing: 0.08em;
}
/* 担当者名 */
.p-casestory__body > .wp-block-columns:has(h2) h2 {
  margin: 4px 0 18px;
  padding: 0;
  border: none;
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--cs-green);
  letter-spacing: 0.06em;
}
.p-casestory__body > .wp-block-columns:has(h2) h2::after {
  display: none;
}
.p-casestory__body > .wp-block-columns:has(h2) p {
  margin: 0 0 1.1em;
  font-size: 1.5rem;
  line-height: 1.95;
}
.p-casestory__body > .wp-block-columns:has(h2) p:last-child {
  margin-bottom: 0;
}

/* =============================================================
   10. レスポンシブ（SP : ~767px）
   ============================================================= */
@media screen and (max-width: 767px) {
  .p-casestory__hero {
    padding: 13vw 0 9vw;
  }
  .p-casestory__eyebrow {
    font-size: 3.2vw;
    gap: 10px;
  }
  .p-casestory__eyebrow::before {
    width: 28px;
  }
  .p-casestory__category {
    margin-top: 3.5vw;
    font-size: 3.2vw;
  }
  .p-casestory__title {
    margin-top: 4vw;
    font-size: 5.4vw;
    line-height: 1.65;
  }

  .p-casestory__content {
    padding: 0 0 16vw;
  }
  .p-casestory__body {
    font-size: 3.7vw;
    line-height: 2;
  }

  .p-casestory__body > figure:first-child {
    margin-bottom: 8vw;
  }
  .p-casestory__body > figure:first-child img,
  .p-casestory__body figure.wp-block-image img {
    border-radius: 10px;
  }
  .p-casestory__body > figure:first-child + p {
    font-size: 4.1vw;
  }

  .p-casestory__body > h2.wp-block-heading {
    font-size: 5vw;
    padding-bottom: 3vw;
    margin: 12vw 0 5vw;
  }
  .p-casestory__body > h3.wp-block-heading {
    font-size: 4.1vw;
    padding: 4vw 4.5vw;
    margin: 10vw 0 5vw;
  }

  .p-casestory__body > p > strong:first-child {
    font-size: 3.5vw;
  }

  .p-casestory__body figure.wp-block-image {
    margin: 8vw auto;
  }

  /* 企業概要テーブルは上から下へ縦積み、矢印は下向き */
  .p-casestory__body > .wp-block-columns:has(.wp-block-table) {
    flex-direction: column;
    gap: 0;
    margin: 8vw 0 10vw;
  }
  .p-casestory__body > .wp-block-columns:has(.wp-block-table) > .wp-block-column:not(:empty) {
    width: 100% !important;
    flex: 1 1 auto;
    padding: 6vw 6vw 7vw;
  }
  .p-casestory__body > .wp-block-columns:has(.wp-block-table) > .wp-block-column:empty {
    flex: 0 0 auto;
    width: 100% !important;
    min-height: 12vw;
  }
  .p-casestory__body > .wp-block-columns:has(.wp-block-table) > .wp-block-column:empty::before {
    content: '↓';
    font-size: 6.5vw;
  }
  .p-casestory__body > .wp-block-columns:has(.wp-block-table) h4 {
    font-size: 4.4vw;
  }
  .p-casestory__body > .wp-block-columns:has(.wp-block-table) table {
    font-size: 3.6vw;
  }
  .p-casestory__body > .wp-block-columns:has(.wp-block-table) td:first-child {
    width: 6.5em;
  }

  /* コンサルタントカードは縦積み */
  .p-casestory__body > .wp-block-columns:has(h2) {
    flex-direction: column;
    gap: 6vw;
    margin-top: 12vw;
    padding: 14vw 6vw 8vw;
    border-radius: 14px;
  }
  .p-casestory__body > .wp-block-columns:has(h2)::before {
    top: 6vw;
    left: 6vw;
    font-size: 3.2vw;
  }
  .p-casestory__body > .wp-block-columns:has(h2) > .wp-block-column {
    flex-basis: auto !important;
    width: 100% !important;
  }
  .p-casestory__body > .wp-block-columns:has(h2) h2 {
    font-size: 5vw;
  }
  .p-casestory__body > .wp-block-columns:has(h2) p {
    font-size: 3.6vw;
  }
}
