/* ============================================
   共通スタイル
   FUJITA築育サイト
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600&family=Zen+Kaku+Gothic+New:wght@400;500;700;900&display=swap');
@import url('variables.css');

/* -----------------------------------------------
   RubyfulV2 内蔵トグルボタンを非表示
   ヘッダーの「ふりがなを付ける」ボタンで制御するため不要
----------------------------------------------- */
.rubyful-toggle-hidden {
  display: none !important;
}

/* -----------------------------------------------
   MV（扉）の見出し＋導入文ラッパー（全下層ページ共通）
   heroの直下に絶対配置し、内側の見出し・導入文は通常フローで縦積みにする。
   これにより、iOSのふりがな表示で行が増えても見出しと導入文が重ならない
   （旧実装は個々のテキストを絶対配置していたため、行が増えると重なっていた）。
   縦位置(top)はページ別CSSで指定する（PC/SPで別値可）。
----------------------------------------------- */
.mv-textblock {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  padding: 0 4%; /* 導入文が画面端に触れないよう左右に余白（旧width:92%等の代替） */
  text-align: center;
  z-index: 2;
}
.mv-textblock > * {
  /* 見出し/導入文クラスに position:absolute や left/top/width/transform が
     直書きされているページ（craft・company系サブ等）でも、ラッパー内では必ず
     通常フローで縦積みさせる（旧・絶対配置用のプロパティを!importantで無効化）。 */
  position: static !important;
  left: auto !important;
  top: auto !important;
  width: auto !important;
  transform: none !important;
  margin-top: 0;
  margin-bottom: 0;
}


*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  font-size: var(--fs-base);
  color: var(--color-text);
  line-height: 1.7;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
  transition: opacity var(--transition);
}

a:hover {
  opacity: 0.8;
}

ul, ol {
  list-style: none;
}

/* -----------------------------------------------
   レイアウト共通
----------------------------------------------- */
.inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-sm);
}

/* -----------------------------------------------
   ヘッダー
----------------------------------------------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: var(--z-header);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px var(--space-md);
}

/* ふりがなボタン
   Figma仕様（PC: Group 394 / node 1025:13349）
   - 179×50px／背景白／文字#1C5191／18px Bold
   - 角丸60px／パディング 上下13px・左右3px
   - ボーダー3px solid #1C5191／ドロップシャドウあり
   - テキストは1行
*/
.btn-furigana {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 179px;
  height: 50px;
  background: var(--color-white);
  color: var(--color-blue-nav);
  font-family: var(--font-main);
  font-size: var(--fs-md); /* 18px */
  font-weight: 700;
  border: 3px solid var(--color-blue-nav);
  border-radius: 60px;
  padding: 13px 3px;
  cursor: pointer;
  transition: opacity var(--transition);
  white-space: nowrap;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-furigana:hover {
  opacity: 0.85;
}

.btn-furigana.is-active {
  background: var(--color-blue-nav);
  color: var(--color-white);
}

/* ハンバーガーボタン */
.btn-hamburger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  background: var(--color-green);
  border: none;
  border-radius: var(--radius-circle);
  cursor: pointer;
  transition: opacity var(--transition);
  flex-shrink: 0;
}

.btn-hamburger:hover {
  opacity: 0.85;
}

.btn-hamburger span,
.btn-hamburger span::before,
.btn-hamburger span::after {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-white);
  border-radius: 2px;
  position: relative;
  transition: var(--transition);
}

.btn-hamburger span::before,
.btn-hamburger span::after {
  content: '';
  position: absolute;
  left: 0;
}

.btn-hamburger span::before { top: -7px; }
.btn-hamburger span::after  { top:  7px; }

/* メニュー表示中はヘッダーのハンバーガーボタンを非表示
   （閉じる操作はポップアップ内の閉じるボタンのみ／Figma仕様） */
.btn-hamburger.is-open {
  opacity: 0;
  pointer-events: none;
}

/* -----------------------------------------------
   ナビゲーションメニュー（オーバーレイ）
----------------------------------------------- */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(14, 132, 92, 0.8); /* #0E845C × opacity 80%（Figma準拠） */
  z-index: var(--z-overlay);
}

.nav-overlay.is-open {
  display: block;
}

.nav-menu {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: 90vw;
  max-width: 1140px;
  max-height: 90vh; /* ウィンドウの高さが低い場合に画面外へはみ出さないための上限 */
  overflow-y: auto;  /* はみ出す分はメニュー内部でスクロール */
  -webkit-overflow-scrolling: touch;
  background: var(--color-white);
  border-radius: 40px;
  padding: 34px 52px 63px;
  z-index: var(--z-menu);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition), transform var(--transition);
}

.nav-menu.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

/* メニュー内：閉じるボタン
   画面基準のfixedにして、メニューが内部スクロールしても常に押せる位置に留める */
.nav-menu__close {
  position: fixed;
  top: var(--space-sm);
  right: var(--space-sm);
  z-index: calc(var(--z-menu) + 1);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--color-green);
  border: none;
  border-radius: var(--radius-circle);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.nav-menu.is-open .nav-menu__close {
  opacity: 1;
  pointer-events: auto;
}

.nav-menu__close:hover { opacity: 0.85; }

.nav-menu__close::before,
.nav-menu__close::after {
  content: '';
  display: block;
  width: 18px;
  height: 2px;
  background: var(--color-white);
  border-radius: 2px;
  position: absolute;
}

.nav-menu__close::before { transform: rotate(45deg); }
.nav-menu__close::after  { transform: rotate(-45deg); }

/* メニュー内：ロゴ＋説明 */
.nav-menu__logo {
  display: flex;
  align-items: center;
  gap: 34px;
  margin-bottom: var(--space-lg);
}

.nav-menu__logo img {
  width: 97px;
  height: 77px;
}

.nav-menu__logo p {
  font-size: 20px;
  font-weight: 700;
  color: #000000;
  letter-spacing: 2px;
  margin-top: 0;
}

/* メニュー内：カテゴリグリッド（PC:3カラム） */
.nav-menu__categories {
  display: grid;
  /* 2列目（仕事を知ろう）は「会社を支える縁の下の力もちって？」が長く1行に収まらないため、
     余裕のある1・3列から幅を少しずつ配分して2列目を確保する。
     3列目はタイトル「フジタってどんな会社？」が折り返さない幅を残す */
  grid-template-columns: 1.25fr 1.1fr 0.95fr;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.nav-menu__cat-title {
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--color-blue);
  margin-bottom: var(--space-xs);
}

.nav-menu__cat-links {
  display: flex;
  flex-direction: column;
}

.nav-menu__cat-links a {
  font-size: 18px;
  font-weight: 500;
  color: #414141;
  line-height: 36px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-menu__cat-links a::before {
  content: '›';
  color: var(--color-green);
  font-size: var(--fs-lg);
  line-height: 1;
}

.nav-menu__cat-links a:hover {
  color: var(--color-green);
}

/* メニュー内：CTAピルボタン群 */
.nav-menu__cta {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

/* デフォルト（〜1150px）：2個ずつ2段 */
.nav-menu__cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  flex: 1 1 calc(50% - 10px);
  height: 58px;
  background: var(--color-white);
  color: var(--color-blue);
  font-family: var(--font-main);
  font-size: 20px;
  font-weight: 700;
  border: 1px solid #D9D9D9;
  border-radius: 37px;
  padding-left: 22px;
  padding-right: 12px;
  cursor: pointer;
  transition: border-color var(--transition), border-width var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

/* 1151px以上：4個横並び1行 */
@media screen and (min-width: 1151px) {
  .nav-menu__cta-btn {
    flex: 1 1 0;
  }
}

.nav-menu__cta-btn:hover {
  border: 2px solid var(--color-blue);
}

.nav-menu__cta-btn .arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--color-blue);
  color: var(--color-white);
  border-radius: var(--radius-circle);
  font-size: var(--fs-base);
  flex-shrink: 0;
}

/* -----------------------------------------------
   フッター
   Figma仕様（PC 1280px基準）：
   - 背景色 #0E845C
   - ロゴ 162×127px
   - フッター上端→ロゴ上端：99px
   - フッター上端→ナビ文字：159px
   - フッター全体高さ：343px
   - 罫線なし（余白のみで区切り）
----------------------------------------------- */
.site-footer {
  background: var(--color-green); /* #0E845C */
  padding-top: 99px;
  padding-bottom: 16px;
}

.site-footer__inner {
  width: 100%;
  margin: 0 auto;
  padding: 0 var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xl); /* 画面幅が狭い時もロゴ・ナビ間の最低距離を確保 */
}

.site-footer__logo {
  margin-left: 65px; /* + inner padding 40px = 105px（Figma準拠） */
  flex-shrink: 0;
}

.site-footer__logo img {
  width: 162px;
  height: 127px;
}

.site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-content: flex-start;
  gap: var(--space-sm) var(--space-lg);
  min-width: 0;
  flex-shrink: 1;
}

.site-footer__nav a {
  position: relative;
  display: inline-block;
  color: var(--color-white);
  font-size: var(--fs-md); /* 18px */
  font-weight: 700;
  white-space: nowrap;
}

.site-footer__nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;
  background: var(--color-white);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s ease;
}

.site-footer__nav a:hover::after {
  transform: scaleX(1);
}

.site-footer__nav a:hover {
  opacity: 1; /* グローバルのa:hover opacity変化を打ち消し、アンダーラインのみ見せる */
}

.site-footer__copy {
  text-align: center;
  color: var(--color-white);
  font-size: var(--fs-xs); /* 12px */
  font-weight: 700;
  margin-top: 32px;
  /* 罫線なし */
}

/* -----------------------------------------------
   フローティングボタン（フジタコインをチェック）
----------------------------------------------- */
.btn-float-coin {
  position: fixed;
  bottom: 20%;
  right: var(--space-md);
  z-index: var(--z-float);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 143px;
  height: 143px;
  border: 4px solid transparent;
  border-radius: var(--radius-circle);
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(95deg, #0E845C 9.49%, #0867AE 94.76%) border-box;
  color: #0E845C;
  font-family: var(--font-main);
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  line-height: 1.3;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  transition: transform var(--transition), opacity var(--transition);
}

.btn-float-coin:hover {
  transform: scale(1.05);
  opacity: 1;
}

.btn-float-coin .coin-icon {
  width: 58px;
  height: 58px;
  margin-bottom: 4px;
}

/* -----------------------------------------------
   共通ボタン
----------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-main);
  font-weight: 700;
  border-radius: var(--radius-pill);
  transition: opacity var(--transition);
  cursor: pointer;
  border: none;
  text-decoration: none;
}

.btn:hover { opacity: 0.85; }

.btn--primary {
  background: var(--color-green);
  color: var(--color-white);
  font-size: var(--fs-md);
  padding: 12px 32px;
}

.btn--outline {
  background: var(--color-white);
  color: var(--color-green);
  font-size: var(--fs-md);
  padding: 10px 30px;
  border: 2px solid var(--color-green);
}

/* -----------------------------------------------
   ページコンテンツ共通
----------------------------------------------- */
.page-content {
  /* padding-top: 80px; */
}

/* -----------------------------------------------
   アクセシビリティ
----------------------------------------------- */
:focus-visible {
  outline: 3px solid var(--color-blue);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* -----------------------------------------------
   レスポンシブ（768px以下 = SP）
----------------------------------------------- */
@media screen and (max-width: 768px) {
  body {
    min-width: 320px;
  }

  /* SPヘッダー
     Figma仕様（SP: Group 443 / node 1199:156）
     158×44px／16px／パディング 上下7px・左右15px
  */
  .btn-furigana {
    min-width: 158px;
    height: 44px;
    font-size: 16px;
    padding: 7px 15px;
  }

  .btn-hamburger {
    width: 44px;
    height: 44px;
  }

  /* SPナビゲーション：PCと同じ天地左右センター配置
     画面いっぱいに収まるサイズにする（高さの上限・内部スクロール・閉じるボタンの
     固定表示は共通ルールに統合済み） */
  .nav-menu {
    width: 95vw;
    max-width: 360px;
    border-radius: var(--radius-lg);
    padding: var(--space-2xl) var(--space-md) var(--space-lg);
    box-sizing: border-box;
  }

  /* SPメニュー：ロゴは枠の左端にクローズボタンと同じ考え方で絶対配置。タグライン文言は非表示 */
  .nav-menu__logo {
    position: absolute;
    top: var(--space-sm);
    left: var(--space-sm);
    margin-bottom: 0;
  }
  .nav-menu__logo img {
    width: 70px;
    height: auto;
  }
  .nav-menu__logo p {
    display: none;
  }

  /* SPメニュー：カテゴリ縦積み */
  .nav-menu__categories {
    grid-template-columns: 1fr;
    gap: var(--space-md);
    margin-top: 20px;
  }

  .nav-menu__cat-title {
    font-size: var(--fs-xl);
  }

  .nav-menu__cat-links a {
    font-size: 16px;
  }

  /* SPメニュー：CTAボタン縦積み */
  .nav-menu__cta {
    flex-direction: column;
    gap: var(--space-sm);
  }

  .nav-menu__cta-btn {
    flex: 1 1 auto;
    width: 100%;
  }

  /* SPフッター
     Figma仕様（SP 390px基準）：
     - 上パディング90px／下パディング53px
     - ロゴ162×127px（PCと同一）
     - ロゴ下端→ナビ上端：61px
     - ナビ：26px / line-height 66px（項目間40pxを行間で表現）
     - ナビ下端→コピーライト上端：58px
     - コピーライト：12px
  */
  .site-footer {
    padding-top: 90px;
    padding-bottom: 53px;
  }

  .site-footer__inner {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0;
  }

  .site-footer__logo {
    margin-left: 0;
    margin-bottom: 61px;
  }

  .site-footer__nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
  }

  .site-footer__nav a {
    font-size: 26px;
    line-height: 66px;
  }

  .site-footer__copy {
    padding: 0 90px; /* 右下のフローティングコインボタンとの重なりを回避 */
    font-size: 12px;
    margin-top: 58px;
  }

  /* SPフローティングボタン（PCと同じグラデーション枠デザインを縮小。Figma確定値：96×96px / 10px） */
  .btn-float-coin {
    width: 96px;
    height: 96px;
    border-width: 3px;
    font-size: 10px;
    bottom: var(--space-sm);
    right: var(--space-sm);
  }

  .btn-float-coin .coin-icon {
    width: 39px;
    height: 39px;
    margin-bottom: 2px;
  }

  /* 修飾クラス：コインが円の上に飛び出すデザイン（Figma Group 361）。
     使うページでは header.php 側で $coin_btn_variant = 'popout'; を指定する。
     枠の太さ・文字サイズは通常版と同じ値を流用。
     ※ .coin-icon の上書きは上の通常版ルールより後に書くこと（同じ詳細度のため順序で決まる） */
  .btn-float-coin--popout {
    width: 68px;
    height: 68px;
    overflow: visible;
  }

  .btn-float-coin--popout .coin-icon {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    width: 29px;
    height: 29px;
    margin-bottom: 0;
  }
}

/* -----------------------------------------------
   隠しコイン演出（ページ最下部・フッター手前）
   confirm/index.php・company/work/index.php で使用
   「最後までスクロールした」ことをトリガーにお宝GET演出を表示する
----------------------------------------------- */
.page-otakara {
  width: 90%;
  margin: 80px auto 0;
  padding: 40px 20px;
  background: #FFF;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.page-otakara[hidden] {
  display: none;
}

.page-otakara__thanks {
  font-size: 40px;
  font-weight: bold;
  color: #0072DD;
  text-align: center;
}

.page-otakara__reward {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.page-otakara__reward[hidden] {
  display: none;
}

.page-otakara__reward-text {
  font-size: 28px;
  color: #414141;
  font-weight: bold;
  letter-spacing: .1em;
}

.page-otakara__reward-coin {
  max-width: 150px;
}

@media screen and (max-width: 768px) {
  .page-otakara { margin-top: 56px; padding: 24px 16px; gap: 16px; }
  .page-otakara__thanks { font-size: 24px; }
  .page-otakara__reward-text { font-size: 18px; }
  .page-otakara__reward-coin { max-width: 100px; }
}

/* -----------------------------------------------
   視覚的には非表示だが、スクリーンリーダーには読み上げさせる要素用
   （例：ページ主題を示すh1で、デザイン上は見せる必要がない場合）
----------------------------------------------- */
.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;
}

/* -----------------------------------------------
   共通パーツ：大見出し（画像＋テキストの縦積み・中央揃え）
   company・work下層ページ共通で使用。
   テキストのスタイルはcompany-charhead__heading（会社ページのキャラ見出し）に準拠。
----------------------------------------------- */
.block-heading-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.block-heading-main__img {
  display: block;
  max-width: 150px;
  width: 100%;
  height: auto;
}

.block-heading-main__text {
  margin: 0;
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 28px;
  color: #0E845C;
  letter-spacing: 0.08em;
}

@media screen and (max-width: 768px) {
  .block-heading-main__text {
    font-size: 22px;
  }
}

/* -----------------------------------------------
   共通パーツ：見出し（company-charhead＝キャラ画像＋見出しテキスト）
   company・work下層ページ共通で使用。画像は選択中キャラに応じてcharacter.jsが切り替える。
----------------------------------------------- */
.company-charhead {
  display: flex;
  align-items: center;
  gap: 24px;
}

.company-charhead__img {
  display: none;
  flex-shrink: 0;
  width: 120px;
  height: auto;
}

.company-charhead__img.is-active {
  display: block;
}

@media screen and (max-width: 768px) {
  .company-charhead__img {
    width: 80px;
  }
}

.company-charhead__heading {
  margin: 0;
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 28px;
  color: #0E845C;
  letter-spacing: 0.08em;
  line-height: 1.5;
}

@media screen and (max-width: 768px) {
  .company-charhead__heading {
    font-size: 22px;
  }
}

/* -----------------------------------------------
   共通パーツ：文中テキスト強調
   本文中の重要な語句を目立たせる。下線はテキストに少しかぶるくらい内側に配置。
----------------------------------------------- */
.text-emphasis {
  color: #0E845C;
  font-weight: 700;
  background-image: linear-gradient(#FFD81B, #FFD81B);
  background-repeat: no-repeat;
  background-size: 100% 5px;
  background-position: 0 88%; /* テキストに少し被せる位置。文字サイズが変わる場合は微調整可 */
  -webkit-box-decoration-break: clone; /* 複数行にまたがった場合、行ごとに下線を独立させる */
  box-decoration-break: clone;
}
