/* Morimi's Home Kitchen in Tokyo
   現行 Studio サイトのデザイン仕様（実測）を踏襲しつつ、
   START-HERE.md 記載の問題 1〜7 を解消する。 */

:root {
  --orange: #FF8336;        /* ブランド色。面としてのみ使う */
  --orange-text: #C2540A;   /* 白文字を乗せる面。白で 4.6:1 を満たす */
  --ink: #333333;
  --ink-soft: #6e6e6e;
  --line: #e8e4de;
  --bg: #ffffff;
  --bg-soft: #faf8f5;
  --header-h: 64px;
  --serif: "Playfair Display", "Times New Roman", serif;
  --sans: "Montserrat", "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --body: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }

body {
  margin: 0;
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;            /* 横スクロールを原理的に封じる */
}

img { max-width: 100%; height: auto; display: block; }
/* CSS 適用前に viewBox 基準で巨大描画されるのを防ぐ保険 */
svg { max-width: 100%; }
a { color: inherit; }

.wrap { width: min(100% - 40px, 1040px); margin-inline: auto; }

/* ---------- ヘッダー / ナビ ----------
   問題1: モバイルでナビが消える → details/summary のハンバーガーで常に到達可能
   問題2: 769〜1140px で切れる → タイトルを縮め、nav を wrap させる
   JS を使わず CSS のみで開閉する（JS 897KB → 0KB） */

.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  min-height: var(--header-h);
  display: flex; align-items: center;
}
.header-inner {
  position: relative;          /* .site-nav の絶対配置の基準 */
  width: min(100% - 32px, 1200px);
  margin-inline: auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
}
.brand {
  flex: 0 1 auto; min-width: 0;
  font-family: var(--serif);
  font-size: 17px; font-weight: 700;
  letter-spacing: .02em;
  text-decoration: none;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
  max-width: 58vw;
}
/* 狭い幅では短縮名に差し替える（ナビを押し出さないため） */
.brand .brand-long { display: none; }
.brand .brand-short { display: inline; }

/* ---------- ナビ（チェックボックス方式・JS不要） ----------
   details/summary は 900px 以上で幅0に潰れリンクが画面外へ出るため使わない。
   通常要素だけで組み、レイアウトを予測可能にする。 */

.nav-check { position: absolute; opacity: 0; pointer-events: none; }

.nav-burger {
  flex: 0 0 auto;
  width: 44px; height: 44px;              /* タップ領域 44px */
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 6px;
  background: #fff; cursor: pointer;
}
.burger, .burger::before, .burger::after {
  content: ""; display: block;
  width: 20px; height: 2px; background: var(--ink);
  transition: transform .2s ease, opacity .2s ease;
}
.burger { position: relative; }
.burger::before { position: absolute; top: -6px; }
.burger::after  { position: absolute; top:  6px; }
.nav-check:checked ~ .nav-burger .burger { background: transparent; }
.nav-check:checked ~ .nav-burger .burger::before { transform: translateY(6px) rotate(45deg); }
.nav-check:checked ~ .nav-burger .burger::after  { transform: translateY(-6px) rotate(-45deg); }

/* 狭い画面: 開いたときだけドロップダウン表示 */
.site-nav {
  display: none;
  position: absolute; left: 0; right: 0; top: 100%;
  background: #fff;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 20px rgba(0,0,0,.06);
  padding: 8px 16px 16px;
  flex-direction: column;
}
.nav-check:checked ~ .site-nav { display: flex; }

.site-nav a {
  font-family: var(--sans);
  font-size: 14px; letter-spacing: .08em;
  text-decoration: none; color: var(--ink);
  padding: 14px 4px;
  border-bottom: 1px solid var(--line);
}
.site-nav a:last-child { border-bottom: 0; }
.site-nav a:focus-visible { outline: 2px solid var(--orange); outline-offset: -2px; }

/* 広い画面: ハンバーガーを隠し、常時横並び */
@media (min-width: 900px) {
  .brand { font-size: 19px; max-width: none; }
  .brand .brand-long  { display: inline; }
  .brand .brand-short { display: none; }
  .nav-burger { display: none; }
  .site-nav,
  .nav-check:checked ~ .site-nav {
    display: flex;
    position: static; flex-direction: row; flex-wrap: nowrap; gap: 4px;
    border: 0; box-shadow: none; padding: 0; background: none;
  }
  .site-nav a {
    border: 0; padding: 8px 12px; white-space: nowrap;
    border-bottom: 2px solid transparent;
  }
  .site-nav a:hover { border-bottom-color: var(--orange); }
}

/* ---------- ヒーロー ----------
   問題3: H1 とサブコピーが 4px 重なる
   → 絶対配置をやめ通常フローで積む。重なりが原理的に起きない */
.hero {
  position: relative;
  min-height: min(78vh, 620px);
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  padding: 72px 20px;
  background: linear-gradient(rgba(0,0,0,.42), rgba(0,0,0,.42)), var(--hero-img, #8a5a3a) center/cover no-repeat;
  color: #fff;
}
.hero-inner { display: flex; flex-direction: column; gap: 20px; max-width: 900px; }
.hero h1 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(30px, 6.4vw, 72px);
  letter-spacing: .1em;
  line-height: 1.22;
  margin: 0;
  text-wrap: balance;
}
.hero p {
  font-family: var(--body);
  font-size: clamp(15px, 2.1vw, 20px);
  line-height: 1.6;
  margin: 0;
  opacity: .96;
}
.hero .btn { align-self: center; margin-top: 8px; }

/* ---------- セクション ---------- */
section { padding: 72px 0; scroll-margin-top: var(--header-h); }
section:nth-of-type(even) { background: var(--bg-soft); }
h2 {
  font-family: var(--sans);
  font-size: clamp(26px, 4.2vw, 40px);
  font-weight: 600;
  letter-spacing: .06em;
  margin: 0 0 8px;
}
.section-rule { width: 48px; height: 3px; background: var(--orange); margin: 0 0 28px; border: 0; }
h3 { font-family: var(--sans); font-size: 20px; font-weight: 600; margin: 0 0 8px; }
p { margin: 0 0 16px; }
.lead { font-size: 17px; }

/* ---------- ボタン ----------
   問題4: VIEW MORE と BOOK が完全同一で主従が無い
   → BOOK を塗り（主）、VIEW MORE を輪郭（従）。並び順も BOOK が先 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 14px 26px;
  font-family: var(--sans); font-size: 15px; font-weight: 600;
  letter-spacing: .06em; text-decoration: none; text-align: center;
  border-radius: 4px; cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }

.btn-primary {                              /* 予約＝主導線 */
  background: var(--orange-text); color: #fff;   /* 白文字で 4.6:1 */
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
}
.btn-primary:hover { background: #a84708; box-shadow: 0 4px 12px rgba(0,0,0,.22); }
.btn-secondary {                            /* 詳細＝従 */
  background: transparent; color: var(--ink);
  border: 1.5px solid #c9c2b8;
}
.btn-secondary:hover { border-color: var(--ink); background: rgba(0,0,0,.03); }
.btn-arrow { flex: none; width: 17px; height: 17px; stroke: currentColor; stroke-width: 2; fill: none; }

/* ---------- コースカード ---------- */
.courses { display: grid; gap: 32px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .courses { grid-template-columns: 1fr 1fr; } }

.course {
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  overflow: hidden; display: flex; flex-direction: column;
}
.course > img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.course-body { padding: 22px; display: flex; flex-direction: column; flex: 1; }
.course-body h3 { font-size: 19px; }
.course-desc { font-size: 15px; color: #4a4a4a; }
.dishes { list-style: none; padding: 0; margin: 0 0 20px; font-size: 15px; }
.dishes li { padding: 5px 0 5px 20px; position: relative; line-height: 1.5; }
.dishes li::before { content: "◎"; position: absolute; left: 0; color: var(--orange); font-size: 12px; top: 8px; }
/* BOOK を上、VIEW MORE を下に置く */
.course-actions { display: flex; flex-direction: column; gap: 10px; margin-top: auto; }
.course-actions .btn { width: 100%; }

/* ---------- 料金表 ----------
   問題5: ベタ箇条書きで約450px消費 → 表組みで圧縮 */
.pricing { margin-top: 32px; }
.price-grid { display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .price-grid { grid-template-columns: repeat(3, 1fr); } }
.price-card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 20px; }
.price-card h4 {
  margin: 0 0 12px; font-family: var(--sans); font-size: 14px; font-weight: 600;
  color: var(--orange-text); letter-spacing: .04em;
}
.price-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.price-table th, .price-table td {
  padding: 9px 0; border-bottom: 1px solid var(--line);
  text-align: left; font-weight: 400; line-height: 1.4;
}
.price-table td { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.price-table tr:last-child th, .price-table tr:last-child td { border-bottom: 0; }
.price-amount { font-size: 16px; color: #1f1f1f; }
.price-each { font-size: 12px; color: var(--ink-soft); margin-left: 3px; }
.price-free { color: var(--orange-text); font-weight: 600; }
.price-note { font-size: 14px; color: var(--ink-soft); margin-top: 16px; }

/* ---------- スケジュール ---------- */
.schedule { list-style: none; padding: 0; margin: 0; max-width: 680px; }
.schedule li {
  display: flex; gap: 18px; padding: 16px 0; border-bottom: 1px solid var(--line);
  align-items: baseline; flex-wrap: wrap;
}
.schedule li:last-child { border-bottom: 0; }
.schedule time {
  font-family: var(--sans); font-weight: 600; font-size: 15px;
  color: var(--orange-text); flex: none; min-width: 108px;
}

/* ---------- ポリシー ---------- */
.policy-box {
  background: #fff; border-left: 4px solid var(--orange);
  border-radius: 0 8px 8px 0; padding: 24px 26px; max-width: 760px;
}
.policy-box p:last-child { margin-bottom: 0; }
.policy-box strong { color: var(--orange-text); }

/* ---------- CONTACT ---------- */
.contact-grid { display: grid; gap: 36px; grid-template-columns: 1fr; }
@media (min-width: 800px) { .contact-grid { grid-template-columns: 1.1fr .9fr; } }
.access { list-style: none; padding: 0; margin: 0 0 20px; font-size: 15px; }
.access li { padding: 7px 0 7px 24px; position: relative; line-height: 1.55; }
.access li::before { content: "▸"; position: absolute; left: 4px; color: var(--orange); }
.contact-actions { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.contact-actions .btn { width: 100%; max-width: 340px; }

/* ---------- フッター ---------- */
.site-footer {
  background: var(--ink); color: rgba(255,255,255,.86);
  padding: 44px 0; text-align: center; font-size: 14px;
}
.site-footer a { color: #fff; }
.site-footer .footer-name { font-family: var(--serif); font-size: 17px; margin-bottom: 10px; color: #fff; }

/* ---------- コース個別ページ ---------- */
.page-head { padding: 56px 0 8px; }
.back-link {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--sans); font-size: 14px; text-decoration: none;
  color: var(--ink-soft); margin-bottom: 22px;
}
.back-link:hover { color: var(--ink); }
/* 本文より写真が目立ちすぎないよう高さを抑える */
.course-hero {
  border-radius: 10px; overflow: hidden; margin: 26px 0 34px;
  max-width: 760px; max-height: 420px;
}
.course-hero img { width: 100%; height: 100%; max-height: 420px; aspect-ratio: 16 / 9; object-fit: cover; }
.course-detail { max-width: 760px; }
.course-detail p { font-size: 16.5px; }
.cta-band {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px;
  padding: 30px 26px; margin: 40px 0 20px; text-align: center;
}
.cta-band h3 { margin-bottom: 6px; }
.cta-band p { color: var(--ink-soft); font-size: 15px; }

/* ヒーローは CSS 背景のため srcset が使えない。
   狭い画面では 480w 版に切り替えて転送量を抑える。 */
@media (max-width: 600px) {
  .hero { background-image: linear-gradient(rgba(0,0,0,.42), rgba(0,0,0,.42)), var(--hero-img-sp, var(--hero-img)); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ---------- コース詳細ダイアログ ----------
   旧サイトのモーダル体験を再現しつつ、コース詳細の実URLも維持する。
   JS未対応・無効時はリンクとして実ページに遷移するので機能を失わない。 */
.course-dialog {
  width: min(100% - 32px, 720px);
  max-height: min(88vh, 900px);
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: var(--bg);
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(0,0,0,.28);
  overflow: hidden;
}
.course-dialog::backdrop { background: rgba(0,0,0,.55); }

.dialog-close-form { margin: 0; }
.dialog-close {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  width: 44px; height: 44px;              /* タップ領域 44px */
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; line-height: 1;
  color: var(--ink);
  background: rgba(255,255,255,.92);
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
}
.dialog-close:hover { background: #fff; }
.dialog-close:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }

.dialog-body {
  max-height: min(88vh, 900px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 30px 28px 28px;
}
.dialog-body h2 { font-size: clamp(22px, 4vw, 30px); padding-right: 44px; }
.dialog-hero { border-radius: 8px; overflow: hidden; margin: 20px 0 24px; }
.dialog-hero img { width: 100%; max-height: 320px; aspect-ratio: 16 / 9; object-fit: cover; }
.dialog-body .course-detail p { font-size: 16px; }

.dialog-actions {
  display: flex; flex-direction: column; gap: 10px;
  margin-top: 28px; padding-top: 22px;
  border-top: 1px solid var(--line);
}
@media (min-width: 560px) {
  .dialog-actions { flex-direction: row; }
  .dialog-actions .btn { flex: 1; }
}

@media (max-width: 480px) {
  .course-dialog { width: 100%; max-width: 100%; max-height: 92vh; border-radius: 12px 12px 0 0; margin-bottom: 0; }
  .dialog-body { padding: 26px 20px 22px; }
}




/* ---------- Instagram への導線 ----------
   コース一覧の締めくくり。テキスト1行では素通りされるため、
   カードにして写真を見に行きたくなる見え方にする。 */
.ig-card {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 36px;
  padding: 20px 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  text-decoration: none;
  color: var(--ink);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.ig-card:hover {
  transform: translateY(-2px);
  border-color: #d8d0c6;
  box-shadow: 0 6px 20px rgba(0,0,0,.08);
}
.ig-card:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }

.ig-icon {
  flex: none;
  width: 26px;
  height: 26px;
  color: var(--orange-text);   /* サイトのブランド色に合わせる */
}

.ig-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ig-label {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
}
.ig-handle { font-size: 14px; color: var(--ink-soft); }

.ig-arrow {
  flex: none;
  width: 20px; height: 20px;
  margin-left: auto;
  color: var(--ink-soft);
  transition: transform .15s ease, color .15s ease;
}
.ig-card:hover .ig-arrow { transform: translateX(3px); color: var(--orange-text); }

@media (max-width: 480px) {
  .ig-card { padding: 16px 18px; gap: 13px; }
  .ig-icon { width: 24px; height: 24px; }
  .ig-label { font-size: 14px; }
}
