/* ==========================================================================
   style.css — チカイカラ共通スタイル
   方針: 高齢者でも使いやすい大きな文字・大きなタップ領域、スマホファースト
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=BIZ+UDGothic:wght@400;700&display=swap');

/* --------------------------------------------------------------------------
   リセット・ベース
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: inherit;
}

/* hidden 属性を display: flex 等のルールに上書きされないよう保護 */
[hidden] { display: none !important; }

html {
  font-size: 18px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'BIZ UDGothic', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans',
               'Meiryo', 'Yu Gothic', sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  color: #111111;
  background: #f5f5f5;
  min-height: 100dvh;
}

/* --------------------------------------------------------------------------
   タイポグラフィ
   -------------------------------------------------------------------------- */
h1 { font-size: clamp(1.5rem, 5vw, 2rem);    font-weight: 700; line-height: 1.3; }
h2 { font-size: clamp(1.25rem, 4vw, 1.6rem); font-weight: 700; line-height: 1.4; }
h3 { font-size: clamp(1.1rem, 3.5vw, 1.3rem); font-weight: 700; }

p, li, label, input, textarea, select, button {
  font-size: clamp(1rem, 2.5vw, 1.125rem);
}

small {
  font-size: clamp(0.875rem, 2vw, 1rem);
}

/* --------------------------------------------------------------------------
   レイアウト
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 16px;
}

/* --------------------------------------------------------------------------
   ヘッダー
   -------------------------------------------------------------------------- */
.site-header {
  background: #ffffff;
  border-bottom: 1px solid #d8d8d8;
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .container {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}

.site-header__left {
  display: flex;
  align-items: center;
}

.site-header__logo {
  font-size: clamp(1.2rem, 4vw, 1.5rem);
  font-weight: 700;
  color: #111111;
  text-decoration: none;
  letter-spacing: 0.02em;
  justify-self: center;
}

.site-header__nav {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  justify-content: flex-end;
  position: relative;
}

.person-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  min-width: 160px;
  z-index: 200;
  overflow: hidden;
}

.person-menu__item {
  display: block;
  padding: 12px 20px;
  color: #111111;
  text-decoration: none;
  font-weight: 600;
  font-size: clamp(0.95rem, 2.2vw, 1.05rem);
  border-bottom: 1px solid #f0f0f0;
}

.person-menu__item:last-child { border-bottom: none; }
.person-menu__item:hover { background: #f5f5f5; }

.person-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid #bdbdbd;
  background: transparent;
  color: #111111;
  text-decoration: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}
.person-btn:hover {
  background: #f0f0f0;
  border-color: #777777;
}
.person-btn--inactive {
  border-style: dashed;
}
.person-btn--active {
  background: #111111;
  border-color: #111111;
  color: #ffffff;
}
.person-btn--active:hover {
  background: #333333;
  border-color: #333333;
}




.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  min-height: 44px;
  font-size: clamp(1rem, 2.5vw, 1.1rem);
  font-weight: 600;
  color: #111111;
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.15s;
}

.nav-link:hover,
.nav-link:focus-visible {
  background: #eeeeee;
  outline: 2px solid #111111;
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   ボタン
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 24px;
  font-size: clamp(1rem, 2.5vw, 1.125rem);
  font-weight: 700;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, opacity 0.15s, transform 0.1s;
  user-select: none;
  white-space: nowrap;
}

.btn:active { transform: scale(0.97); }
.btn:focus-visible {
  outline: 3px solid #111111;
  outline-offset: 3px;
}
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* プライマリ */
.btn-primary {
  background: #111111;
  color: #ffffff;
}
.btn-primary:hover:not(:disabled) { background: #333333; }

/* セカンダリ */
.btn-secondary {
  background: #ffffff;
  color: #111111;
  border: 2px solid #333333;
}
.btn-secondary:hover:not(:disabled) { background: #f0f0f0; }

/* 危険 */
.btn-danger {
  background: #1a1a1a;
  color: #ffffff;
  border: 2px solid #1a1a1a;
}
.btn-danger:hover:not(:disabled) { background: #444444; }

/* ブロック */
.btn-block { width: 100%; }

/* 大きめ */
.btn-lg {
  min-height: 56px;
  padding: 14px 32px;
  font-size: clamp(1.1rem, 3vw, 1.25rem);
  border-radius: 10px;
}

/* --------------------------------------------------------------------------
   フォーム
   -------------------------------------------------------------------------- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

label {
  font-weight: 700;
  color: #111111;
}

button,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="search"],
textarea,
select {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  font-size: clamp(1rem, 2.5vw, 1.125rem);
  color: #111111;
  background: #ffffff;
  border: 2px solid #cccccc;
  border-radius: 8px;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #111111;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.12);
}

input::placeholder,
textarea::placeholder { color: #888888; }

textarea {
  min-height: 120px;
  resize: vertical;
}

/* エラー状態 */
input.is-error,
textarea.is-error,
select.is-error {
  border-color: #555555;
}

.form-error {
  font-size: clamp(0.875rem, 2vw, 1rem);
  color: #111111;
  font-weight: 600;
}

.form-hint {
  font-size: clamp(0.875rem, 2vw, 1rem);
  color: #555555;
}

/* --------------------------------------------------------------------------
   カード
   -------------------------------------------------------------------------- */
.card {
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}

.card-title {
  font-size: clamp(1.1rem, 3vw, 1.3rem);
  font-weight: 700;
  margin-bottom: 8px;
}

.card-body { color: #333333; }

/* --------------------------------------------------------------------------
   アラート・メッセージ
   -------------------------------------------------------------------------- */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border-radius: 8px;
  font-size: clamp(1rem, 2.5vw, 1.1rem);
  font-weight: 600;
  margin-bottom: 16px;
}

.alert-success { background: #e8e8e8; color: #111111; border: 1px solid #cccccc; }
.alert-error   { background: #f0f0f0; color: #111111; border: 1px solid #aaaaaa; }
.alert-info    { background: #eeeeee; color: #111111; border: 1px solid #cccccc; }
.alert-warning { background: #e8e8e8; color: #111111; border: 1px solid #aaaaaa; }

/* --------------------------------------------------------------------------
   リスト
   -------------------------------------------------------------------------- */
.list-none { list-style: none; }

.list-item {
  padding: 16px 0;
  border-bottom: 1px solid #e8e8e8;
  display: flex;
  align-items: center;
  gap: 12px;
}

.list-item:last-child { border-bottom: none; }

/* --------------------------------------------------------------------------
   バッジ
   -------------------------------------------------------------------------- */
.badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: clamp(0.8rem, 2vw, 0.9rem);
  font-weight: 700;
  border-radius: 999px;
  white-space: nowrap;
}

.badge-green  { background: #e8e8e8; color: #111111; }
.badge-red    { background: #dddddd; color: #111111; }
.badge-gray   { background: #e0e0e0; color: #111111; }
.badge-yellow { background: #e8e8e8; color: #111111; }

/* --------------------------------------------------------------------------
   ローディング
   -------------------------------------------------------------------------- */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 32px;
  font-size: 1.1rem;
  color: #555555;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 4px solid #e0e0e0;
  border-top-color: #111111;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* --------------------------------------------------------------------------
   地図コンテナ
   -------------------------------------------------------------------------- */
.map-container {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #d8d8d8;
  background: #e8e8e8;
}

@media (min-width: 600px) {
  .map-container { aspect-ratio: 16 / 9; }
}

/* --------------------------------------------------------------------------
   メインコンテンツ
   -------------------------------------------------------------------------- */
.main {
  padding: 24px 0 64px;
}

/* --------------------------------------------------------------------------
   フッター
   -------------------------------------------------------------------------- */
.site-footer {
  background: #ffffff;
  border-top: 1px solid #e0e0e0;
  padding: 24px 0;
  text-align: center;
  color: #555555;
  font-size: clamp(0.875rem, 2vw, 1rem);
}

/* --------------------------------------------------------------------------
   スキップリンク（アクセシビリティ）
   -------------------------------------------------------------------------- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  padding: 12px 20px;
  background: #111111;
  color: #ffffff;
  font-weight: 700;
  border-radius: 0 0 8px 8px;
  text-decoration: none;
  z-index: 9999;
  transition: top 0.2s;
}
.skip-link:focus { top: 0; }

/* --------------------------------------------------------------------------
   ユーティリティ
   -------------------------------------------------------------------------- */
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.mt-8  { margin-top:  8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8  { margin-bottom:  8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.gap-8  { gap:  8px; }
.gap-16 { gap: 16px; }
.d-flex   { display: flex; }
.flex-col { flex-direction: column; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full  { width: 100%; }
.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;
}

/* --------------------------------------------------------------------------
   レスポンシブ（タブレット〜）
   -------------------------------------------------------------------------- */
@media (min-width: 600px) {
  .container { padding: 0 24px; }
  .card { padding: 28px; }
  .btn-lg { min-height: 60px; }
}

@media (min-width: 800px) {
  .container { padding: 0 32px; }
  .two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
}

/* --------------------------------------------------------------------------
   タブパネル
   -------------------------------------------------------------------------- */
.tab-panel { padding: 24px 0 60px; }
.tab-panel[hidden] { display: none; }

/* --------------------------------------------------------------------------
   ステータスメッセージ
   -------------------------------------------------------------------------- */
.status-msg { font-size: clamp(0.9rem, 2vw, 1rem); margin-top: 6px; min-height: 1.4em; color: #333333; }
.status-msg--error { color: #c0392b; }

/* --------------------------------------------------------------------------
   区切り線（位置情報フォーム）
   -------------------------------------------------------------------------- */
.location-divider { display: flex; align-items: center; gap: 10px; color: #616161; font-size: clamp(0.9rem, 2vw, 1rem); margin: 8px 0; }
.location-divider__line { flex: 1; height: 1px; background: #bdbdbd; display: block; }

/* --------------------------------------------------------------------------
   スプリットトグル（セグメントコントロール）
   -------------------------------------------------------------------------- */
.split-toggle {
  display: flex;
  background: #d0d0d0;
  border-radius: 10px;
  padding: 3px;
  gap: 3px;
}
.split-toggle__btn {
  flex: 1;
  min-height: 42px;
  padding: 8px 12px;
  font-size: clamp(0.95rem, 2.5vw, 1.05rem);
  font-weight: 700;
  font-family: inherit;
  background: transparent;
  color: #444444;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}
.split-toggle__btn:hover:not(.is-active) { background: rgba(255,255,255,0.6); }
.split-toggle__btn.is-active {
  background: #111111;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.content-mode-bar {
  background: #ffffff;
  border-bottom: 1px solid #d8d8d8;
  padding: 10px 0;
  position: sticky;
  top: 62px;
  z-index: 90;
}
.content-mode-bar .split-toggle {
  background: #e8e8e8;
}

/* --------------------------------------------------------------------------
   ダークモード
   -------------------------------------------------------------------------- */
@media (prefers-color-scheme: dark) {
  body              { background: #111111; color: #f0f0f0; }
  .site-header      { background: #1a1a1a; border-color: #333333; }
  .site-header__logo { color: #f0f0f0; }
  .card             { background: #1e1e1e; border-color: #333333; }
  .site-footer      { background: #1a1a1a; border-color: #333333; color: #888888; }
  .nav-link         { color: #e0e0e0; }
  .nav-link:hover   { background: #2a2a2a; }
  .btn-primary      { background: #f0f0f0; color: #111111; }
  .btn-primary:hover:not(:disabled) { background: #cccccc; }
  .btn-secondary    { background: #1e1e1e; color: #f0f0f0; border-color: #888888; }
  .btn-secondary:hover:not(:disabled) { background: #2a2a2a; }
  .person-btn       { border-color: #555555; color: #f0f0f0; }
  .person-btn:hover { background: #2a2a2a; border-color: #888888; }
  .person-btn--active       { background: #f0f0f0; border-color: #f0f0f0; color: #111111; }
  .person-btn--active:hover { background: #cccccc; border-color: #cccccc; }
  .person-menu      { background: #242424; border-color: #3a3a3a; }
  .person-menu__item { color: #f0f0f0; border-color: #333333; }
  .person-menu__item:hover { background: #2a2a2a; }
  input[type="text"], input[type="email"], input[type="password"],
  input[type="tel"],  input[type="number"], input[type="search"],
  textarea, select {
    background: #222222;
    border-color: #444444;
    color: #f0f0f0;
  }
  input:focus, textarea:focus, select:focus {
    border-color: #cccccc;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.12);
  }

  .list-item   { border-color: #333333; }
  .badge-gray  { background: #333333; color: #e0e0e0; }
  .badge-yellow { background: #333333; color: #e0e0e0; }
  .badge-green  { background: #333333; color: #e0e0e0; }
  .badge-red    { background: #3a2020; color: #ffaaaa; }
  .form-hint   { color: #bbbbbb; }
  .form-error  { color: #f0f0f0; }
  .card-body   { color: #e0e0e0; }
  .loading     { color: #bbbbbb; }
  .spinner     { border-color: #333333; border-top-color: #eeeeee; }
  input::placeholder, textarea::placeholder { color: #666666; }
  .alert-success { background: #2a2a2a; color: #e0e0e0; border-color: #444444; }
  .alert-error   { background: #2a2a2a; color: #ff8888; border-color: #555555; }
  .alert-info    { background: #2a2a2a; color: #e0e0e0; border-color: #444444; }
  .alert-warning { background: #2d2500; color: #ffc107; border-color: #666644; }
  .status-msg       { color: #e0e0e0; }
  .status-msg--error { color: #ff8888; }
  .location-divider { color: #bbbbbb; }
  .location-divider__line { background: #444444; }
  .input-field   { background: #222222; border-color: #444444; color: #f0f0f0; }
  .split-toggle  { background: #333333; }
  .split-toggle__btn { color: #e0e0e0; }
  .split-toggle__btn:hover:not(.is-active) { background: rgba(255,255,255,0.08); }
  .split-toggle__btn.is-active { background: #f0f0f0; color: #111111; }
  .content-mode-bar { background: #1a1a1a; border-color: #333333; }
  .content-mode-bar .split-toggle { background: #2a2a2a; }
  label { color: #f0f0f0; }
}

/* --------------------------------------------------------------------------
   アニメーション軽減（アクセシビリティ）
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
