/* =============================================
   株式会社メトコス - style.css
   ============================================= */

:root {
  --yellow: #F5C800;
  --yellow-dark: #E0B000;
  --black: #1a1a1a;
  --gray: #555;
  --light-gray: #f8f8f8;
  --white: #fff;
  --header-h: 68px;
  --nav-h: 44px;
  --offset: calc(var(--header-h) + var(--nav-h));
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Noto Sans JP', sans-serif;
  color: var(--black);
  background: var(--white);
  overflow-x: hidden;
}

/* =============================================
   HEADER
   ============================================= */
header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 40px;
  height: var(--header-h);
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

/*
  ┌─────────────────────────────────────────────┐
  │ 【CSS①】ヘッダーロゴ画像のサイズ・形状          │
  │ width / height を変えると大きさが変わります    │
  │ border-radius: 50% で丸くなっています          │
  └─────────────────────────────────────────────┘
*/
.logo-badge-img {
  width: 46px;
  height: 46px;
  border-radius: 50%;       /* 丸くする */
  object-fit: cover;        /* 画像をトリミングして丸に合わせる */
  flex-shrink: 0;
  border: 2px solid var(--yellow);
}

.logo-text { display: flex; flex-direction: column; }

.logo-main {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 24px;
  letter-spacing: 0.05em;
  color: var(--black);
  line-height: 1;
}

.logo-sub {
  font-size: 9px;
  color: var(--gray);
  letter-spacing: 0.06em;
  font-weight: 300;
}

.header-contact {
  text-align: right;
  font-size: 11px;
  line-height: 1.9;
  color: var(--gray);
}

.header-contact a {
  color: var(--black);
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
}

.header-contact a:hover { color: var(--yellow-dark); }

/* =============================================
   NAV (desktop: fixed bar | mobile: hamburger)
   ============================================= */
nav {
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0;
  z-index: 99;
  background: var(--yellow);   /* フッターと同じ黄色に変更 */
  display: flex;
  justify-content: center;
  height: var(--nav-h);
}

nav a {
  color: var(--black);          /* 黒文字に変更 */
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 0.14em;
  padding: 0 28px;
  font-weight: 700;
  transition: all 0.2s;
  border-right: 1px solid rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
}

nav a:first-child { border-left: 1px solid rgba(0,0,0,0.15); }
nav a:hover { background: var(--yellow-dark); color: var(--black); }

/* =============================================
   HAMBURGER (mobile only)
   ============================================= */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
}

.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--black);
  border-radius: 2px;
  transition: all 0.3s;
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* mobile nav drawer */
.mobile-nav {
  display: none;
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0;
  background: var(--yellow);   /* モバイルも黄色に統一 */
  z-index: 98;
  flex-direction: column;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}

.mobile-nav.open { transform: translateY(0); }

.mobile-nav a {
  color: var(--black);          /* 黒文字 */
  text-decoration: none;
  font-size: 14px;
  letter-spacing: 0.12em;
  font-weight: 700;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(0,0,0,0.12);
  display: block;
  transition: all 0.2s;
}

.mobile-nav a:hover { background: var(--yellow-dark); color: var(--black); }

/* =============================================
   HERO
   ============================================= */
#hero {
  margin-top: var(--offset);
  position: relative;
  height: calc(100vh - var(--offset));
  min-height: 420px;
  max-height: 640px;
  background-image: url('images/hero_bg.jpg');
  background-size: cover;
  background-position: center;
  /*
    ┌──────────────────────────────────────────────────────────┐
    │ 【画像変更箇所⑨】HEROセクションの背景画像                   │
    │                                                          │
    │ 背景をJPGにする場合：                                      │
    │   1. hero_bg.jpg を同じフォルダに置く                      │
    │   2. 下記3行のコメントを外し、グラデーション行を削除する      │
    │                                                          │
    │ background-image: url('images/hero_bg.jpg');             │
    │ background-size: cover;                                  │
    │ background-position: center;                             │
    │                                                          │
    │ ※ 写真が明るい場合は .hero-bg-pattern の rgba 値を         │
    │   rgba(0,0,0,0.45) 等に変更すると文字が読みやすくなります    │
    │ 推奨サイズ：横1920px × 縦1280px 以上                       │
    └──────────────────────────────────────────────────────────┘
  background: linear-gradient(135deg, #1a1a2e 0%, #2d3561 50%, #1a2a4a 100%);
  */
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: flex-end;  /* コンテンツを右寄せ */
}
/*
.hero-bg-pattern {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    -45deg,
    transparent, transparent 40px,
    rgba(245,200,0,0.03) 40px, rgba(245,200,0,0.03) 80px
  );
}
*/
.hero-yellow-accent {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 6px;
  background: var(--yellow);
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 0 80px;             /* 右端から80pxの余白 */
  text-align: right;           /* テキストを右揃え */
  animation: fadeUp 0.9s ease both;
}

.hero-label {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 13px;
  letter-spacing: 0.3em;
  color: var(--yellow);
  margin-bottom: 14px;
}

.hero-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 90px;
  line-height: 0.95;
  color: var(--white);
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}

.hero-title span { color: var(--yellow); display: block; }

.hero-subtitle {
  font-size: 15px;  /* ← 文字サイズ調整箇所（ヒーロー サブタイトル） */
  color: rgba(255,255,255,0.6);
  letter-spacing: 0.12em;
  margin-bottom: 32px;
  font-weight: 300;
}

.hero-cta {
  display: inline-block;
  background: var(--yellow);
  color: var(--black);
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.1em;
  padding: 14px 36px;
  transition: all 0.2s;
}

.hero-cta:hover { background: var(--yellow-dark); transform: translateY(-2px); }

.hero-company-name {
  position: absolute;
  right: 40px;
  bottom: 30px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 120px;
  color: rgba(255,255,255,0.04);
  letter-spacing: 0.05em;
  line-height: 1;
  pointer-events: none;
  user-select: none;
}

/* =============================================
   SECTIONS — common
   ============================================= */
section { padding: 80px 0; }

.section-header {
  text-align: center;
  margin-bottom: 52px;
}

.section-en {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 48px;
  letter-spacing: 0.15em;
  color: var(--black);
  line-height: 1;
  margin-bottom: 6px;
}

.section-ja {
  font-size: 18px;  /* ← 文字サイズ調整箇所（セクション日本語サブタイトル） */
  color: var(--gray);
  letter-spacing: 0.2em;
  font-weight: 300;
}

.section-line {
  width: 32px;
  height: 2px;
  background: var(--yellow);
  margin: 10px auto 0;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 40px;
}

/* =============================================
   ABOUT
   ============================================= */
#about { background: var(--white); }

.about-catch {
  font-size: 19px;  /* ← 文字サイズ調整箇所（ABOUTキャッチコピー） */
  font-weight: 700;
  text-align: center;
  margin-bottom: 20px;
  letter-spacing: 0.05em;
}

.about-text {
  text-align: center;
  font-size: 16px;  /* ← 文字サイズ調整箇所（ABOUT本文） */
  line-height: 2.2;
  color: var(--gray);
  font-weight: 300;
}

/*
  ┌────────────────────────────────────────────────┐
  │ 【CSS②】ABOUTセクション 写真グリッドの画像スタイル  │
  │ SERVICEの画像と縦サイズを揃えています             │
  └────────────────────────────────────────────────┘
*/
.photo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);  /* 4列 */
  gap: 4px;
  margin: 52px 0;
}

.photo-grid-item {
  height: 300px;   /* SERVICEの画像高さ（3:2 で約449px幅）に合わせた固定値 */
  overflow: hidden;
  position: relative;
  background: #ccc;
}

.photo-grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s;
}

.photo-grid-item:hover img { transform: scale(1.05); }

.carsensor-wrap {
  text-align: center;
  padding-bottom: 0;
}

.carsensor-text {
  font-size: 16px;  /* ← 文字サイズ調整箇所（カーセンサー説明文） */
  margin-bottom: 20px;
  color: var(--gray);
}

.carsensor-banner {
  display: inline-block;
  border: 3px solid #F26619;
  padding: 12px 36px;
  text-decoration: none;
  transition: all 0.2s;
}

.carsensor-banner:hover { transform: translateY(-2px); }

.carsensor-banner-inner {
  background: linear-gradient(135deg, #F26619, #E05000);
  color: white;
  font-size: 26px;
  font-weight: 900;
  padding: 8px 24px;
  letter-spacing: 0.05em;
}

.carsensor-tagline {
  font-size: 12px;
  color: #F26619;
  margin-top: 6px;
  letter-spacing: 0.08em;
}

/* =============================================
   SERVICE
   ============================================= */
#service { background: var(--light-gray); }

.service-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3px;
  background: #ddd;
}

.service-item { background: var(--white); overflow: hidden; }

/*
  ┌────────────────────────────────────────────────┐
  │ 【CSS③】SERVICEセクション 写真のスタイル          │
  └────────────────────────────────────────────────┘
*/
.service-img {
  aspect-ratio: 3/2;
  background: #eee;
  position: relative;
  overflow: hidden;
}

.service-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;        /* 写真をトリミングして枠に合わせる */
  display: block;
  transition: transform 0.4s;
}

.service-img:hover img { transform: scale(1.04); }

.service-body {
  padding: 20px 24px 28px;
  border-top: 3px solid var(--yellow);
}

.service-num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 18px;
  letter-spacing: 0.05em;
  color: var(--yellow-dark);
  margin-bottom: 4px;
}

.service-title {
  font-size: 16px;  /* ← 文字サイズ調整箇所（サービスタイトル） */
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.5;
}

.service-desc {
  font-size: 15px;  /* ← 文字サイズ調整箇所（サービス説明文） */
  color: var(--gray);
  line-height: 1.9;
  font-weight: 300;
}

/* =============================================
   COMPANY
   ============================================= */
#company { background: var(--white); }

.map-wrap {
  width: 100%;
  height: 320px;
  background: #e8e8e8;
  margin-bottom: 48px;
  overflow: hidden;
}

.map-wrap iframe { width: 100%; height: 100%; border: none; display: block; }

.company-table { width: 100%; border-collapse: collapse; }

.company-table tr { border-bottom: 1px solid #ebebeb; }

.company-table td {
  padding: 15px 0;
  font-size: 15px;  /* ← 文字サイズ調整箇所（会社概要テーブル） */
  vertical-align: top;
  line-height: 1.8;
}

.company-table td:first-child {
  color: var(--gray);
  width: 150px;
  font-weight: 400;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

.company-table td:last-child {
  color: var(--black);
  font-weight: 300;
}

/* =============================================
   HISTORY
   ============================================= */
#history { background: var(--light-gray); }

/* =============================================
   ACCESS
   ============================================= */
#access { background: var(--white); }

/* =============================================
   FOOTER
   ============================================= */
footer {
  background: var(--yellow);
  padding: 28px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  letter-spacing: 0.1em;
  color: var(--black);
}

.footer-copy {
  font-size: 12px;
  color: rgba(0,0,0,0.55);
  letter-spacing: 0.06em;
}

/* =============================================
   ANIMATIONS
   ============================================= */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

/* =============================================
   RESPONSIVE — Tablet (≤ 860px)
   ============================================= */
@media (max-width: 860px) {
  .container { padding: 0 28px; }
  .hero-content { padding: 0 48px; }
  .hero-title { font-size: 72px; }
  .hero-company-name { font-size: 80px; }
}

/* =============================================
   RESPONSIVE — Mobile (≤ 640px)
   ============================================= */
@media (max-width: 640px) {
  :root {
    --header-h: 60px;
    --nav-h: 0px;
  }

  header { padding: 10px 16px; }
  .logo-main { font-size: 20px; }
  .logo-sub { display: none; }
  .logo-badge-img { width: 38px; height: 38px; }
  .header-contact { font-size: 10px; line-height: 1.7; }
  .header-contact a { font-size: 13px; }

  nav { display: none; }
  .hamburger { display: flex; }
  .mobile-nav { display: flex; }

  #hero {
    /* 縦サイズを固定して横スクロールを防止 */
    height: 240px;
    min-height: unset;
    max-height: unset;
    aspect-ratio: unset;
  }

  .hero-content { padding: 28px 20px; text-align: right; }
  .hero-title { font-size: 38px; margin-bottom: 6px; }
  .hero-label { font-size: 10px; margin-bottom: 8px; }
  .hero-subtitle { font-size: 11px; letter-spacing: 0.04em; margin-bottom: 18px; }
  .hero-company-name { display: none; }
  .hero-cta { padding: 10px 22px; font-size: 12px; }

  section { padding: 60px 0; }
  .container { padding: 0 20px; }
  .section-en { font-size: 38px; }
  .section-header { margin-bottom: 36px; }

  .about-catch { font-size: 16px; }
  .about-text { font-size: 14px; line-height: 2; }
  .photo-grid { grid-template-columns: 1fr 1fr; margin: 36px 0; } /* 4枚を2×2で表示 */
  .photo-grid-item { height: 180px; }
  .carsensor-text { font-size: 14px; }
  .carsensor-banner { padding: 10px 20px; }
  .carsensor-banner-inner { font-size: 22px; }

  .service-grid { grid-template-columns: 1fr; }
  .service-body { padding: 16px 20px 24px; }
  .service-title { font-size: 15px; }
  .service-desc { font-size: 14px; }

  .map-wrap { height: 240px; margin-bottom: 32px; }
  .company-table td { font-size: 13px; padding: 12px 0; }
  .company-table td:first-child { width: 100px; font-size: 12px; }

  .contact-lead { font-size: 14px; margin-bottom: 32px; }
  .form-label { font-size: 13px; }
  .form-submit { letter-spacing: 0.12em; }

  footer { flex-direction: column; gap: 10px; text-align: center; padding: 24px 20px; }
