/* ============================================
   希死念慮対応コンテンツ — 共通スタイル
   こころのクリニック桜が丘
   ============================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
a { text-decoration: none; color: inherit; }

:root {
  --bg: #f8f6f4;
  --card: #fff;
  --text: #3a3530;
  --text-light: #6e665e;
  --text-faint: #a8a098;
  --border: #e8e4df;
  --border-light: #f0ede8;

  --primary: #d4819a;
  --primary-deep: #b56b82;
  --primary-pale: #fdf7f8;

  /* 層別カラー */
  --layer1: #a8d8b9;
  --layer1-bg: #f4faf6;
  --layer2: #c4e3a3;
  --layer2-bg: #f8fbf3;
  --layer3: #7eb3d8;
  --layer3-bg: #f0f6fb;
  --layer4: #3a5a8c;
  --layer4-bg: #eef2f8;
  --layer5: #2a2a3e;
  --layer5-bg: #f0f0f4;

  /* 緊急 */
  --emergency: #d97757;
  --emergency-bg: #fff8f0;
  --emergency-border: #f0c4a8;

  /* タイポグラフィ */
  --font-base: -apple-system, BlinkMacSystemFont, 'Hiragino Kaku Gothic ProN', 'Yu Gothic UI', sans-serif;
  --font-heading: 'Hiragino Mincho ProN', 'Yu Mincho', serif;
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-sm: clamp(0.875rem, 0.85rem + 0.15vw, 0.95rem);
  --text-lg: clamp(1.15rem, 1.05rem + 0.5vw, 1.35rem);
  --text-xl: clamp(1.3rem, 1.1rem + 1vw, 1.75rem);
  --line-height: 1.9;

  /* スペーシング */
  --container-max: 640px;
  --section-gap: 2.5rem;
}

body {
  font-family: var(--font-base);
  background: var(--bg);
  color: var(--text);
  font-size: var(--text-base);
  line-height: var(--line-height);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.25rem;
  width: 100%;
}

/* ── Top bar ── */
.top-bar {
  background: rgba(248, 246, 244, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}
.top-bar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.top-bar-back {
  font-size: var(--text-sm);
  color: var(--primary-deep);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.top-bar-back svg { width: 18px; height: 18px; }
.top-bar-title {
  font-size: var(--text-sm);
  color: var(--text-light);
  font-weight: 500;
}

/* ── 緊急バナー ── */
.emergency-banner {
  background: var(--emergency-bg);
  border-bottom: 2px solid var(--emergency);
  padding: 0.6rem 1rem;
  position: sticky;
  top: 46px;
  z-index: 99;
  text-align: center;
}
.emergency-banner-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.emergency-banner .icon { font-size: 1.1rem; }
.emergency-banner .text {
  font-size: var(--text-sm);
  color: var(--text);
  font-weight: 500;
}
.emergency-banner .emergency-link {
  font-size: var(--text-sm);
  color: var(--emergency);
  font-weight: 700;
  border-bottom: 1px solid var(--emergency);
  padding-bottom: 1px;
}

/* ── メインコンテンツ ── */
.main-content {
  flex: 1;
  padding: 2rem 0 6rem;
}

.page-header {
  text-align: center;
  margin-bottom: 2rem;
  padding: 0 0.5rem;
}
.page-header .emoji {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  display: block;
}
.page-header h1 {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 0.5rem;
}
.page-header .subtitle {
  font-size: var(--text-sm);
  color: var(--text-light);
  line-height: 1.7;
}

/* ── 本文ブロック ── */
.content-block {
  max-width: 28em;
  margin: 0 auto var(--section-gap);
  padding: 0 0.5rem;
}
.content-block p {
  margin-bottom: 1.2em;
}
.content-block .lead {
  font-size: var(--text-lg);
  line-height: 2;
  color: var(--text);
}

/* セクション見出し */
.section-heading {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px dashed var(--border);
}

/* セパレーター */
.separator {
  border: none;
  border-top: 1px dashed var(--border);
  margin: var(--section-gap) auto;
  max-width: 28em;
}

/* リスト */
.content-block ul {
  list-style: none;
  padding: 0;
}
.content-block ul li {
  padding-left: 1.2em;
  position: relative;
  margin-bottom: 0.6em;
}
.content-block ul li::before {
  content: '・';
  position: absolute;
  left: 0;
  color: var(--text-faint);
}

/* 強調ボックス */
.highlight-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.2rem 1.4rem;
  margin: 1.5rem 0;
}
.highlight-box strong {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text);
}

/* ── 分岐カード ── */
.branch-card {
  display: block;
  min-height: 80px;
  padding: 1.2rem 1.4rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 0.8rem;
  transition: transform 100ms ease, box-shadow 150ms ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.branch-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.branch-card:active {
  transform: scale(0.98);
}
.branch-card .card-emoji {
  font-size: 1.3rem;
  margin-bottom: 0.3rem;
  display: block;
}
.branch-card .card-title {
  font-weight: 700;
  font-size: var(--text-base);
  margin-bottom: 0.4rem;
  color: var(--text);
}
.branch-card .card-desc {
  font-size: var(--text-sm);
  color: var(--text-light);
  line-height: 1.7;
}
.branch-card .card-arrow {
  display: block;
  text-align: right;
  font-size: var(--text-sm);
  color: var(--primary);
  margin-top: 0.6rem;
  font-weight: 500;
}

/* 層別左ボーダー */
.branch-card.layer1 { border-left: 4px solid var(--layer1); }
.branch-card.layer2 { border-left: 4px solid var(--layer2); }
.branch-card.layer3 { border-left: 4px solid var(--layer3); }
.branch-card.layer4 { border-left: 4px solid var(--layer4); }
.branch-card.layer5 { border-left: 4px solid var(--layer5); }

/* ── アクションボタン ── */
.action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 1rem 1.5rem;
  border-radius: 9999px;
  font-size: var(--text-base);
  font-weight: 700;
  font-family: var(--font-base);
  border: none;
  cursor: pointer;
  transition: opacity 200ms ease;
  text-decoration: none;
  min-height: 52px;
}
.action-btn:hover { opacity: 0.9; }
.action-btn:active { transform: scale(0.98); }

.action-btn.primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
  color: #fff;
  box-shadow: 0 3px 12px rgba(180, 107, 130, 0.25);
}
.action-btn.secondary {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
}
.action-btn.emergency-btn {
  background: linear-gradient(135deg, var(--emergency), #c4593f);
  color: #fff;
  box-shadow: 0 3px 12px rgba(217, 119, 87, 0.25);
}
.action-btn.call-btn {
  background: linear-gradient(135deg, #5a9a6a, #4a8a5a);
  color: #fff;
  box-shadow: 0 3px 12px rgba(90, 154, 106, 0.25);
}
.action-btn.line-btn {
  background: linear-gradient(135deg, #06C755, #05a648);
  color: #fff;
  box-shadow: 0 3px 12px rgba(6, 199, 85, 0.25);
}

.btn-group {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 1.5rem 0;
}

/* ── ページ内ナビ ── */
.page-nav {
  max-width: 28em;
  margin: 2rem auto 0;
  padding: 0 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.page-nav a {
  display: block;
  padding: 0.8rem 1.2rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text);
  transition: background 150ms ease;
  text-align: center;
}
.page-nav a:hover {
  background: var(--border-light);
}
.page-nav a.emergency {
  color: var(--emergency);
  border-color: var(--emergency-border);
}
.page-nav a.safety {
  color: var(--primary-deep);
  border-color: var(--primary);
}

/* ── 相談先ホットライン（下部固定） ── */
.hotline-fixed {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  padding: 0.6rem 1rem;
  z-index: 100;
  display: flex;
  justify-content: center;
  gap: 0.8rem;
}
.hotline-fixed a {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-size: var(--text-sm);
  font-weight: 600;
  transition: opacity 150ms ease;
}
.hotline-fixed a:hover { opacity: 0.8; }
.hotline-fixed .hotline-line {
  background: #06C755;
  color: #fff;
}
.hotline-fixed .hotline-call {
  background: var(--primary);
  color: #fff;
}

/* ── フッター ── */
.site-footer {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 2rem 1.25rem 5rem;
  text-align: center;
}
.site-footer p {
  font-size: clamp(0.75rem, 0.7rem + 0.25vw, 0.8rem);
  color: var(--text-faint);
  line-height: 1.7;
  margin-bottom: 0.5rem;
}
.site-footer a {
  color: var(--primary-deep);
  text-decoration: underline;
}

/* ── その他リンク群 ── */
.other-links {
  max-width: 28em;
  margin: var(--section-gap) auto;
  padding: 0 0.5rem;
}
.other-links h2 {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 1rem;
}
.other-link-item {
  display: block;
  padding: 0.8rem 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 0.5rem;
  font-size: var(--text-sm);
  color: var(--text);
  transition: background 150ms ease;
}
.other-link-item:hover { background: var(--border-light); }
.other-link-item .label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.15rem;
}
.other-link-item .hint {
  font-size: clamp(0.75rem, 0.7rem + 0.25vw, 0.8rem);
  color: var(--text-faint);
}
.other-link-item.coming-soon {
  opacity: 0.5;
  pointer-events: none;
}

/* ── 相談先セクション（本文内） ── */
.contact-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.2rem 1.4rem;
  margin: 1.5rem 0;
}
.contact-section h3 {
  font-size: var(--text-base);
  font-weight: 700;
  margin-bottom: 0.8rem;
}
.contact-group {
  margin-bottom: 1rem;
}
.contact-group .group-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 0.4rem;
}
.contact-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
}
.contact-item a {
  color: var(--primary-deep);
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: border-color 150ms;
}
.contact-item a:hover {
  border-bottom-color: var(--primary-deep);
}

/* ── 緊急ページ専用 ── */
.emergency-page .main-content {
  padding-top: 1.5rem;
}
.breathing-guide {
  text-align: center;
  font-size: var(--text-lg);
  line-height: 2.2;
  padding: 1.5rem 0;
}
.big-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  max-width: 28em;
  margin: 0 auto;
  padding: 0 0.5rem;
}
.big-button {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1.2rem 1.5rem;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 14px;
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
  min-height: 64px;
}
.big-button:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.big-button:active { transform: scale(0.98); }
.big-button .btn-icon { font-size: 1.5rem; flex-shrink: 0; }
.big-button .btn-label { flex: 1; }
.big-button .btn-sub {
  display: block;
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--text-light);
  margin-top: 0.15rem;
}

/* 手段距離化ボックス */
.means-restriction {
  background: var(--emergency-bg);
  border: 1px solid var(--emergency-border);
  border-radius: 12px;
  padding: 1.2rem 1.4rem;
  margin: 2rem auto;
  max-width: 28em;
}
.means-restriction p {
  margin-bottom: 0.8em;
}
.means-restriction strong {
  color: var(--emergency);
}

/* ── JSON-LD非表示 ── */
script[type="application/ld+json"] { display: none; }

/* ── アクセシビリティ ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1917;
    --card: #2a2826;
    --text: #e8e4df;
    --text-light: #b8b0a8;
    --text-faint: #807870;
    --border: #3a3632;
    --border-light: #2e2c28;
    --primary-pale: #2a2025;
    --emergency-bg: #2a2018;
    --emergency-border: #5a3828;
  }
  .top-bar {
    background: rgba(26, 25, 23, 0.95);
  }
  .hotline-fixed {
    background: rgba(26, 25, 23, 0.97);
  }
}

/* ── フォントサイズ大モード対応 ── */
@media (min-width: 600px) {
  :root {
    --section-gap: 3rem;
  }
}

/* ── 印刷対応 ── */
@media print {
  .top-bar, .emergency-banner, .hotline-fixed { display: none; }
  .main-content { padding-bottom: 0; }
  body { background: #fff; }
}
