/* common.css: 共通レイヤー（リセット/トークン/レイアウト/ヘッダー/フッター） */
:root {
  --color-bg: #f9fafb;
  --color-surface: #ffffff;
  --color-text: #1a1a1a;
  --color-muted: #6b7280;
  --color-primary: #0e7a5f;
  --color-accent: #179e74;
  --color-heading: #0f172a;
  --color-border: #e5e7eb;

  /* Typography tones (by hierarchy) */
  --ink-900: #0f172a; /* deepest for small text if needed */
  --ink-800: #1f2937; /* heading/base strong */
  --ink-700: #334155; /* base body on light bg */
  --ink-600: #475569; /* secondary body */

  --text-strong: var(--ink-800);
  --text-base: var(--ink-700);
  --text-secondary: var(--ink-600);
  --heading-strong: var(--ink-900);
  --heading: var(--ink-800);

  /* Size/weight-aware tones */
  --tone-heading-lg: var(--ink-700);
  --tone-heading-md: var(--ink-800);
  --tone-heading-sm: var(--ink-900);
  --tone-body-lg: var(--ink-700);
  --tone-body-md: var(--ink-700);
  --tone-body-sm: var(--ink-800);

  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.08);

  --space-2: 8px;  --space-3: 12px; --space-4: 16px; --space-6: 24px; --space-8: 32px; --space-9: 48px;
  
  /* 追加: 共通で使用するスペーシングとカラー */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  
  --color-error: #dc3545;
  --color-success: #28a745;
  --color-warning: #ffc107;
  --color-info: #17a2b8;
  
  --transition-base: 0.2s ease;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--text-base);
  font-family: 'Noto Sans JP', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  line-height: 1.7;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* コンテナー */
.c-container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--space-4); }
@media (max-width: 480px) { .c-container { padding: 0 12px; } }

/* ヘッダー/フッター（最小骨格。既存.site-headerは維持） */
.c-header { background: var(--color-surface); box-shadow: var(--shadow-sm); position: sticky; top: 0; z-index: 50; transition: background .2s ease, box-shadow .2s ease; }
.c-footer { background: var(--color-bg); color: var(--color-muted); padding: var(--space-8) 0; text-align: center; border-top: 1px solid #eee; }
.c-footer a { color: var(--color-text); }
.c-footer a:hover { color: var(--color-primary); text-decoration: underline; }

/* ヘッダー詳細 */
.c-header__inner { display:flex; align-items:center; gap: 12px; padding: 16px 0; transition: padding .2s ease; }
.c-header__logo { width: 56px; height: 56px; border-radius: 12px; border:1px solid #f1e9b0; background:#fff; transition: width .2s ease, height .2s ease; }
.c-header__titles { display:flex; flex-direction:column; }
.c-header__title { margin:0; font-size: 22px; font-weight: 900; letter-spacing:.01em; color: var(--heading); transition: font-size .2s ease, color .2s ease; }
.c-header__accent { color: var(--color-primary); }
.c-header__subtitle { margin:2px 0 0; font-size: 13px; color: var(--text-secondary); transition: font-size .2s ease, color .2s ease, opacity .2s ease, max-height .2s ease, margin .2s ease; opacity: 1; max-height: 40px; }

/* ヘッダー縮小（スクロール時） */
.site-header.is-compact .c-header__inner { padding: 8px 0; }
.site-header.is-compact .c-header__logo { width: 38px; height: 38px; border-radius: 10px; }
.site-header.is-compact .c-header__title { font-size: 16px; color: var(--heading-strong); }
.site-header.is-compact .c-header__subtitle { opacity: 0; max-height: 0; margin: 0; overflow: hidden; pointer-events: none; }

/* ヘッダー右端のお気に入りボタン（スクロール時のみ表示） */
.header-fav-btn { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); border: none; background: transparent; color: #e11d48; font-size: 20px; padding: 6px 8px; display: none; }
.header-fav-badge { position: absolute; top: -6px; right: -6px; background: #ef4444; color: #fff; border-radius: 999px; padding: 0 6px; font-size: 11px; line-height: 18px; min-width: 18px; text-align: center; }
.site-header.is-compact .header-fav-btn { display: inline-flex; align-items: center; justify-content: center; }
@media (max-width: 700px) { .header-fav-btn { right: 8px; font-size: 20px; } }

/* お気に入りオーバーレイ */
.fav-overlay { position: fixed; inset: 0; z-index: 60; }
.fav-overlay__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.35); }
.fav-panel { position: absolute; right: 10px; top: 56px; width: min(420px, 92vw); max-height: 70vh; overflow: auto; background: #fff; border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.25); border: 1px solid rgba(0,0,0,.06); }
.fav-panel__header { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid rgba(0,0,0,.06); }
.fav-panel__close { border: none; background: transparent; font-size: 18px; }
.fav-panel__empty { padding: 16px; color: #6b7280; font-size: 14px; }
.fav-list { display: grid; grid-template-columns: 1fr; gap: 10px; padding: 12px; }
.fav-item { display: flex; gap: 10px; align-items: center; padding: 8px; border: 1px solid rgba(0,0,0,.06); border-radius: 10px; cursor: pointer; overflow: hidden; }
.fav-item__thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; flex: 0 0 auto; }
.fav-item__body { min-width: 0; }
.fav-item__title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fav-item__desc { color: #6b7280; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fav-item__remove { margin-left: auto; border: none; background: transparent; color: #ef4444; font-size: 18px; }

/* SPでの更なる小型化と縦→横切替 */
@media (max-width: 480px){
  /* 通常時はロゴ最上部→下にタイトル群（縦並び） */
  .c-header__inner { padding: 12px 0; flex-direction: column; align-items: center; gap: 8px; }
  .c-header__logo { width: 52px; height: 52px; }
  .c-header__titles { align-items: center; text-align: center; }
  .c-header__title { font-size: 18px; }
  .c-header__subtitle { font-size: 12px; }
  /* スクロール時は横並びでシームレスに縮小 */
  .site-header.is-compact .c-header__inner { padding: 6px 0; flex-direction: row; align-items: center; gap: 12px; }
  .site-header.is-compact .c-header__logo { width: 32px; height: 32px; }
  .site-header.is-compact .c-header__titles { align-items: flex-start; text-align: left; }
  .site-header.is-compact .c-header__title { font-size: 15px; }
}

/* main spacing */
main.c-container { padding-top: var(--space-6); }

/* ユーティリティ */
.u-card { background: var(--color-surface); border: 1px solid #eef2f2; border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.c-input { width: 100%; padding: 10px 12px; border:1px solid #e5e7eb; border-radius: 8px; background:#fff; color: var(--color-text); }
.c-input:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(14,122,95,.12); }
.c-button { background: var(--color-primary); color:#fff; border:none; padding: 10px 16px; border-radius: 8px; cursor:pointer; }
.c-button:disabled { opacity:.6; cursor: not-allowed; }
.c-button:hover:not(:disabled) { background: #0a5f4a; }
.u-shadow-md { box-shadow: var(--shadow-md); }
.u-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-3); }
@media (min-width: 900px) { .u-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); } }

/* ===== 共通で使用する最小限のスタイル ===== */
.hotel-form { position: relative; }
.hotel-input-wrap { position: relative; }
.hotel-suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 20;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  max-height: 220px;
  overflow: auto;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
  list-style: none;
  margin: 0;
  padding: 4px 0;
}
.hotel-suggest__item {
  padding: 8px 12px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hotel-suggest__item.is-active,
.hotel-suggest__item:hover {
  background: #f5f5f5;
}

/* ローディング */
.c-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
  text-align: center;
}

.c-loading__spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--color-border);
  border-top: 3px solid var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: var(--space-md);
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* エラー表示 */
.c-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
  text-align: center;
  color: var(--color-error);
}

.c-error i {
  font-size: 2.25rem;
  margin-bottom: var(--space-md);
}

.c-error h2 {
  margin: 0 0 var(--space-md) 0;
  color: var(--color-text);
}

.c-error p {
  margin: 0 0 var(--space-lg) 0;
  color: var(--color-text-light);
}

.c-error__btn {
  background: var(--color-primary);
  color: white;
  border: none;
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition-base);
}

.c-error__btn:hover {
  background: #0a5f4a;
  transform: translateY(-1px);
}

/* 戻るボタン */
.c-back-btn {
  background: none;
  border: none;
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--color-text);
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.c-back-btn:hover {
  background: var(--color-bg);
  color: var(--color-primary);
}

.c-back-btn i {
  font-size: 1.125rem;
}
