/* ============================================================
   型3 建設・工務店 ／ 方向B「暮らしの情景型」
   2026-08-20 新規作成。他の型からの流用は無し。
   既知バグの回避:
     KB-001 ヒーローの文字は絶対配置にしない（背景画像＋通常フローのpadding）
     KB-002 モバイルの右寄せは .header-actions 側に持たせる
     KB-010 本文の最小は 12px（0.75rem）。それ未満を書かない
     KB-011 メニューを開いている間は body を固定し、高さは dvh で取る
     KB-013 表は .table-wrap で横スクロール。内側に overflow:hidden を置かない
     KB-014 320px でハンバーガーが押し出されないよう、ヘッダーの要素を縮める
   ============================================================ */

:root {
  --bg: #ffffff;
  --bg-tint: #f7f4ef;
  --bg-deep: #efe9e0;
  --ink: #241f1b;
  --ink-soft: #635a51;
  --line: #e2dbd1;
  --accent: #7a5327;
  --accent-dark: #55391a;
  --accent-tint: #f6f0e6;
  --sans: system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif;
  --serif: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP", "MS PMincho", serif;
  --wrap: 1080px;
}

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

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

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;      /* 17px */
  line-height: 1.9;
  color: var(--ink);
  background: var(--bg);
  overflow-wrap: anywhere;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-dark); }
h1, h2, h3, h4 { line-height: 1.45; margin: 0; font-weight: 700; }
p { margin: 0 0 1.1em; }
ul, ol { margin: 0 0 1.1em; padding-left: 1.3em; }
li { margin-bottom: .4em; }

.inner { width: min(100% - 2.4rem, var(--wrap)); margin-inline: auto; }

/* ---------- デモである旨の帯 ---------- */
.demo-bar {
  background: #37312b;
  color: #f6f1e9;
  font-size: 0.8125rem;      /* 13px */
  line-height: 1.7;
  padding: .5rem 0;
}
.demo-bar .inner { display: flex; flex-wrap: wrap; gap: .2rem 1.2rem; }
.demo-bar a { color: #ffd9a0; }

/* ---------- ヘッダー ---------- */
.header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(1.2) blur(6px);
}
.header-inner {
  width: min(100% - 1.6rem, 1240px); margin-inline: auto;
  display: flex; align-items: center; gap: 1rem; min-height: 58px;
}
.brand { display: block; text-decoration: none; color: inherit; padding: .5rem 0; flex-shrink: 1; min-width: 0; }
.brand .name { display: block; font-weight: 700; font-size: 1.05rem; letter-spacing: .02em; }
.brand small { display: block; font-size: 0.75rem; color: var(--ink-soft); line-height: 1.5; }

.gnav ul { display: flex; gap: 1.35rem; list-style: none; margin: 0; padding: 0; }
.gnav a {
  display: block; text-decoration: none; color: var(--ink);
  font-size: 0.9375rem; font-weight: 600; padding: .5rem 0;
  border-bottom: 2px solid transparent;
}
.gnav a:hover, .gnav a[aria-current="page"] { border-bottom-color: var(--accent); color: var(--accent-dark); }

.header-actions { display: flex; align-items: center; gap: .7rem; margin-left: auto; }
.tel-link { text-decoration: none; color: var(--ink); text-align: right; line-height: 1.25; }
.tel-link b { display: block; font-family: var(--serif); font-size: 1.3rem; letter-spacing: .01em; color: var(--accent-dark); }
.tel-link small { display: block; font-size: 0.75rem; color: var(--ink-soft); }
.btn-head {
  display: inline-block; background: var(--accent); color: #fff; text-decoration: none;
  font-size: 0.875rem; font-weight: 700; padding: .65rem 1.1rem; border-radius: 3px; white-space: nowrap;
}
.btn-head:hover { background: var(--accent-dark); }

.nav-toggle {
  display: none; width: 44px; height: 44px; flex: 0 0 44px; padding: 0;
  border: 1px solid var(--line); background: #fff; border-radius: 3px; cursor: pointer;
  position: relative;
}
.nav-toggle::before, .nav-toggle::after, .nav-toggle span {
  content: ""; position: absolute; left: 11px; width: 22px; height: 2px; background: var(--ink);
  transition: transform .2s, opacity .2s;
}
.nav-toggle::before { top: 15px; }
.nav-toggle span { top: 21px; }
.nav-toggle::after { top: 27px; }
.nav-toggle[aria-expanded="true"]::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span { opacity: 0; }
.nav-toggle[aria-expanded="true"]::after { transform: translateY(-6px) rotate(-45deg); }

/* ---------- ヒーロー（KB-001: 絶対配置を使わない） ---------- */
.hero {
  background-color: var(--bg-deep);
  background-position: center;
  background-size: cover;
  color: #fff;
}
.hero-shade {
  background: linear-gradient(100deg, rgba(20,17,14,.78) 0%, rgba(20,17,14,.60) 48%, rgba(20,17,14,.22) 100%);
}
.hero .inner { padding: 5.5rem 0 5rem; }
.hero-lead { font-size: 0.9375rem; letter-spacing: .18em; margin: 0 0 1rem; opacity: .92; }
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(1.75rem, 5.4vw, 2.9rem);
  font-weight: 600; letter-spacing: .04em; margin: 0 0 1.2rem;
  text-shadow: 0 2px 18px rgba(0,0,0,.35);
}
.hero p.sub { font-size: 1.0625rem; max-width: 34em; margin: 0 0 1.9rem; text-shadow: 0 1px 10px rgba(0,0,0,.4); }
.hero-cta { display: flex; flex-wrap: wrap; gap: .8rem; }

.btn {
  display: inline-block; text-decoration: none; font-weight: 700; font-size: 1rem;
  padding: .95rem 1.7rem; border-radius: 3px; border: 2px solid transparent; line-height: 1.4;
}
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-ghost { background: rgba(255,255,255,.10); color: #fff; border-color: rgba(255,255,255,.75); }
.btn-ghost:hover { background: rgba(255,255,255,.22); }
.btn-line { background: #fff; color: var(--accent-dark); border-color: var(--accent); }
.btn-line:hover { background: var(--accent-tint); }

/* ---------- 帯（信頼の要素） ---------- */
.trust { background: var(--accent-dark); color: #fff; }
.trust .inner { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.4rem; padding: 1.6rem 0; }
.trust dt { font-size: 0.8125rem; letter-spacing: .1em; opacity: .8; margin-bottom: .15rem; }
.trust dd { margin: 0; font-family: var(--serif); font-size: 1.35rem; line-height: 1.4; }
.trust dd small { font-family: var(--sans); font-size: 0.8125rem; display: block; opacity: .85; }

/* ---------- セクション ---------- */
.section { padding: 4.2rem 0; }
.section.tint { background: var(--bg-tint); }
.section.deep { background: var(--bg-deep); }
.section-head { margin-bottom: 2.2rem; }
.section-head .eyebrow { display: block; font-size: 0.8125rem; letter-spacing: .18em; color: var(--accent-dark); font-weight: 700; margin-bottom: .5rem; }
.section-head h2 { font-family: var(--serif); font-weight: 600; font-size: clamp(1.4rem, 3.6vw, 2rem); letter-spacing: .03em; }
.section-head p { margin: .9rem 0 0; color: var(--ink-soft); max-width: 46em; }

/* ---------- 実績カード ---------- */
.works { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.6rem; }
.work-card { background: #fff; border: 1px solid var(--line); border-radius: 3px; overflow: hidden; display: flex; flex-direction: column; }
.section.tint .work-card, .section.deep .work-card { background: #fff; }
.ba { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; background: var(--line); }
.ba figure { margin: 0; background: var(--bg-deep); }
.ba .ph {
  aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center;
  text-align: center; font-size: 0.75rem; color: var(--ink-soft); padding: .6rem;
  background: repeating-linear-gradient(-45deg, #eee8de 0 8px, #e6ded2 8px 16px);
}
.ba figcaption { font-size: 0.75rem; font-weight: 700; letter-spacing: .1em; background: #fff; color: var(--ink-soft); padding: .3rem .5rem; }
.work-body { padding: 1.1rem 1.2rem 1.3rem; flex: 1; }
.work-body h3 { font-size: 1.0625rem; margin-bottom: .5rem; }
.work-meta { list-style: none; margin: 0 0 .7rem; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem; }
.work-meta li { margin: 0; font-size: 0.75rem; background: var(--accent-tint); color: var(--accent-dark); padding: .2rem .55rem; border-radius: 2px; }
.work-body p { font-size: 0.9375rem; color: var(--ink-soft); margin: 0; }

/* ---------- 3列の柱 ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.6rem; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 3px; padding: 1.6rem 1.5rem; }
.card h3 { font-size: 1.125rem; margin-bottom: .7rem; color: var(--accent-dark); }
.card p:last-child { margin-bottom: 0; }
.card .num { display: block; font-family: var(--serif); font-size: 0.875rem; letter-spacing: .2em; color: var(--accent); margin-bottom: .35rem; }

/* ---------- 情景（写真と文章の交互） ---------- */
.feature { display: grid; grid-template-columns: 1.05fr 1fr; gap: 2.6rem; align-items: center; }
.feature + .feature { margin-top: 3.4rem; }
.feature.rev .feature-text { order: 2; }
.feature-media img { width: 100%; border-radius: 3px; }
.feature-media .ph {
  aspect-ratio: 4 / 3; border-radius: 3px; display: flex; align-items: center; justify-content: center;
  text-align: center; font-size: 0.8125rem; color: var(--ink-soft); padding: 1rem;
  background: repeating-linear-gradient(-45deg, #eee8de 0 10px, #e6ded2 10px 20px);
}
.feature-text h3 { font-family: var(--serif); font-weight: 600; font-size: 1.45rem; margin-bottom: .9rem; }

/* ---------- 一覧（メニュー） ---------- */
.menu-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; list-style: none; margin: 0; padding: 0; }
.menu-list li { margin: 0; }
.menu-list span {
  display: block; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--accent);
  padding: .85rem 1rem; font-weight: 600; font-size: 1rem;
}
.menu-list small { display: block; font-weight: 400; font-size: 0.8125rem; color: var(--ink-soft); }

/* ---------- 流れ ---------- */
.flow { list-style: none; margin: 0; padding: 0; counter-reset: flow; }
.flow li {
  counter-increment: flow; position: relative; padding: 0 0 1.6rem 3.4rem;
  border-left: 2px solid var(--line); margin: 0 0 0 1.1rem;
}
.flow li:last-child { border-left-color: transparent; padding-bottom: 0; }
.flow li::before {
  content: counter(flow); position: absolute; left: -1.15rem; top: 0;
  width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 0.9375rem; font-weight: 700;
}
.flow h3 { font-size: 1.0625rem; margin-bottom: .3rem; }
.flow p { font-size: 0.9375rem; color: var(--ink-soft); margin: 0; }

/* ---------- 表（KB-013: 外側で横スクロール、内側で切らない） ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); background: #fff; }
.table-wrap table { border-collapse: collapse; width: 100%; min-width: 480px; font-size: 0.9375rem; }
.table-wrap th, .table-wrap td { border-bottom: 1px solid var(--line); padding: .8rem 1rem; text-align: left; vertical-align: top; }
.table-wrap th { background: var(--bg-tint); font-weight: 700; white-space: nowrap; width: 11em; }
.table-wrap tr:last-child th, .table-wrap tr:last-child td { border-bottom: 0; }
.table-note { font-size: 0.8125rem; color: var(--ink-soft); margin: .6rem 0 0; }

/* ---------- FAQ ---------- */
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 700; padding: 1.1rem 0; list-style: none; font-size: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "Q"; font-family: var(--serif); color: var(--accent); margin-right: .7rem; font-weight: 700; }
.faq .a { padding: 0 0 1.2rem 1.9rem; color: var(--ink-soft); font-size: 0.9375rem; }

/* ---------- 注記 ---------- */
.note {
  background: #fffaf0; border: 1px solid #e8d7ae; border-left: 4px solid #c8912f;
  padding: 1.1rem 1.3rem; font-size: 0.9375rem; border-radius: 3px;
}
.note h3 { font-size: 1rem; margin-bottom: .5rem; }
.note p:last-child, .note ul:last-child { margin-bottom: 0; }

/* ---------- CTA ---------- */
.cta { background: var(--accent-dark); color: #fff; text-align: center; }
.cta .inner { padding: 3.6rem 0; }
.cta h2 { font-family: var(--serif); font-weight: 600; font-size: clamp(1.4rem, 4vw, 2rem); margin-bottom: .9rem; }
.cta p { max-width: 40em; margin-inline: auto; }
.cta .hero-cta { justify-content: center; margin-top: 1.6rem; }
.cta .btn-primary { background: #fff; color: var(--accent-dark); border-color: #fff; }
.cta .btn-primary:hover { background: var(--accent-tint); }

/* ---------- フォーム ---------- */
.form { display: grid; gap: 1.2rem; max-width: 640px; }
.field label { display: block; font-weight: 700; font-size: 0.9375rem; margin-bottom: .35rem; }
.field .req { font-size: 0.75rem; background: var(--accent); color: #fff; padding: .1rem .45rem; border-radius: 2px; margin-left: .5rem; vertical-align: 2px; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: 1rem; padding: .75rem .85rem;
  border: 1px solid #c9c0b4; border-radius: 3px; background: #fff; color: var(--ink);
}
.field textarea { min-height: 8.5em; }
.form-note { font-size: 0.8125rem; color: var(--ink-soft); }

/* ---------- フッター ---------- */
.footer { background: #2b2621; color: #e5ded4; padding: 3rem 0 1.6rem; font-size: 0.9375rem; }
.footer a { color: #e5ded4; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 2rem; }
.footer h3 { font-size: 1.0625rem; margin-bottom: .6rem; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer-bottom { border-top: 1px solid #453d35; margin-top: 2.4rem; padding-top: 1.2rem; font-size: 0.75rem; color: #b3a99c; }

/* ---------- スマホ固定バー ---------- */
.sp-bar { display: none; }

/* ============================================================
   モバイル
   ============================================================ */
@media (max-width: 1040px) {
  .gnav {
    position: fixed; inset: 58px 0 auto 0; height: calc(100dvh - 58px);
    background: #fff; border-top: 1px solid var(--line);
    padding: 1.2rem 1.2rem 6rem; overflow-y: auto;
    opacity: 0; visibility: hidden; transition: opacity .2s ease, visibility .2s ease;
  }
  .gnav.open { opacity: 1; visibility: visible; }
  .gnav ul { flex-direction: column; gap: 0; }
  .gnav a { padding: .95rem .2rem; border-bottom: 1px solid var(--line); font-size: 1.0625rem; }
  .gnav a:hover, .gnav a[aria-current="page"] { border-bottom-color: var(--line); }
  /* KB-002: .gnav が fixed になり margin-left:auto が効かないため、右寄せはここに持たせる */
  .header-actions { margin-left: auto; }
  .nav-toggle { display: block; }
  .btn-head { display: none; }
  .feature { grid-template-columns: 1fr; gap: 1.4rem; }
  .feature.rev .feature-text { order: 0; }
}

@media (max-width: 640px) {
  body { font-size: 1rem; line-height: 1.85; }
  .inner { width: calc(100% - 2rem); }
  .hero .inner { padding: 3.6rem 0 3.2rem; }
  .section { padding: 3rem 0; }
  .brand .name { font-size: 0.9375rem; }
  .brand small { display: none; }
  .tel-link b { font-size: 1.1rem; }
  .tel-link small { display: none; }
  .ba { grid-template-columns: 1fr 1fr; }
  .sp-bar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    border-top: 1px solid var(--line); background: #fff;
  }
  .sp-bar a {
    flex: 1; text-align: center; text-decoration: none; font-weight: 700; font-size: 0.9375rem;
    padding: .95rem .4rem; color: var(--accent-dark);
  }
  .sp-bar a + a { background: var(--accent); color: #fff; }
  body { padding-bottom: 3.6rem; }
  .footer { padding-bottom: 4.6rem; }
}

/* KB-014: 320px でハンバーガーが画面外へ押し出されないよう、電話を畳む */
@media (max-width: 380px) {
  .header-inner { gap: .5rem; }
  .tel-link { display: none; }
  .brand .name { font-size: 0.875rem; }
}

body.nav-open { overflow: hidden; }

/* grid / flex の子は既定が min-width:auto なので、中に置いた表（.table-wrap の
   min-width:480px）が親を押し広げ、ページ全体が横にはみ出す。
   表を横スクロールにする改修の巻き添えで起きるやつ（layout-check の「ページ横はみ出し」）。 */
.feature, .feature-text, .feature-media,
.split, .split-text, .split-media,
.cards, .card, .works, .work-card, .goods, .good,
.symptoms, .symptom, .cases, .case, .ba-set, .ba,
.reasons, .reason, .shops, .shop, .voices, .voice,
.menu-list, .tiles, .steps, .flow, .form, .field { min-width: 0; }
