/* ============================================================
   common/style.css — 全ページ共通：変数 / フォント / レイアウト基盤 /
                       header / footer / 追従CVボタン / 共通ボタン
   ============================================================
   ブレイクポイント：750px（749以下=SP / 750以上=PC）
   PC：1240px固定設計、Figma実寸ピクセルパーフェクト
   SP：335基準の min(calc()) で可変
   ============================================================ */

/* --- 変数 ----------------------------------------------- */
:root {
  /* カラー */
  --color-brand: #dc2626;          /* メインレッド（category/悩み・ロゴ・アクセント） */
  --color-accent-red: #dc2626;     /* alias（既存参照保持用） */
  --color-red-deep: #b50d34;       /* 深紅（強調テキスト red：チェック帯等） */
  --color-text: #2c2d2b;           /* 本文テキスト */
  --color-text-sub: #1a1a1a;       /* サブテキスト */
  --color-border: #e2e8f0;         /* 罫線 */
  --color-bg: #ffffff;             /* ベース背景 */
  --color-gold-bg: #f4ecc8;        /* 黄色いラインハイライト */
  --color-yellow: #fec83c;         /* ボタングラデ起点 */
  --color-yellow-strong: #ffb700;  /* ボタングラデ終点 */

  /* 寸法 */
  --header-h-pc: 117px;
  --header-h-sp: 90px;
  --container-w: 1240px;
  --content-pad-sp: calc(30 / 750 * 100vw);
  --pc-gutter: 20px;               /* PCコンテンツ枠の左右最小余白（端に張り付かないように。15/20で調整） */

  /* フォント */
  --font-jp: "Noto Sans JP", "ヒラギノ角ゴ ProN", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", YuGothic, Meiryo, sans-serif;
  --font-handwrite: "Klee One", "Yu Gothic", YuGothic, sans-serif;

  /* z-index */
  --z-header: 100;
  --z-cv-fixed: 90;
  --z-menu: 110;
}

/* --- ベース ----------------------------------------------- */
html {
  scroll-behavior: smooth;
  /* 固定ヘッダー分だけアンカー遷移位置を下げる（全アンカー共通／PC・SP両対応） */
  scroll-padding-top: var(--header-h-pc);
}

body {
  font-family: var(--font-jp);
  font-weight: 400;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.5;
  min-width: var(--container-w);           /* PC：1240px下回ったら横スクロール */
  padding-top: var(--header-h-pc);         /* fixed headerぶんの余白 */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media (max-width: 749px) {
  html { scroll-padding-top: var(--header-h-sp); }
  body {
    min-width: 0;
    padding-top: var(--header-h-sp);
  }
}

/* --- ユーティリティ --------------------------------------- */
.common-container {
  width: min(var(--container-w), calc(100% - var(--pc-gutter) * 2));
  margin-inline: auto;
}

/* PC/SP 出し分け改行：<br class="br-pc"> はPCのみ、<br class="br-sp"> はSPのみ改行 */
.br-sp { display: none; }

@media (max-width: 749px) {
  .common-container {
    width: 100%;
    padding-inline: var(--content-pad-sp);
  }
  .br-pc { display: none; }
  .br-sp { display: inline; }
}

/* --- 共通 h2（セクション見出し） -----------------------------
   仕様：36px Noto Sans JP Bold / line-height 56 / 文字色 #1a1a1a
   赤強調は <span class="common-h2-em">…</span>（#dc2626）
   下：2px ゴールド(#B17612)横線 ＋ 中央下にフキダシ状の斜線（"/"）
   ※テキスト色(--h2-color)と装飾線色(--h2-line-color)は別物。
     ダーク背景セクションは --h2-line-color を上書きする。
   フキダシ線は ::after。Figma Vector25(path M24,1→L1,22 / 23×21px /
     stroke 2 round)を rotate 47.6deg・中央配置で再現
   ------------------------------------------------------------ */
/* ★ --h2-* はここで「宣言」しない。宣言すると祖先セクションの上書きが
     継承で届かなくなる（要素自身の宣言が継承値に勝つため）。
     代わりに var() のフォールバックで既定値を与え、上書きはセクション側で行う。 */
.common-h2 {
  position: relative;
  display: inline-block;
  font-family: var(--font-jp);
  font-weight: 700;
  font-size: 36px;
  line-height: 56px;
  color: var(--h2-color, var(--color-text-sub));
  padding-bottom: 10px;
  border-bottom: 2px solid var(--h2-line-color, #b17612);
  text-align: center;
}
.common-h2-em {
  color: var(--h2-em-color, var(--color-brand));
}
.common-h2::after {
  content: "";
  position: absolute;
  top: 100%;                    /* 下線の直下から始める */
  left: 50%;                    /* 見出し中央 */
  width: 2px;
  height: 31px;                 /* √(23²+21²)≈31.1px */
  background: var(--h2-line-color, #b17612);
  border-radius: 1px;           /* stroke-linecap: round 相当 */
  transform-origin: top center;
  transform: translateX(-50%) rotate(47.6deg);  /* "/"：上=右・下=左 */
}

@media (max-width: 749px) {
  .common-h2 {
    font-size: min(calc(56 / 750 * 100vw), 56px);
    line-height: 1.5;
    padding-bottom: calc(20 / 750 * 100vw);
  }
  .common-h2::after {
    height: min(calc(60 / 750 * 100vw), 60px);
  }
}

/* ============================================================
   header — PC・SPとも上部固定。高さ固定。
   ============================================================ */
.common-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-header);
  background: #fff;
  border-bottom: 1px solid var(--color-border);
}

.common-header-inner {
  width: min(var(--container-w), calc(100% - var(--pc-gutter) * 2));
  height: var(--header-h-pc);
  margin-inline: auto;
  padding-block: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

.common-header-logo-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
}

.common-header-subtitle {
  font-size: 18px;
  line-height: 28px;
  letter-spacing: 1.44px;
  font-weight: 400;
  color: var(--color-text-sub);
  margin: 0;
}

.common-header-logo {
  display: block;
  width: 372.81px;
  height: 37px;
}

.common-header-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.common-header-nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.common-header-nav-link {
  font-size: 18px;
  line-height: 1;
  font-weight: 500;
  color: var(--color-text);
  white-space: nowrap;
  transition: opacity 0.2s;
}

.common-header-nav-link:hover { opacity: 0.6; }

/* SPハンバーガー（CSS描画） */
.common-header-menu-btn {
  display: none;
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--color-brand);
  flex-shrink: 0;
}

.common-header-menu-btn span {
  position: absolute;
  left: 50%;
  width: 20px;
  height: 2px;
  background: #fff;
  border-radius: 20px;
  transform: translateX(-50%);
  transition: transform 0.2s, top 0.2s, opacity 0.2s;
}
.common-header-menu-btn span:nth-child(1) { top: 11px; }
.common-header-menu-btn span:nth-child(2) { top: 18px; }
.common-header-menu-btn span:nth-child(3) { top: 25px; }

/* メニュー開時：× に変形 */
.common-header-menu-btn[aria-expanded="true"] span:nth-child(1) {
  top: 18px;
  transform: translateX(-50%) rotate(45deg);
}
.common-header-menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.common-header-menu-btn[aria-expanded="true"] span:nth-child(3) {
  top: 18px;
  transform: translateX(-50%) rotate(-45deg);
}

/* SPメディアクエリ：ナビ非表示・ハンバーガー表示・サイズ調整 */
@media (max-width: 749px) {
  .common-header-inner {
    width: 100%;
    height: var(--header-h-sp);
    padding: calc(40 / 750 * 100vw);
    gap: 0;
  }
  .common-header-logo-block {
    gap: 10px;
  }
  .common-header-subtitle {
    font-size: 12px;
    line-height: 28px;
    letter-spacing: 0.96px;
  }
  .common-header-logo {
    width: 240px;
    height: 24px;
  }
  .common-header-nav { display: none; }
  .common-header-menu-btn { display: block; }
}

/* SP メニューパネル（ハンバーガー展開時） — Figma: 赤背景・白文字・白区切り */
.common-header-menu-panel {
  position: fixed;
  top: var(--header-h-sp);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: var(--z-menu);
  background: var(--color-brand);
  padding: 0;
  overflow-y: auto;
  display: none;               /* 閉じ時は完全に消す＝右外へのはみ出し(横スクロール)を出さない */
}

.common-header-menu-panel[data-open="true"] {
  display: block;
  animation: common-menu-slide-in 0.3s ease;   /* 開く時だけ右からスライドイン */
}
@keyframes common-menu-slide-in {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}
.common-header-menu-panel-nav {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.common-header-menu-panel-link {
  display: flex;
  align-items: center;
  gap: calc(20 / 750 * 100vw);
  font-size: min(calc(36 / 750 * 100vw), 36px);
  font-weight: 500;
  color: #fff;
  padding: calc(60 / 750 * 100vw) calc(40 / 750 * 100vw);
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}
.common-header-menu-panel-link-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(calc(48 / 750 * 100vw), 48px);
  height: min(calc(48 / 750 * 100vw), 48px);
  background: #fff;
  border-radius: calc(24 / 750 * 100vw);
  flex-shrink: 0;
}
.common-header-menu-panel-link-icon img {
  width: min(calc(36 / 750 * 100vw), 36px);
  height: min(calc(36 / 750 * 100vw), 36px);
  display: block;
}
.common-header-menu-panel-cta {
  padding: calc(120 / 750 * 100vw) calc(40 / 750 * 100vw) calc(60 / 750 * 100vw);
  display: flex;
  justify-content: center;
}
.common-header-menu-panel-btn {
  width: 100%;
  height: min(calc(140 / 750 * 100vw), 140px);
  font-size: min(calc(36 / 750 * 100vw), 36px);
}

@media (min-width: 750px) {
  .common-header-menu-panel { display: none; }
}

/* ============================================================
   footer — まずは枠だけ。具体実装はセクション着手時に追加。
   ============================================================ */
/* Figma：クリーム背景 #fffbeb。上段=ロゴ+タグライン / CTAボタン、
   下段=右寄せ3リンク+下罫線 / 中央コピーライト */
.common-footer {
  background: #fffbeb;
  color: var(--color-text-sub);
  padding-block: 60px;
}
.common-footer-inner {
  width: min(var(--container-w), calc(100% - var(--pc-gutter) * 2));
  margin-inline: auto;
}
.common-footer-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
  padding-bottom: 60px;
}
.common-footer-brand {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.common-footer-logo {
  display: block;
  width: 372px;
}
.common-footer-logo img {
  width: 100%;
  height: auto;
  display: block;
}
.common-footer-tagline {
  font-family: var(--font-jp);
  font-size: 18px;
  line-height: 34px;
  color: var(--color-text-sub);
  margin: 0;
}
.common-footer-cta {
  flex-shrink: 0;
  align-self: center;
}
/* フッターのCTAは共通ボタン(510×100)より小さいコンパクト版（Figma: max-w335 / px50 py18） */
.common-footer-cta.common-btn-primary {
  width: auto;
  max-width: 335px;
  height: auto;
  padding: 18px 50px;
  font-size: 28px;
}
.common-footer-cta .common-btn-primary-label .em { color: var(--color-brand); }
.common-footer-nav {
  display: flex;
  justify-content: flex-start;
  gap: 28px;
  padding: 20px 0;
  border-bottom: 1px solid var(--color-text-sub);
}
.common-footer-nav-link {
  font-family: var(--font-jp);
  font-size: 16px;
  line-height: 38px;
  color: var(--color-text-sub);
  text-decoration: underline;
  transition: opacity 0.2s;
}
.common-footer-nav-link:hover { opacity: 0.7; }
.common-footer-copyright {
  font-family: var(--font-jp);
  font-size: 14px;
  color: #000;
  text-align: center;
  padding-top: 20px;
  margin: 0;
}

@media (max-width: 749px) {
  .common-footer {
    padding-block: calc(120 / 750 * 100vw);
  }
  .common-footer-inner {
    width: 100%;
    padding-inline: calc(40 / 750 * 100vw);
  }
  .common-footer-top {
    flex-direction: column;
    align-items: stretch;
    gap: min(calc(20 / 750 * 100vw), 20px);
    padding-bottom: min(calc(120 / 750 * 100vw), 120px);
  }
  .common-footer-logo { width: 100%; }
  .common-footer-tagline {
    font-size: min(calc(36 / 750 * 100vw), 36px);
    line-height: min(calc(68 / 750 * 100vw), 68px);
    padding-bottom: min(calc(40 / 750 * 100vw), 40px);
  }
  .common-footer-cta { align-self: stretch; }
  .common-footer-cta.common-btn-primary {
    width: 100%;
    max-width: 100%;
    font-size: min(calc(56 / 750 * 100vw), 56px);
  }
  .common-footer-nav {
    justify-content: space-between;
    gap: 0;
    flex-wrap: nowrap;
    padding: min(calc(40 / 750 * 100vw), 40px) 0;
  }
  .common-footer-nav-link {
    font-size: min(calc(32 / 750 * 100vw), 32px);
    line-height: min(calc(76 / 750 * 100vw), 76px);
  }
  .common-footer-copyright { font-size: min(calc(28 / 750 * 100vw), 28px); }
}

/* ============================================================
   common-cv 帯（共通CVバンド：TOP複数箇所＋下層ページ共通）
   赤グラデ bg + 中央に白カード（和柄）。下端に円弧（楕円）で
   次セクション色へつなぐ。色は --cv-arc-color（既定 #fef9e6）。
   - .common-cv--white  次が白セクション
   - .common-cv--flow   次がflow（#F4ECC8）
   - .common-cv--footer 次がフッター（#fffbeb）＝下層ページの末尾CV
   SP（≤749px）はカード余白・タイトルを Figma SP 準拠に縮小（末尾の @media 参照）。
   ============================================================ */
.common-cv {
  --cv-arc-color: #fef9e6;
  position: relative;
  overflow: hidden;
  background: linear-gradient(to right, #c12638, #e64f50);
  padding: 60px 0;
}
.common-cv--white  { --cv-arc-color: #fff; }
.common-cv--flow   { --cv-arc-color: #F4ECC8; }
.common-cv--footer { --cv-arc-color: #fffbeb; }
/* 下端の円弧（Figma：1600×600 楕円・中央・上に約26pxはみ出す） */
.common-cv::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: calc(100% - 26px);
  width: 1600px;
  height: 600px;
  background: var(--cv-arc-color);
  border-radius: 50%;
  z-index: 0;
  pointer-events: none;
}
.common-cv-card {
  width: min(var(--container-w), calc(100% - var(--pc-gutter) * 2));
  margin: 0 auto;
  position: relative;
  z-index: 1;                 /* 円弧(::after)より前面 */
  background: #fff;
  border-radius: 30px;
  padding: 60px 40px;
  overflow: hidden;
  background-image: url('../../img/top/cv-bg_pc.png');
  background-size: cover;
  background-position: center;
}
.common-cv-card-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.common-cv-lead {
  font-family: var(--font-jp);
  font-weight: 700;
  font-size: 18px;
  line-height: 28px;
  color: var(--color-text-sub);
  margin-bottom: 12px;
}
.common-cv-title {
  font-family: var(--font-jp);
  font-weight: 900;
  font-size: 36px;
  line-height: 56px;
  letter-spacing: 0.1em;
  color: var(--color-text-sub);
  margin-bottom: 30px;
}
.common-cv-title .em {
  color: var(--color-brand);
  font-size: 46px;
  letter-spacing: 0.2em;
  padding: 0 4px;
}
/* 黄ハイライトは「全部無料」全体に敷く（Figma: line 幅190px） */
.common-cv-title-hl {
  display: inline-block;
  position: relative;
}
.common-cv-title-hl::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 5px;
  height: 14px;
  background: var(--color-gold-bg);
  z-index: -1;
}
/* ボタン＋赤バースト装飾（Figma：ボタン右上に「ポップ」3本線 57×63） */
.common-cv-btn-wrap {
  position: relative;
  display: inline-block;
  align-self: center;
}
.common-cv-btn { display: inline-flex; }
.common-cv-btn-deco {
  position: absolute;
  top: -26px;
  right: -35px;
  width: 48px;
  height: auto;
  pointer-events: none;
}

/* SP：Figma CTA帯（375）に合わせてカード余白とタイトルを縮小。
   カード幅・左右20px gutter・角丸30px・地色は PC値（min()式）のままでSP成立。 */
@media (max-width: 749px) {
  .common-cv-card {
    padding: min(calc(80 / 750 * 100vw), 60px) min(calc(40 / 750 * 100vw), 40px);
    background-image: url('../../img/top/cv-bg_sp.png');
  }
  .common-cv-lead {
    font-size: min(calc(36 / 750 * 100vw), 36px);
    line-height: min(calc(56 / 750 * 100vw), 28px);
    margin-bottom: min(calc(24 / 750 * 100vw), 12px);
    line-height: 155%;
  }
  .common-cv-title {
    font-size: min(calc(60 / 750 * 100vw), 60px);
    letter-spacing: 0.04em;
    margin-bottom: min(calc(40 / 750 * 100vw), 40px);
  }
  .common-cv-title .em {
    font-size: min(calc(92 / 750 * 100vw), 92px);
    letter-spacing: 0.1em;
    padding: 0 2px;
  }
  .common-cv-title-hl::before {
    height: min(calc(28 / 750 * 100vw), 28px);
    bottom:-10%;
  }
  /* CVボタンはカード内で全幅（common-btn-primaryのSP幅335pxを上書き）。
     高さ70px・文字18px・アイコン24px は common-btn-primary のSPで成立。 */
  .common-cv-btn-wrap {
    display: block;
    width: 100%;
  }
  .common-cv-btn-wrap .common-cv-btn { width: 100%; }
  /* 赤バースト装飾はSPでは非表示 */
  .common-cv-btn-deco { display: none; }
}

/* ============================================================
   追従CVボタン — 右端密着・縦書き・上にメールアイコン
   遷移先：
   - TOP（body[data-page="top"]）→ アンカー #cv-form
   - その他 → /contact
   ============================================================ */
.common-cv-fixed {
  position: fixed;
  right: 0;                 /* -2px だと2px右にはみ出して横スクロールの原因になるため0に */
  top: 50%;
  transform: translateY(-50%);
  z-index: var(--z-cv-fixed);

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;

  width: 60px;
  padding: 20px 2px 20px 0;

  border-radius: 16px 0 0 16px;

  background: linear-gradient(to bottom, var(--color-yellow), var(--color-yellow-strong));

  box-shadow: -3px 3px 8px rgba(0, 0, 0, 0.15);
  transition: right 0.2s, box-shadow 0.2s, opacity 0.3s ease, visibility 0.3s ease;
}

.common-cv-fixed:hover {
  right: 0;
  box-shadow: -5px 3px 12px rgba(0, 0, 0, 0.2);
}

/* SPで最下部のCVエリアが画面に入ったら自動で隠す（JSが付与） */
.common-cv-fixed.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.common-cv-fixed-icon {
  width: 24px;
  height: 24px;
  display: block;
  flex-shrink: 0;
}

.common-cv-fixed-label {
  writing-mode: vertical-rl;
  text-orientation: upright;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.2em;
  color: var(--color-text);
  line-height: 1.2;
}
.common-cv-fixed-label .em { color: var(--color-brand); }

@media (max-width: 749px) {
  .common-cv-fixed {
    width: min(calc(100 / 750 * 100vw), 120px);
    padding: min(calc(32 / 750 * 100vw), 40px) 0;
    gap: min(calc(16 / 750 * 100vw), 20px);
    border-radius: min(calc(24 / 750 * 100vw), 32px) 0 0 min(calc(24 / 750 * 100vw), 32px);
  }
  .common-cv-fixed-icon {
    width: min(calc(40 / 750 * 100vw), 48px);
    height: min(calc(40 / 750 * 100vw), 48px);
  }
  .common-cv-fixed-label {
    font-size: min(calc(28 / 750 * 100vw), 36px);
  }
}

/* ============================================================
   共通ボタン（黄色グラデの大型CTA：FV / CV帯で使用）
   ============================================================ */
.common-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;

  width: 510px;
  height: 100px;
  padding: 0 30px;
  border-radius: 200px;
  border: 3px solid #fff;

  background: linear-gradient(to bottom, var(--color-yellow), var(--color-yellow-strong));
  color: var(--color-text);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: 0.02em;
  white-space: nowrap;

  box-shadow: 3px 3px 5px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s;
}
.common-btn-primary:hover { transform: translateY(-2px); }

.common-btn-primary-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: block;
}

.common-btn-primary-label .em { color: var(--color-brand); }

@media (max-width: 749px) {
  .common-btn-primary {
    width: min(calc(670 / 750 * 100vw), 1020px);
    max-width: 100%;
    height: min(calc(140 / 750 * 100vw), 140px);
    gap: min(calc(16 / 750 * 100vw), 32px);
    font-size: min(calc(36 / 750 * 100vw), 36px);
  }
  .common-btn-primary-icon {
    width: min(calc(48 / 750 * 100vw), 48px);
    height: min(calc(48 / 750 * 100vw), 48px);
  }
}
