/* ===============================
   PC/モバイル表示切り替え
=============================== */

/* デフォルト（PC版）: PC版を表示、モバイル版を非表示 */
.pc-only {
  display: block !important;
}

.mobile-only {
  display: none !important;
}

html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden; /* 横スクロール防止 */
  height: 100%;
}

body {
  font-family: var(--font-family-default);
}

/* アニメーション初期状態 */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(20px); /* 少し下に配置しておく */
  transition: opacity 1.5s ease, transform 1.5s ease;
  transition-delay: 0s;
}

/* スクロールで見えたら付与される */
.animate-on-scroll.start {
  opacity: 1;
  transform: translateY(0); /* 元の位置に戻る */
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-title {
  font-family: var(--font-family-default);
  font-size: var(--font-size-title);
  line-height: var(--lh-main-title);
  font-weight: bold;
  color: var(--color-title);
  margin: 0;
  letter-spacing: var(--letter-spacing-sec-title);
}

.section-label {
  font-family: var(--font-family-special-2);
  font-size: var(--font-size-label);
  line-height: var(--lh-label);
  color: var(--color-label);
  letter-spacing: var(--letter-spacing-label);
  text-transform: uppercase;
}

/* ===============================
   ヒーロー専用パララックス効果
=============================== */
.parallax-hero {
  position: relative;
  height: 300px; /* ヒーローの高さを固定 */
  overflow: hidden;
}

.parallax-hero .parallax-bg {
  position: fixed; /* パララックス効果にはfixedが必要 */
  top: 0;
  left: 0;
  width: 100%;
  height: 120%; /* パララックス効果に十分な高さを確保 */
  z-index: -1; /* 他の要素の後ろに配置 */
  will-change: transform;
}

.parallax-bg::after{
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--color-title);
  opacity: 0.5;
  z-index: 1;
}

/* システムインテグレーション専用の調整 */
.system-integration-hero.parallax-hero .parallax-bg {
  width: 85%; /* 元の80%幅を維持 */
  left: 0; /* 左寄せを維持 */
}

.infrastructure-hero-right.parallax-hero .parallax-bg {
  width: 85%; /* 元の80%幅を維持 */
  left: auto; /* 右寄せを維持 */
  right: 0;
}

.parallax-hero .parallax-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--hero-bg-position, center bottom);
}

.parallax-hero .parallax-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column; /* 縦並びを維持 */
  align-items: center; /* 中央寄せ */
  justify-content: flex-end; /* 下寄せ */
  text-align: center;
  padding: 2rem;
  box-sizing: border-box;
}

/* 次のセクションが上にかぶさる効果 */
.parallax-hero + * {
  position: relative;
  z-index: 3;
  background: white; /* 背景を白に設定してかぶさる効果を演出 */
}

/* ===============================
   ヘッダー全体
=============================== */
.site-header {
  position: fixed;
  z-index: 1000;
  top: 0;
  left: 0;
  width: 100%;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  box-sizing: border-box;
}

/* デスクトップでのスクロールバー対応は削除 */
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 1rem 2rem;
  box-sizing: border-box;
}

/* TOPページ専用: 透明状態（デスクトップのみ） */
@media (min-width: 769px) {
  .site-header.transparent {
    background-color: transparent;
  }
}

.site-header.scrolled {
  background-color: white;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

/* ロゴ */
.logo {
  flex-shrink: 0; /* ロゴのサイズを固定 */
}

.logo img {
  height: 40px;
}

/* ナビゲーション */
.main-nav a {
  font-family: var(--font-family-default);
  font-size: 18px;
  letter-spacing: 0.2em; /* Illustratorで200 */
  text-decoration: none;
  font-weight: 500;
}

.main-nav ul {
  display: flex;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
}

.main-nav li {
  margin: 0 0.75rem;
}

.main-nav li:not(:last-child)::after {
  content: ' | ';
  color: var(--color-title);
  margin-left: 0.75rem;
}

.main-nav a {
  position: relative;           /* 擬似要素の基準 */
  text-decoration: none;
  color: var(--color-title);
  font-weight: 500;
  padding-bottom: 3px;          /* 下線の位置調整 */
}

.main-nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1.5px;                  /* 下線の太さ */
  background-color: var(--color-title);       /* 下線の色 */
  transform: scaleX(0);         /* 初期は見えない */
  transform-origin: left center;
  transition: transform 0.3s ease; /* 0.3秒でアニメーション */
}

.main-nav a:hover::after {
  transform: scaleX(1);         /* 左から右に伸びる */
}

/* アクティブなページの下線を常に表示 */
.main-nav a.active::after {
  transform: scaleX(1);         /* アクティブページは常に下線を表示 */
}

/* お問い合わせボタン */
.contact-button {
  background-color: var(--color-title);
  color: #fff;
  letter-spacing: 0.2em;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: bold;
  position: relative; /* 擬似要素用 */
  white-space: nowrap;
  flex-shrink: 0;
}

/* 擬似要素で枠を作る */
.contact-button.hover-effect::before {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  border: 3px solid var(--color-title); /* 元のボタン色に合わせる */
  border-radius: 999px;   /* ボタンの丸みに合わせる */
  box-sizing: border-box;
  z-index: -1;
  transform: scale(1.2);
  opacity: 0;
  transition: transform ease .3s, opacity .3s;
}

/* ホバー時の色反転・枠表示 */
.contact-button.hover-effect:hover {
  color: var(--color-title);
  background: transparent;
}

.contact-button.hover-effect:hover .arrow-icon {
  filter: invert(1); /* 白→黒に反転 */
}

.contact-button .arrow-icon {
  display: inline-block;
  transition: filter 0.3s, opacity 0.3s;
}

.contact-button.hover-effect:hover::before {
  transform: scale(1);
  opacity: 1;
}

.read-more-btn img {
  vertical-align: middle; /* 文字とアイコンを中央揃え */
  height: auto;
}

.read-more-btn {
  display: inline-flex;
  align-items: center; /* 縦方向中央 */
}

.contact-button img {
  width: 20px;
  height: auto;
  vertical-align: middle;
  position: relative;
  top: -2px;
}

/* ナビゲーション全体のコンテナ */
.nav-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-left: auto; /* これで右端に寄せる */
}

/* ハンバーガーメニュー */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-title);
  transition: all 0.3s ease;
  transform-origin: center;
}

/* アクティブ時の × マーク */
.hamburger.active span:nth-child(1) {
  transform: rotate(45deg);
  position: relative;
  top: 6px; /* 上の線を下へ */
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg);
  position: relative;
  top: -6px; /* 下の線を上へ */
}

/* モバイルメニューオーバーレイ */
.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-color: white; /* 背景を白に変更 */
  z-index: 999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

.mobile-menu-overlay .main-nav {
  display: block;
}

.mobile-menu-overlay .main-nav ul {
  flex-direction: column;
  gap: 0; /* 間隔をリセットして仕切り線を追加 */
  list-style: none;
  margin: 0;
  padding: 0;
}

.mobile-menu-overlay .main-nav li {
  margin: 0;
  text-align: center;
  border-bottom: 1px solid var(--color-title); /* お問い合わせボタンと同じ色の仕切り線 */
}

.mobile-menu-overlay .main-nav li:last-child {
  border-bottom: none; /* 最後のアイテムには仕切り線なし */
}

.mobile-menu-overlay .main-nav li::after {
  display: none; /* セパレーターを非表示 */
}

.mobile-menu-overlay .main-nav a {
  color: var(--color-title); /* お問い合わせボタンと同じ色 */
  font-size: 1.5rem;
  text-decoration: none;
  font-weight: 500;
  letter-spacing: 0.1em;
  transition: color 0.3s ease;
  display: block;
  padding: 2rem; /* リンクエリアを広げる */
}

.mobile-menu-overlay .main-nav a:hover {
  color: #666; /* ホバー時は少し薄いグレー */
}

/* ===============================
   フッター
=============================== */
.site-footer {
  background-color: #000;
  padding: 2rem 0;
  text-align: center;
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.footer-bottom p {
  color: #fff;
  margin: 0;
  font-size: 0.9rem;
}

/* ===============================
   お問い合わせセクション
=============================== */
.contact-section {
  position: relative;
  padding: 5rem 2rem;
  min-height: 100vh;
  display: flex;
  align-items: center;
  background-image: url('../images/shutterstock_2465529039.jpg');
  background-position: bottom center;
  background-repeat: no-repeat;
  background-size: cover;
}

.contact-container {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  text-align: center;
}

.contact-header {
  margin-bottom: 4rem;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 1s ease-out 0.2s forwards;
}

.contact-content {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4rem;
  max-width: 900px;
  margin: 0 auto;
}

.contact-method {
  background: rgba(255, 255, 255, 0.555);
  padding: 2.5rem 2rem;
  border-radius: 8px;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1s ease-out, transform 1s ease-out;
}

.contact-method.start {
  opacity: 1;
  transform: translateY(0);
}

.contact-method-description {
  font-family: var(--font-family-default);
  font-size: var(--font-size-sec-label);
  letter-spacing: var(--letter-spacing-text-s);
  font-weight: 500;
  margin: 0;
  line-height: 1.8;
  color: var(--color-text);
  text-align: center;
  margin-bottom: 1.5rem;
}

.phone-number {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 2rem;
}

/* PC版では電話番号のリンク機能を無効化 */
@media (min-width: 769px) {
  .phone-number {
    pointer-events: none;
    cursor: default;
    text-decoration: none;
    color: var(--color-main);
  }
  
  .phone-number:hover {
    background-color: transparent !important;
    transform: none !important;
  }
}

.phone-text-wrapper {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.phone-icon {
  font-size: 1.2rem;
}

.phone-text {
  font-family: var(--font-family-special-2);
  font-size: var(--font-size-text-m);
  line-height: var(--lh-text-m);
  letter-spacing: var(--letter-spacing-text-m);
  color: var(--color-main);
  transform: translateY(-5px);
}

.phone-hours {
  font-size: 0.85rem;
  color: var(--color-title);
  text-align: left;
  transform: translateY(-10px);
}

.contact-button-wrapper {
  text-align: center;
  width: 100%; /* Ensure wrapper spans full width */
}

.top-contact {
  display: block;
  align-items: center;
  justify-content: center;
  position: relative;
  background-color: var(--color-title);
  color: white;
  padding: 1rem 2rem;
  border-radius: 50px;
  text-decoration: none;
  font-family: var(--font-family-default);
  font-size: var(--font-size-sec-label);
  letter-spacing: var(--letter-spacing-text-s);
  font-weight: normal;
  width: auto;
  max-width: 100%;
  margin: 0 2rem;
}

.top-contact-text {
  flex: 1;
  text-align: center;
}

.top-contact .arrow-icon {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: auto;
}

.top-contact:hover {
  background-color: #444;
}


  /* モバイル時のお問い合わせセクション */
@media (max-width: 768px) {
  /* PC/モバイル表示切り替え */
  .pc-only {
    display: none !important;
  }

  .mobile-only {
    display: block !important;
  }

  .contact-section {
    padding: 3rem 1rem;
    min-height: auto;
  }

  .contact-title {
    font-size: var(--mobile-font-size-sec-title);
  }

  .contact-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .contact-method {
    padding: 2rem 1.5rem;
  }

  .contact-method-title {
    font-size: var(--mobile-font-size-sub-title);
  }

  .contact-method-description {
    font-size: var(--mobile-font-size-sub-text);
    line-height: var(--mobile-lh-sub-text);
    letter-spacing: var(--mobile-letter-spacing-text);
  }

  .contact-phone,
  .contact-form {
    padding: 2rem 1rem;
  }

  /* モバイル版：電話番号を緑の電話ボタンに変更 */
  .phone-number {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background-color: #28a745; /* 緑色の背景 */
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-family: var(--font-family-default);
    font-size: var(--mobile-font-size-sub-text);
    letter-spacing: var(--mobile-letter-spacing-text);
    font-weight: bold;
    width: 100%;
    max-width: 100%;
    margin: 0;
    transition: background-color 0.3s ease, transform 0.2s ease;
    text-align: center;
    gap: 0.5rem;
    box-sizing: border-box;
  }

  /* 電話アイコンを左側に配置 */
  .phone-number .phone-icon {
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1); /* 白色に変更 */
    flex-shrink: 0;
  }

  /* 電話テキストを「電話する」に変更 */
  .phone-number .phone-text-wrapper::before {
    content: "電話する";
    color: white;
    font-family: var(--font-family-default);
    font-size: var(--mobile-font-size-sub-text);
    letter-spacing: var(--mobile-letter-spacing-text);
    font-weight: bold;
  }

  /* 元のテキストと営業時間を非表示 */
  .phone-number .phone-text,
  .phone-number .phone-hours {
    display: none;
  }

  .phone-number:hover {
    background-color: #218838;
    transform: translateY(-2px);
  }

  /* 電話テキストを中央に配置 */
  .phone-number .phone-text-wrapper {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0;
  }

  .phone-number .phone-text {
    display: none; /* 電話番号を非表示 */
  }

  .phone-number .phone-text-wrapper::before {
    content: "電話する";
    color: white;
    font-family: var(--font-family-default);
    font-size: var(--mobile-font-size-sub-text);
    letter-spacing: var(--mobile-letter-spacing-text);
    white-space: nowrap;
  }

  /* 営業時間をボタンの下に配置 */
  .phone-number .phone-hours {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 1rem;
    text-align: center;
    font-size: var(--mobile-font-size-small);
    line-height: var(--mobile-lh-sub-text);
    color: var(--color-title);
    font-weight: 500;
    background: transparent;
    white-space: nowrap;
  }

  /* 実際にクリック可能にする */
  .phone-number {
    cursor: pointer;
  }

  .contact-form-btn,
  .top-contact {
    font-size: var(--mobile-font-size-sub-text);
    line-height: var(--mobile-lh-sub-text);
    letter-spacing: var(--mobile-letter-spacing-text);
    padding: 0.8rem 1.5rem;
    width: 100%;
    max-width: 100%;
    margin: 0;
    box-sizing: border-box;
  }

  /* モバイル版のヘッダー幅調整 */
  .site-header {
    width: 100%;
    padding: 0; /* 上下左右のパディングを完全に削除 */
    background-color: white !important; /* モバイル版は最初から白背景 */
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1) !important; /* モバイル版は常に影をつける */
  }

  .header-inner {
    gap: 0.5rem;
    max-width: 100%;
    padding: 0; /* パディングを完全に削除 */
  }

  .main-nav {
    display: none; /* モバイル時はメニュー非表示（開閉機能は後ほど） */
  }

  .nav-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    order: 2; /* nav-container（お問い合わせボタンを含む）を最後に配置 */
  }

  .hamburger {
    display: flex;
    flex-shrink: 0;
    order: 0; /* ハンバーガーメニューを最初に配置 */
    margin-left: 1rem; /* 左端に適度な余白 */
    padding: 0.5rem; /* ハンバーガー自体に余白 */
  }

  .logo {
    flex: 1;
    display: flex;
    justify-content: center;
    min-width: 0; /* フレックスアイテムの最小幅をリセット */
    order: 1; /* ロゴを中央に配置 */
    padding: 0.5rem 0; /* ロゴに上下の余白を追加 */
  }

  .logo img {
    height: 25px; /* ロゴを少し小さく */
    max-width: 100%;
  }

  /* ヘッダー専用のモバイル版お問い合わせボタン */
  .header-contact-button {
    flex-shrink: 0;
    font-size: 0.7rem;
    padding: 1rem; /* シンプルなパディング */
    margin: 0; /* マージンをリセット */
    min-width: fit-content;
    order: 2; /* お問い合わせボタンを最後に配置 */
    width: auto;
    text-align: center;
    background-color: var(--color-title) !important; /* モバイルでは背景を確実に表示 */
    color: white !important;
    border-radius: 0 !important; /* 角丸なし - 画面端まで */
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* モバイル版の.section-headerマージン調整 */
  .section-header {
    margin-bottom: 2rem;
  }

  /* モバイル版のセクションタイトル */
  .section-title {
    font-size: var(--mobile-font-size-sec-title);
    line-height: var(--mobile-lh-sec-title);
    letter-spacing: var(--mobile-letter-spacing-title);
  }

  .section-label {
    font-size: var(--mobile-font-size-sec-label);
    line-height: var(--mobile-lh-sub-text);
    letter-spacing: var(--mobile-letter-spacing-label);
  }

  /* モバイル版でのシステムインテグレーション背景調整 */
  .system-integration-hero.parallax-hero .parallax-bg {
    width: 95% !important;
  }

  .infrastructure-hero-right.parallax-hero .parallax-bg {
    width: 95% !important;
  }
  /* モバイル版：ヘッダーお問い合わせボタンのhoverエフェクトを無効化 */
  .header-contact-button.hover-effect:hover,
  .header-contact-button.hover-effect:active,
  .header-contact-button.hover-effect:focus {
    color: white !important;
    background: var(--color-title) !important;
    border: none !important;
    box-shadow: none !important;
  }
  .header-contact-button.hover-effect::before {
    display: none !important;
  }
  /* モバイル版：ヘッダーお問い合わせボタンの矢印アイコン反転エフェクトも無効化 */
  .header-contact-button.hover-effect:hover .arrow-icon,
  .header-contact-button.hover-effect:active .arrow-icon,
  .header-contact-button.hover-effect:focus .arrow-icon {
    filter: none !important;
  }
}