/* 株式会社 松田木材 — 共通スタイル
   ページ本文の細かい見た目は各ページのHTMLに直接書いてあります（デザインデータから移したため）。
   ここには、全ページ共通の土台・ヘッダー・フッター・スマホ向けの調整だけを置いています。 */

:root {
  --paper: #F7F4EE;
  --paper-deep: #EFE8DC;
  --ink: #231816;
  --sub: #5B4E46;
  --line: #DDD2C2;
  --green: #007A5E;
  --green-dark: #005843;
  --mincho: 'Shippori Mincho B1', 'Hiragino Mincho ProN', 'Yu Mincho', 'Noto Serif CJK JP', serif;
  --gothic: 'Zen Kaku Gothic New', 'Hiragino Sans', 'Yu Gothic', 'Noto Sans CJK JP', sans-serif;
  --gutter: 32px;   /* 左右の余白。スマホでは小さくなる */
  --dt-col: 180px;  /* 会社概要などの表の見出し列の幅 */
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 120px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--gothic);
  font-size: 16px;
  line-height: 1.9;
  letter-spacing: 0.04em;
  /* 日本語の改行：ビルド時に文節ごとの改行位置（<wbr>）を埋め込んでいるので、それ以外では改行しない */
  word-break: keep-all;
  overflow-wrap: anywhere;
  line-break: strict;
}
h1, h2, h3, h4 { text-wrap: balance; }
img { max-width: 100%; }
a { color: var(--green); }
a:hover { color: var(--green-dark); }
.ib { display: inline-block; }

a:focus-visible, button:focus-visible, summary:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 100;
  background: var(--ink); color: #fff; padding: 8px 16px; text-decoration: none;
}
.skip-link:focus { top: 8px; color: #fff; }

/* ---------- ボタン ---------- */
.btn-primary, .btn-light {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; font-weight: 700;
}
.btn-primary { min-height: 48px; padding: 0 22px; background: var(--green); color: #fff; font-size: 15px; }
.btn-primary:hover { background: var(--green-dark); color: #fff; }
.btn-light { min-height: 56px; padding: 0 30px; background: #fff; color: var(--ink); }
.btn-light:hover { color: var(--ink); background: #F3EFE8; }

/* ---------- ヘッダー（PC） ---------- */
.hd-pc { background: var(--paper); border-bottom: 1px solid var(--line); }
.hd-pc__top {
  max-width: 1280px; margin: 0 auto; padding: 14px 24px 0;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px;
}
.hd-logo { display: block; line-height: 0; }
.hd-logo img { height: 40px; width: auto; }
.hd-pc__contact { display: flex; align-items: center; gap: 16px 20px; flex-wrap: wrap; }
.hd-pc__tel { line-height: 1.3; }
.hd-pc__tel-label { font-size: 12px; color: var(--sub); }
.hd-pc__tel-number { font-family: var(--mincho); font-size: 22px; font-weight: 700; color: var(--ink); text-decoration: none; letter-spacing: 0.02em; }
.hd-pc__nav {
  max-width: 1280px; margin: 0 auto; padding: 0 24px;
  display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 28px;
  font-size: 15px; font-weight: 500; white-space: nowrap;
}
.hd-pc__nav a { display: block; padding: 14px 0; color: var(--ink); text-decoration: none; box-shadow: inset 0 -2px 0 transparent; }
.hd-pc__nav a:hover, .hd-pc__nav a[aria-current="page"] { color: var(--green); box-shadow: inset 0 -2px 0 var(--green); }

/* ---------- ヘッダー（スマホ） ---------- */
.hd-sp { display: none; }
.hd-sp__row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-block: 10px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(8px, env(safe-area-inset-right, 0px));
}
.hd-sp .hd-logo img { height: 34px; }
.hd-sp__menu summary {
  list-style: none; display: flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 0 10px; cursor: pointer;
  font-weight: 700; font-size: 13px; letter-spacing: 0.08em; color: var(--ink);
}
.hd-sp__menu summary::-webkit-details-marker { display: none; }
.hd-sp__menu .when-open { display: none; }
.hd-sp__menu[open] .when-open { display: inline; }
.hd-sp__menu[open] .when-closed { display: none; }
.hd-sp__menu nav {
  position: absolute; left: 0; right: 0; top: 100%;
  background: var(--paper); border-bottom: 1px solid var(--line);
  box-shadow: 0 12px 24px rgba(35, 24, 22, 0.08);
  padding: 4px 20px 24px; display: flex; flex-direction: column;
  max-height: calc(100vh - 60px); overflow-y: auto;
}
.hd-sp__menu nav a {
  display: flex; justify-content: space-between; align-items: center;
  min-height: 52px; border-bottom: 1px solid #E6DDCF;
  color: var(--ink); text-decoration: none; font-weight: 500; font-size: 16px; white-space: nowrap;
}
.hd-sp__menu nav a[aria-current="page"] { color: var(--green); }
.hd-sp__tel { margin-top: 18px; font-size: 13px; color: var(--sub); line-height: 1.6; }
.hd-sp__tel a { display: block; font-family: var(--mincho); font-size: 24px; font-weight: 700; color: var(--ink); text-decoration: none; }

/* ---------- フッター ---------- */
.ft-cta { background: var(--green); color: #fff; }
.ft-cta__inner {
  max-width: 1280px; margin: 0 auto; padding: 72px 24px;
  display: flex; flex-wrap: wrap; gap: 32px 40px; align-items: center; justify-content: space-between;
}
.ft-cta__inner p { margin: 0; }
.ft-cta__title { margin: 0 0 8px; font-family: var(--mincho); font-weight: 600; font-size: clamp(22px, 6vw, 30px); letter-spacing: 0.1em; }
.ft-cta__actions { display: flex; flex-wrap: wrap; gap: 20px 36px; align-items: center; }
.ft-cta__tel { line-height: 1.4; }
.ft-cta__tel-label { font-size: 13px; }
.ft-cta__tel-number { color: #fff; text-decoration: none; font-family: var(--mincho); font-size: 32px; font-weight: 700; }
.ft-cta__tel-number:hover { color: #fff; }
.ft-cta__fax { font-size: 14px; }

.ft { background: var(--ink); color: #E9E2D6; }
.ft__inner {
  max-width: 1280px; margin: 0 auto; padding: 56px 24px 36px;
  display: flex; flex-wrap: wrap; gap: 36px 48px; justify-content: space-between;
}
.ft__company { display: flex; flex-direction: column; gap: 16px; font-size: 14px; }
.ft__company img { height: 40px; width: auto; align-self: flex-start; }
.ft__license { font-size: 13px; color: #CFC4B4; }
.ft__nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 40px; font-size: 14px; align-content: start; }
.ft__nav a { color: #E9E2D6; padding: 6px 0; }
.ft__nav a:hover { color: #fff; }
.ft__copy { max-width: 1280px; margin: 0 auto; padding: 18px 24px 30px; border-top: 1px solid #4A3F38; font-size: 12px; color: #CFC4B4; }

/* ---------- スマホ下部の電話・お問い合わせバー ---------- */
.sp-bar { display: none; }

/* ---------- Googleマップ ---------- */
.map { display: flex; flex-direction: column; gap: 12px; }
.map iframe { display: block; width: 100%; height: 100%; min-height: 320px; border: 1px solid #D3C6B2; background: #E9E3D8; }
.map__link { align-self: flex-start; font-size: 15px; }

/* ---------- お問い合わせフォーム ---------- */
.choice:has(input:checked) { border-color: var(--green) !important; background: #EEF6F2 !important; }
.form-builder-only, .form-home-only { display: flex; flex-direction: column; gap: 8px; }
form:has(input[data-role="builder"]:checked) .form-home-only { display: none; }
form:not(:has(input[data-role="builder"]:checked)) .form-builder-only { display: none; }
.form-honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { margin: 0; font-weight: 700; }
.form-status[data-state="error"] { color: #B3123F; }
button[type="submit"][disabled] { opacity: 0.6; cursor: wait; }

/* ---------- タブレット・スマホ ---------- */
@media (max-width: 899px) {
  .hd-pc { display: none; }
  .hd-sp {
    display: block; position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
    background: var(--paper); border-bottom: 1px solid var(--line);
  }
  body::before {
    content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px);
    z-index: 30; background: var(--paper);
  }
  html { scroll-padding-top: 72px; }
  .sp-bar {
    display: grid; grid-template-columns: 1fr 1fr;
    position: sticky; bottom: 0; z-index: 20;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--ink);
  }
  .sp-bar a {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-height: 58px; color: #fff; text-decoration: none; font-weight: 700; font-size: 14px; line-height: 1.3;
  }
  .sp-bar a small { font-weight: 500; font-size: 11px; opacity: 0.85; }
  .sp-bar a + a { background: var(--green); }
}
@media (max-width: 600px) {
  :root { --gutter: 20px; --dt-col: 6.5em; }
  dl[style*="grid"] { column-gap: 12px; }
}

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