/* =========================================
   1. 基本設定 & 変数
   ========================================= */
:root {
  --brand-red: #d80013;
  --brand-red-dark: #b0000f;
  --text-main: #222222;
  --text-sub: #555555;
  --bg-light: #f9f9f9;
  --white: #ffffff;
  --container-width: 1200px;
  --transition: 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 120px;
}

body {
  font-family: "Noto Sans JP", sans-serif;
  color: var(--text-main);
  line-height: 1.8;
  background-color: var(--white);
  -webkit-font-smoothing: antialiased;
}

html[lang="ja"] body {
  font-family:
    "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
}

html[lang="en"] body {
  font-family: "Helvetica Neue", "Helvetica", "Arial", sans-serif;
}

html[lang="zh-hans"] body {
  font-family:
    "PingFang SC", "Lantinghei SC", "Microsoft YaHei", "HanHei SC", sans-serif;
  letter-spacing: 0.05em;
}

/* =========================================
   2. レイアウト：コンテナ設定
   ========================================= */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 40px;
}

/* =========================================
   3. ナビゲーション
   ========================================= */
.navbar {
  background: var(--white);
  border-bottom: 3px solid var(--brand-red);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.flex-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 120px;
}

.logo img {
  height: 80px;
  width: auto;
  display: block;
  transition: var(--transition);
}

.nav-links {
  display: flex;
  list-style: none;
  align-items: center;
  gap: 30px;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-main);
  font-weight: 700;
  transition: var(--transition);
}

.nav-links a:hover {
  color: var(--brand-red);
}

.nav-btn {
  background: var(--brand-red);
  color: var(--white) !important;
  padding: 14px 28px;
  border-radius: 4px;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 22px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 2000;
}

.menu-toggle span {
  width: 100%;
  height: 3px;
  background-color: var(--brand-red);
  transition: all 0.3s;
}

/* =========================================
   4. ヒーローセクション
   ========================================= */
.hero {
  background:
    linear-gradient(rgba(26, 43, 60, 0.9), rgba(0, 0, 0, 0.7)),
    url("img/hero-bg.avif");
  background-size: cover;
  background-position: center;
  padding: 100px 0;
  text-align: center;
}

.hero h1 {
  font-size: 1.6rem;
  color: var(--white);
  max-width: 900px;
  margin: 0 auto 20px;
  line-height: 1.3;
}

.hero p.hero-lead {
  font-size: 2.4rem;
  color: var(--white);
  max-width: 900px;
  margin: 0 auto 40px;
  line-height: 1.3;
}

/* 英語版のHTMLタグに <html lang="en"> が入っている場合 */
html[lang="en"] .hero p.hero-lead {
  font-size: 1.8rem; /* 日本語(2rem)より少し控えめに */
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.hero-card {
  background: var(--white);
  padding: 40px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  text-align: start;
  border-left: 3px solid var(--brand-red);
}

.hero-card h3 {
  font-size: 1.4rem;
  margin-bottom: 20px;
}

/* =========================================
   5. セクション共通設定
   ========================================= */
.section {
  padding: 100px 0;
}

.bg-light {
  background-color: var(--bg-light);
}

.section-title {
  font-size: 2.2rem;
  text-align: center;
  margin-bottom: 60px;
}

.section-title::after {
  content: "";
  display: block;
  width: 50px;
  height: 4px;
  background: var(--brand-red);
  margin: 15px auto;
}

/* =========================================
   6. 各コンテンツレイアウト
   ========================================= */

/* 会社概要 */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.about-card {
  background: var(--white);
  padding: 40px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.about-card h3 {
  font-size: 1.4rem;
  margin-bottom: 20px;
}

/* サービス紹介（事業分野）★修正箇所 */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.service-card {
  background: var(--white);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
}

.service-card .img-placeholder {
  width: 100%;
  height: 200px;
  flex-shrink: 0;
}

.service-card .img-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* カード内のテキストエリアに余白を追加 */
.service-card h3,
.service-card p {
  padding-left: 30px;
  padding-right: 30px;
}

.service-card h3 {
  font-size: 1.4rem;
  margin-top: 25px; /* 写真との間隔 */
  margin-bottom: 15px;
  color: var(--text-main);
}

.service-card p {
  font-size: 0.95rem;
  color: var(--text-sub);
  margin-bottom: 30px; /* カード下部との間隔 */
  line-height: 1.7;
}

/* 強み */
/* 成功事例 */
.flex-content {
  display: flex;
  align-items: center;
  gap: 60px;
}

.text-area,
.image-area {
  flex: 1;
}

.strength-points,
.case-study {
  list-style: none;
}
.strength-points li,
.case-study li {
  margin-bottom: 20px;
  padding-left: 30px;
  position: relative;
}

.strength-points li::before,
.case-study li::before {
  content: "◆";
  font-size: 1.3rem;
  position: absolute;
  left: 0;
  color: var(--brand-red);
  font-weight: bold;
}

.strength-points h3,
.case-study h3 {
  font-size: 1.3rem;
  margin-bottom: 8px;
  color: var(--text-main);
}

.cases-lead {
  font-size: 1.125rem;
  margin-bottom: 24px;
}

.rounded-img {
  width: 100%;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* =========================================
   7. お問い合わせ
   ========================================= */
.contact-section {
  background: var(--brand-red);
  padding: 100px 0;
}

.contact-card {
  background: white;
  padding: 60px;
  border-radius: 15px;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.contact-details p + p {
  margin-top: 8px;
}

.phone-link {
  font-size: 2.5rem;
  line-height: 1;
  color: var(--brand-red);
  text-decoration: none;
  font-weight: 800;
  display: block;
  margin: 6px 0 0;
}

.email {
  margin-top: 32px;
}

.email i {
  font-size: 1.2rem;
  margin-right: 8px;
}

.footer-note {
  margin-top: 40px;
}

html[lang="en"] .footer-note em {
  font-style: italic;
  display: inline-block;
  color: #666;
}

/* =========================================
   8. アニメーション演出
   ========================================= */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.8s ease-out,
    transform 0.8s ease-out;
}

.fade-in.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* =========================================
   9. レスポンシブ設定
   ========================================= */

@media (max-width: 900px) {
  .hero-grid,
  .about-grid,
  .services-grid {
    grid-template-columns: 1fr;
  }
  .flex-content,
  .case-study-box {
    flex-direction: column;
  }
}

@media (max-width: 768px) {
  html {
    scroll-padding-top: 90px;
  }

  .flex-nav {
    height: 90px;
  }
  .logo img {
    height: 60px;
  }

  .hero {
    padding: 80px 0;
  }
  .hero h1 {
    font-size: 1.8rem;
    line-height: 1.4;
    padding: 0 10px;
  }
  .hero p.hero-lead {
    font-size: 2rem;
  }

  .section {
    padding: 60px 0;
  }
  .section-title {
    font-size: 1.6rem;
    margin-bottom: 40px;
  }

  .hero-card h3,
  .about-card h3,
  .service-card h3,
  .case-study-box h3,
  .strength-points h3,
  .strength-points li::before {
    font-size: 1.2rem;
  }

  /* スマホでのカード内余白の微調整 */
  .service-card h3,
  .service-card p {
    padding-left: 20px;
    padding-right: 20px;
  }

  .menu-toggle {
    display: flex;
  }

  .nav-links {
    display: flex;
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100vh;
    background-color: var(--white);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: 0.4s ease-in-out;
    z-index: 1500;
    gap: 40px;
  }

  .nav-links.is-active {
    right: 0;
  }
  .nav-links a {
    font-size: 1.4rem;
  }
  .phone-link {
    font-size: 1.8rem;
  }

  .menu-toggle.is-active span:nth-child(1) {
    transform: translateY(9.5px) rotate(45deg);
  }
  .menu-toggle.is-active span:nth-child(2) {
    opacity: 0;
  }
  .menu-toggle.is-active span:nth-child(3) {
    transform: translateY(-9.5px) rotate(-45deg);
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 20px;
  }
  .hero h1 {
    font-size: 1.5rem;
  }
  .hero p.hero-lead {
    font-size: 1.8rem;
  }
  .section-title {
    font-size: 1.4rem;
  }
  .phone-link {
    font-size: 1.5rem;
  }
  .contact-card {
    padding: 40px 20px;
  }
}

footer {
  background: #1a2a3a;
  color: rgba(255, 255, 255, 0.7);
  padding: 60px 0;
  text-align: center;
}

/* 許可番号バッジ */
.license-badge {
  display: inline-block;
  color: var(--white);
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid var(--white);
  padding: 5px 15px;
  font-size: 0.85rem;
  border-radius: 50px;
  margin-bottom: 20px;
  letter-spacing: 1px;
}

/* サブタイトル */
.section-subtitle {
  margin-top: -40px;
  margin-bottom: 40px;
  color: var(--text-sub);
  font-weight: bold;
}

.text-center {
  text-align: center;
}

/* プロジェクトコンセプト */
.project-concept {
  text-align: center;
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--brand-red);
  margin-bottom: 40px;
  background: var(--white);
  display: inline-block;
  padding: 10px 30px;
  border-radius: 5px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  width: 100%;
}

/* 言語セレクター */
/* --- PC版の設定 --- */
.lang-selector {
  position: relative;
  list-style: none;
}

.lang-current {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: bold;
  font-size: 0.9rem;
  color: var(--text-main);
  border: 1px solid #ddd;
  padding: 6px 16px;
  cursor: pointer;
  transition: var(--transition);
  user-select: none; /* テキスト選択を防止 */
}

/* 開いている時の枠線の色 */
.lang-current.is-open {
  border-color: var(--brand-red);
}

.lang-list {
  position: absolute;
  top: 110%; /* 少し隙間を空ける */
  right: 0;
  background: var(--white);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  min-width: 120px;
  padding: 8px 0;
  list-style: none;
  /* 初期状態：非表示 */
  opacity: 0;
  visibility: hidden;
  transform: translateY(5px);
  transition: 0.2s ease;
  z-index: 1000;
}

/* JSで 'is-open' クラスがついた時だけ表示 */
.lang-list.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-list li a {
  display: block;
  padding: 10px 20px;
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: bold;
}

/* --- スマホ版の設定 (768px以下) --- */
@media (max-width: 768px) {
  .lang-current {
    display: none; /* スマホではクリックの親玉を隠す */
  }
  .lang-list {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    display: flex; /* 横並び */
    justify-content: center;
    align-items: center; /* 縦方向の中央寄せを強制 */
    width: 100%;
    margin-top: 20px;
    padding: 20px 0 0;
    border-top: 1px solid #eee;
  }

  .lang-list li {
    display: flex;
    align-items: center; /* リスト項目内も中央寄せ */
  }

  .lang-list li i {
    margin-right: 16px;
  }

  /* 修正：文字の "|" をやめ、border（線）で区切る */
  .lang-list li:not(:last-child)::after {
    content: ""; /* 文字を消す */
    display: block;
    width: 1px; /* 線の太さ */
    height: 14px; /* 線の長さ（文字の高さに合わせる） */
    background-color: #ccc; /* 線の色 */
    margin: 0 15px; /* 左右の余白 */
  }

  .lang-list li a {
    padding: 5px 0; /* 上下の余白を削ってズレを防止 */
    font-size: 1.1rem;
    line-height: 1; /* 行の高さを最小限にして位置を安定させる */
  }
}

.nobreak {
  display: inline-block; /* 塊として扱う */
  white-space: nowrap; /* 内部での改行を禁止 */
}

.nobreak-en {
  display: inline-block;
  white-space: nowrap;
}

@media (max-width: 480px) {
  /* iPhone SEなどの極端に幅が狭い端末では、突き抜け防止のために改行を許可する */
  .nobreak-en {
    white-space: normal;
  }

  .hero-lead {
    word-wrap: break-word; /* 単語が長すぎる場合に強制改行 */
    overflow-wrap: break-word;
    font-size: 1.6rem;
  }
}
