/* =====================================================================
   山鐵建築 サイト共通スタイル
   ---------------------------------------------------------------------
   【色を変更したいとき】下の :root のCSS変数だけ直せば全体に反映されます
   ===================================================================== */

:root {
  /* ===== ここから：カラーパレット（編集OK） ===== */
  --color-bg: #FAF6F0;          /* ベース背景（生成り・漆喰の白） */
  --color-bg-sub: #F0E6D8;      /* サブ背景（淡いベージュ） */
  --color-text: #3E332A;        /* メインテキスト（焦げ茶） */
  --color-text-soft: #6E5F50;   /* 補足テキスト */
  --color-primary: #8B5E3C;     /* プライマリ（木のブラウン） */
  --color-accent: #FF8000;      /* アクセント（ロゴオレンジ） */
  --color-accent-dark: #E07000; /* アクセント hover */
  --color-honey: #D9A05B;       /* アクセント補助（琥珀・ハニー） */
  --color-line: #E5D9C8;        /* 罫線 */
  --color-footer: #3E332A;      /* フッター背景（一番下の濃い茶） */
  --color-cta-deep: #6E4528;    /* ご相談・ご質問の帯の深い茶（グラデーション側） */
  --color-cta-text: #FFF6EA;    /* ご相談・ご質問の帯の文字 */
  --color-footer-text: #EFE5D6; /* フッターの文字 */
  --color-footer-soft: #C9B79F; /* フッターの薄い文字（コピーライト等） */
  --color-hero-text: #FFF8EE;   /* トップ写真の上の文字 */
  --color-card: #FFFDF9;        /* カードの背景（白っぽい面） */
  --shadow-soft: 0 8px 24px rgba(94, 66, 41, 0.12);   /* 茶系の柔らかい影 */
  --shadow-card: 0 4px 16px rgba(94, 66, 41, 0.10);
  /* ===== ここまで ===== */

  /* フォント */
  --font-serif: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --font-sans: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;

  --radius: 14px;
  --header-h: 72px;
}

/* ---------- リセット・ベース ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.9;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-text-size-adjust: 100%;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-accent-dark); text-decoration: none; }
a:hover { color: var(--color-accent); }
h1, h2, h3, h4 { font-family: var(--font-serif); font-weight: 600; line-height: 1.5; }
table { border-collapse: collapse; width: 100%; }
button { font-family: inherit; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ---------- ヘッダー ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 246, 240, 0.97);
  /* backdrop-filter(ぼかし)は使わない：ヘッダー内のメニュー(position:fixed)が
     画面全体ではなくヘッダー基準になってしまい、スマホメニューが崩れるため */
  border-bottom: 1px solid var(--color-line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--header-h);
  max-width: 1180px;
  margin: 0 auto;
  padding: 8px 20px;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--color-text); flex-shrink: 0; }
.brand img { width: 46px; height: auto; }
.brand-name {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
  display: block;
  white-space: nowrap;   /* 社名を途中で改行させない */
}
.brand-sub {
  font-size: 0.68rem;
  color: var(--color-text-soft);
  display: block;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

/* ナビ（モバイル：ドロワー） */
.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 48px;
  height: 48px;
  padding: 12px;
  background: none;
  border: 0;
  cursor: pointer;
  z-index: 120;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}
.nav-open .nav-toggle span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.global-nav {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;  /* inset:0 は古いSafariで効かないため個別指定 */
  width: 100%;
  height: 100%;
  background: #FAF6F0;                    /* 古いブラウザ用の不透明フォールバック */
  background: rgba(250, 246, 240, 0.97);  /* ほぼ不透明（うっすら透け感のみ） */
  display: none;
  align-items: center;
  justify-content: center;
  overflow-y: auto;                       /* 画面が低い端末では中でスクロール */
  z-index: 110;
}
.nav-open .global-nav { display: flex; }
.nav-open { overflow: hidden; }
.global-nav ul {
  list-style: none;
  margin: auto;            /* 中央寄せ＋項目が多くても上端で切れない */
  padding: 72px 0 32px;    /* 上下に余白を確保しタップしやすく */
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: center;
}
.global-nav a {
  display: block;
  padding: 12px 24px;
  font-size: 1.05rem;
  color: var(--color-text);
}
.global-nav a:hover,
.global-nav a[aria-current="page"] { color: var(--color-accent-dark); }
.global-nav a[aria-current="page"] { font-weight: 700; }

/* ---------- ヒーロー（トップ） ---------- */
.hero {
  position: relative;
  min-height: 72vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}
.hero img.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(62, 41, 20, 0.25) 0%,
    rgba(255, 128, 0, 0.16) 60%,
    rgba(62, 41, 20, 0.45) 100%
  );
}
.hero-text {
  position: relative;
  z-index: 1;
  color: var(--color-hero-text);
  padding: 48px 20px;
  text-shadow: 0 2px 16px rgba(40, 24, 8, 0.55);
}
.hero-text .hero-catch {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 4.6vw, 2.6rem);
  font-weight: 700;
  margin: 0 0 14px;
  letter-spacing: 0.08em;
}
.hero-text .hero-title {
  font-family: var(--font-serif);
  font-size: clamp(1.05rem, 2.6vw, 1.5rem);
  margin: 0 0 6px;
  letter-spacing: 0.06em;
}
.hero-text .hero-lead { font-size: clamp(0.9rem, 2vw, 1.05rem); margin: 0; }

/* ---------- セクション共通 ---------- */
.section { padding: 72px 0; }
.section.alt { background: var(--color-bg-sub); }
.section-title {
  text-align: center;
  font-size: clamp(1.4rem, 3.4vw, 1.9rem);
  margin: 0 0 8px;
  letter-spacing: 0.06em;
}
.section-title::after {
  content: "";
  display: block;
  width: 48px;
  height: 3px;
  margin: 14px auto 0;
  border-radius: 2px;
  background: var(--color-accent);
}
.section-lead {
  text-align: center;
  color: var(--color-text-soft);
  margin: 0 0 40px;
}
.page-title-band {
  background: var(--color-bg-sub);
  padding: 40px 20px 36px;
  text-align: center;
}
.page-title-band h1 {
  font-size: clamp(1.4rem, 3.6vw, 2rem);
  margin: 0 0 6px;
  letter-spacing: 0.08em;
}
.page-title-band p { margin: 0; color: var(--color-text-soft); }

/* ---------- カード・グリッド ---------- */
.grid-2, .grid-3, .grid-4 { display: grid; gap: 24px; }
.card {
  background: var(--color-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.card-body { padding: 20px 22px 24px; }
.card-body h3, .card-body h4 { margin: 0 0 6px; font-size: 1.12rem; }
.card-body .card-tag {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-accent-dark);
  margin-bottom: 8px;
}
.card-body p { margin: 0; font-size: 0.95rem; }

/* 2カラム（写真＋文章） */
.split { display: grid; gap: 28px; align-items: center; }
.split img { border-radius: var(--radius); box-shadow: var(--shadow-soft); }
.split h2, .split h3 { margin: 0 0 12px; font-size: clamp(1.25rem, 3vw, 1.6rem); }
.split p { margin: 0 0 10px; }
/* 家造りの想い：代表の顔写真を、下の3枚並び写真と同じ横幅に。正方形のまま全体を表示し切れないようにする */
.split-img .profile-photo { width: 100%; max-width: 340px; aspect-ratio: 1 / 1; object-fit: contain; }

/* ---------- 性能カード ---------- */
.spec-cards { display: grid; gap: 20px; }
.spec-card {
  background: var(--color-card);
  border-top: 4px solid var(--color-accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  text-align: center;
  padding: 26px 18px 22px;
}
.spec-card .spec-num {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-accent-dark);
  line-height: 1.2;
  display: block;
}
.spec-card .spec-label { font-weight: 700; margin-top: 6px; display: block; }
.spec-card p { margin: 8px 0 0; font-size: 0.88rem; color: var(--color-text-soft); }

/* ---------- ボタン ---------- */
.btn {
  display: inline-block;
  padding: 14px 36px;
  border-radius: 999px;
  background: var(--color-accent);
  color: #FFF;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: var(--shadow-card);
  transition: background 0.2s, transform 0.2s;
}
.btn:hover { background: var(--color-accent-dark); color: #FFF; transform: translateY(-2px); }
.btn.ghost {
  background: transparent;
  color: var(--color-accent-dark);
  border: 2px solid var(--color-accent);
  box-shadow: none;
}
.btn.ghost:hover { background: var(--color-accent); color: #FFF; }
.center { text-align: center; }

/* ---------- ギャラリー ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.gallery-item {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.gallery-item img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  transition: transform 0.3s;
}
.gallery-item:hover img { transform: scale(1.05); }

/* クリックで拡大できる画像（class="js-zoom"） */
img.js-zoom { cursor: zoom-in; }
.zoom-note {
  font-size: 0.82rem;
  color: var(--color-text-soft);
  text-align: center;
  margin: 8px 0 0;
}
.zoom-note::before { content: "🔍 "; }

/* ---------- ライトボックス ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(40, 28, 16, 0.92);
  padding: 24px;
}
.lightbox.is-open { display: flex; }
.lb-lock { overflow: hidden; }
.lb-figure { margin: 0; max-width: min(1100px, 92vw); text-align: center; }
.lb-figure img {
  max-width: 100%;
  max-height: 82vh;
  width: auto;
  height: auto;
  margin: 0 auto;
  border-radius: 8px;
}
.lb-figure figcaption { color: #F3E9DC; font-size: 0.9rem; margin-top: 10px; }
.lightbox button {
  position: absolute;
  border: 0;
  background: rgba(255, 253, 249, 0.14);
  color: #FFF;
  cursor: pointer;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font-size: 1.3rem;
  line-height: 1;
  transition: background 0.2s;
}
.lightbox button:hover { background: var(--color-accent); }
.lb-close { top: 18px; right: 18px; font-size: 1.7rem; }
.lb-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 14px; top: 50%; transform: translateY(-50%); }

/* ---------- Instagramセクション ---------- */
.insta-strip { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 28px; }
.insta-strip img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: var(--shadow-card);
}

/* ---------- 表（会社概要・沿革） ---------- */
.info-table th, .info-table td {
  text-align: left;
  vertical-align: top;
  padding: 14px 10px;
  border-bottom: 1px solid var(--color-line);
  font-weight: normal;
}
.info-table th {
  width: 9em;
  color: var(--color-primary);
  font-weight: 700;
  white-space: nowrap;
}
.info-table td p { margin: 0; }

/* ---------- お問い合わせ ---------- */
.contact-iframe {
  width: 100%;
  height: 1800px;
  border: 0;
  border-radius: var(--radius);
  background: var(--color-card);
  box-shadow: var(--shadow-card);
}
.contact-other {
  background: var(--color-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 26px 24px;
  text-align: center;
}
.contact-other .tel {
  font-family: var(--font-serif);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--color-accent-dark);
  display: block;
  margin: 4px 0;
}

/* ---------- CTA（お問い合わせ誘導） ---------- */
.cta {
  background: linear-gradient(135deg, var(--color-primary), var(--color-cta-deep));
  color: var(--color-cta-text);
  text-align: center;
  padding: 64px 20px;
}
.cta h2 { margin: 0 0 10px; font-size: clamp(1.3rem, 3vw, 1.7rem); }
.cta p { margin: 0 0 24px; }

/* ---------- フッター ---------- */
.site-footer {
  background: var(--color-footer);
  color: var(--color-footer-text);
  padding: 48px 0 28px;
  font-size: 0.92rem;
}
.footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  gap: 28px;
}
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-brand img { width: 52px; }
.footer-brand .name { font-family: var(--font-serif); font-size: 1.1rem; font-weight: 700; }
.footer-brand .sub { font-size: 0.78rem; color: var(--color-footer-soft); display: block; }
.footer-address { margin: 0; font-style: normal; line-height: 2; }
.footer-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.footer-nav a { color: var(--color-footer-text); }
.footer-nav a:hover { color: var(--color-honey); }
.footer-sns a {
  display: inline-block;
  color: #FFD9AE;
  border: 1px solid var(--color-honey);
  border-radius: 999px;
  padding: 8px 22px;
}
.footer-sns a:hover { background: var(--color-accent); border-color: var(--color-accent); color: #FFF; }
.copyright {
  text-align: center;
  margin-top: 36px;
  padding-top: 18px;
  border-top: 1px solid rgba(239, 229, 214, 0.2);
  color: var(--color-footer-soft);
  font-size: 0.8rem;
}

/* ---------- フェードイン ---------- */
.fade-in {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.fade-in.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .fade-in { opacity: 1; transform: none; transition: none; }
}

/* =====================================================================
   レスポンシブ（タブレット〜PC）
   ===================================================================== */
@media (min-width: 600px) {
  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
  .insta-strip { grid-template-columns: repeat(4, 1fr); }
  .spec-cards { grid-template-columns: repeat(3, 1fr); }
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 840px) {
  .split { grid-template-columns: 1fr 1fr; gap: 48px; }
  .split.reverse > .split-img { order: 2; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .gallery-grid { grid-template-columns: repeat(4, 1fr); gap: 14px; }
  .footer-inner { grid-template-columns: 1.4fr 1fr 1fr; align-items: start; }
}

/* ナビをPC表示（横並び）に。項目が全部1行で収まる幅(1080px)以上で横並び、
   それ未満はハンバーガーメニューにして改行・はみ出しを防ぐ */
@media (min-width: 1080px) {
  .nav-toggle { display: none; }
  /* 4KディスプレイのWindows等でも1段に収まるよう、ヘッダーの箱を広げる */
  .header-inner { max-width: 1460px; }
  .global-nav {
    position: static;
    display: block;
    background: none;
    overflow: visible;   /* モバイル用のスクロール指定を解除（横スライダー防止） */
  }
  /* 収まらない幅のときはスクロールさせず、メニューを2段に折り返す */
  .global-nav ul { flex-direction: row; flex-wrap: wrap; justify-content: flex-end; gap: 2px; margin: 0; padding: 0; }
  .global-nav a {
    font-size: 0.88rem;
    padding: 10px 9px;
    position: relative;
    white-space: nowrap;   /* メニュー項目を改行させない */
  }
  .global-nav a::after {
    content: "";
    position: absolute;
    left: 9px;
    right: 9px;
    bottom: 4px;
    height: 2px;
    border-radius: 1px;
    background: var(--color-accent);
    transform: scaleX(0);
    transition: transform 0.25s;
  }
  .global-nav a:hover::after,
  .global-nav a[aria-current="page"]::after { transform: scaleX(1); }
}
