/* ============================================================
   株式会社オオツカエンジニアリング 公式サイト 共通スタイル
   ブランドカラー: ネイビー / テラコッタ / 白
   ============================================================ */

:root {
  --navy: #16283f;
  --navy-dark: #0e1a2b;
  --navy-light: #2c4666;
  --terracotta: #b85c3a;
  --terracotta-dark: #954a2e;
  --white: #ffffff;
  --offwhite: #f6f4f1;
  --border: #e0e0dc;
  --text: #202a33;
  --text-muted: #5b6570;
  --shadow: 0 4px 16px rgba(22, 40, 63, 0.08);

  --font-base: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic",
    "Meiryo", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --max-width: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  /* 個々の要素のはみ出しは下記の各修正で解消するが、
     念のための最終防波堤として横スクロールを禁止する。 */
  overflow-x: hidden;
}

body {
  margin: 0;
  overflow-x: hidden;
  font-family: var(--font-base);
  color: var(--text);
  background: var(--white);
  line-height: 1.8;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  /* 日本語の意味のまとまり(単語・固有名詞)の途中で改行しない。
     句読点・中黒(・)・スペースなど自然な区切りでのみ改行される。 */
  word-break: keep-all;
  overflow-wrap: break-word;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--navy);
  text-decoration: none;
}

a:hover {
  color: var(--terracotta);
}

h1, h2, h3, h4 {
  color: var(--navy);
  line-height: 1.5;
  margin: 0 0 0.6em;
}

h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); text-wrap: balance; }
h2 { font-size: clamp(1.3rem, 2.4vw, 1.7rem); text-wrap: balance; }
h3 { font-size: 1.15rem; text-wrap: balance; }

p {
  margin: 0 0 1em;
}

ul {
  margin: 0 0 1em;
  padding-left: 1.3em;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 64px 0;
}

.section--alt {
  background: var(--offwhite);
}

.section-label {
  display: inline-block;
  color: var(--terracotta);
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 0.85rem;
  margin-bottom: 0.6em;
}

/* ---------- ヘッダー ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  max-width: 1680px;
  margin: 0 auto;
  padding: 24px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* 正式ロゴ(hexアイコン+社名が一体になった横長画像)。
   高さのみ指定し、幅は自動計算(縦横比を変更しない)。 */
.logo__icon {
  height: 56px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.logo__text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.logo__name {
  font-weight: 700;
  color: var(--navy);
  font-size: clamp(1.15rem, 1.35vw, 1.4rem);
  white-space: nowrap;
}

.logo__name-en {
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 44px;
  height: 40px;
  cursor: pointer;
  position: relative;
}

.nav-toggle span,
.nav-toggle::before,
.nav-toggle::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  height: 2px;
  background: var(--navy);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle::before { top: 13px; }
.nav-toggle span { top: 19px; }
.nav-toggle::after { top: 25px; }

.nav-toggle[aria-expanded="true"]::before {
  transform: translateY(6px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"]::after {
  transform: translateY(-6px) rotate(-45deg);
}

.main-nav {
  flex: 1 1 auto;
  min-width: 0;
}

.main-nav__list {
  list-style: none;
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 4px 10px;
  margin: 0;
  padding: 0;
}

.main-nav__list a {
  display: inline-block;
  padding: 6px 1px;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.main-nav__list a:hover,
.main-nav__list a[aria-current="page"] {
  color: var(--navy);
  border-bottom-color: var(--terracotta);
}

.header-cta {
  white-space: nowrap;
  flex-shrink: 0;
  padding: 10px 18px;
  background: var(--terracotta);
  color: var(--white);
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.85rem;
}

.header-cta:hover {
  background: var(--terracotta-dark);
  color: var(--white);
}

/* 1280px未満(タブレット以下)でのみハンバーガーメニューに切り替える。
   一般的なノートPC(1280px〜)ではナビゲーションを常に横1列で表示する。 */
@media (max-width: 1279px) {
  .nav-toggle {
    display: block;
  }

  .logo__icon {
    height: 38px;
  }

  .main-nav {
    display: none;
    width: 100%;
    order: 3;
    padding-top: 14px;
  }

  .main-nav.is-open {
    display: block;
  }

  .main-nav__list {
    flex-direction: column;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0;
    border-top: 1px solid var(--border);
  }

  .main-nav__list a {
    display: block;
    padding: 12px 4px;
    border-bottom: 1px solid var(--border);
    white-space: normal;
  }

  .site-header__inner {
    flex-wrap: wrap;
  }

  .header-cta {
    margin-left: auto;
    order: 2;
  }
}

/* スマートフォン幅(640px以下)。
   ・ロゴ+ハンバーガーの1行だけに整理する(お問い合わせボタンは非表示)。
     「お問い合わせ」はナビゲーションの一項目としてハンバーガーメニュー内に既に含まれている(data/site-data.js の nav 参照)。
   ・ヘッダーの上下paddingを詰めて、白いヘッダーの高さを抑える(ロゴ自体のサイズは変更しない)。 */
@media (max-width: 640px) {
  .header-cta {
    display: none;
  }

  .site-header__inner {
    padding: 12px 24px;
  }
}

/* ---------- ヒーロー(TOP) ---------- */
.hero {
  background: var(--navy-dark);
  color: var(--white);
  overflow: hidden;
}

.hero__inner {
  max-width: 1680px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 45% 55%;
  gap: 0;
}

.hero__copy {
  padding: 52px 48px 52px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero__catch {
  /* 45%/55%の2カラム構成でのテキスト列幅を基準に、
     見出し2行目(17文字)が1行に収まる上限で計算したサイズ。
     文字サイズ自体は前回から変更していません(余白のみ調整)。 */
  font-size: clamp(1.95rem, 2.3vw, 2.45rem);
  font-weight: 800;
  line-height: 1.3;
  color: var(--white);
  margin-bottom: 0.4em;
}

/* スマホ専用の改行位置(「点検」の途中で改行させないため)。
   PCではデフォルトで非表示にし、900px以下のmedia queryでのみ表示する。 */
.hero__catch-break {
  display: none;
}

.hero__sub {
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.6;
  color: #dbe2e9;
  margin-bottom: 0.8em;
}

.hero__lead {
  font-size: 0.92rem;
  line-height: 1.7;
  color: #a9b4c0;
  margin-bottom: 1.1em;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero__actions .btn {
  padding: 10px 16px;
  font-size: 0.9rem;
  gap: 6px;
}

/* ---------- ヒーロービジュアル(右側の写真パネル) ---------- */
.hero__visual {
  position: relative;
  min-height: 420px;
  overflow: hidden;
  background: var(--navy-dark);
}

.hero__visual-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right center;
  z-index: 0;
}

.hero__visual::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    90deg,
    var(--navy-dark) 0%,
    rgba(14, 26, 43, 0.88) 8%,
    rgba(14, 26, 43, 0.5) 20%,
    rgba(14, 26, 43, 0.12) 36%,
    rgba(14, 26, 43, 0) 52%
  );
  pointer-events: none;
}

@media (max-width: 900px) {
  /* grid の 1fr トラックは既定では「中身の最小コンテンツ幅」より縮まない(auto-minimum)。
     日本語の長い未分割文字列が1つでもあると、列全体が画面幅を超えて広がり、
     .hero の overflow:hidden で見た目だけ右側が切れる、という実機バグの原因になっていた。
     スマホでは grid をやめて通常のブロック要素として上下に積み、この問題を構造ごと無くす。
     (main-nav で同じ理由から min-width:0 を使っているのと同じ考え方) */
  .hero__inner {
    display: block;
  }

  .hero__copy {
    /* 上下の余白だけをさらに少し詰める。
       左右の余白・文字サイズ・行間・改行位置は変更しない。 */
    padding: 8px 24px 6px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .hero__catch,
  .hero__sub,
  .hero__lead {
    max-width: 100%;
  }

  .hero__catch {
    font-size: clamp(1.65rem, 6.8vw, 1.95rem);
    line-height: 1.4;
    margin-bottom: 0.05em;
  }

  /* 「点検」の途中で改行されるのを防ぐための改行位置指定。
     PC(このmedia query外)では display:none で無効化し、現在のPCデザインに影響しない。 */
  .hero__catch-break {
    display: inline;
  }

  .hero__sub {
    line-height: 1.4;
    margin-bottom: 0.1em;
  }

  .hero__lead {
    font-size: 1rem;
    line-height: 1.45;
    margin-bottom: 0.12em;
  }

  .hero__actions {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    width: 100%;
    max-width: 100%;
  }

  .hero__actions .btn {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    justify-content: center;
  }

  .hero__visual {
    min-height: 240px;
    width: 100%;
    max-width: 100%;
  }

  .hero__visual::after {
    background: linear-gradient(
      180deg,
      var(--navy-dark) 0%,
      rgba(14, 26, 43, 0.35) 18%,
      rgba(14, 26, 43, 0) 45%
    );
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.95rem;
  border: 1px solid transparent;
}

.btn__arrow {
  font-size: 1.05em;
  transition: transform 0.15s ease;
}

.btn:hover .btn__arrow {
  transform: translateX(3px);
}

.btn--primary {
  background: var(--terracotta);
  color: var(--white);
}

.btn--primary:hover {
  background: var(--terracotta-dark);
  color: var(--white);
}

.btn--outline {
  border-color: rgba(255, 255, 255, 0.5);
  color: var(--white);
}

.btn--outline:hover {
  border-color: var(--white);
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
}

.page-hero {
  background: var(--navy);
  color: var(--white);
  padding: 52px 0;
}

.page-hero h1 {
  color: var(--white);
  margin: 0;
}

.page-hero p {
  color: #c3cbd4;
  margin: 0.6em 0 0;
}

/* ---------- カードグリッド ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin-top: 32px;
}

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 28px;
  box-shadow: var(--shadow);
  height: 100%;
}

.card__index {
  color: var(--terracotta);
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 0.6em;
  display: block;
}

.card__head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 0.7em;
}

.card__icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: rgba(22, 40, 63, 0.06);
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card__icon svg {
  width: 24px;
  height: 24px;
}

.card__head h3 {
  margin: 0;
}

.card h3 {
  margin-bottom: 0.5em;
}

.card p {
  color: var(--text-muted);
  margin: 0;
}

/* ---------- TOPページ限定のセクション/カード調整(他ページには影響しません) ---------- */
.page-top .container {
  /* ヘッダー・ヒーローと同じ幅(1680px)に合わせる */
  max-width: 1680px;
}

.page-top .section {
  padding: 36px 0 56px;
}

.page-top .card-grid {
  gap: 24px;
  margin-top: 24px;
}

.page-top .card {
  padding: 22px 26px;
}

.page-top .card__index {
  font-size: 0.78rem;
  margin-bottom: 0.4em;
}

.page-top .card__head {
  gap: 16px;
  align-items: center;
  margin-bottom: 0.6em;
}

.page-top .card__icon {
  width: 64px;
  height: 64px;
  border-radius: 12px;
}

.page-top .card__icon svg {
  width: 32px;
  height: 32px;
}

.page-top .card h3 {
  font-size: 1.1rem;
  line-height: 1.45;
  margin-bottom: 0.4em;
  overflow-wrap: break-word;
}

.page-top .card p {
  font-size: 0.85rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

/* .card__head は display:flex の横並びで、アイコンは固定幅(flex-shrink:0)。
   見出し(h3)側は既定で min-width:auto のため、01/03のように <br> で
   あらかじめ改行してある見出しは問題にならないが、02のように1つの
   長い文で自然改行に任せている見出しは、狭い幅で縮みきれず
   カード右端・画面右端からはみ出すことがある(Heroで発生したものと同じ原因)。
   ナビがハンバーガーになる1279px以下(=横1280px以上のPC版ではない範囲)全体で
   適用し、2列・3列どちらのタブレット幅でも安全にする。
   タイトル・本文サイズ・アイコンサイズ・1280px以上のPC版は変更しない。 */
@media (max-width: 1279px) {
  .page-top .card__head h3 {
    min-width: 0;
    width: 100%;
  }
}

/* ---------- 表組み(会社概要・資格) ---------- */
.info-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 24px;
  background: var(--white);
}

.info-table th,
.info-table td {
  text-align: left;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.info-table th {
  width: 30%;
  color: var(--navy);
  font-weight: 700;
  background: var(--offwhite);
}

@media (max-width: 640px) {
  .info-table,
  .info-table tbody,
  .info-table tr,
  .info-table th,
  .info-table td {
    display: block;
    width: auto;
  }

  .info-table tr {
    border-bottom: 1px solid var(--border);
    padding: 10px 0;
  }

  .info-table th,
  .info-table td {
    border-bottom: none;
    padding: 4px 0;
  }

  .info-table th {
    background: none;
    padding-top: 12px;
  }
}

/* ---------- リスト系 ---------- */
.plain-list {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
}

.plain-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.check-list {
  padding-left: 1.2em;
}

.check-list li {
  margin-bottom: 0.5em;
}

/* ---------- 画像プレースホルダー ---------- */
.img-placeholder {
  background: var(--offwhite);
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.9rem;
  padding: 20px;
}

/* ---------- フォーム ---------- */
.contact-form {
  margin-top: 32px;
  max-width: 640px;
}

.form-row {
  margin-bottom: 20px;
}

.form-row label {
  display: block;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 6px;
}

.form-row input,
.form-row textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.95rem;
}

.form-row input:focus,
.form-row textarea:focus {
  outline: 2px solid var(--terracotta);
  outline-offset: 1px;
}

.form-note {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* 迷惑送信対策用のhoneypot欄。人間には見せず、bot対策として画面外に隠す。 */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- CTAバンド ---------- */
.cta-band {
  background: var(--offwhite);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 48px 0;
  text-align: center;
}

.cta-band h2 {
  margin-bottom: 0.4em;
}

/* ---------- フッター ---------- */
.site-footer {
  background: var(--navy-dark);
  color: #c3cbd4;
  padding: 48px 0 24px;
  font-size: 0.9rem;
}

.site-footer a {
  color: #c3cbd4;
}

.site-footer a:hover {
  color: var(--white);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

@media (max-width: 640px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

.footer-grid h3 {
  color: var(--white);
  font-size: 0.95rem;
}

.footer-nav {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 8px 24px;
}

.footer-bottom {
  padding-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #8b96a3;
}

/* ---------- ユーティリティ ---------- */
.mt-0 { margin-top: 0; }
.text-muted { color: var(--text-muted); }
