/* ═══════════════════════════════════════════
   豊島歯科 共通レスポンシブCSS  v2.0
   全サブページに適用
═══════════════════════════════════════════ */

/* ── フォント・基本 ── */
html { -webkit-text-size-adjust: 100%; }
img, video { max-width: 100%; height: auto; }
table { border-collapse: collapse; }

/* ── スクロールバー非表示（横） ── */
.price-table-wrap, .table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 8px;
}

/* ══════════════════════════════════════
   TABLET（900px以下）
══════════════════════════════════════ */
@media (max-width: 900px) {

  /* ─ ヘッダー ─ */
  #header { padding: 0 16px !important; height: 56px !important; }
  .logo-en, .le { display: none !important; }
  .logo-jp, .lj { font-size: .72rem !important; }
  .nav-links, .nl { display: none !important; }
  .hamburger, .hb { display: flex !important; }
  .nav-cta-li { display: none !important; }

  /* ─ ページヒーロー ─ */
  .page-hero, .ph {
    padding: 96px 20px 48px !important;
    text-align: center;
  }
  .page-hero-jp, .pj { font-size: clamp(1.4rem, 5vw, 2rem) !important; }
  .page-hero-sub, .ps { font-size: .75rem !important; }
  .breadcrumb, .bc { font-size: .6rem !important; }

  /* ─ コンテンツエリア ─ */
  .page-content, .pc { padding: 44px 20px !important; }

  /* ─ セクションタイトル ─ */
  .sec-title, .st { font-size: clamp(1.1rem, 4vw, 1.4rem) !important; }

  /* ─ カードグリッド → 1カラム ─ */
  .card-grid, .cg { grid-template-columns: 1fr 1fr !important; gap: 14px !important; }

  /* ─ CTAバンド ─ */
  .cta-band, .cta, footer { padding: 48px 20px !important; }
  .footer-inner, .fi2 { grid-template-columns: 1fr !important; gap: 20px !important; }

  /* ─ 料金テーブル ─ */
  .price-table { font-size: .78rem !important; }
  .price-table th, .price-table td { padding: 9px 12px !important; }

  /* ─ ハイライトボックス ─ */
  .highlight-box, .hb2, .warn-box { padding: 18px 16px !important; }

  /* ─ FAQ ─ */
  .faq-q-text { font-size: .84rem !important; }

  /* ─ コンタクトグリッド ─ */
  .contact-grid { grid-template-columns: 1fr !important; }
}

/* ══════════════════════════════════════
   MOBILE（600px以下）
══════════════════════════════════════ */
@media (max-width: 600px) {

  /* ─ ヘッダー ─ */
  #header { padding: 0 14px !important; height: 52px !important; }
  .logo-mark, .lm { width: 30px !important; height: 30px !important; }
  .logo-jp, .lj { font-size: .65rem !important; letter-spacing: .04em !important; }

  /* ─ ページヒーロー ─ */
  .page-hero, .ph { padding: 84px 16px 40px !important; }
  .page-hero-en, .pe { font-size: .75rem !important; letter-spacing: .2em !important; }
  .page-hero-jp, .pj { font-size: clamp(1.25rem, 6vw, 1.7rem) !important; letter-spacing: .04em !important; }
  .page-hero-sub, .ps { font-size: .72rem !important; line-height: 1.8 !important; margin-top: 10px !important; }
  .breadcrumb, .bc { flex-wrap: wrap; justify-content: center; gap: 4px !important; margin-top: 12px !important; }

  /* ─ コンテンツエリア ─ */
  .page-content, .pc { padding: 36px 16px !important; }
  .sec-label, .sl { font-size: .78rem !important; letter-spacing: .2em !important; }
  .sec-title, .st { font-size: clamp(1.05rem, 5vw, 1.3rem) !important; margin-bottom: 10px !important; }
  .lead, .ld { font-size: .84rem !important; line-height: 1.95 !important; }

  /* ─ コンテンツブロック ─ */
  .content-block, .cb { margin-bottom: 36px !important; }
  .content-block h3, .cb h3 {
    font-size: .95rem !important;
    padding-left: 11px !important;
    line-height: 1.6 !important;
  }
  .content-block p, .cb p { font-size: .83rem !important; line-height: 1.95 !important; }
  .content-block ul li, .cb ul li { font-size: .83rem !important; }

  /* ─ カードグリッド → 全1カラム ─ */
  .card-grid, .cg { grid-template-columns: 1fr !important; gap: 12px !important; }
  .card, .cd { padding: 18px 16px !important; }
  .card-num, .cn { font-size: 1.7rem !important; }
  .card h4, .cd h4 { font-size: .88rem !important; }
  .card p, .cd p { font-size: .76rem !important; }

  /* ─ 料金テーブル ─ */
  /* 2カラム構成なのでスマホ幅に収める（横スクロール不要） */
  .price-table { min-width: 0; font-size: .74rem !important; }
  .price-table th { font-size: .68rem !important; padding: 8px 10px !important; }
  .price-table td { padding: 8px 10px !important; }

  /* ─ ハイライト・警告ボックス ─ */
  .highlight-box, .hb2 { padding: 16px 14px !important; border-radius: 8px !important; }
  .highlight-box p, .hb2 p { font-size: .8rem !important; }
  .warn-box { padding: 14px 14px !important; }
  .warn-box p { font-size: .8rem !important; }

  /* ─ FAQ ─ */
  .faq-q { padding: 16px 2px 12px !important; gap: 10px !important; }
  .faq-q-badge { width: 22px !important; height: 22px !important; font-size: .66rem !important; }
  .faq-q-text { font-size: .82rem !important; }
  .faq-a { padding: 0 2px 16px 32px !important; font-size: .8rem !important; line-height: 1.9 !important; }

  /* ─ CTAバンド ─ */
  .cta-band, .cta { padding: 40px 16px !important; }
  .cta-band h2, .cta h2 { font-size: 1.15rem !important; margin-bottom: 10px !important; }
  .cta-band p, .cta p { font-size: .76rem !important; line-height: 1.85 !important; margin-bottom: 18px !important; }
  .btn-primary, .bp { padding: 13px 28px !important; font-size: .82rem !important; }

  /* ─ フッター ─ */
  .footer-inner, .fi2 { gap: 16px !important; }
  footer { padding: 40px 16px 80px !important; }

  /* ─ モバイルメニュー ─ */
  #mobileMenu a { font-size: 1rem !important; }
  .menu-cta-wrap { padding: 0 20px !important; }

  /* ─ 採用ページ特有 ─ */
  .job-grid { grid-template-columns: 1fr !important; }

  /* ─ 2カラムレイアウト ─ */
  .two-col, .tc, .split-layout { grid-template-columns: 1fr !important; gap: 20px !important; }

  /* ─ タッチ操作 ─ */
  a, button { min-height: 44px; }
  .faq-q { min-height: 52px; }

  /* ─ テーブルwrapper ─ */
  .table-outer {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -16px;
    padding: 0 16px;
  }

  /* ─ ページトップボタン ─ */
  #pageTopBtn { bottom: 24px !important; right: 16px !important; width: 46px !important; height: 46px !important; cursor: pointer !important; }

@media(max-width:600px){
  /* chat-fab(bottom:80px)と被らないよう上に配置 */
  #pageTopBtn { bottom: 150px !important; right: 16px !important; }
}
}

/* ── ボトムナビ余白（スマホ） ── */
@media (max-width: 600px) {
  body { padding-bottom: 64px; }
}

/* ── モバイルボトムナビ ── */
#mobileBottomNav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(9,60,69,.97);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255,255,255,.1);
  z-index: 1800;
  padding: 6px 0 env(safe-area-inset-bottom, 6px);
}
#mobileBottomNav a {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  gap: 3px; padding: 6px 4px;
  color: rgba(255,255,255,.5); font-size: .52rem;
  letter-spacing: .04em; text-decoration: none; transition: color .2s;
  min-height: 44px; justify-content: center;
}
#mobileBottomNav a:hover, #mobileBottomNav a.active { color: var(--ochre, #ef7d2e); }
#mobileBottomNav svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#mobileBottomNav .bnav-reserve {
  background: var(--ochre, #ef7d2e); border-radius: 6px; color: #fff !important;
  margin: 4px 6px; flex: 1.4 !important; border-radius: 8px;
}
@media (max-width: 600px) {
  #mobileBottomNav { display: flex; }
}

/* ════ CTAテーマ（コーラルオレンジ） 強化 ════ */

/* ボタン・CTAのコーラルグロー */
.btn-primary, .bp, .menu-cta-btn {
  background: var(--ochre, #ef7d2e) !important;
  box-shadow: 0 4px 20px rgba(239,125,46,.35) !important;
  transition: background .22s, box-shadow .22s, transform .15s !important;
}
.btn-primary:hover, .bp:hover {
  background: var(--ochre2, #d9660f) !important;
  box-shadow: 0 6px 28px rgba(239,125,46,.5) !important;
  transform: translateY(-1px);
}

/* キーボードフォーカスの可視化 */
.btn-primary:focus-visible, .bp:focus-visible, .menu-cta-btn:focus-visible,
.nav-cta:focus-visible, .bnav-reserve:focus-visible {
  outline: 3px solid #f79549 !important;
  outline-offset: 3px;
  box-shadow: 0 0 0 6px rgba(239,125,46,.25) !important;
}
a:focus-visible, button:focus-visible {
  outline: 2px solid #0e5561;
  outline-offset: 2px;
}

/* アニメーション抑制設定の尊重 */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ページヒーロー オレンジアクセントライン */
.page-hero::after, .ph::after {
  content: '';
  display: block;
  width: 48px; height: 3px;
  background: var(--ochre, #ef7d2e);
  margin: 18px auto 0;
  border-radius: 2px;
  box-shadow: 0 0 16px rgba(239,125,46,.6);
}

/* セクションバー オレンジ */
.sec-bar, .sb {
  background: linear-gradient(90deg, var(--ochre, #ef7d2e), var(--ochre, #f79549)) !important;
}

/* カードボーダートップ オレンジ */
.card, .cd {
  border-top-color: var(--ochre, #ef7d2e) !important;
}

/* FAQ バッジ オレンジ */
.faq-q-badge {
  background: var(--ochre, #ef7d2e) !important;
  box-shadow: 0 2px 8px rgba(239,125,46,.4) !important;
}

/* ハイライトボックス オレンジ */
.highlight-box, .hb2 {
  border-left: 3px solid var(--ochre, #ef7d2e) !important;
  border-color: rgba(239,125,46,.22) !important;
}

/* コンテンツブロック h3 ボーダー */
.content-block h3, .cb h3 {
  border-left-color: var(--ochre, #ef7d2e) !important;
}

/* テーブルヘッダー */
.price-table th {
  background: var(--navy, #0e5561) !important;
}

/* ナビCTAグロー */
.nav-cta, .bnav-reserve, .menu-cta-btn {
  box-shadow: 0 2px 16px rgba(239,125,46,.4) !important;
}

/* ボトムナビ アクティブ */
#mobileBottomNav a.active,
#mobileBottomNav a:hover {
  color: var(--ochre, #ef7d2e) !important;
}

/* ページトップボタン */
#pageTopBtn:hover, #scrollTop:hover {
  background: var(--ochre, #ef7d2e) !important;
}


/* ════════════════════════════════════════════
   モバイルメニュー 完全スタイル
   （全サブページ共通 - TOPと同一仕様）
════════════════════════════════════════════ */

/* オーバーレイ */
#menuOverlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(2px);
  z-index: 2099; /* ボトムナビ(1800)やFAB(2000)より上に */
}
#menuOverlay.show { display: block; }

/* メニュー本体 */
#mobileMenu {
  position: fixed; inset: 0;
  background: rgba(6,40,48,.98);
  backdrop-filter: blur(18px);
  z-index: 2100; /* 開いている間は固定UIより前面に */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-100%);
  transition: opacity .3s ease, transform .3s ease;
  max-width: 320px;
  width: 85vw;
  box-shadow: 6px 0 40px rgba(0,0,0,.5);
}
#mobileMenu.open {
  opacity: 1;
  pointer-events: all;
  transform: translateX(0);
}

/* ブランド・閉じるボタン */
.menu-brand {
  position: absolute; top: 14px; left: 18px;
  display: flex; align-items: center; gap: 8px;
}
.menu-brand-text {
  font-family: 'Shippori Mincho', serif;
  font-size: .65rem;
  color: rgba(255,255,255,.5);
  letter-spacing: .04em;
  line-height: 1.4;
}
.menu-close {
  position: absolute; top: 14px; right: 14px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 50%;
  width: 36px; height: 36px;
  color: rgba(255,255,255,.65);
  font-size: .9rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .2s;
  z-index: 10;
}
.menu-close:hover { background: rgba(255,255,255,.15); }

/* メニューリスト */
.menu-items {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  padding: 72px 0 16px;
  flex: 1;
}
.menu-items > a {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: .9rem;
  color: rgba(255,255,255,.72);
  letter-spacing: .04em;
  padding: 14px 24px;
  width: 100%;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,.06);
  transition: color .2s, background .2s;
  display: block;
}
.menu-items > a:hover {
  color: #fff;
  background: rgba(255,255,255,.05);
}

/* CTA */
.menu-cta-wrap {
  width: 100%;
  padding: 16px 20px 32px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.menu-cta-btn {
  display: block; width: 100%; text-align: center;
  background: var(--ochre, #ef7d2e);
  color: #fff !important;
  padding: 15px;
  border-radius: 8px;
  font-size: .88rem; font-weight: 700;
  letter-spacing: .05em;
  border: none;
  font-family: 'Noto Sans JP', sans-serif;
  box-shadow: 0 4px 16px rgba(239,125,46,.4);
  transition: background .2s;
  text-decoration: none;
}
.menu-cta-btn:hover { background: var(--ochre2, #d9660f) !important; }

/* アコーディオン */
.mob-acc {
  width: 100%;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.mob-acc-head {
  width: 100%; background: none; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: .9rem; font-weight: 600;
  color: rgba(255,255,255,.85);
  letter-spacing: .04em;
  padding: 15px 24px;
  text-align: left;
  transition: background .2s;
}
.mob-acc-head:hover { background: rgba(255,255,255,.04); }
.mob-acc-head svg {
  transition: transform .25s; flex-shrink: 0;
  opacity: .5; width: 14px; height: 14px;
}
.mob-acc-head.open { color: #fff; }
.mob-acc-head.open svg { transform: rotate(180deg); opacity: .8; }

/* ★ここが核心：デフォルトは非表示 */
.mob-acc-body {
  display: none;
  flex-direction: column;
  background: rgba(0,0,0,.2);
}
.mob-acc-body.open { display: flex; }

.mob-acc-body a {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: .82rem;
  color: rgba(255,255,255,.55);
  padding: 11px 24px 11px 36px;
  border-bottom: 1px solid rgba(255,255,255,.04);
  transition: color .2s, background .2s;
  text-align: left;
  display: flex; align-items: center; gap: 8px;
}
.mob-acc-body a::before {
  content: '';
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--ochre, #ef7d2e);
  flex-shrink: 0; opacity: .6;
}
.mob-acc-body a:hover {
  color: #fff;
  background: rgba(255,255,255,.04);
}
.mob-acc-body a:last-child { border-bottom: none; }

/* ════════════════════════════════════════════
   全ページ共通 レスポンシブ対応
   （各ページの <style> セクションを補完）
════════════════════════════════════════════ */

/* ── タブレット (900px以下) ── */
@media (max-width: 900px) {
  /* グリッドレイアウト: 3列 → 2列 */
  [style*="grid-template-columns:repeat(3"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 14px !important;
  }
  
  /* セクション内 3列 → 2列 */
  .content-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 16px !important; }
  
  /* パディング調整 */
  section[style*="padding:88px 40px"] {
    padding: 64px 32px !important;
  }
}

/* ── モバイル (600px以下) ── */
@media (max-width: 600px) {
  /* グリッドレイアウト: 3列 → 1列 */
  [style*="grid-template-columns:repeat(3"] {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  
  /* グリッドレイアウト: 2列 → 1列 */
  [style*="grid-template-columns:repeat(2"],
  [style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  
  /* セクション内 グリッド → 1列 */
  .content-grid { grid-template-columns: 1fr !important; gap: 12px !important; }
  
  /* パディング統一: 56px 20px */
  section[style*="padding:88px 40px"] {
    padding: 56px 20px !important;
  }
  section[style*="padding:72px 40px"] {
    padding: 56px 20px !important;
  }
  section[style*="padding:60px 40px"] {
    padding: 48px 20px !important;
  }
  
  /* セクション見出しの最適化 */
  h2[style*="font-size:"] {
    font-size: clamp(1.2rem, 5vw, 1.6rem) !important;
  }
  
  /* テーブル: 通常の表組みのまま。はみ出す場合はラッパー側で横スクロール */
  table {
    width: 100%;
    border-collapse: collapse;
  }
  .table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* カード型に積み上げたい表だけ opt-in（td に data-label が必須） */
  table.stack-sp {
    width: 100%;
    display: block;
    border-collapse: collapse;
  }
  table.stack-sp thead {
    display: none;
  }
  table.stack-sp tbody tr {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 12px;
  }
  table.stack-sp td {
    padding: 6px 0 !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  table.stack-sp td::before {
    content: attr(data-label);
    font-weight: bold;
    width: 40%;
    color: var(--navy, #0e5561);
  }
}

