/* ===== デザイン案4 ミニマル白×赤 ===== */
:root {
  --accent: #c81e1e;      /* アクセントカラー（赤） */
  --text: #1a1a1a;
  --sub: #555555;
  --muted: #777777;
  --line: #e5e5e5;
  --bg-gray: #f5f5f4;
  --wide: 1700px;         /* ヘッダー・フッター・お問い合わせ欄の横幅（本文は1200px） */
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Zen Kaku Gothic New', sans-serif;
  color: var(--text);
  background: #ffffff;
  line-height: 1.9;
}
a { color: var(--text); }
a:hover { color: var(--accent); }
img { max-width: 100%; display: block; }
/* 写真がないときの枠と、写真があるときの写真を、どちらか一方だけ表示します */
[hidden] { display: none !important; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ヘッダー */
.site-header {
  max-width: var(--wide); margin: 0 auto; padding: 32px 48px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
  border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 16px; font-weight: 700; font-size: 32px; letter-spacing: 0.15em; text-decoration: none; }
.logo img { height: 48px; width: auto; }
.nav { display: flex; flex-wrap: wrap; gap: 4px 48px; font-size: 25px; font-weight: 500; letter-spacing: 0.12em; }
.nav a { text-decoration: none; padding: 10px 0; }

/* ヒーロー */
.hero { padding-top: 96px; padding-bottom: 64px; display: flex; flex-wrap: wrap; gap: 48px; align-items: center; }
.hero-text { flex: 1 1 460px; min-width: 0; }
.hero-visual { flex: 1 1 460px; min-width: 0; }
.bar { width: 48px; height: 3px; background: var(--accent); }
.hero h1 { font-size: 56px; line-height: 1.4; margin: 28px 0; font-weight: 700; letter-spacing: 0.04em; }
.hero p { font-size: 16px; color: var(--sub); margin: 0; max-width: 460px; }
.hero-img { width: 100%; aspect-ratio: 15 / 11; object-fit: cover; background: #fafafa; }

/* 共通セクション */
.section { padding: 88px 0; }
.section-split { display: flex; flex-wrap: wrap; gap: 48px; }
.section-head { flex: 1 1 280px; }
.section-body { flex: 3 1 600px; min-width: 0; }
.eyebrow { font-size: 13px; letter-spacing: 0.2em; color: var(--muted); }
.section h1, .section h2 { font-size: 32px; margin: 8px 0 0; font-weight: 700; }
.gray { background: var(--bg-gray); }

/* 理念 */
/* 左右の余白（24px）は .container のものを残すため、上下だけ指定します */
.philosophy { border-top: 1px solid var(--line); padding-top: 72px; padding-bottom: 72px; }
.philosophy-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 56px; }
/* 画面が狭いときは3つを縦に並べて、ゆったり読めるようにします */
@media (max-width: 1100px) {
  .philosophy { padding-top: 56px; padding-bottom: 56px; }
  .philosophy-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .philosophy-grid > div { padding: 32px 0; border-bottom: 1px solid var(--line); }
  .philosophy-grid > div:first-child { padding-top: 0; }
  .philosophy-grid > div:last-child { border-bottom: 0; padding-bottom: 0; }
  .philosophy p { max-width: 560px; line-height: 2; }
}
.num { font-size: 13px; color: var(--accent); letter-spacing: 0.2em; font-weight: 700; }
.philosophy h3 { font-size: 22px; margin: 12px 0; font-weight: 700; }
.philosophy p { margin: 0; color: var(--sub); }

/* 事業内容 */
.service-row {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  padding: 20px 0; border-bottom: 1px solid #d6d3d1;
}
.service-row span { color: var(--sub); }

/* 私たちの仕事（旧レイアウト・現在は未使用） */
.works-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; margin-top: 40px; }
.works-grid figure { margin: 0; }
.works-grid img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; background: #e7e5e4; }
.works-grid figcaption { font-size: 14px; color: var(--sub); margin-top: 8px; }

/* 対応エリア */
#area { padding: 48px 0; }
#area .section-split { align-items: center; gap: 16px 48px; }
#area h2 { font-size: 24px; }
.area-main { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: 0.08em; }
.area-main span { color: var(--accent); }
.area-body { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 40px; }
.area-main { flex: none; }
.area-sub { flex: 1 1 320px; min-width: 0; margin: 0; font-size: 14px; color: var(--sub); }
/* スマホ・タブレット：「対応エリア」の横に「釜戸 ― 塩尻」、その真下に頭をそろえて地名の一覧 */
@media (max-width: 976px) {
  #area .section-split { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: end; gap: 16px 24px; }
  .area-body { display: contents; }
  .area-sub { grid-column: 2; }
}

/* 会社概要 */
.company-list { margin: 0; display: grid; grid-template-columns: 140px minmax(0, 1fr); border-top: 1px solid var(--line); }
.company-list dt, .company-list dd { padding: 16px 0; border-bottom: 1px solid var(--line); }
.company-list dt { color: var(--muted); }
.company-list dd { margin: 0; }

/* お問い合わせ */
.contact { background: var(--text); color: #ffffff; padding: 56px 0; }
.contact .container { max-width: var(--wide); padding: 0 48px; display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-end; justify-content: space-between; }
.contact h2 { font-size: 18px; margin: 24px 0 8px; font-weight: 700; }
.contact p { margin: 0; color: #a3a3a3; }
.tel { font-size: 18px; font-weight: 700; letter-spacing: 0.05em; color: #ffffff; text-decoration: none; }
.contact-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.contact .btn { font-size: 18px; }

/* ボタン */
.btn {
  display: inline-block; padding: 14px 32px; border: 0; border-radius: 0; cursor: pointer;
  background: var(--accent); color: #ffffff; font: inherit; font-weight: 700; letter-spacing: 0.1em; text-decoration: none;
}
.btn:hover { background: #a51818; color: #ffffff; }
.btn:disabled { background: var(--muted); cursor: default; }

/* お問い合わせフォーム */
.contact-info { margin: 24px 0 0; font-size: 14px; color: var(--sub); }
.contact-info a { display: block; font-size: 20px; font-weight: 700; text-decoration: none; }
.form-field { margin-bottom: 24px; }
.form-field label { display: block; margin-bottom: 8px; font-weight: 500; }
.required { margin-left: 8px; font-size: 12px; font-weight: 700; color: var(--accent); }
.form-field input, .form-field select, .form-field textarea {
  width: 100%; padding: 12px 16px; border: 1px solid #a8a29e; border-radius: 0;
  background: #ffffff; color: var(--text); font: inherit; font-size: 16px;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.form-field textarea { min-height: 200px; resize: vertical; }
.form-status { margin: 16px 0 0; font-weight: 500; }
.form-status.is-error { color: var(--accent); }

/* フッター */
.site-footer {
  max-width: var(--wide); margin: 0 auto; padding: 40px 48px; font-size: 15px; color: var(--muted); letter-spacing: 0.05em;
  display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between;
}

/* スマホ */
@media (max-width: 640px) {
  .hero { padding-top: 48px; }
  .hero h1 { font-size: 38px; }
  .site-header { padding: 24px; }
  .logo { font-size: 24px; }
  .logo img { height: 36px; }
  .nav { gap: 4px 24px; font-size: 17px; }
  .site-footer { padding: 28px 24px; font-size: 13px; }
  .contact .container { padding: 0 24px; }
  .section { padding: 64px 0; }
  .company-list { grid-template-columns: 96px minmax(0, 1fr); }
}

/* ===== アニメーション ===== */
/* スクロールして画面に入ったら、ふわっと表示（JavaScriptが動かない環境では最初から表示） */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.2,1); transition-delay: var(--delay, 0s); }
.js .reveal.from-left { transform: translateX(-24px); }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* 赤い線が左から伸びる */
.js .bar.reveal { opacity: 1; transform: scaleX(0); transform-origin: left; transition: transform .9s cubic-bezier(.2,.7,.2,1); transition-delay: var(--delay, 0s); }
.js .bar.reveal.is-visible { transform: scaleX(1); }

/* トップのイラスト：電線を描くように表示 */
.js #hero-illust.draw g * { stroke-dasharray: 1200; stroke-dashoffset: 1200; animation: draw 2.4s ease forwards; }
.js #hero-illust.draw g *:nth-child(n+6) { animation-delay: .4s; }
.js #hero-illust.draw g *:nth-child(n+14) { animation-delay: .9s; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ヘッダー：スクロールで少し影 */
.site-header { transition: box-shadow .3s ease; }

/* 事業内容：行にマウスを乗せると赤い線 */
.service-row { position: relative; }
.service-row::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 100%; height: 1px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .5s ease; }
.service-row:hover::after { transform: scaleX(1); }
.service-row strong { transition: color .3s ease; }
.service-row:hover strong { color: var(--accent); }

/* ボタン：マウスを乗せると少し浮く */
.btn { transition: background .2s ease, transform .2s ease; }
.btn:hover { transform: translateY(-2px); }

/* ===== 写真スライドショー ===== */
.slider { margin-top: 40px; }
.slider-viewport { overflow: hidden; touch-action: pan-y; }
.slider-track { display: flex; transition: transform .7s cubic-bezier(.65,0,.35,1); }
.slide { flex: 0 0 100%; margin: 0; min-width: 0; }
/* 表示中以外の写真は隠す（画面の拡大率によって、隣の写真が端に少し見切れるのを防ぎます）
   切り替わりの0.7秒間だけ、出ていく写真も表示したままにします */
.slide { visibility: hidden; transition: visibility 0s linear .7s; }
.slide.is-active { visibility: visible; transition: visibility 0s linear 0s; }
.slide img, .slide .ph { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #e7e5e4; }
.slide figcaption { font-size: 15px; color: var(--sub); margin-top: 12px; opacity: 0; transform: translateY(8px); transition: opacity .6s ease .4s, transform .6s ease .4s; }
.slide.is-active figcaption { opacity: 1; transform: none; }
.slider-controls { display: flex; align-items: center; gap: 24px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.slider-count { font-size: 13px; letter-spacing: .15em; color: var(--muted); }
.slider-count b { color: var(--accent); }
.slider-dots { display: flex; gap: 8px; flex: 1; }
.slider-dot { width: 32px; height: 24px; padding: 0; border: 0; background: none; cursor: pointer; position: relative; }
.slider-dot::before { content: ""; position: absolute; left: 0; right: 0; top: 11px; height: 2px; background: var(--line); }
.slider-dot::after { content: ""; position: absolute; left: 0; top: 11px; height: 2px; width: 0; background: var(--accent); }
.slider-dot.is-active::after { animation: progress var(--interval, 5s) linear forwards; }
.slider.is-paused .slider-dot.is-active::after { animation-play-state: paused; }
@keyframes progress { to { width: 100%; } }
.slider-arrows { display: flex; gap: 8px; }
.slider-btn { width: 44px; height: 44px; border: 1px solid var(--line); background: #fff; color: var(--text); font-size: 18px; cursor: pointer; transition: background .2s ease, color .2s ease, border-color .2s ease; }
.slider-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.slider-btn:focus-visible, .slider-dot:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* 動きを減らす設定のパソコン・スマホでは、アニメーションを止めます */
@media (prefers-reduced-motion: reduce) {
  .js .reveal, .js .bar.reveal { opacity: 1; transform: none; transition: none; }
  .js #hero-illust.draw g * { animation: none; stroke-dasharray: none; }
  .slider-track, .slide figcaption { transition: none; }
  .slider-dot.is-active::after { animation: none; width: 100%; }
}
