/* 共通スタイル */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Helvetica Neue", Arial, sans-serif;
  color: var(--text-color);
  background-color: var(--bg-color);
  line-height: 1.7;
  font-size: 17px;
}

/* カラーバリエーション */
:root {
  --primary-color: #1a1a2e; /* シックなネイビー */
  --accent-color: #4a90e2; /* 控えめなブルー */
  --text-color: #eaf2ff;   /* ダーク背景で読みやすいテキスト色 */
  --bg-color: #0b132b;     /* ダーク基調の背景 */
  --card-bg: #ffffff;
  --section-bg: #f1f3f4;
  --border-color: #e1e5e9;
}

/* ナビゲーションバー */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 100;
  background: rgba(26, 26, 46, 0.95);
}

.navbar .logo {
  color: #fff;
  font-size: 1.4rem;
  font-weight: bold;
}

.navbar .logo span {
  color: var(--accent-color);
}

.navbar .logo a {
  color: inherit;
  text-decoration: none;
}

.navbar .nav-links {
  list-style: none;
  display: flex;
  gap: 1rem;
}

.navbar .nav-links li a {
  color: #fff;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.navbar .nav-links li a:hover {
  color: var(--accent-color);
}

/* ボタンスタイル */
.btn-primary,
.btn-secondary {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  text-decoration: none;
  font-weight: bold;
  transition: background 0.3s ease, color 0.3s ease;
}

.btn-primary {
  background-color: var(--accent-color);
  color: #fff;
}

.btn-primary:hover {
  background-color: #e66a00;
}

.btn-secondary {
  background-color: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
  background-color: var(--primary-color);
  color: #fff;
}

/* セクション共通 */
.section {
  padding: 4rem 2rem;
  max-width: 1200px;
  margin: 0 auto;

  /* 固定ナビゲーションバーによりスクロール時に見出しが隠れないように調整 */
  scroll-margin-top: 120px;
}

.section h2 {
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: 2rem;
  color: #ffffff;
  font-weight: 700;
}

.section p {
  margin-bottom: 1rem;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.92);
  font-weight: 500;
}

.bg-light {
  background-color: var(--section-bg);
}

/* ライト背景セクションでは文字色を濃色に戻す */
.bg-light h2 { color: #0f172a; }
.bg-light p { color: #1e293b; }

/* 業界リストスタイル */
.industry-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.5rem 1rem;
  max-width: 800px;
  margin: 2rem auto 0;
  padding: 0;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
}

.bg-light .industry-list { color: #334155; }

.industry-list li::before {
  content: "•";
  margin-right: 0.5rem;
  color: var(--accent-color);
}

/* 沿革タイムライン用のスタイル */
.history-list {
  list-style: none;
  max-width: 800px;
  margin: 2rem auto 0;
  padding: 0;
}

.history-list li {
  padding-left: 1.25rem;
  position: relative;
  margin-bottom: 0.75rem;
}

.history-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.5rem;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background-color: var(--accent-color);
}

.history-list li span {
  font-weight: bold;
  color: #ffffff;
}

.bg-light .history-list li span { color: #0f172a; }

/* 企業理念・経営方針リスト用スタイル */
.philosophy-list {
  list-style: none;
  margin: 1rem 0 2rem 0;
  padding: 0;
}

.philosophy-list li {
  padding-left: 1.25rem;
  position: relative;
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.philosophy-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.5rem;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background-color: var(--accent-color);
}

.philosophy-list li span {
  font-weight: bold;
  color: #ffffff;
}

.bg-light .philosophy-list li span { color: #0f172a; }

/* 会社概要セクションのレイアウト */
.about-container {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: center;
}

/* 会社概要セクションの各カラム幅を調整し、画像を少しコンパクトにします */
.about-text {
  flex: 1 1 60%;
}

.about-image {
  flex: 1 1 40%;
  max-width: 450px;
}

.about-image img {
  width: 100%;
  border-radius: 8px;
  object-fit: cover;
}

/* フェードインアニメーション */
.fade {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* サービスカード */
/* サービスおよび強みのカードをグリッドで並べ、幅に応じて列数を調整します */
.services-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

/* カードのスタイル */
.service-card {
  background-color: var(--card-bg);
  border: 2px solid #d1d5db;
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1), 0 2px 6px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: default;
}

.service-card:hover {
  transform: translateY(-5px) scale(1.03);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.service-card .icon {
  color: var(--accent-color);
  margin-bottom: 1rem;
}

.service-card h3 {
  margin-bottom: 0.75rem;
  font-size: 1.3rem;
  color: #0f172a;
  font-weight: 700;
}

.service-card p {
  font-size: 0.95rem;
  color: #334155;
  font-weight: 500;
}

/* プロジェクトカード */
.project-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
  margin-top: 2rem;
}

.project-card {
  background-color: var(--card-bg);
  border: 2px solid #d1d5db;
  border-radius: 8px;
  padding: 1rem;
  flex: 1 1 280px;
  max-width: 320px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1), 0 2px 6px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
  transform: translateY(-5px) scale(1.03);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 施工事例カード内の画像要素に適用されるスタイルです。 */
.project-image {
  width: 100%;
  height: 180px;
  border-radius: 4px;
  object-fit: cover;
  margin-bottom: 0.75rem;
  display: block;
}

.project-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  color: #0f172a;
  font-weight: 700;
}

.project-card p {
  font-size: 0.9rem;
  color: #334155;
  font-weight: 500;
}

/* お問い合わせセクション */
.contact-container {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin-top: 2rem;
}

.contact-info {
  flex: 1 1 280px;
}

.contact-form {
  flex: 1 1 280px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 0.95rem;
  background-color: var(--card-bg);
  color: #334155;
  font-weight: 500;
}

.contact-form button {
  align-self: flex-start;
}

/* フッター */
.footer {
  text-align: center;
  padding: 2rem;
  background-color: var(--primary-color);
  color: var(--text-color);
}

.footer .small {
  font-size: 0.75rem;
  margin-top: 0.5rem;
}

.center {
  text-align: center;
  margin-top: 2rem;
}

/* サブヒーロー（施工事例ページ） */
/*
 * サブヒーローセクションは施工事例ページ用のヘッダーです。
 * 背景には抽象的な回路をイメージしたジェネレーティブアートを使い、
 * 計装・制御の雰囲気を演出します。
 */
.sub-hero {
  background-image: url('../images/background.jpg');
  background-size: cover;
  background-position: center;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  position: relative;
  padding-top: 100px;
}

.sub-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
}

/* プロジェクト一覧ページのグリッド */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

/* ギャラリー */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.gallery-item {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.gallery-photo {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.gallery-item:hover .gallery-photo {
  transform: scale(1.04);
}

/* ライト背景のカード（サービス/強み/施工事例）を読みやすくする */
.bg-light .service-card,
.bg-light .project-card {
  background-color: #ffffff;
}
.bg-light .service-card h3,
.bg-light .project-card h3 {
  color: #0f172a !important;
}
.bg-light .service-card p,
.bg-light .project-card p {
  color: #334155 !important;
}

/* セクション見出し（サービス/強み）を濃色に固定 */
#services.section h2,
#strengths.section h2,
.section.bg-light h2,
.bg-light h2 {
  color: #0f172a !important;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    align-items: flex-start;
  }
  .navbar .nav-links {
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
  }
  .hero-content h1 {
    font-size: 2rem;
  }
  .hero-content p {
    font-size: 1rem;
  }
  .services-container,
  .project-cards,
  .contact-container {
    flex-direction: column;
  }
}