/* =====================================================================
   長崎伝統さんぽ - style.css
   デザインコンセプト：出島の「窓」— 鎖国時代、長崎の出島だけが
   日本と世界をつなぐ窓でした。このサイトも、旅人と職人をつなぐ
   ひとつの「窓」として、丸窓（ポートホール）と波の意匠を軸にしています。
   ===================================================================== */

/* ---------- デザイントークン ---------- */
:root {
  /* カラー */
  --ink: #16283F;          /* 出島の夜の海 - ヘッダー/フッター/見出し */
  --ink-soft: #24425F;     /* ink のやや明るいバリエーション */
  --paper: #F1EAD6;        /* 和紙のような背景 */
  --paper-card: #FBF7EC;   /* カード背景 */
  --vermilion: #C1442D;    /* 長崎ランタンの朱色 - CTA/アクセント */
  --vermilion-dark: #99331F;
  --brass: #AD8A2E;        /* 蒔絵の金 - 罫線・装飾 */
  --charcoal: #2A241C;     /* 本文テキスト */
  --charcoal-soft: #5B5142;/* 補助テキスト */
  --line: rgba(42, 36, 28, 0.14);
  --white: #ffffff;
  --success: #3E7A4C;
  --danger: #B23A2E;

  /* タイポグラフィ */
  --font-display: "Shippori Mincho", serif;
  --font-body: "Noto Sans JP", "Hiragino Sans", sans-serif;

  /* レイアウト */
  --max-width: 1140px;
  --radius-s: 6px;
  --radius-m: 14px;
  --radius-l: 28px;
  --shadow-card: 0 6px 24px rgba(22, 40, 63, 0.10);
  --shadow-modal: 0 20px 60px rgba(22, 40, 63, 0.35);
}

/* ---------- リセット ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--charcoal);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.4;
  margin: 0 0 0.6em;
}
p { margin: 0 0 1em; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; font-size: 1rem; }
ul { list-style: none; margin: 0; padding: 0; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

:focus-visible {
  outline: 3px solid var(--vermilion);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------- 波の区切り線（署名的な装飾要素） ---------- */
.wave-divider {
  height: 26px;
  width: 100%;
  background-repeat: repeat-x;
  background-size: 52px 26px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='52' height='26' viewBox='0 0 52 26'%3E%3Cpath d='M0 13 Q13 0 26 13 T52 13' fill='none' stroke='%23AD8A2E' stroke-width='2' opacity='0.55'/%3E%3C/svg%3E");
}

/* ---------- ヘッダー ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--ink);
  color: var(--paper);
  border-bottom: 1px solid rgba(173, 138, 46, 0.4);
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex; align-items: center; gap: 24px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--paper);
  white-space: nowrap;
}
.brand-mark { color: var(--brass); display: inline-flex; }
.main-nav { display: flex; gap: 20px; flex: 1; }
.main-nav a {
  font-size: 0.95rem;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  opacity: 0.88;
}
.main-nav a:hover, .main-nav a.active { border-bottom-color: var(--vermilion); opacity: 1; }
.auth-area { display: flex; align-items: center; gap: 12px; }
.lang-select-wrap select {
  background: rgba(255,255,255,0.08);
  color: var(--paper);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--radius-s);
  padding: 6px 8px;
}
.user-box { display: flex; align-items: center; gap: 10px; }
.user-name { font-size: 0.9rem; opacity: 0.9; }
.menu-toggle { display: none; }

/* ---------- ボタン ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: none; cursor: pointer;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.92rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--vermilion); color: #fff; }
.btn-primary:hover { background: var(--vermilion-dark); }
.btn-outline {
  background: transparent; color: inherit;
  border: 1.5px solid rgba(241, 234, 214, 0.55);
}
.btn-outline:hover { border-color: var(--brass); color: var(--brass); }
.btn-ghost { background: transparent; color: inherit; text-decoration: underline; padding: 6px 4px; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 14px; font-size: 0.82rem; }
.btn-danger { background: var(--danger); color: #fff; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- ページ全体レイアウト ---------- */
.app-root { min-height: 60vh; }
.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 64px 24px;
}
.section-eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--vermilion);
  font-weight: 700;
  margin-bottom: 10px;
}
.section-head { max-width: 640px; margin-bottom: 40px; }
.section-head p { color: var(--charcoal-soft); }

.loading-screen, .empty-state, .error-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 90px 20px; text-align: center; color: var(--charcoal-soft);
}
.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--vermilion);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- ホーム: ヒーロー（出島の窓＝丸窓モチーフ） ---------- */
.hero {
  position: relative;
  background: radial-gradient(120% 120% at 20% 0%, var(--ink-soft) 0%, var(--ink) 60%);
  color: var(--paper);
  overflow: hidden;
}
.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 80px 24px 100px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
}
.hero-copy .section-eyebrow { color: var(--brass); }
.hero h1 {
  color: var(--paper);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  margin-bottom: 0.5em;
}
.hero p.lead { color: rgba(241,234,214,0.82); font-size: 1.05rem; max-width: 46ch; }
.hero-ctas { display: flex; gap: 14px; margin-top: 28px; flex-wrap: wrap; }

.porthole {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 380px;
  margin: 0 auto;
  border-radius: 50%;
  border: 14px solid var(--brass);
  box-shadow: 0 0 0 6px var(--ink), 0 30px 60px rgba(0,0,0,0.45), inset 0 0 30px rgba(0,0,0,0.5);
  overflow: hidden;
  background: #0d1b2e;
}
.porthole img {
  width: 100%; height: 100%; object-fit: cover;
}
.porthole::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: 50%;
  box-shadow: inset 0 0 40px rgba(0,0,0,0.5);
  pointer-events: none;
}
.porthole .rivet {
  position: absolute; width: 8px; height: 8px; border-radius: 50%;
  background: #8a6f24; box-shadow: 0 0 0 2px rgba(0,0,0,0.3);
}

/* ---------- 特長カード ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.feature-card {
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 26px;
}
.feature-card .icon { color: var(--vermilion); margin-bottom: 12px; }
.feature-card h3 { font-size: 1.05rem; margin-bottom: 6px; }
.feature-card p { color: var(--charcoal-soft); font-size: 0.92rem; margin: 0; }

/* ---------- 利用の流れ（本物の手順なので番号を使用） ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; counter-reset: step; }
.step { position: relative; padding-left: 6px; }
.step-num {
  font-family: var(--font-display);
  font-size: 2.4rem; color: var(--brass); font-weight: 700; line-height: 1;
  display: block; margin-bottom: 10px;
}
.step h3 { font-size: 1rem; margin-bottom: 6px; }
.step p { color: var(--charcoal-soft); font-size: 0.9rem; }

/* ---------- ワークショップ カードグリッド ---------- */
.toolbar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; flex-wrap: wrap; margin-bottom: 28px;
}
.search-input {
  padding: 10px 16px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  min-width: 260px;
  background: var(--paper-card);
}
.workshop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 26px;
}
.workshop-card {
  background: var(--paper-card);
  border-radius: var(--radius-m);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  display: flex; flex-direction: column;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.workshop-card:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(22,40,63,0.16); }
.workshop-card .thumb { aspect-ratio: 4/3; overflow: hidden; background: var(--ink); }
.workshop-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.workshop-card .body { padding: 18px 18px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.workshop-card .craft-tag {
  align-self: flex-start;
  font-size: 0.72rem; letter-spacing: 0.04em;
  color: var(--vermilion); font-weight: 700; text-transform: uppercase;
}
.workshop-card h3 { font-size: 1.08rem; margin: 0; }
.workshop-card .meta { font-size: 0.86rem; color: var(--charcoal-soft); display: flex; flex-wrap: wrap; gap: 4px 10px; }
.workshop-card .foot {
  margin-top: auto; display: flex; justify-content: space-between; align-items: center;
  padding-top: 10px; border-top: 1px dashed var(--line);
}
.price { font-weight: 700; color: var(--ink); }
.rating-badge { font-size: 0.85rem; color: var(--brass); font-weight: 700; }

/* ---------- ワークショップ詳細 ---------- */
.detail-back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 20px; color: var(--charcoal-soft); }
.detail-grid {
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px;
}
.detail-hero-img { border-radius: var(--radius-m); overflow: hidden; aspect-ratio: 16/10; margin-bottom: 20px; }
.detail-hero-img img { width: 100%; height: 100%; object-fit: cover; }
.detail-title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.info-pills { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 20px; }
.pill {
  background: var(--paper-card); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 14px; font-size: 0.85rem; color: var(--charcoal-soft);
}
.translate-row { display: flex; align-items: center; gap: 10px; margin: 10px 0 18px; flex-wrap: wrap; }
.translate-row select { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 5px 8px; }
.translated-box {
  margin-top: 10px; padding: 12px 14px; background: #fff;
  border-left: 3px solid var(--brass); border-radius: var(--radius-s);
  font-size: 0.92rem; color: var(--charcoal-soft);
}

.artisan-card {
  display: flex; gap: 16px; align-items: center;
  background: var(--paper-card); border: 1px solid var(--line);
  border-radius: var(--radius-m); padding: 18px; margin: 22px 0;
}
.artisan-card img { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; border: 3px solid var(--brass); }
.artisan-card h4 { margin: 0 0 4px; font-size: 1rem; }
.artisan-card .craft { color: var(--vermilion); font-size: 0.82rem; font-weight: 700; }

.booking-panel {
  background: var(--ink); color: var(--paper);
  border-radius: var(--radius-l);
  padding: 28px;
  position: sticky; top: 90px;
}
.booking-panel h3 { color: var(--paper); }
.booking-panel .price-line { font-size: 1.6rem; font-weight: 700; margin-bottom: 4px; }
.booking-panel .price-line small { font-size: 0.9rem; font-weight: 400; opacity: 0.75; }
.booking-panel label { display: block; margin: 14px 0 6px; font-size: 0.86rem; opacity: 0.9; }
.booking-panel select, .booking-panel input {
  width: 100%; padding: 10px 12px; border-radius: var(--radius-s); border: none;
}
.booking-note { font-size: 0.8rem; opacity: 0.7; margin-top: 12px; }

.reviews-section { margin-top: 40px; }
.review-item {
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
}
.review-item .stars { color: var(--brass); letter-spacing: 2px; }
.review-item .meta { font-size: 0.8rem; color: var(--charcoal-soft); }
.review-form {
  background: var(--paper-card); border: 1px solid var(--line);
  border-radius: var(--radius-m); padding: 20px; margin-top: 20px;
}
.review-form textarea { width: 100%; padding: 10px; border-radius: var(--radius-s); border: 1px solid var(--line); min-height: 90px; margin: 8px 0 14px; }
.star-select { display: flex; gap: 6px; font-size: 1.4rem; cursor: pointer; }
.star-select button { background: none; border: none; cursor: pointer; color: var(--line); padding: 0; }
.star-select button.active, .star-select button:hover { color: var(--brass); }

/* ---------- マイページ ---------- */
.mypage-grid { display: grid; grid-template-columns: 260px 1fr; gap: 32px; }
.mypage-side {
  background: var(--paper-card); border: 1px solid var(--line);
  border-radius: var(--radius-m); padding: 22px; align-self: start;
}
.mypage-side .avatar {
  width: 56px; height: 56px; border-radius: 50%; background: var(--ink); color: var(--paper);
  display: flex; align-items: center; justify-content: center; font-family: var(--font-display);
  font-size: 1.4rem; margin-bottom: 12px;
}
.booking-row, .my-review-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 16px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.status-badge { font-size: 0.76rem; padding: 3px 10px; border-radius: 999px; font-weight: 700; }
.status-confirmed { background: rgba(62,122,76,0.15); color: var(--success); }
.status-cancelled { background: rgba(178,58,46,0.12); color: var(--danger); }

/* ---------- モーダル（ログイン／新規登録） ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(22,40,63,0.55);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal-box {
  background: var(--paper-card); border-radius: var(--radius-l);
  max-width: 400px; width: 100%; padding: 32px 28px;
  box-shadow: var(--shadow-modal); position: relative;
}
.modal-close {
  position: absolute; top: 14px; right: 16px; background: none; border: none;
  font-size: 1.6rem; cursor: pointer; color: var(--charcoal-soft); line-height: 1;
}
.auth-tabs { display: flex; gap: 6px; margin-bottom: 22px; background: var(--paper); border-radius: 999px; padding: 4px; }
.auth-tab {
  flex: 1; border: none; background: none; padding: 9px; border-radius: 999px;
  cursor: pointer; font-weight: 600; color: var(--charcoal-soft);
}
.auth-tab.active { background: var(--ink); color: var(--paper); }
.auth-form label { display: block; font-size: 0.85rem; margin: 12px 0 6px; color: var(--charcoal-soft); }
.auth-form input {
  width: 100%; padding: 10px 12px; border-radius: var(--radius-s); border: 1px solid var(--line);
}
.auth-form button[type="submit"] { margin-top: 20px; }
.auth-message { min-height: 1.2em; font-size: 0.85rem; color: var(--danger); margin-top: 12px; text-align: center; }

/* ---------- トースト ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--paper); padding: 12px 22px;
  border-radius: 999px; box-shadow: var(--shadow-modal); z-index: 200;
  font-size: 0.9rem;
}
.toast.error { background: var(--danger); }
.toast.success { background: var(--success); }

/* ---------- フッター ---------- */
.site-footer { background: var(--ink); color: rgba(241,234,214,0.75); margin-top: 60px; }
.footer-inner { max-width: var(--max-width); margin: 0 auto; padding: 40px 24px; text-align: center; }
.footer-brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display); color: var(--paper); font-size: 1.05rem; margin-bottom: 10px;
}
.footer-copy { font-size: 0.88rem; }
.footer-fine { font-size: 0.78rem; opacity: 0.6; margin: 0; }

/* ---------- レスポンシブ ---------- */
@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; }
  .porthole { order: -1; max-width: 260px; }
  .feature-grid, .steps { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .booking-panel { position: static; }
  .mypage-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .main-nav { position: fixed; top: 62px; left: 0; right: 0; background: var(--ink);
    flex-direction: column; padding: 16px 24px; gap: 4px; display: none; }
  .main-nav.open { display: flex; }
  .menu-toggle {
    display: flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 30px; height: 26px; background: none; border: none; cursor: pointer;
  }
  .menu-toggle span { width: 100%; height: 2px; background: var(--paper); border-radius: 2px; }
  .lang-select-wrap { display: none; }
  .header-inner { flex-wrap: wrap; }
}
