/* =====================================================================
   株式会社大建 — modern テーマ: layout.css
   全ページ共通の枠: スキップリンク / ヘッダー（固定・縮小）/ ドロップダウン / モバイルドロワー /
   下部固定 CTA バー / ページ頭（パンくず・H1・リード）/ CTA 帯 / フッター
   根拠: Docs/redesign-proposal.md §4。トークンは base.css。
   ===================================================================== */

/* ---------- スキップリンク ---------- */
.m-skip { position: absolute; left: var(--sp-4); top: -100px; z-index: 1000; padding: var(--sp-3) var(--sp-4); background: var(--c-brand); color: #fff; border-radius: var(--radius-btn); font-weight: 700; text-decoration: none; }
.m-skip:focus { top: var(--sp-2); color: #fff; }
.m-main:focus { outline: none; }

/* ---------- ヘッダー（sticky。PC 72px → スクロール後 56px / モバイル 56px） ---------- */
.m-header-sentinel { position: absolute; top: 0; left: 0; height: 8px; width: 1px; pointer-events: none; }
.m-header { position: sticky; top: 0; z-index: 100; background: rgba(255, 255, 255, .97); border-bottom: 1px solid var(--c-line); }
@supports (backdrop-filter: blur(8px)) { .m-header { background: rgba(255, 255, 255, .9); backdrop-filter: blur(8px); } }
.m-header__inner { display: flex; align-items: center; gap: var(--sp-5); height: var(--header-h); transition: height var(--t-fast); }
.m-logo { display: flex; align-items: center; flex: none; margin-right: auto; }
.m-logo img { height: 26px; width: auto; transition: height var(--t-fast); }
.m-gnav { display: none; }
.m-header__actions { display: flex; align-items: center; gap: var(--sp-4); }
.m-header__tel, .m-header__contact { display: none; }

.m-burger { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; margin-right: -8px; padding: 0; border: 0; background: none; color: var(--c-ink); border-radius: var(--radius-btn); cursor: pointer; }
.m-burger:hover { background: var(--c-bg-warm); }

@media (min-width: 1024px) {
  .m-header__inner { height: var(--header-h-lg); gap: var(--sp-6); }
  .m-logo { margin-right: 0; }
  .m-logo img { height: 32px; }
  .m-header.is-compact .m-header__inner { height: var(--header-h); }
  .m-header.is-compact .m-logo img { height: 26px; }
  .m-header.is-compact .m-header__hours { display: none; }
  .m-burger { display: none; }
  .m-gnav { display: block; margin-right: auto; }
  .m-header__tel { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; color: var(--c-ink); text-decoration: none; }
  .m-header__telnum { display: inline-flex; align-items: center; gap: var(--sp-1); font-weight: 700; font-size: 20px; letter-spacing: .06em; }
  .m-header__telnum .m-icon { color: var(--c-brand); }
  .m-header__hours { font-size: 12px; color: var(--c-muted); letter-spacing: .02em; }
  .m-header__tel:hover .m-header__telnum { color: var(--c-brand); }
  .m-header__contact { display: inline-flex; }
}

/* ---------- PC メニュー（4 グループ）+ ドロップダウン ---------- */
.m-gnav__list { display: flex; align-items: center; gap: var(--sp-1); list-style: none; margin: 0; padding: 0; }
.m-gnav__item { position: relative; }
.m-gnav__btn, .m-gnav__link {
  display: inline-flex; align-items: center; gap: 2px; min-height: 44px; padding: 8px 12px; border: 0; border-radius: var(--radius-btn);
  background: none; color: var(--c-ink); font-weight: 700; font-size: 16px; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color var(--t-fast), color var(--t-fast);
}
.m-gnav__btn:hover, .m-gnav__link:hover, .m-gnav__btn[aria-expanded="true"] { background: var(--c-bg-warm); color: var(--c-brand); }
.m-gnav__btn.is-current, .m-gnav__link.is-current { color: var(--c-brand); box-shadow: inset 0 -3px 0 var(--c-brand); border-radius: 0; }
.m-gnav__caret { transition: transform var(--t-fast); }
.m-gnav__btn[aria-expanded="true"] .m-gnav__caret { transform: rotate(180deg); }

.m-dd {
  position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); z-index: 110;
  min-width: 260px; padding: var(--sp-4); background: #fff; border: 1px solid var(--c-line); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(34, 34, 34, .12);
}
.m-dd--wide { display: grid; grid-template-columns: 1fr 1fr; column-gap: var(--sp-5); min-width: 480px; }
.m-dd--wide .m-dd__index { grid-column: 1 / -1; }
.m-dd__list { list-style: none; margin: 0; padding: 0; }
.m-dd__list a { display: block; padding: 8px 12px; border-radius: var(--radius-btn); color: var(--c-ink); text-decoration: none; font-size: 15px; white-space: nowrap; }
.m-dd__list a:hover { background: var(--c-brand-tint); color: var(--c-brand-dark); }
.m-dd__list a[aria-current="page"] { color: var(--c-brand); font-weight: 700; }
.m-dd__sub { border-left: 1px solid var(--c-line); padding-left: var(--sp-4); }
.m-dd__subhead { margin: 0 0 var(--sp-1); padding: 0 12px; font-size: 13px; color: var(--c-muted); font-weight: 700; }
.m-dd__index { display: flex; align-items: center; justify-content: space-between; margin-top: var(--sp-3); padding: 10px 12px 2px; border-top: 1px solid var(--c-line); font-weight: 700; font-size: 15px; text-decoration: none; }
.m-dd__index:hover { text-decoration: underline; }

/* ---------- モバイルドロワー（<dialog>、右から） ---------- */
.m-drawer {
  position: fixed; inset: 0 0 0 auto; width: min(400px, 88vw); max-width: none; height: 100%; max-height: none; margin: 0; padding: 0;
  border: 0; background: #fff; color: var(--c-ink); overflow-y: auto; overscroll-behavior: contain;
  padding-bottom: env(safe-area-inset-bottom);
}
.m-drawer::backdrop { background: rgba(34, 34, 34, .45); }
.m-drawer[open] { animation: m-drawer-in 200ms ease-out; }
@keyframes m-drawer-in { from { transform: translateX(100%); } to { transform: none; } }
.m-drawer__head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; height: var(--header-h); padding: 0 var(--sp-2) 0 var(--sp-5); background: #fff; border-bottom: 1px solid var(--c-line); }
.m-drawer__title { font-weight: 700; }
.m-drawer__close { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border: 0; background: none; color: var(--c-ink); cursor: pointer; border-radius: var(--radius-btn); }
.m-drawer__list { list-style: none; margin: 0; padding: 0; }
.m-drawer__list > li { border-bottom: 1px solid var(--c-line); }
.m-drawer__link, .m-drawer__group > summary {
  display: flex; align-items: center; justify-content: space-between; min-height: 56px; padding: var(--sp-2) var(--sp-5);
  color: var(--c-ink); font-weight: 700; text-decoration: none; cursor: pointer; list-style: none;
}
.m-drawer__group > summary::-webkit-details-marker { display: none; }
.m-drawer__link .m-icon { color: var(--c-muted); }
.m-drawer__toggle { display: inline-flex; color: var(--c-brand); }
.m-drawer__group .is-open { display: none; }
.m-drawer__group[open] .is-open { display: inline; }
.m-drawer__group[open] .is-closed { display: none; }
.m-drawer__group ul { list-style: none; margin: 0; padding: 0 0 var(--sp-3); background: var(--c-bg-warm); }
.m-drawer__group ul a { display: flex; align-items: center; min-height: 48px; padding: var(--sp-2) var(--sp-5) var(--sp-2) var(--sp-7); color: var(--c-ink); text-decoration: none; }
.m-drawer a[aria-current="page"] { color: var(--c-brand); }
.m-drawer__cta { display: grid; gap: var(--sp-3); padding: var(--sp-5); }
.m-drawer__cta .m-btn { gap: var(--sp-3); }
.m-drawer__cta .m-btn span { display: flex; flex-direction: column; align-items: flex-start; font-size: 20px; letter-spacing: .06em; }
@media (min-width: 1024px) { .m-drawer { display: none; } }

/* ---------- 下部固定 CTA バー（<1024px、お問い合わせページ以外） ---------- */
.m-ctabar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  height: calc(var(--ctabar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: #fff; border-top: 1px solid var(--c-line); box-shadow: 0 -4px 16px rgba(34, 34, 34, .08);
}
.m-ctabar__btn { display: flex; align-items: center; justify-content: center; gap: var(--sp-2); font-weight: 700; text-decoration: none; }
.m-ctabar__btn--tel { color: var(--c-brand-dark); }
.m-ctabar__btn--mail { background: var(--c-brand); color: #fff; }
.m-ctabar__btn--mail:hover { background: var(--c-brand-dark); color: #fff; }
body:has(.m-ctabar) { padding-bottom: calc(var(--ctabar-h) + env(safe-area-inset-bottom)); }
@media (min-width: 1024px) {
  .m-ctabar { display: none; }
  body:has(.m-ctabar) { padding-bottom: 0; }
}

/* ---------- ページ頭（パンくず + H1 + リード） ---------- */
.m-pagehead { padding-block: var(--sp-3) var(--sp-4); background: var(--c-bg-warm); border-bottom: 1px solid var(--c-line); }
/* 2026-12-05 높이를 줄였다(사용자 요청): 위아래 여백·제목 크기 축소 */
@media (min-width: 1024px) { .m-pagehead { padding-block: var(--sp-4) var(--sp-5); } }
.m-breadcrumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) 0; list-style: none; margin: 0 0 var(--sp-2); padding: 0; font-size: var(--fs-small); color: var(--c-muted); }
.m-breadcrumb li { display: inline-flex; align-items: center; }
.m-breadcrumb li + li::before { content: "›"; margin: 0 var(--sp-2); color: #999; }
.m-breadcrumb a { color: var(--c-muted); text-decoration: none; }
.m-breadcrumb a:hover { color: var(--c-brand); text-decoration: underline; }
.m-breadcrumb [aria-current] { color: var(--c-ink); }
.m-pagehead__title { font-size: clamp(26px, 3.6vw, 40px); line-height: 1.3; margin: 0; } /* 원래 최대 44px → 40px (사용자 요청) */
.m-pagehead__lead { margin: var(--sp-2) 0 0; color: var(--c-muted); font-size: 17px; max-width: var(--measure); }

/* ---------- CTA 帯（フッターの上。お問い合わせページでは出さない） ---------- */
.m-ctaband { background: var(--c-brand-tint); padding-block: var(--sp-7); }
.m-ctaband__inner { display: grid; gap: var(--sp-5); align-items: center; }
.m-ctaband__title { margin: 0; font-size: var(--fs-h2); font-weight: 700; line-height: 1.4; }
.m-ctaband__sub { margin: var(--sp-2) 0 0; color: var(--c-brand-dark); font-weight: 700; font-size: 18px; }
.m-ctaband__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-4) var(--sp-6); }
.m-ctaband__tel { display: flex; flex-direction: column; color: var(--c-ink); text-decoration: none; line-height: 1.3; }
.m-ctaband__telnum { display: inline-flex; align-items: center; gap: var(--sp-2); font-size: 28px; font-weight: 700; letter-spacing: .06em; }
.m-ctaband__telnum .m-icon { color: var(--c-brand); }
.m-ctaband__hours { color: var(--c-muted); font-size: var(--fs-small); padding-left: 32px; }
@media (min-width: 1024px) { .m-ctaband__inner { grid-template-columns: 1fr auto; } }
/* PC: 「〇〇のお客様のご相談・お見積りはこちら」(최장 23자)가 한 줄에 들어가게 글자를 화면 폭에 맞춰 줄인다(2026-12-05 사용자 요청) */
@media (min-width: 1024px) { .m-ctaband__title { font-size: clamp(17px, calc((100vw - 700px) / 25), 26px); white-space: nowrap; } }

/* ---------- フッター（茶 #3D2E24） ---------- */
.m-footer { background: var(--c-earth-dark); color: #EFE9E3; font-size: 15px; }
.m-footer a { color: #fff; }
.m-footer__grid { display: grid; gap: var(--sp-7); padding-block: var(--sp-8) var(--sp-7); }
@media (min-width: 1024px) { .m-footer__grid { grid-template-columns: 5fr 7fr; gap: var(--sp-8); } }
.m-footer__brand { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-4); font-size: 20px; font-weight: 700; color: #fff; }
.m-footer__brand img { height: 48px; width: auto; }
.m-footer__intro { color: #D9CFC5; max-width: 34em; }
.m-footer__address { display: grid; gap: var(--sp-1); margin-bottom: var(--sp-4); }
.m-footer__address a { text-decoration: none; }
.m-footer__map { display: inline-flex; align-items: center; gap: var(--sp-1); font-weight: 700; }
.m-footer__nav { display: grid; gap: var(--sp-6); grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.m-footer__head { margin: 0 0 var(--sp-3); font-weight: 700; color: #fff; padding-bottom: var(--sp-2); border-bottom: 1px solid rgba(255, 255, 255, .2); }
.m-footer__col ul { list-style: none; margin: 0; padding: 0; }
.m-footer__col a { display: inline-flex; min-height: 36px; align-items: center; color: #EFE9E3; text-decoration: none; }
.m-footer__col a:hover { color: #fff; text-decoration: underline; }
.m-footer__bottom { border-top: 1px solid rgba(255, 255, 255, .15); padding-block: var(--sp-4); color: #CFC4B9; }
