/* =========================================================
   株式会社ひなた工務店 - style.css
   Pure CSS / no framework。配色・フォント・余白は :root のトークンで一元管理する。
   新色を直値で書かず、必要ならトークンを :root に足して命名を揃えること。
   ========================================================= */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
/* overflow-x: hidden は body のみに付ける。html にも付けると、body 側の
   overflow-y が auto に再計算されて html/body が二重のスクロールコンテナ化し、
   スクロール自体がほぼ効かなくなる（結果としてヘッダーの sticky も追従しなく見える）。 */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { overflow-x: hidden; }
body, h1, h2, h3, h4, p, ul, ol, figure, dl, dd, table, th, td { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { border: none; background: none; cursor: pointer; font: inherit; color: inherit; }
table { border-collapse: collapse; width: 100%; }

/* ---------- Design Tokens ---------- */
/* プリセット参考: P2ネイビー×ビビッド構造を応用し、白＋深緑＋木のぬくもりへカスタマイズ */
:root {
  /* 配色 — 白ベース × 深い緑（差し色） × 木のぬくもり（アクセント） */
  --c-primary: #2D6A4F;          /* 深い緑 — ブランドカラー・CTA */
  --c-primary-deep: #1B4D38;     /* hover / active で深く */
  --c-primary-soft: #E3EFE9;     /* 主役色の淡い背景 */
  --c-primary-mid: #4D9272;      /* 中間緑（グラデ・差し色）*/
  --c-accent: #8B5E3C;           /* 木のぬくもり（earthy brown）*/
  --c-accent-soft: #F0E8DF;      /* アクセントの淡い背景 */
  --c-line: #06C755;             /* LINE ブランドカラー */

  --c-bg: #FFFFFF;               /* ページ背景 */
  --c-bg-cream: #FAF7F2;         /* セクション差し色（温かみのあるクリーム）*/
  --c-bg-deep: #1B3028;          /* フッター等の濃色面 */
  --c-text: #2A2015;             /* 基本テキスト（温かみのあるほぼ黒）*/
  --c-text-muted: #70625A;       /* 補助テキスト（白地で約4.8:1確保）*/
  --c-border: #E8E0D4;           /* 罫線（温かみのあるベージュ）*/
  --c-danger: #c0392b;

  /* フォント */
  --f-base: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", system-ui, sans-serif;
  --f-disp: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", serif; /* ラベル・装飾用 */

  /* レイアウト */
  --container: 1120px;
  --gutter: 24px;
  --header-h: 92px;
  --radius: 6px;
  --radius-pill: 999px;
  --shadow-soft: 0 10px 30px rgba(0,0,0,0.06);
  --shadow-card: 0 24px 60px rgba(0,0,0,0.08);
}

/* ---------- Base ---------- */
html, body {
  font-family: var(--f-base);
  color: var(--c-text);
  background: var(--c-bg);
  font-size: 16px;
  line-height: 1.8;
  letter-spacing: 0.02em;
  -webkit-font-smoothing: antialiased;
}
@media (max-width: 768px) {
  :root { --header-h: 64px; }
}

h1, h2, h3 { line-height: 1.4; font-weight: 600; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding: 88px 0; }
.section--cream { background: var(--c-bg-cream); }
.section__head { text-align: center; max-width: 760px; margin: 0 auto 48px; }
.section__label { display: block; font-family: var(--f-disp); font-size: 13px; letter-spacing: 0.3em; color: var(--c-primary); text-transform: uppercase; margin-bottom: 10px; }
.section__title { font-size: clamp(22px, 4vw, 30px); font-weight: 600; letter-spacing: 0.06em; }
.section__lead { margin-top: 16px; color: var(--c-text-muted); font-size: 15px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 28px; border-radius: var(--radius-pill);
  background: var(--c-primary); color: #fff; font-weight: 600;
  letter-spacing: 0.08em; transition: background 0.2s, transform 0.2s;
}
.btn:hover { background: var(--c-primary-deep); transform: translateY(-1px); }

/* ---------- Header ---------- */
.hdr {
  position: sticky; top: 0; z-index: 100;
  border-bottom: 1px solid var(--c-border);
}
/* 背景のすりガラス効果は ::before に分離する。
   .hdr 自身に backdrop-filter / filter を持たせると、その要素がモバイル用ドロワー
   (.nav / position:fixed) の「包含ブロック」になり、ドロワーがビューポートではなく
   ヘッダーの高さ(数十px)に閉じ込められてレイアウトが壊れるため。 */
.hdr::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: rgba(255,255,255,0.92);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  backdrop-filter: saturate(180%) blur(8px);
}
.hdr__inner { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); }
.hdr__logo-img { width: auto; max-height: 48px; }
.nav { display: flex; align-items: center; gap: 22px; }
.nav > a { font-size: 14px; letter-spacing: 0.04em; transition: color 0.2s; }
.nav > a:hover { color: var(--c-primary); }
.nav__sns { display: none; } /* PC ヘッダーではアイコンを hdr__actions 側に出す想定 */
.hdr__actions { display: flex; align-items: center; gap: 14px; }
.hdr__sns { display: inline-flex; }
.sns-icon { width: 22px; height: 22px; }
.sns-symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
.hdr__cta {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px; border-radius: var(--radius-pill);
  background: var(--c-primary); color: #fff; font-size: 14px; font-weight: 600;
  transition: background 0.2s;
}
.hdr__cta:hover { background: var(--c-primary-deep); }

/* Burger */
/* z-index はドロワー(.nav, z-index:95)より高くする。.hdr__burger は .hdr のローカルな
   スタッキングコンテキストに属するため、指定がないと z-index:auto 扱いとなり、
   ドロワーを開いた際に自分自身のボタン(×アイコン)がドロワーの下に隠れてしまう。 */
.hdr__burger { display: none; width: 40px; height: 40px; position: relative; z-index: 96; }
.hdr__burger span {
  position: absolute; left: 9px; right: 9px; height: 2px; background: var(--c-text);
  transition: transform 0.3s, opacity 0.2s;
}
.hdr__burger span:nth-child(1) { top: 13px; }
.hdr__burger span:nth-child(2) { top: 19px; }
.hdr__burger span:nth-child(3) { top: 25px; }
.hdr__burger.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.hdr__burger.is-open span:nth-child(2) { opacity: 0; }
.hdr__burger.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.nav-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0.3s; z-index: 90;
}
.nav-backdrop.is-open { opacity: 1; visibility: visible; }

/* ---------- Page hero（サブページ共通の見出し帯） ---------- */
.page-hero { background: var(--c-primary-soft); padding: 64px 0; text-align: center; }
.page-hero__label { display: block; font-family: var(--f-disp); letter-spacing: 0.3em; color: var(--c-primary); font-size: 13px; text-transform: uppercase; margin-bottom: 10px; }
.page-hero__title { font-size: clamp(24px, 5vw, 34px); letter-spacing: 0.08em; }
.page-hero__lead { margin-top: 14px; color: var(--c-text-muted); font-size: 15px; }

/* ---------- News（新着情報・アコーディオン / news.js と対応） ---------- */
.news__list { max-width: 860px; margin: 0 auto; border-top: 1px solid var(--c-border); }
.news__item { border-bottom: 1px solid var(--c-border); }
.news__head {
  width: 100%; display: flex; align-items: center; gap: 14px;
  padding: 22px 8px; text-align: left;
}
.news__date { font-family: var(--f-disp); color: var(--c-primary); font-size: 14px; letter-spacing: 0.06em; flex-shrink: 0; }
.news__cat {
  font-size: 11px; letter-spacing: 0.08em; color: var(--c-text-muted);
  border: 1px solid var(--c-border); border-radius: var(--radius-pill);
  padding: 3px 12px; flex-shrink: 0;
}
.news__title { flex: 1; font-size: 15px; font-weight: 500; }
.news__toggle { width: 12px; height: 12px; position: relative; flex-shrink: 0; }
.news__toggle::before, .news__toggle::after { content: ""; position: absolute; background: var(--c-text-muted); transition: transform 0.3s; }
.news__toggle::before { top: 5px; left: 0; right: 0; height: 2px; }
.news__toggle::after { left: 5px; top: 0; bottom: 0; width: 2px; }
.news__item.is-open .news__toggle::after { transform: scaleY(0); }
.news__body { max-height: 0; overflow: hidden; transition: max-height 0.35s ease; }
.news__item.is-open .news__body { max-height: 600px; }
.news__body-inner { padding: 0 8px 24px; color: var(--c-text-muted); font-size: 14px; }
.news__link { display: inline-flex; gap: 6px; margin-top: 12px; color: var(--c-primary); font-weight: 600; }
.news__empty { text-align: center; color: var(--c-text-muted); padding: 40px 0; }

/* ---------- Cards / CTA ---------- */
.cta-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; max-width: 880px; margin: 0 auto; }
.cta-card { display: block; padding: 32px 28px; background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius); box-shadow: var(--shadow-soft); transition: transform 0.2s, box-shadow 0.2s; text-align: center; }
.cta-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-card); }
.cta-card__label { font-family: var(--f-disp); letter-spacing: 0.2em; color: var(--c-primary); font-size: 12px; text-transform: uppercase; }
.cta-card__title { margin: 8px 0 10px; font-size: 19px; }
.cta-card__desc { color: var(--c-text-muted); font-size: 14px; }
.cta-card__btn { display: inline-block; margin-top: 16px; color: var(--c-primary); font-weight: 600; }

/* ---------- Form（Web3Forms / contact.js と対応） ---------- */
.form { max-width: 720px; margin: 0 auto; }
.form__intro { font-size: 13px; color: var(--c-text-muted); margin-bottom: 24px; }
.form__intro strong { color: var(--c-danger); }
.form__field { margin-bottom: 22px; }
.form__label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.form__required { font-size: 11px; color: #fff; background: var(--c-danger); border-radius: 3px; padding: 2px 7px; margin-left: 6px; }
.form__optional { font-size: 11px; color: var(--c-text-muted); border: 1px solid var(--c-border); border-radius: 3px; padding: 2px 7px; margin-left: 6px; }
.form__input, .form__select, .form__textarea {
  width: 100%; padding: 13px 14px; border: 1px solid var(--c-border); border-radius: var(--radius);
  background: #fff; font-size: 15px; font-family: inherit; outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
.form__input:focus, .form__select:focus, .form__textarea:focus { border-color: var(--c-primary); box-shadow: 0 0 0 3px var(--c-primary-soft); }
.form__textarea { min-height: 160px; resize: vertical; }
.form__hint { display: block; margin-top: 6px; font-size: 12px; color: var(--c-text-muted); }
.form__check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.form__check input { margin-top: 5px; }
.form__honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form__submit { width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 16px; border-radius: var(--radius-pill); background: var(--c-primary); color: #fff; font-weight: 600; letter-spacing: 0.1em; transition: background 0.2s; }
.form__submit:hover { background: var(--c-primary-deep); }
.form__submit:disabled { opacity: 0.6; cursor: default; }
.form__success { max-width: 720px; margin: 0 auto 24px; padding: 28px; border: 1px solid var(--c-primary); border-radius: var(--radius); background: var(--c-primary-soft); text-align: center; }
.form__error { padding: 14px; border: 1px solid var(--c-danger); border-radius: var(--radius); background: #fdecea; color: var(--c-danger); font-size: 14px; margin-bottom: 20px; }
.form__radio { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border: 1px solid var(--c-border); border-radius: var(--radius-pill); cursor: pointer; margin: 0 8px 8px 0; }
.form__radio.is-checked { border-color: var(--c-primary); background: var(--c-primary-soft); }

/* ---------- FAQ ---------- */
.faq__item { border-bottom: 1px solid var(--c-border); }
.faq__q { width: 100%; text-align: left; padding: 20px 8px; font-weight: 600; }
.faq__a { max-height: 0; overflow: hidden; transition: max-height 0.35s ease; color: var(--c-text-muted); font-size: 14px; }
.faq__item.is-open .faq__a { max-height: 500px; padding: 0 8px 20px; }

/* ---------- Footer ---------- */
.ftr { background: var(--c-bg-deep); color: #ddd; padding: 64px 0 32px; }
.ftr__inner { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 40px; }
.ftr__about, .ftr__address { font-size: 13px; color: #aaa; margin-top: 14px; line-height: 1.9; }
.ftr__tel a { font-family: var(--f-disp); font-size: 18px; letter-spacing: 0.06em; margin-top: 10px; display: inline-block; }
.ftr__sns { display: flex; gap: 14px; margin-top: 16px; }
.ftr__sns .sns-icon { width: 26px; height: 26px; }
.ftr__heading { font-family: var(--f-disp); letter-spacing: 0.2em; font-size: 13px; color: #fff; margin-bottom: 16px; text-transform: uppercase; }
.ftr__links { display: flex; flex-direction: column; gap: 10px; }
.ftr__links a { font-size: 14px; color: #bbb; transition: color 0.2s; }
.ftr__links a:hover { color: #fff; }
.ftr__bottom { border-top: 1px solid #333; margin-top: 48px; padding-top: 24px; text-align: center; }
.ftr__copy { font-size: 12px; color: #888; letter-spacing: 0.06em; }

/* ---------- Mobile sticky CTA bar ---------- */
.mobile-cta { display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 80; background: rgba(255,255,255,0.96); border-top: 1px solid var(--c-border); backdrop-filter: blur(8px); }
.mobile-cta__inner { display: flex; }
.mobile-cta__btn { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 4px; font-size: 10px; color: var(--c-text); }
.mobile-cta__btn--primary { background: var(--c-primary); color: #fff; }
.mobile-cta__btn-icon svg { width: 22px; height: 22px; }

/* ---------- Fade-in（main.js / news.js と対応） ---------- */
.fade-in { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.fade-in.is-visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .hdr__burger { display: block; }
  .hdr__cta { display: none; }
  .nav {
    position: fixed; top: 0; right: 0; bottom: 0; width: min(78vw, 320px);
    flex-direction: column; align-items: flex-start; gap: 4px;
    background: #fff; padding: calc(var(--header-h) + 16px) 28px 28px;
    transform: translateX(100%); transition: transform 0.35s ease; z-index: 95;
    box-shadow: -10px 0 40px rgba(0,0,0,0.15); overflow-y: auto;
  }
  .nav.is-open { transform: translateX(0); }
  .nav > a { width: 100%; padding: 14px 0; border-bottom: 1px solid var(--c-border); font-size: 15px; }
  .nav__sns { display: flex; gap: 16px; margin-top: 20px; }
}

@media (max-width: 768px) {
  .section { padding: 56px 0; }
  .ftr__inner { grid-template-columns: 1fr; gap: 32px; }
  .mobile-cta { display: block; }
  body { padding-bottom: 60px; } /* mobile-cta の高さ分 */
  .news__head { flex-wrap: wrap; gap: 8px 12px; }
  .news__title { flex-basis: 100%; }
}

/* ---------- Hero（three-stage の上に乗せるテキスト専用スタイル）---------- */
.hero__label { display: block; font-family: var(--f-disp); font-size: 13px; letter-spacing: 0.4em; opacity: 0.8; margin-bottom: 18px; text-transform: uppercase; }
.hero__title { font-family: var(--f-disp); font-size: clamp(28px, 5.5vw, 52px); line-height: 1.45; letter-spacing: 0.06em; font-weight: 600; }
.hero__lead { margin-top: 20px; font-size: 15px; line-height: 1.9; opacity: 0.88; max-width: 480px; }
.hero__actions { margin-top: 36px; display: flex; gap: 14px; flex-wrap: wrap; }
.btn--outline-white { background: transparent; border: 2px solid rgba(255,255,255,0.7); color: #fff; }
.btn--outline-white:hover { background: rgba(255,255,255,0.15); border-color: #fff; transform: translateY(-1px); }

/* ---------- Strength cards ---------- */
.strengths { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 0; }
.strength-card { padding: 36px 28px; background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius); box-shadow: var(--shadow-soft); }
.strength-card__num { font-family: var(--f-disp); font-size: 32px; font-weight: 600; color: var(--c-primary-soft); line-height: 1; margin-bottom: 14px; }
.strength-card__title { font-size: 18px; font-weight: 600; color: var(--c-text); margin-bottom: 10px; }
.strength-card__body { font-size: 14px; color: var(--c-text-muted); line-height: 1.9; }
.strength-card__badge { display: inline-block; margin-top: 12px; padding: 5px 14px; background: var(--c-primary-soft); color: var(--c-primary-deep); border-radius: var(--radius-pill); font-size: 12px; font-weight: 600; letter-spacing: 0.05em; }

@media (max-width: 900px) { .strengths { grid-template-columns: 1fr; } }
@media (max-width: 768px) { .strength-card { padding: 28px 22px; } }

/* ---------- 見学会CTA帯 ---------- */
.event-cta { background: var(--c-primary-soft); padding: 72px 0; text-align: center; }
.event-cta__label { display: block; font-family: var(--f-disp); font-size: 13px; letter-spacing: 0.35em; color: var(--c-primary); text-transform: uppercase; margin-bottom: 12px; }
.event-cta__title { font-size: clamp(22px, 4vw, 32px); font-weight: 600; letter-spacing: 0.04em; margin-bottom: 14px; }
.event-cta__lead { color: var(--c-text-muted); font-size: 15px; margin-bottom: 32px; }
.event-cta__schedule { display: inline-block; padding: 10px 22px; background: var(--c-accent-soft); border-radius: var(--radius); font-size: 14px; color: var(--c-accent); font-weight: 600; margin-bottom: 28px; }

/* ---------- 家づくりの流れ（steps）---------- */
.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; counter-reset: step; }
.step { position: relative; padding: 28px 16px; text-align: center; }
.step::after { content: ""; position: absolute; top: 42px; right: -1px; width: 24px; height: 2px; background: var(--c-primary-soft); z-index: 1; }
.step:last-child::after { display: none; }
.step__num { display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 50%; background: var(--c-primary); color: #fff; font-family: var(--f-disp); font-size: 18px; font-weight: 600; margin: 0 auto 14px; }
.step__title { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.step__body { font-size: 12px; color: var(--c-text-muted); line-height: 1.7; }

@media (max-width: 900px) {
  .steps { grid-template-columns: 1fr 1fr; }
  .step::after { display: none; }
}
@media (max-width: 480px) { .steps { grid-template-columns: 1fr; } }

/* ---------- LINE相談バナー ---------- */
.line-banner { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 18px 28px; background: var(--c-line); color: #fff; border-radius: var(--radius); text-decoration: none; font-weight: 600; font-size: 16px; max-width: 380px; margin: 16px auto 0; transition: opacity 0.2s; }
.line-banner:hover { opacity: 0.88; }
.line-banner svg { width: 28px; height: 28px; flex-shrink: 0; }

/* ---------- Parallax grid (MOTION-02) ---------- */
.parallax-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.parallax-frame { overflow: hidden; border-radius: var(--radius); box-shadow: var(--shadow-soft); }
.parallax-frame img { transition: none; } /* motion.css が制御するため CSS transition 不要 */

/* ---------- Gallery card 補完スタイル ---------- */
.hgallery-card { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-soft); flex-shrink: 0; width: min(72vw, 420px); }
.hgallery-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.hgallery-card__body { padding: 16px 18px; }
.hgallery-card__title { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.hgallery-card__text { font-size: 13px; color: var(--c-text-muted); }

@media (max-width: 768px) {
  .hgallery-card { width: 78vw; }
}

/* ---------- Accessibility：動きを抑える設定への配慮 ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .fade-in { opacity: 1; transform: none; }
}
