/* カスタムスタイル - Tailwindでカバーできない部分 */

/* safe-area 変数 & iOS安定vh */
:root {
  /* ヘッダー高さ：navのpy-4 (上下16px = 32px) + コンテンツ高さ約48px = 約80px */
  --header-h: 80px;
  --safe-top: env(safe-area-inset-top);
  --safe-bottom: env(safe-area-inset-bottom);
  --vh: 100vh;
}


/* ベースフォント（デフォルト） */
html {
  /* スクロールバーの有無による横ズレを防ぐ（対応ブラウザで有効） */
  scrollbar-gutter: stable;
}

/* =========================================
   背景色：html/bodyの背景設定
   - ホーム画面（#heroがあるページ）：ヒーロー背景と同じ画像
   - 遷移先ページ：白背景（透過を自然に）
   ========================================= */
html,
body {
  background-color: #ffffff;
  /* 遷移先ページでは白背景で透過 */
}

/* ホーム画面（#heroがあるページ）のみ、ヒーロー背景画像を設定 */
body:has(#hero) html,
body:has(#hero) body {
  background-color: #0b0f14;
  background-image: url("assets/images/hero-1.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  /* background-attachment: fixed は削除（iOS Safariで問題を起こす） */
}

/* :has()が使えない場合のフォールバック */
body.has-hero html,
body.has-hero body {
  background-color: #0b0f14;
  background-image: url("assets/images/hero-1.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Noto Sans JP', sans-serif;
  margin: 0;
  min-height: 100svh;
}

@supports (height: 100dvh) {
  :root {
    --vh: 100dvh;
  }

  body {
    min-height: 100dvh;
  }
}

/* FOUC（Flash of Unstyled Content）を防ぐ */
html:not(.head-loaded) body {
  visibility: hidden;
}

html.head-loaded body {
  visibility: visible;
}

/* ===== iPhone Safe Area: header / content / footer =====
   .safe-headerクラスのみにsafe-area対応を適用（最小構成）
*/

/* 固定ヘッダーの背景をsafe-areaまで塗る（.safe-headerクラスのみ） */
.safe-header {
  padding-top: env(safe-area-inset-top);
  box-sizing: border-box;
  background: transparent !important;
  backdrop-filter: none !important;
  box-shadow: none !important;
  position: relative;
  z-index: 50; /* ヘッダーはヒーローの上に表示される */
}

/* header内のnav要素とその子要素も完全透明に */
.safe-header nav,
.safe-header nav > div {
  background: transparent !important;
  backdrop-filter: none !important;
}

/* fixed header で本文が隠れないようにする（該当要素に当たればOK）
   押し下げ＋相殺構造を廃止し、最小限のパディングのみ */
main,
#main,
.page,
.page-wrapper,
.site-content {
  padding-top: 0;
}

/* 全ページでヘッダー下の余白を削除（ヘッダーはstickyなので重ねる） */
main {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

/* Tailwindのpt-24クラスも上書き */
main.pt-24 {
  padding-top: 0 !important;
}

/* ホーム画面の#heroセクションがヘッダーと重なるように（既に#hero側でpadding-topを設定済み） */
body:has(#hero) main,
body.has-hero main {
  margin-top: 0;
  padding-top: 0;
}

/* ヒーローセクションは相殺構造を廃止
   ヘッダーの下に隠れないよう、z-indexを適切に設定
   ヘッダー分のパディングを追加して内容が見えるようにする */
#hero {
  margin-top: 0;
  padding-top: calc(var(--header-h) + env(safe-area-inset-top));
  position: relative;
  z-index: 1;
    font-family: 'Shippori Mincho', 'Hiragino Mincho ProN', 'Yu Mincho', serif;
}

/* フッター背景をhome-indicator(safe-area-bottom)まで塗る */
footer {
  padding-bottom: calc(1rem + var(--safe-bottom));
  box-sizing: border-box;
}

/* スマホ時のフッター固定は廃止（通常のフッター表示） */
/* iOS Safariのviewport再計算不具合対策：footerをdocument flowに完全固定 */
@media (max-width: 767px) {
  footer {
    position: static !important;
    inset: auto !important;
    transform: none !important;
    /* footer が fixed / absolute / transform される可能性を完全に排除 */
  }

  /* 英語ページでもフッター幅を日本語と揃える */
  html[lang="en"] footer {
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  html[lang="en"] footer .md\\:hidden {
    width: 100% !important;
    padding-left: 1.25rem !important; /* pl-5 */
    padding-right: 2rem !important;   /* pr-8 */
  }
}

/* セクションごとのフォント設定 */
/* Shippori Mincho を使用するセクション */
#hero,
#services,
#gallery,
#blog,
#workflow,
#profile,
#qa,
#contact {
    font-family: 'Shippori Mincho', 'Hiragino Mincho ProN', 'Yu Mincho', serif;
}

/* Playfair Display を使用するセクション */
#workflowIntro,
#workflowOutro {
    font-family: 'Playfair Display', 'Shippori Mincho', serif;
}
/* ロゴのイントロアニメーション（中央 → ヘッダー左） */
.site-logo {
  position: absolute;
  left: 1.25rem;       /* left-5 相当 */
  top: 1rem;           /* ヘッダー内の縦位置 */
  transform: translate(0, 0);
  z-index: 60;
  transition: all 800ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* 最初は画面中央に大きく表示（無効化） */
/* body.logo-intro .site-logo {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2.25rem;
  letter-spacing: 0.3em;
} */

/* アニメ後の通常位置（ヘッダー左） */
body.logo-ready .site-logo {
  position: absolute;
  top: 1rem;
  left: 1.25rem;
  transform: translate(0, 0);
  font-size: 1.25rem;  /* 普通のロゴサイズ */
}

/* ロゴアニメ中はスクロールを無効化 */
body.logo-animating {
  overflow: hidden;
  /* height: 100vh を削除（iOS Safariのviewport再計算不具合対策） */
}

/* ロゴアニメ終了後は必ずスクロールを復帰（スマホで class が残る事故の保険） */
body.logo-ready {
  overflow-y: auto !important;
  /* height の指定は完全に削除（iOS Safariのviewport再計算不具合対策） */
}

/* 画面全体のスクロールは body 側で持つ（iOS Safari対策） */
html,
body {
  -webkit-overflow-scrolling: touch;
}

/* ロゴアニメ中はナビゲーション非表示（無効化） */
/* body.logo-intro .nav-items {
  opacity: 0;
  pointer-events: none;
} */

/* ロゴが左に移動したらフェードイン */
body.logo-ready .nav-items {
  opacity: 1;
  pointer-events: auto;
  transition: opacity 600ms ease 200ms;
}
/* =========================================
   イントロロゴ（中央 → 左上へ移動し、ヒーロー画像の上に残す）
   - visible: 全画面（fixed）で表示
   - ready: #hero 内に移動した場合のみ absolute でヒーロー上に残す
   - slide-complete: 終了位置＝固定位置（transformを完全一致）
   ========================================= */

/* ロゴ演出レイヤーはタッチを奪わない */
#introLogo,
.intro-logo {
  pointer-events: none;
}

/* 初期：全画面オーバーレイ */
.intro-logo {
  position: fixed;
  inset: 0;
  width: 100%;
  height: var(--vh);
  background-color: rgba(23, 23, 23, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.8s cubic-bezier(0.22, 0.61, 0.36, 1);
  /* ちらつき防止：ready/slide-completeクラスがある場合は即座に表示 */
  transition-delay: 0s;
}

/* ハッシュがある場合（ready/slide-completeが既に設定されている場合）は即座に表示 */
.intro-logo.ready.slide-complete {
  opacity: 1 !important;
  background-color: transparent !important;
  transition: none !important;
}

.intro-logo-img {
  width: 600px;
  height: auto;
  transform: translate3d(0, 0, 0);
  transition: transform 2s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 1s ease;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
  background: transparent;
  mix-blend-mode: normal;
  will-change: transform;
}

/* ① visible：ふわっと表示 */
.intro-logo.visible {
  opacity: 1;
}

/* ② ready：オーバーレイを透明化（位置はCSSで決める） */
.intro-logo.ready {
  background-color: transparent;
  opacity: 1;
}

/* 重要：#hero 内に移動された時だけ、ヒーロー上に残す（2段階ジャンプ防止） */
#hero .intro-logo.ready,
#hero .intro-logo.ready.slide-complete {
  position: absolute;
  inset: 0;
    width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 8; /* グラデーションより上、テキストより下 */
}

/* =========================
   デスクトップ（1280px〜）：左上へスライド
   ========================= */
@media (min-width: 1280px) {
  .intro-logo.ready .intro-logo-img,
  .intro-logo.ready.slide-complete .intro-logo-img {
    transform: translate3d(calc(-50vw + 1.25rem + 300px), 0, 0);
  }

  .intro-logo.ready.slide-complete .intro-logo-img {
    transition: none;
  }
}

/* =========================
   タブレット（768〜1279px）：少し上に逃がす
   ========================= */
@media (min-width: 768px) and (max-width: 1279px) {
  .intro-logo.ready .intro-logo-img,
  .intro-logo.ready.slide-complete .intro-logo-img {
    transform: translate3d(calc(-50vw + 1.25rem + 300px), -200px, 0);
  }

  .intro-logo.ready.slide-complete .intro-logo-img {
    transition: none;
  }

  /* ヒーローのテキストがロゴと被らないように余白 */
  #hero > div.relative.z-10 {
    padding-top: 250px !important;
    margin-top: 250px !important;
  }

  html[lang="en"] #hero > div.relative.z-10 {
    padding-top: 200px !important;
    margin-top: 200px !important;
  }
}

/* =========================
   スマホ（〜767px）：上部寄せ（Yのみ）
   ========================= */
@media (max-width: 767px) {
  .intro-logo.ready .intro-logo-img,
  .intro-logo.ready.slide-complete .intro-logo-img {
    transform: translate3d(0, -200px, 0);
  }

  .intro-logo.ready.slide-complete .intro-logo-img {
    transition: none;
  }

  /* ヒーローのテキストがロゴと被らないように余白 */
  #hero > div.relative.z-10 {
    margin-top: 200px !important;
  }

  html[lang="en"] #hero > div.relative.z-10 {
    padding-top: 200px !important;
    margin-top: 200px !important;
  }
}

/* モバイル/タブレット画面（1280px未満）では、ハンバーガーメニューを表示、通常メニューを非表示 */
@media (max-width: 1279px) {
  body.logo-ready .hamburger-btn {
    opacity: 1 !important;
    pointer-events: auto !important;
    display: flex !important;
  }

  body.logo-ready .nav-menu-list:not(.active) {
    opacity: 0 !important;
    pointer-events: none !important;
    display: none !important;
  }

}

/* 1400px以下では、ハンバーガーメニューを表示、通常メニューを非表示 */
@media (max-width: 1400px) {
  .hamburger-btn {
    display: flex !important;
  }

  .nav-menu-list {
    position: fixed;
    top: calc(var(--header-h) + var(--safe-top));
    right: -100%;
    flex-direction: column;
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    width: 100%;
    height: calc(var(--vh) - var(--header-h) - var(--safe-top));
    overflow-y: auto;
  -webkit-overflow-scrolling: touch;
    padding: 2rem;
    padding-bottom: calc(2rem + var(--safe-bottom));
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transition: right 0.3s ease, opacity 0.3s ease;
    gap: 0;
    z-index: 50;
  opacity: 0;
  pointer-events: none;
    display: flex;
  }

  .nav-menu-list.active {
    right: 0;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  /* ロゴアニメーション完了後もメニューが表示されるように */
  body.logo-ready .nav-menu-list.active {
    display: flex !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  .nav-menu-list li {
    padding: 1rem 0;
    border-bottom: 1px solid #e5e7eb;
  }

  .nav-menu-list li:last-child {
    border-bottom: none;
  }

  .nav-menu-list li.nav-lang-switch {
    border-bottom: 1px solid #e5e7eb !important;
  }

  .nav-menu-list li.nav-lang-switch:not(:last-child) {
    border-bottom: 1px solid #e5e7eb !important;
  }

  .nav-menu-list a {
    display: block;
    font-size: 1.2rem;
    padding: 0.5rem 0;
    color: #1f2937 !important;
  }

  .nav-menu-list a:hover {
    color: #111827 !important;
  }

  .nav-lang-item {
    margin-left: 0 !important;
    padding-left: 0 !important;
    border-left: none !important;
    border-bottom: 1px solid #e5e7eb !important;
    border-top: 1px solid #e5e7eb !important;
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
    margin-top: 0.5rem !important;
    margin-bottom: 0 !important;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    width: 100% !important;
  }

  .nav-lang-link {
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    color: #1f2937 !important;
    text-align: center;
    display: block !important;
    padding: 0.75rem 0;
  }

  /* ハンバーガーメニュー展開時のソーシャルアイコンを大きく表示 */
  .nav-menu-list.active .nav-social .social-icon {
    width: 2.5rem !important;
    height: 2.5rem !important;
  }

  .nav-social {
    margin-left: 0 !important;
    padding-left: 0 !important;
    border-left: none !important;
    border-top: none !important;
    padding-top: 1rem;
    margin-top: 1rem;
    justify-content: center;
    gap: 2rem;
    display: flex !important;
  }

  .nav-social a {
    display: inline-block;
    padding: 0.5rem;
  }

  .social-icon {
    width: 36px;
    height: 36px;
    color: #1f2937 !important;
  }

  .social-icon:hover {
    color: #111827 !important;
  }
}

/* 1401px以上では、通常のメニューを表示（横並び）、ハンバーガーメニューを非表示 */
@media (min-width: 1401px) {
  .hamburger-btn {
    display: none !important;
  }

  .nav-menu-list {
    display: flex !important;
    position: static !important;
    flex-direction: row !important;
    background-color: transparent !important;
    backdrop-filter: none !important;
    width: auto !important;
    height: auto !important;
    overflow-y: visible !important;
    padding: 0 !important;
    box-shadow: none !important;
    gap: 2rem !important;
  }

  .nav-menu-list li {
    padding: 0 !important;
    border-bottom: none !important;
  }

  .nav-menu-list a {
    display: inline !important;
    font-size: 1rem !important;
    padding: 0 !important;
    color: #f3f4f6 !important;
  }

  .nav-menu-list a:hover {
    color: #d1d5db !important;
  }

  .nav-lang-item {
    margin-left: 1rem !important;
    padding-left: 1rem !important;
    border-left: 1px solid #374151 !important;
    border-bottom: none !important;
    border-top: none !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
    display: inline-block !important;
    width: auto !important;
  }

  .nav-lang-link {
    font-size: 1rem !important;
    font-weight: 500 !important;
    color: #f3f4f6 !important;
    text-align: left !important;
    padding: 0 !important;
  }
}
/* 和風テキストシャドウ */
.text-shadow-lg {
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 0, 0, 0.3);
}

/* ヒーローセクションのテキストコンテナ：スマホ・タブレット時は縦長に表示 */
/* 縦書き（writing-mode: vertical-rl）の場合、heightが横方向の幅になる */
@media (max-width: 1279px) {
    .hero-text-container {
        /* vh単位を削除し、内容に応じた自然な高さにする（iOS SafariのURLバー伸縮で幅が変わらないように） */
        height: auto;
        max-height: none;
        min-height: auto;
    }
}

/* スマホ時（~767px）はさらに幅を長く */
/* iOS Safariのviewport再計算不具合対策：vh指定を完全に無効化 */
@media (max-width: 767px) {
    .hero-text-container {
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
        /* 縦書き（writing-mode: vertical-rl）の場合、widthを固定してスクロール時の幅変動を防ぐ */
        width: auto !important;
        max-width: 90vw !important; /* 画面幅の90%を上限とする */
        writing-mode: vertical-rl !important; /* 縦書きを維持 */
        padding-top: 1rem !important; /* pt-24 → pt-4 */
        padding-bottom: 1rem !important; /* pb-24 → pb-4 */
        padding-left: 0.5rem !important; /* pl-4 → pl-2 */
        padding-right: 0.5rem !important; /* pr-12 → pr-2 */
        /* 中央配置 */
        position: relative !important;
        margin: 0 auto !important;
        /* vh / svh / dvh を一切使わない（iOS Safari対策） */
    }

    .hero-text-container h1 {
        font-size: 1.5rem !important; /* text-3xl → text-2xl */
        margin-bottom: 0.75rem !important; /* mb-6 → mb-3 */
        line-height: 1.5 !important; /* leading-tight */
        letter-spacing: 0.15em !important; /* tracking-[0.2em] → tracking-[0.15em] */
    }

    .hero-text-container p {
        font-size: 0.75rem !important; /* text-sm → text-xs */
        line-height: 1.5 !important; /* leading-tight */
        letter-spacing: 0.05em !important;
    }

    .hero-text-container br {
        margin-bottom: 0.25rem !important; /* mb-1 → mb-1 */
    }
}

/* PC時は通常の高さ */
@media (min-width: 1280px) {
    .hero-text-container {
        max-height: none;
        min-height: auto;
        height: auto;
    }
}

/* ヒーローセクションの文章を右から左へ進むアニメーション（PCのみ） */
/* 縦書き（writing-mode: vertical-rl）の場合は translateY を使用 */
/* ロゴアニメーション完了後（3秒後）に開始 */
@media (min-width: 768px) {
    .hero-text-slide {
        opacity: 0;
        transform: translateY(-100px); /* 縦書きの場合は上から下へ（右から左に見える） */
        animation: slideInFromRightVertical 1.5s ease-out forwards;
        animation-delay: 3.5s; /* ロゴアニメーション完了後（3秒） + 0.5秒 */
        will-change: transform, opacity; /* パフォーマンス最適化 */
    }

    @keyframes slideInFromRightVertical {
        from {
            opacity: 0;
            transform: translateY(-100px); /* 縦書きの場合は上から下へ */
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    /* 横書き（英語版）の場合は translateX を使用 */
    html[lang="en"] .hero-text-slide {
        transform: translateX(100px); /* 横書きの場合は右から左へ */
        animation-name: slideInFromRightHorizontal;
        animation-delay: 1.5s; /* ロゴアニメーション完了後（3秒） + 0.5秒 */
    }

    @keyframes slideInFromRightHorizontal {
        from {
            opacity: 0;
            transform: translateX(100px);
        }
        to {
            opacity: 1;
            transform: translateX(0);
        }
    }
}

/* Q&Aアコーディオン */
.qa-answer {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s ease, opacity 0.4s ease;
    padding-top: 0;
    padding-bottom: 0;
}

.qa-answer.open {
    opacity: 1;
    transition: max-height 0.4s ease, opacity 0.4s ease;
}

.qa-icon {
    transition: transform 0.3s ease;
}

.qa-item.active .qa-icon {
    transform: rotate(180deg);
}


/* ハンバーガーメニューのアニメーション */
.hamburger-btn.active .hamburger-line:nth-child(1),
.hamburger.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger-btn.active .hamburger-line:nth-child(2),
.hamburger.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active .hamburger-line:nth-child(3),
.hamburger.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* メニュー開いている間は背景スクロールを無効化（iOS Safari対策） */
body.menu-open {
    overflow: hidden !important;
        position: fixed;
    inset: 0;
        width: 100%;
    height: var(--vh);
}
/* セレクトボックスのカスタム矢印 */
select {
    appearance: none !important; /* ブラウザのデフォルト矢印を非表示 */
    -webkit-appearance: none !important; /* Safari対応 */
    -moz-appearance: none !important; /* Firefox対応 */
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12"><path fill="%23333" d="M6 9L1 4h10z"/></svg>') !important;
    background-repeat: no-repeat !important;
    background-position: right 0.75rem center !important;
    padding-right: 3rem !important; /* 矢印のスペースを確保（Tailwindのpx-4を上書き） */
}

/* 日付・時間入力欄の幅と高さを他の入力欄と同じにする（スマホ対応） */
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="month"],
input[type="week"] {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-top: 0.75rem !important; /* py-3と同じ */
    padding-bottom: 0.75rem !important; /* py-3と同じ */
    min-height: calc(0.75rem * 2 + 1.5em + 2px) !important; /* padding + line-height + border */
    line-height: 1.5 !important;
    -webkit-appearance: none !important;
    -moz-appearance: textfield !important;
    appearance: none !important;
}

/* iOS Safariでの日付・時間入力欄の幅・高さ制御 */
@supports (-webkit-touch-callout: none) {
    input[type="date"],
    input[type="time"],
    input[type="datetime-local"] {
        min-width: 0 !important;
        max-width: 100% !important;
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
        min-height: calc(0.75rem * 2 + 1.5em + 2px) !important;
    }
}
/* =========================
   スクロールアニメーション
   ========================= */

/* アニメーション対象要素の初期状態 */
.scroll-animate {
    opacity: 0;
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

/* フェードイン（上から） */
.scroll-animate.fade-in-up {
    transform: translateY(30px);
}

/* フェードイン（左から） */
.scroll-animate.fade-in-left {
    transform: translateX(-30px);
}

/* フェードイン（右から） */
.scroll-animate.fade-in-right {
    transform: translateX(30px);
}

/* アニメーション実行時 */
.scroll-animate.animate {
    opacity: 1;
    transform: translate(0, 0);
}

/* 遅延アニメーション */
.scroll-animate.delay-100 {
    transition-delay: 0.1s;
}

.scroll-animate.delay-200 {
    transition-delay: 0.2s;
}

.scroll-animate.delay-300 {
    transition-delay: 0.3s;
}

.scroll-animate.delay-400 {
    transition-delay: 0.4s;
}

.scroll-animate.delay-500 {
    transition-delay: 0.5s;
}

/* =========================
   チャットボット
   ========================= */
#chatbot {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Noto Sans JP', sans-serif;
}

/* チャットボットボタン（白丸背景・シャドウ・黒字） */
#chatbotToggle {
    background-color: #ffffff !important;
    color: #000000 !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
}

#chatbotToggle:hover {
    background-color: #ffffff !important;
    opacity: 0.9;
}

#chatbotWindow {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#chatbotMessages {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e0 #f7fafc;
}

#chatbotMessages::-webkit-scrollbar {
    width: 6px;
}

#chatbotMessages::-webkit-scrollbar-track {
    background: #f7fafc;
}

#chatbotMessages::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

#chatbotMessages::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* スマホ時のチャットボット */
@media (max-width: 640px) {
    #chatbot {
        bottom: 1rem;
        right: 1rem;
    }

    #chatbotWindow {
        bottom: 5rem;
        right: 1rem;
        left: 1rem;
        width: auto;
        height: calc(var(--vh) - 6rem);
        max-height: 600px;
    }
}

/* 左下固定リンクアイコン（白丸背景・シャドウ・黒字） */
.floating-links {
    position: fixed;
    left: 1.5rem; /* 24px = right-6 と同じ */
    bottom: calc(1.5rem + env(safe-area-inset-bottom)); /* 24px = bottom-6 と同じ */
    width: 3.5rem; /* 56px = w-14 */
    height: 3.5rem; /* 56px = h-14 */
    background-color: #ffffff; /* 白背景 */
    color: #000000; /* 黒字 */
    border-radius: 9999px; /* rounded-full */
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    z-index: 9999;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); /* shadow-lg */
    transition: all 0.2s ease;
    cursor: pointer;
}

.floating-links:hover {
    transform: scale(1.1); /* hover:scale-110 */
    opacity: 0.9;
}

.floating-links:active {
    transform: scale(0.95);
}

/* スマホ時の調整 */
@media (max-width: 640px) {
    .floating-links {
        left: 1rem; /* 16px */
        bottom: calc(1rem + env(safe-area-inset-bottom)); /* 16px */
    }
}

/* PC画面時はリンクツリーアイコンを非表示 */
@media (min-width: 641px) {
    .floating-links {
        display: none !important;
    }
}

/* ===== Chatbot badge (赤丸通知) ===== */
.chatbot-has-badge {
  position: relative;
}

.chatbot-badge {
  position: absolute;
  top: 1px;
  left: 1px;
  width: 14px;
  height: 14px;
  border-radius: 9999px;
  background: #e11d48; /* red */
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
  pointer-events: none;
}
/* =========================================
   削除：body::before / body::afterによる疑似要素でのsafe-area塗りつぶしは禁止
   削除：mainのpadding-bottom: 140px（URLピル周りの黒透け原因）
   削除：!important付きの背景色指定（重複・競合の原因）
   ========================================= */
/* =========================================================
   Links page（統合版）: links.css を廃止して style.css に統合
   - 日本語に自然なタイポグラフィ
   - overflow: hidden は使わない（iOS SafariのURLピル/スクロール挙動を壊すため）
   ========================================================= */

   body.links-page {
    margin: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP",
      Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
    color: #111827;
    background: #eef1f1;
  }

  /* ヘッダーを表示する導線（from=hp）のときだけ上余白 */
  body.links-page main.links-main--with-header {
    padding-top: 64px;
  }

  body.links-page .links-container {
    max-width: 520px;
    margin: 0 auto;
    padding: 22px 16px 28px;
  }

  body.links-page .links-card {
    background: #e6eaeb;
    border-radius: 18px;
    box-shadow: 0 14px 34px rgba(17, 24, 39, 0.12);
    overflow: hidden;
    border: 1px solid rgba(17, 24, 39, 0.08);
  }

  body.links-page .hero-top {
    padding: 18px 0 12px;
    display: flex;
    justify-content: center;
  }

  body.links-page .avatar-wrap {
    width: 116px;
    height: 116px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    display: grid;
    place-items: center;
    border: 1px solid rgba(17, 24, 39, 0.10);
  }

  body.links-page .profile-photo {
    width: 98px;
    height: 98px;
    border-radius: 999px;
    object-fit: cover;
  }

  body.links-page .hero-body {
    padding: 10px 18px 18px;
  }

  body.links-page .name-block {
    text-align: center;
    padding: 6px 0 14px;
  }

  body.links-page .name-jp {
    display: inline-flex;
    gap: 10px;
    align-items: baseline;
    justify-content: center;
    letter-spacing: 0.02em;
  }

  body.links-page .name-family {
    font-size: 18px;
    font-weight: 600;
  }

  body.links-page .name-given {
    font-size: 30px;
    font-weight: 700;
  }

  body.links-page .name-sub {
    margin-top: 6px;
    font-size: 12px;
    letter-spacing: 0.14em;
    color: rgba(17, 24, 39, 0.62);
  }

  body.links-page .menu-grid {
    display: grid;
    grid-template-columns: 1fr 1.05fr;
    gap: 14px;
    align-items: stretch;
  }

  body.links-page .menu-left {
    display: grid;
    gap: 10px;
  }

  body.links-page .menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 10px 12px;
    text-decoration: none;
    color: #111827;
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(17, 24, 39, 0.16);
    border-radius: 12px;
    letter-spacing: 0.06em;
    font-size: 14px;
    font-weight: 600;
    transition: transform 120ms ease, background-color 120ms ease, border-color 120ms ease;
  }

  body.links-page .menu-btn:hover {
    background: rgba(255, 255, 255, 0.72);
    border-color: rgba(17, 24, 39, 0.22);
  }

  body.links-page .menu-btn:active {
    transform: translateY(1px);
  }

  body.links-page .menu-right {
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(17, 24, 39, 0.12);
    background: rgba(255, 255, 255, 0.40);
    min-height: 216px;
  }

  /* 右側の写真：パスは絶対パスにする（ディレクトリ差で壊れない） */
  body.links-page .menu-photo {
    width: 100%;
    height: 100%;
    min-height: 216px;
    background-image: url("/assets/images/hero-1.jpg");
    background-size: cover;
    background-position: center;
    filter: saturate(0.95) contrast(0.96);
  }

  body.links-page .back-area {
    padding-top: 14px;
    display: flex;
    justify-content: center;
  }

  body.links-page .back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    padding: 10px 18px;
    border-radius: 999px;
    border: 1px solid rgba(17, 24, 39, 0.16);
    background: rgba(255, 255, 255, 0.62);
    color: #111827;
    letter-spacing: 0.04em;
    font-size: 13px;
    font-weight: 600;
  }

  body.links-page .back-btn:hover {
    background: rgba(255, 255, 255, 0.72);
  }

  @media (max-width: 420px) {
    body.links-page .links-container {
      padding: 18px 14px 24px;
    }
    body.links-page .menu-grid {
      grid-template-columns: 1fr;
    }
    body.links-page .menu-right {
      min-height: 180px;
    }
    body.links-page .menu-photo {
      min-height: 180px;
    }
}
