﻿/* 西湖工業 共通ヘッダー設定 */
body {
  font-family: -apple-system, "Hiragino Kaku Gothic ProN", "ヒラギノ角ゴ ProN W3", "メイリオ", Meiryo, sans-serif;
}
header {
  background: #fff;
  border-bottom: 3px solid #2e7d32;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
}
.hdr-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 12px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.hdr-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  flex-shrink: 0;
}
.hdr-logo img {
  height: 32px;
  width: auto;
  display: block;
}
/* 文字の高さ調整:ここを直せば全部のページが同時に直ります */
.hdr-logo div {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.1;
  margin-top: 2px;
}
.hdr-name {
  font-size: 20px;
  font-weight: 700;
  color: #1b5e20;
  white-space: nowrap;
}
.hdr-sub {
  font-size: 10px;
  color: #555;
  display: block;
  margin-top: 1px;
}
.hdr-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.hdr-tel {
  display: flex;
  align-items: center;
  gap: 5px;
  background: #2e7d32;
  color: #fff;
  padding: 5px 10px;
  border-radius: 20px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.hdr-tel span {
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
/* 電話アイコン白固定（全デバイス共通） */
.hdr-tel svg {
  fill: #fff !important;
  flex-shrink: 0;
}
.cta-tel svg {
  fill: #fff !important;
}
.hdr-est {
  background: #1b5e20;
  color: #fff;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.hdr-hbg {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 52px;
  height: 44px;
  cursor: pointer;
  background: #2e7d32;
  border: none;
  border-radius: 6px;
  padding: 6px 8px;
  flex-shrink: 0;
}
.hdr-hbg span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: .3s;
}
.hdr-hbg::after {
  content: "メニュー";
  font-size: 9px;
  color: #fff;
  font-weight: 700;
  line-height: 1;
  margin-top: 1px;
}
.hdr-hbg.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.hdr-hbg.open span:nth-child(2) { opacity: 0; }
.hdr-hbg.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
nav { background: #1b5e20; }
.hdr-nav {
  max-width: none;
  margin: 0;
  display: flex;
  flex-wrap: nowrap;
}
.hdr-nav a {
  color: #fff;
  text-decoration: none;
  padding: 9px 5px;
  font-size: 10.5px;
  display: block;
  white-space: nowrap;
  flex: 1;
  text-align: center;
}
.hdr-nav a:hover, .hdr-nav a.active { background: #2e7d32; }
/* タブレット：ナビを2行折り返し */
@media(max-width: 1024px) and (min-width: 701px) {
  .hdr-nav { flex-wrap: wrap; }
  .hdr-nav a { flex: 0 0 auto; padding: 8px 10px; font-size: 10.5px; }
}
@media(max-width: 700px) {
  .hdr-sub { display: none; }
  .hdr-logo div { margin-top: 0; }
  .hdr-name { font-size: 15px; }
  .hdr-tel { font-size: 11px; padding: 5px 8px; }
  .hdr-est { display: none; }
  .hdr-hbg { display: flex; }
  .hdr-nav { display: none; flex-direction: column; }
  .hdr-nav.open { display: flex; }
  .hdr-nav a { padding: 12px 16px; font-size: 14px; border-bottom: 1px solid rgba(255,255,255,.15); }
}

/* トップに戻るボタン（全ページ共通） */
#page-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 52px;
  height: 52px;
  background: #2e7d32;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 3px 10px rgba(0,0,0,.35);
  z-index: 9999;
}
#page-top svg {
  fill: #fff;
  width: 28px;
  height: 28px;
}

/* 施工写真ギャラリー共通（全ページ） */
.gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}
.gallery img {
  width: 100%;
  height: auto;
  display: block;
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
}
@media(max-width: 700px) {
  .gallery {
    grid-template-columns: 1fr;
  }
}
/* Codex mobile header complete 2026-07-08 */
@media(max-width: 700px) {
  header {
    position: sticky !important;
    top: 0 !important;
    z-index: 10000 !important;
  }
  .hdr-inner {
    min-height: 66px !important;
    padding: 8px 8px !important;
    gap: 8px !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto auto !important;
    align-items: center !important;
  }
  .hdr-logo {
    min-width: 0 !important;
  }
  .hdr-logo img {
    width: 50px !important;
    height: auto !important;
    flex: 0 0 auto !important;
  }
  .hdr-logo div {
    min-width: 0 !important;
  }
  .hdr-name {
    display: block !important;
    font-size: 14px !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  .hdr-right {
    display: contents !important;
  }
  .hdr-tel {
    position: static !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 132px !important;
    height: 34px !important;
    padding: 0 4px !important;
    border-radius: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    overflow: visible !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #1b5e20 !important;
    -webkit-text-fill-color: #1b5e20 !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }
  .hdr-tel svg {
    width: 16px !important;
    height: 16px !important;
    margin: 0 !important;
    flex: 0 0 auto !important;
  }
  .hdr-tel svg path {
    fill: #2e7d32 !important;
  }
  .hdr-tel span {
    display: inline !important;
    color: #1b5e20 !important;
    -webkit-text-fill-color: #1b5e20 !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
  }
  .hdr-tel,
  .hdr-tel *,
  .hdr-tel a {
    color: #1b5e20 !important;
    -webkit-text-fill-color: #1b5e20 !important;
    text-decoration: none !important;
  }
  .hdr-hbg,
  .hdr-hbg.open {
    display: flex !important;
    position: relative !important;
    top: auto !important;
    right: auto !important;
    width: 56px !important;
    height: 46px !important;
    z-index: 10004 !important;
    pointer-events: auto !important;
    touch-action: manipulation !important;
    background: #2e7d32 !important;
    border: 0 !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.16) !important;
  }
  .hdr-hbg span {
    display: block !important;
    width: 24px !important;
    height: 3px !important;
    background: #fff !important;
    border-radius: 2px !important;
    opacity: 1 !important;
    transition: transform .2s ease, opacity .2s ease !important;
  }
  .hdr-hbg::after {
    content: "メニュー" !important;
    color: #fff !important;
    font-size: 9px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    margin-top: 1px !important;
  }
  .hdr-hbg.open {
    position: fixed !important;
    top: 10px !important;
    right: 10px !important;
  }
  .hdr-hbg.open::after { content: "閉じる" !important; }
  .hdr-hbg.open span:nth-child(1) { transform: translateY(7px) rotate(45deg) !important; }
  .hdr-hbg.open span:nth-child(2) { opacity: 0 !important; }
  .hdr-hbg.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg) !important; }
  .hdr-nav:not(.open) {
    display: none !important;
    pointer-events: none !important;
  }
  .hdr-nav.open {
    display: flex !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    z-index: 10003 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    box-sizing: border-box !important;
    padding: 38px 0 calc(72px + env(safe-area-inset-bottom, 0px)) !important;
    background: #155d24 !important;
    flex-direction: column !important;
    pointer-events: auto !important;
  }
  .hdr-nav.open a {
    display: block !important;
    flex: none !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 10px 20px !important;
    color: #fff !important;
    font-size: 15px !important;
    text-align: left !important;
    border-bottom: 1px solid rgba(255,255,255,.18) !important;
  }
  .hdr-nav.open a:last-child {
    margin-bottom: 24px !important;
  }
  .hdr-nav.open::after {
    content: "" !important;
    display: block !important;
    flex: 0 0 24px !important;
  }
  body.codex-menu-open #page-top {
    display: none !important;
  }
  body.codex-menu-open {
    overflow: hidden !important;
  }
}
@media(max-width: 380px) {
  .hdr-tel,
  .hdr-tel span {
    font-size: 12px !important;
  }
  .hdr-tel svg {
    width: 14px !important;
    height: 14px !important;
  }
  .hdr-hbg,
  .hdr-hbg.open {
    width: 54px !important;
  }
}

@supports (-webkit-touch-callout: none) {
  @media(max-width: 700px) {
    .hdr-nav.open {
      padding: 36px 0 calc(64px + env(safe-area-inset-bottom, 0px)) !important;
    }
    .hdr-nav.open a {
      padding: 10px 20px !important;
    }
    .hdr-nav.open a:last-child {
      margin-bottom: 20px !important;
    }
    .hdr-nav.open::after {
      flex-basis: 20px !important;
    }
  }
}
/* Codex mobile header complete end */

