/* ============================================================
   松尾ガラス｜共通スタイル
   ============================================================ */

:root {
  --navy: #17288a;
  --navy-dark: #101d63;
  --blue: #1f64b0;
  --blue-dark: #18548f;
  --bg: #ffffff;
  --bg-light: #f3f7fb;
  --bg-blue: #eaf1fb;
  --line: #e3e8ef;
  --text: #2b2f36;
  --muted: #565d68;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 6px 24px rgba(23, 40, 138, 0.08);
  --shadow-soft: 0 2px 10px rgba(23, 40, 138, 0.06);
  --header-h: 68px;
  --maxw: 1120px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: "Noto Sans JP", system-ui, -apple-system, "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.8;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img { max-width: 100%; display: block; }

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { margin: 0; line-height: 1.4; color: var(--navy); }

/* インラインSVGアイコン（ラインアイコン共通） */
svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

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

/* ---------- アクセシビリティ共通 ---------- */
/* スクリーンリーダー専用（視覚的に隠す） */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* 本文へスキップリンク */
.skip-link {
  position: fixed; top: 8px; left: 8px; z-index: 200;
  transform: translateY(-150%); transition: transform .2s;
  background: var(--navy); color: #fff; font-weight: 700;
  padding: 12px 18px; border-radius: var(--radius-sm); box-shadow: var(--shadow);
}
.skip-link:focus { transform: translateY(0); text-decoration: none; }

/* フォーカスの可視化 */
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
/* 濃色背景上は白系アウトラインで視認性確保 */
.site-footer :focus-visible,
.page-hero :focus-visible,
.btn-primary:focus-visible,
.contact-mail-button:focus-visible,
.filter-btn.is-active:focus-visible,
.skip-link:focus-visible { outline-color: #fff; }

/* ---------- ボタン ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; font-weight: 700; font-size: 16px;
  border: 2px solid transparent; cursor: pointer; transition: .2s; white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn svg { width: 18px; height: 18px; flex-shrink: 0; transform: translateY(1px); }
.btn-lg { padding: 15px 30px; font-size: 16px; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-secondary { background: #fff; color: var(--blue); border-color: var(--line); box-shadow: var(--shadow-soft); }
.btn-secondary:hover { background: #fff; border-color: var(--blue); color: var(--blue-dark); }
.sp-break { display: none; }

.text-link {
  display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--blue);
}
.text-link svg { width: 17px; height: 17px; }
.text-link:hover { color: var(--blue-dark); }

/* ---------- セクション見出し ---------- */
section { scroll-margin-top: var(--header-h); }
.section-head { margin-bottom: 32px; }
.section-head-center { text-align: center; }
.section-title { font-size: 28px; letter-spacing: .04em; }
.section-title::after,
.contact-title::after,
.company-title::after {
  content: ""; display: block; width: 46px; height: 4px; border-radius: 2px;
  background: var(--blue); margin-top: 12px;
}
.section-head-center .section-title::after,
.contact-title::after { margin-inline: auto; }
.section-lead { margin: 14px 0 0; color: var(--muted); font-size: 16px; display: flex; align-items: center; gap: 6px; }
.section-head-center .section-lead { justify-content: center; }
.section-foot { text-align: center; margin-top: 36px; }

/* ============================================================
   ヘッダー
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,.98);
  backdrop-filter: blur(6px); border-bottom: 1px solid #edf1f6;
}
.header-inner {
  max-width: var(--maxw); margin-inline: auto; padding: 0 24px;
  height: var(--header-h); display: flex; align-items: stretch; gap: 18px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--navy); flex-shrink: 0; }
.brand:hover { text-decoration: none; }
.brand-logo { width: 46px; height: 46px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; white-space: nowrap; }
.brand-name { font-size: 22px; font-weight: 700; letter-spacing: .04em; }

.primary-nav { margin-left: auto; display: flex; align-items: stretch; gap: 26px; }
.nav-links { display: flex; align-items: center; gap: 24px; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: #202636; font-weight: 700; font-size: 16px; white-space: nowrap; letter-spacing: .01em; }
.nav-links a:hover { color: var(--blue); text-decoration: none; }

.header-contact { display: flex; align-items: stretch; gap: 14px; }
.header-tel { display: grid; grid-template-columns: auto 1fr; align-content: center; column-gap: 8px; row-gap: 4px; color: var(--navy); line-height: 1.1; }
.header-tel:hover { text-decoration: none; }
.header-tel .header-tel-num { font-size: 22px; font-weight: 700; letter-spacing: .02em; }
.header-tel svg { grid-row: 1 / span 2; align-self: center; width: 20px; height: 20px; color: var(--blue); }
.header-tel-note { font-size: 13px; color: var(--muted); white-space: nowrap; }
.nav-toggle {
  display: none; margin-left: auto; background: none; border: 0; color: var(--blue);
  cursor: pointer; padding: 9px; min-width: 44px; min-height: 44px;
  align-items: center; justify-content: center;
}
.nav-toggle .nav-toggle-close { display: none; }
.nav-toggle[aria-expanded="true"] .nav-toggle-open { display: none; }
.nav-toggle[aria-expanded="true"] .nav-toggle-close { display: block; }

/* ============================================================
   ① ヒーロー
   ============================================================ */
.hero { position: relative; color: var(--text); }
.hero-bg {
  position: absolute; inset: 0; background-size: cover; background-position: center;
}
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(255,255,255,.94) 0%, rgba(241,247,255,.84) 38%, rgba(241,247,255,.36) 64%, rgba(255,255,255,0) 100%);
}
.hero-inner {
  position: relative; max-width: var(--maxw); margin-inline: auto; padding: 72px 24px 48px;
  display: grid; justify-items: start; gap: 18px;
}
.hero-title { color: var(--navy); font-size: 40px; line-height: 1.45; letter-spacing: .02em; text-shadow: 0 0 6px rgba(255,255,255,.9), 0 0 14px rgba(255,255,255,.7); }
.hero-sub { font-size: 18px; margin: 0; color: var(--text); }
.hero-sub-strong { font-weight: 700; color: var(--navy); font-size: 1.08em; }
.hero-note {
  width: fit-content; max-width: 100%; margin: 0;
  color: var(--text); font-size: 16px; font-weight: 600; line-height: 1.8;
}
.hero-note-mark {
  padding: 0 .12em 2px;
  background: linear-gradient(transparent 58%, rgba(255,214,64,.55) 58%);
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
  text-shadow:
    0 0 6px rgba(255,255,255,.95), 0 0 12px rgba(255,255,255,.85),
    0 0 20px rgba(255,255,255,.7);
}
.hero-cta { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 8px; }
.hero-cta .btn-secondary { border-color: rgba(31,100,176,.30); }
.hero-cta .btn-secondary:hover { background: var(--blue); color: #fff; border-color: var(--blue); }

/* ヒーロー下端の対応エリア帯（ガラス風） */
.hero-area-band {
  position: relative; margin-top: 40px;
  background: rgba(255,255,255,.55);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255,255,255,.65);
}
.hero-area-band-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 13px 24px;
  display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap;
}
.hero-area-label {
  flex: 0 0 auto; color: var(--navy); font-weight: 700;
  font-size: 13px; letter-spacing: .08em;
  padding-right: 16px; border-right: 1.5px solid rgba(23,40,138,.35);
}
.hero-area-text { color: var(--navy); font-weight: 600; font-size: 15.5px; }

.qual-badge {
  display: inline-block; background: var(--navy); color: #fff; font-weight: 700;
  font-size: 12px; padding: 3px 12px; border-radius: 999px;
}

/* ============================================================
   ② ご挨拶
   ============================================================ */
.greeting { padding: 84px 0; }
.greeting-head { margin-bottom: 28px; }
.greeting-title { margin-bottom: 0; }
.greeting-inner { display: grid; grid-template-columns: 300px 1fr; gap: 48px; align-items: start; }
.greeting-photo { margin: 0; }
.greeting-photo img {
  width: 100%; height: auto; display: block;
  border-radius: var(--radius); box-shadow: var(--shadow);
  background: var(--bg-light);
}
.greeting-qual { margin-top: 14px; text-align: center; }
.greeting-qual .qual-name {
  display: block; margin-top: 6px;
  font-weight: 700; font-size: 16.5px; color: var(--text);
}
.greeting-message p { margin: 0 0 20px; font-size: 16px; line-height: 2.05; }
.greeting-message p:last-child { margin-bottom: 0; }
.greeting-message p.greeting-handnote {
  font-family: "Klee One", "Noto Sans JP", sans-serif;
  font-size: 23px; font-weight: 600; color: var(--navy); line-height: 1.8;
  margin: 26px 0 10px;
}
.greeting-message p.greeting-sign {
  font-family: "Klee One", "Noto Sans JP", sans-serif;
  font-size: 20px; font-weight: 600; color: var(--text); text-align: right;
}

.strength-list {
  list-style: none; margin: 48px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
.strength-card {
  background: var(--bg-light); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px 26px; text-align: center;
}
.strength-icon {
  display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 64px;
  border-radius: 50%; background: #fff; color: var(--blue); margin-bottom: 16px;
}
.strength-icon svg { width: 36px; height: 36px; }
.strength-card h3 { font-size: 18px; margin-bottom: 10px; }
.strength-card p { margin: 0; font-size: 16px; color: var(--muted); }

/* ============================================================
   ③ サービス内容
   ============================================================ */
.services { padding: 84px 0; background: var(--bg-light); }
.service-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px;
}
/* リンクではないカードなので、hover では動かさない（クリックできると誤解させないため） */
.service-card {
  background: #fff; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-soft); border: 1px solid var(--line);
}
.service-photo { aspect-ratio: 4 / 3; overflow: hidden; background: var(--bg-light); }
.service-photo img { width: 100%; height: 100%; object-fit: cover; }
.service-text { padding: 16px 18px 20px; }
.service-text h3 { font-size: 16.5px; margin-bottom: 8px; }
.service-text p { margin: 0; font-size: 16px; color: var(--muted); line-height: 1.7; }

/* ============================================================
   ④ 施工事例
   ============================================================ */
.cases { padding: 84px 0; }
.case-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px;
}
/* カード全体がリンク（.case-more の疑似要素をカード全面に広げる）。hover で浮かせて押せることを示す */
.case-card {
  position: relative;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-soft);
  transition: transform .2s, box-shadow .2s;
}
.case-card:hover,
.case-card:focus-within { transform: translateY(-4px); box-shadow: var(--shadow); }
.case-more::after { content: ""; position: absolute; inset: 0; z-index: 1; }
/* 上のオーバーレイに食われないよう、カード内の他の操作要素は必ずこれより上に載せる */
.case-card button,
.case-card a:not(.case-more) { position: relative; z-index: 2; }
.case-media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: #e9eef4; }
/* 縦位置で撮られた写真も切らずに全体を見せる（余白は薄ブルーの地色でなじませる） */
.case-img { width: 100%; height: 100%; object-fit: contain; }
.case-ba-switch {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); z-index: 2;
  display: inline-flex; padding: 4px; border-radius: 999px;
  background: rgba(255,255,255,.92); box-shadow: var(--shadow-soft);
}
.case-ba-seg {
  min-height: 44px; padding: 0 16px; border: 0; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--navy); font-weight: 700; font-size: 13px;
  white-space: nowrap; transition: background .2s, color .2s;
}
.case-ba-seg:hover { color: var(--navy-dark); }
.case-ba-seg.is-active { background: var(--navy); color: #fff; }
.case-body { padding: 16px 18px 20px; }
.case-tag {
  display: inline-block; background: var(--bg-blue); color: var(--navy);
  font-size: 13px; font-weight: 700; padding: 3px 11px; border-radius: 999px; margin-bottom: 10px;
}
.case-title { font-size: 17px; font-weight: 700; line-height: 1.5; color: var(--navy); margin-bottom: 8px; }

/* ---------- 施工事例カルーセル（トップページ） ---------- */
.case-carousel-viewport {
  overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none; padding: 4px 4px 8px;  /* hover で浮いた分と影が切れないよう余白 */
  margin: -4px -4px -8px;
}
.case-carousel-viewport::-webkit-scrollbar { display: none; }
/* .case-grid とは別レイアウト（横並び）なので、グリッド指定は継がず自前で組む */
.case-track {
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: 24px;
}
.case-track .case-card { flex: 0 0 calc((100% - 48px) / 3); scroll-snap-align: start; }

.cases .section-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.case-carousel-ctrl { display: flex; gap: 8px; }
.case-ctrl {
  width: 44px; height: 44px; flex: 0 0 auto; border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid var(--line); color: var(--navy);
  transition: background .2s, color .2s, border-color .2s;
}
.case-ctrl:hover { background: var(--navy); border-color: var(--navy); color: #fff; }
.case-ctrl svg { width: 20px; height: 20px; }
.case-ctrl .icon-play { display: none; }

/* 枚数と現在位置を示すドット。操作ボタンを置かないモバイルでだけ出す */
.case-dots { display: none; justify-content: center; gap: 2px; margin-top: 14px; }
.case-dot {
  width: 28px; height: 28px; padding: 0; border: 0; background: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.case-dot::before {
  content: ""; width: 8px; height: 8px; border-radius: 999px;
  background: var(--line); transition: background .2s, transform .2s;
}
.case-dot.is-active::before { background: var(--navy); transform: scale(1.35); }
.case-ctrl.is-paused .icon-play { display: block; }
.case-ctrl.is-paused .icon-pause { display: none; }

/* ============================================================
   ⑤⑥ 費用 ＋ 流れ
   ============================================================ */
.info-split { padding: 84px 0; background: var(--bg-light); }
.info-split-grid { display: grid; grid-template-columns: 1fr; gap: 58px; align-items: start; }
.price-block { max-width: 640px; }

.price-table { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.price-table th, .price-table td { padding: 14px 18px; text-align: left; border-bottom: 1px solid var(--line); font-size: 16px; }
.price-table thead th { background: var(--navy); color: #fff; font-weight: 700; }
.price-table tbody tr:last-child td { border-bottom: 0; }
.price-table th:last-child, .price-table td:last-child { width: 30%; }
.price-amount { white-space: nowrap; font-weight: 700; color: var(--navy); }
.price-note { margin: 14px 0 0; font-size: 13px; color: var(--muted); }

.flow-block .section-head { margin-bottom: 28px; }
.flow-list {
  list-style: none; margin: 0; padding: 0; display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px; counter-reset: flow;
  padding-top: 15px;
}
.flow-step {
  position: relative;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 35px 18px 22px; text-align: center;
  display: flex; flex-direction: column; align-items: center; min-height: 220px;
}
.flow-num {
  position: absolute; left: 50%; top: 0; transform: translate(-50%, -50%);
  width: 32px; height: 32px; border-radius: 50%; background: var(--blue); color: #fff;
  font-weight: 700; font-size: 14px; line-height: 1; display: flex; align-items: center; justify-content: center;
}
.flow-icon {
  color: var(--navy); margin: 0 0 18px;
}
.flow-icon svg { width: 48px; height: 48px; stroke-width: 1.45; }
.flow-step h3 { font-size: 16px; margin-bottom: 8px; line-height: 1.35; white-space: nowrap; }
.flow-step p { margin: 0; font-size: 16px; line-height: 1.65; color: var(--muted); }

/* ============================================================
   ⑦⑧ お問い合わせ ＋ アクセス ＋ 会社情報
   ============================================================ */
.contact-access { padding: 84px 0; }
.contact-access-grid { display: block; }
.contact-block { max-width: none; }
.company-access-grid {
  display: grid; grid-template-columns: 1fr;
  gap: 56px; align-items: start; margin-top: 64px;
}

.contact-head { text-align: center; margin-bottom: 0; }
.contact-title { font-size: 28px; letter-spacing: .04em; }
.contact-lead { margin: 24px 0 0; color: var(--muted); font-size: 16px; font-weight: 400; }
.contact-actions {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px; margin-top: 36px;
}
.contact-action {
  min-height: 250px; padding: 36px 32px; text-align: center;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.contact-action h3 {
  font-size: 18px; color: var(--navy); margin-bottom: 26px;
}
.contact-action h3::after {
  content: none;
}
.contact-tel { display: inline-flex; align-items: center; gap: 12px; color: var(--navy); font-size: 38px; font-weight: 700; line-height: 1; }
.contact-tel:hover { text-decoration: none; color: var(--blue); }
.contact-tel svg { width: 32px; height: 32px; color: var(--blue); display: block; flex-shrink: 0; transform: translateY(3px); }
.contact-tel span { display: block; line-height: 1; }
.contact-meta { display: flex; gap: 28px; margin: 18px 0 0; justify-content: center; }
.contact-meta div { display: flex; flex-direction: column; }
.contact-meta dt { font-size: 14px; color: var(--muted); }
.contact-meta dd { margin: 2px 0 0; font-weight: 700; color: var(--text); font-size: 16px; }
.contact-mail-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 18px;
  width: min(300px, 100%); min-height: 58px; padding: 14px 24px; border-radius: 999px;
  background: var(--blue); color: #fff; font-size: 16px; font-weight: 700; letter-spacing: 0;
}
.contact-mail-button:hover { background: var(--blue-dark); color: #fff; text-decoration: none; }
.contact-mail-button svg { width: 18px; height: 18px; }
.contact-mail-text { margin: 16px 0 0; color: var(--muted); font-size: 16px; }

.access-media { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: stretch; }
.access-map { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-soft); border: 1px solid var(--line); }
.access-map iframe { width: 100%; height: 280px; border: 0; display: block; }
.access-photo { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-soft); }
.access-photo img { width: 100%; height: 280px; object-fit: cover; }
.access-block .text-link { margin-top: 12px; }

.company-block { margin-top: 0; }
.company-title { font-size: 28px; margin-bottom: 20px; }
.company-title::after { width: 40px; margin-top: 10px; }
.company-table { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.company-table > div { display: grid; grid-template-columns: minmax(0, 200px) minmax(0, 1fr); border-bottom: 1px solid var(--line); }
.company-table > div:last-child { border-bottom: 0; }
.company-table dt { background: var(--bg-light); padding: 14px 20px; font-weight: 700; color: var(--navy); font-size: 16px; margin: 0; }
.company-table dd { padding: 14px 20px; margin: 0; font-size: 16px; }
.company-table dt,
.company-table dd {
  min-width: 0;
  overflow-wrap: anywhere;
}
/* 本文中のリンクは色のみに頼らず下線で識別（1.4.1） */
.company-table dd a,
.footer-info a,
.breadcrumb a { text-decoration: underline; }

/* ============================================================
   フッター
   ============================================================ */
.site-footer { background: var(--navy); color: rgba(255,255,255,.85); padding: 56px 0 0; }
.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 520px) minmax(150px, 180px) minmax(120px, 160px);
  justify-content: start;
  column-gap: clamp(32px, 5vw, 56px);
  row-gap: 32px;
  padding-bottom: 40px;
}
.brand-footer .brand-name, .brand-footer { color: #fff; }
.footer-heading { font-weight: 700; color: #fff; margin: 0 0 14px; font-size: 16px; }
.footer-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.footer-nav a { color: rgba(255,255,255,.82); font-size: 16px; }
/* リンク文言の途中折返しを防ぐ（span 単位で折り返す） */
.footer-nav a span { white-space: nowrap; }
.footer-nav a:hover { color: #fff; }
.footer-info { margin-top: 22px; }
.footer-info dl { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.footer-info div { display: grid; grid-template-columns: 88px 1fr; font-size: 16px; line-height: 1.7; }
.footer-info dt { color: #9fb3e6; }
.footer-info dd { margin: 0; color: rgba(255,255,255,.85); }
.footer-info a { color: rgba(255,255,255,.85); }
.copyright { margin: 0; text-align: center; font-size: 13px; padding: 18px; border-top: 1px solid rgba(255,255,255,.14); color: rgba(255,255,255,.8); }

/* トップへ戻る */
.to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 90;
  width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--blue); color: #fff; box-shadow: var(--shadow);
  display: inline-flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transform: translateY(10px); transition: .25s;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { background: var(--blue-dark); }
.to-top svg { width: 22px; height: 22px; }

/* モバイル固定電話バー（ヘッダーのCTAが隠れる幅で表示） */
.mobile-callbar { display: none; }
@media (max-width: 1100px) {
  .mobile-callbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 95;
    display: grid; grid-template-columns: 1fr 1fr;
    background: #fff; border-top: 1px solid var(--line);
    box-shadow: 0 -4px 18px rgba(23, 40, 138, 0.10);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .mobile-callbar-item {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 56px; font-weight: 700; font-size: 16px; color: var(--blue);
  }
  .mobile-callbar-item:hover { text-decoration: none; }
  .mobile-callbar-item.is-primary { background: var(--blue); color: #fff; }
  .mobile-callbar-item svg { width: 20px; height: 20px; }
  .to-top { bottom: 72px; }
  body { padding-bottom: 56px; }
}

/* ============================================================
   施工事例ページ専用
   ============================================================ */
.page-hero { background: var(--navy); color: #fff; padding: 56px 0; }
.page-hero .section-title { color: #fff; }
.page-hero .section-title::after { background: #fff; }
.page-hero .section-lead { color: rgba(255,255,255,.85); }
.cases-page { padding: 56px 0 84px; }

/* ---------- 規約・法的ページ ---------- */
.legal { padding: 56px 0 84px; }
.legal-inner { max-width: 800px; }
.legal-intro { color: var(--muted); margin: 0 0 40px; }
.legal-section { margin-bottom: 44px; }
.legal-section:last-of-type { margin-bottom: 0; }
.legal-section > h2 {
  font-size: 21px; letter-spacing: .02em; padding-bottom: 12px;
  border-bottom: 2px solid var(--line); margin-bottom: 18px;
}
.legal-section h3 { font-size: 17px; margin: 26px 0 8px; color: var(--navy); }
.legal-section p { margin: 0 0 14px; }
.legal-section p:last-child { margin-bottom: 0; }
.legal-section ul { margin: 0 0 14px; padding-left: 1.4em; }
.legal-section ul li { margin-bottom: 8px; }
.legal-meta { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 15px; }
.legal-meta p { margin: 0 0 4px; }

.case-filter { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 36px; justify-content: center; }
.filter-btn {
  border: 1px solid var(--line); background: #fff; color: var(--text); font-weight: 700;
  font-size: 16px; padding: 11px 20px; min-height: 44px; border-radius: 999px; cursor: pointer; transition: .2s;
}
.filter-btn:hover { border-color: var(--blue); color: var(--blue); }
.filter-btn.is-active { background: var(--navy); color: #fff; border-color: var(--navy); }

/* 一覧ページと、詳細ページ下部の「関連する施工事例」は同じ段組で見せる */
.cases-page .case-grid,
.case-grid-related { grid-template-columns: repeat(3, 1fr); }
.case-desc { margin: 8px 0 0; font-size: 16px; color: var(--muted); line-height: 1.7; }
.case-card.is-hidden { display: none; }

.cases-cta {
  margin-top: 64px; text-align: center; background: var(--bg-light);
  border-radius: var(--radius); padding: 48px 24px; border: 1px solid var(--line);
}
.cases-cta h2 { font-size: 24px; margin-bottom: 10px; }
.cases-cta p { color: var(--muted); margin: 0 0 26px; }
.cases-cta-buttons { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

.case-count { margin: -20px 0 28px; text-align: center; color: var(--muted); font-size: 14px; }
.case-more { margin-top: 14px; }

/* ---------- 施工事例 詳細ページ ---------- */
.case-detail { padding: 28px 0 84px; }
.breadcrumb {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: 13px; color: var(--muted); margin-bottom: 24px;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--blue); }
.breadcrumb .breadcrumb-current { color: var(--text); font-weight: 700; }

.case-detail-head { margin-bottom: 28px; }
.case-detail-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 14px; }
.case-detail-head .case-tag { margin-bottom: 0; }
.case-detail-head .section-title { margin: 0; }
.case-detail-summary { margin: 16px 0 0; color: var(--muted); font-size: 16px; line-height: 1.8; }

.ba-figures { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 4px 0 44px; }
.ba-figure { margin: 0; }
.ba-figure img {
  width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: contain;
  border-radius: var(--radius); border: 1px solid var(--line); background: #e9eef4;
}
.ba-cap {
  display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: .08em;
  color: #fff; padding: 4px 13px; border-radius: 5px; margin-bottom: 10px;
}
.ba-cap-before { background: var(--muted); }
.ba-cap-after { background: var(--navy); }

.case-detail-body { display: grid; gap: 32px; max-width: 760px; }
.case-block-title {
  font-size: 18px; color: var(--navy); margin-bottom: 8px;
  padding-left: 12px; border-left: 4px solid var(--blue);
}
.case-block p { margin: 0; color: var(--text); line-height: 1.9; }

/* ---------- 前後の事例へのページ送り ---------- */
/* :not([hidden]) が無いと、事例が1件のときに空の枠線だけが出てしまう */
.case-pager:not([hidden]) {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  margin: 44px 0 0; padding-top: 28px; border-top: 1px solid var(--line);
}
.case-pager-item {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; color: var(--navy); text-decoration: none;
  transition: border-color .2s, box-shadow .2s;
}
.case-pager-item:hover { border-color: var(--blue); box-shadow: var(--shadow-soft); }
.case-pager-item svg { width: 20px; height: 20px; flex: 0 0 auto; color: var(--blue); }
.case-pager-item.is-next { grid-column: 2; flex-direction: row-reverse; text-align: right; }
.case-pager-label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.case-pager-title {
  font-size: 15px; font-weight: 700; line-height: 1.5;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}

/* ---------- 関連する施工事例 ---------- */
.related-cases { margin-top: 56px; }
.related-cases-title { font-size: 22px; margin-bottom: 28px; }

.case-detail-nav { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; margin: 40px 0; }
.case-detail .cases-cta { margin-top: 0; }
.case-detail-back { margin: 28px 0 0; }

.case-notfound { padding: 80px 0; text-align: center; }
.case-notfound .section-lead { justify-content: center; margin-bottom: 28px; }
.case-notfound .section-title::after { margin-inline: auto; }

/* ============================================================
   レスポンシブ
   ============================================================ */
@media (max-width: 1024px) {
  .service-grid { grid-template-columns: repeat(2, 1fr); }
  .case-grid, .cases-page .case-grid, .case-grid-related { grid-template-columns: repeat(2, 1fr); }
  .case-track .case-card { flex-basis: calc((100% - 24px) / 2); }
  .ba-figures { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 1100px) {
  :root { --header-h: 70px; }
  .nav-toggle { display: inline-flex; }
  .header-contact .header-tel-note { display: none; }
  .primary-nav {
    position: fixed; inset: var(--header-h) 0 auto 0; margin: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
    padding: 8px 24px 24px; max-height: calc(100vh - var(--header-h)); overflow-y: auto;
    transform: translateY(-12px); opacity: 0; visibility: hidden; transition: .22s;
  }
  .primary-nav.is-open { transform: translateY(0); opacity: 1; visibility: visible; }
  body.nav-open::before {
    content: ""; position: fixed; inset: 0; z-index: 99;
    background: rgba(15, 23, 42, .45);
  }
  .nav-links { flex-direction: column; gap: 0; }
  .nav-links li { border-bottom: 1px solid var(--line); }
  .nav-links a { display: block; padding: 14px 4px; }
  .header-contact { flex-direction: column; align-items: center; gap: 12px; margin-top: 18px; }
  .header-tel {
    display: inline-flex; align-items: center; justify-content: center;
    width: fit-content; gap: 10px; text-align: center;
  }
  .header-tel svg { grid-row: auto; }
}

@media (max-width: 860px) {
  .greeting-inner { grid-template-columns: 1fr; gap: 28px; }
  .greeting-photo { max-width: 280px; margin-inline: auto; }
  .strength-list { grid-template-columns: 1fr; gap: 16px; }
  .info-split-grid { grid-template-columns: 1fr; gap: 44px; }
  .contact-actions { grid-template-columns: 1fr; }
  .company-access-grid { gap: 44px; margin-top: 52px; }
  .company-table > div { grid-template-columns: minmax(0, 130px) minmax(0, 1fr); }
  .footer-inner { grid-template-columns: 1fr; gap: 30px; }
  .cases-page .case-grid, .case-grid-related { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  body { font-size: 16px; }
  .sp-break { display: block; }
  /* 固定改行が中途半端な位置で折り返されるのを防ぐ（自然折返しに任せる） */
  .hero-sub br { display: none; }
  .hero { overflow: hidden; }
  .hero-inner { width: 100%; padding: 52px 24px 44px; }
  .hero-title { font-size: 27px; }
  .hero-sub { font-size: 15.5px; }
  .hero-cta { width: 100%; }
  .hero-cta .btn {
    width: 100%;
    min-width: 0;
    white-space: normal;
    text-align: center;
    line-height: 1.5;
  }
  .hero-area-band { margin-top: 28px; }
  .hero-area-band-inner { padding: 12px 18px; gap: 6px; flex-direction: column; }
  .hero-area-label { padding-right: 0; border-right: none; }
  .hero-area-text { text-align: center; }
  .hero-area-text { font-size: 14.5px; }
  .section-title { font-size: 23px; }
  .greeting, .services, .cases, .info-split, .contact-access { padding: 56px 0; }
  .service-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .service-text { padding: 12px 13px 16px; }
  .service-text h3 { font-size: 14.5px; }
  .case-grid, .cases-page .case-grid, .case-grid-related { grid-template-columns: 1fr; }
  /* 次の1枚が少し覗く幅にして、横に送れることを見せる */
  .case-track { gap: 14px; }
  .case-track .case-card { flex-basis: 86%; }
  /* 操作ボタンは幅に入らないので隠し、代わりにドットで位置を示す（自動送りも止める） */
  .case-carousel-ctrl { display: none; }
  .case-dots { display: flex; }
  .ba-figures { grid-template-columns: 1fr; gap: 24px; }
  .case-pager:not([hidden]) { grid-template-columns: 1fr; }
  .case-pager-item.is-next { grid-column: 1; }
  .case-block-title { font-size: 17px; }
  .contact-title { font-size: 23px; }
  .contact-lead { margin-top: 20px; font-size: 16px; line-height: 1.8; text-align: center; }
  .contact-actions { gap: 16px; margin-top: 30px; }
  .contact-action { min-height: auto; padding: 30px 18px; }
  .contact-action h3 { font-size: 17px; margin-bottom: 24px; }
  .contact-tel { font-size: 30px; gap: 10px; }
  .contact-tel svg { width: 28px; height: 28px; }
  .contact-meta { gap: 22px; }
  .contact-mail-button { min-height: 54px; font-size: 16px; padding: 12px 20px; }
  .contact-mail-button svg { width: 18px; height: 18px; }
  .access-media { grid-template-columns: 1fr; gap: 14px; }
  .access-map iframe,
  .access-photo img { height: 240px; }
  .flow-list { grid-template-columns: 1fr; gap: 14px; padding-top: 0; padding-left: 14px; }
  .flow-step {
    min-height: auto; padding: 18px 16px; text-align: left;
    display: grid; grid-template-columns: 42px 1fr; column-gap: 14px; align-items: center;
  }
  .flow-num {
    left: 0; top: 50%; transform: translate(-50%, -50%);
    width: 28px; height: 28px; font-size: 13px;
  }
  .flow-icon { grid-row: 1 / 3; margin: 0; }
  .flow-icon svg { width: 36px; height: 36px; }
  .flow-step h3 { font-size: 15px; margin-bottom: 2px; }
  .flow-step p { font-size: 16px; line-height: 1.6; }
  .container { padding-inline: 18px; }
}

@media (max-width: 380px) {
  .service-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   モーション低減の設定を尊重
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .btn:hover,
  .case-card:hover,
  .case-card:focus-within { transform: none; }
  .case-carousel-viewport { scroll-behavior: auto; }
}
