/* =========================================================
   Global Reset
========================================================= */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; min-height: 100%; overflow-x: hidden; }
body { font-family: "Helvetica Neue", sans-serif; color: #fff; }

/* =========================================================
   Header & Background
========================================================= */
header {
  position: relative;
  height: 600px;
  overflow: hidden;
}

/* 背景（画像/動画置き場） */
.background-video,
#bgSwitcher {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-image: url('img/bg1.jpg');
  background-size: cover;
  background-position: center;
  z-index: 0; /* 最背面 */
}

/* #bgSwitcher 用：フェード切替レイヤ */
#bgSwitcher .bg-layer {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.2s ease-in-out;
}
#bgSwitcher .bg-layer.show { opacity: 1; z-index: 1; }

/* 画像要素で切替する場合のフェード（使っていれば有効） */
.background-video img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}
.background-video img.active { opacity: 1; z-index: 1; }

/* ロゴ・リンクなど前景 */
.header-overlay {
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 20px;
}
.logo {
  width: auto !important;
  max-width: 180px !important;
  height: auto !important;
}
.header-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: right;
}
.header-links a {
  font-size: 14px;
  color: #111;
  background: rgba(255,255,255,.8);
  padding: 4px 8px;
  border-radius: 4px;
  text-decoration: none;
  font-weight: bold;
}

/* =========================================================
   Main Navigation
========================================================= */
.main-nav {
  position: sticky; top: 0; z-index: 10;
  background: #f8f8f8; color: #000;
  padding: 10px 0;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap;
}
.main-nav ul { display: flex; list-style: none; gap: 20px; flex-wrap: wrap; margin-left: 20px; }
.main-nav a { text-decoration: none; color: #000; font-weight: bold; border-bottom: 2px solid transparent; padding: 4px 6px; }
.main-nav a:hover { border-bottom: 2px solid #333; }

/* SNS */
.sns { margin: 10px 20px; display: flex; justify-content: center; gap: 10px; }
.sns img { width: 24px; height: 24px; }

/* =========================================================
   Generic Sections
========================================================= */
.content-section { padding: 60px 20px; background: #fff; color: #333; text-align: center; }
.content-section h2 { margin-bottom: 20px; font-size: 28px; color: #007acc; }
.content-section p { max-width: 800px; margin: auto; line-height: 1.6; }

/* h2帯（ベース） */
.section-title {
  background: url('img/bg0.jpg') repeat-x center;
  background-size: cover;
  padding: 25px 0;
  text-align: center;
  position: relative;
}
.section-title h2 {
  font-size: 28px;
  color: #fff;
  margin: 0;
  text-shadow: 1px 1px 4px rgba(0,0,0,.4);
}
/* 白おびラベル（必要な見出しだけクラス追加で使用） */
.section-title--white-label h2 { display: inline-block; margin: 0; }
.section-title--white-label h2 span {
  background: rgba(255,255,255,0.92);
  color: #111;
  padding: 6px 14px;
  border-radius: 6px;
  line-height: 1.2;
  box-shadow: 0 1px 6px rgba(0,0,0,0.2);
}
/* 上下極細ライン（必要な見出しだけ） */
.section-title--lined { position: relative; }
.section-title--lined h2 {
  color: #fff; margin: 0; display: inline-block;
  padding: 8px 0; text-shadow: 0 1px 3px rgba(0,0,0,0.35);
}
.section-title--lined h2::before,
.section-title--lined h2::after {
  content: ""; display: block; height: 2px;
  background: rgba(255,255,255,0.85);
}
.section-title--lined h2::before { margin-bottom: 6px; }
.section-title--lined h2::after  { margin-top: 6px; }

/* =========================================================
   Services（トップ：サービス紹介）
========================================================= */
.services {
  background-image: url('img/service_bg.png');
  background-size: cover; background-position: center; background-repeat: no-repeat;
}
.services-grid {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; margin-top: 30px;
}
.service-box {
  width: 300px; height: 280px;
  border-radius: 10px; overflow: hidden;
  background-size: cover; background-position: center;
  position: relative; color: #fff;
  display: flex; align-items: flex-end;
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
}
.service-box .box-inner {
  background: rgba(0,0,0,.5);
  padding: 16px; width: 100%;
  display: flex; flex-direction: column; gap: 8px;
  min-height: 120px; justify-content: flex-end; /* 段差対策 */
}
.service-box h3{
  font-size: 18px; color:#fff; margin: 0 0 6px; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: calc(1.3em * 2);
}
.service-box p{
  font-size: 14px; color:#eee; margin: 0; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden; min-height: calc(1.5em * 3);
}

/* =========================================================
   Subpage Header（各ページのサブタイトル帯）
   - .subpage-header と .sub-header の両方をサポート
========================================================= */
.subpage-header, .sub-header {
  height: 100px;
  background-size: cover; background-position: center;
  position: relative; color: #fff;
  display: flex; justify-content: center; align-items: center;
}
.subpage-header .overlay, .sub-header .overlay {
  background: rgba(0,0,0,.35);
  position: absolute; inset: 0;
  display: flex; justify-content: center; align-items: center;
}
.subpage-header h1, .sub-header h1 {
  position: relative; z-index: 1;
  font-size: 36px; line-height: 1.2;
  text-shadow: 1px 1px 5px rgba(0,0,0,.6);
  margin: 0; text-align: center;
}
@media (max-width: 768px){
  .subpage-header, .sub-header { height: 220px; }
  .subpage-header h1, .sub-header h1 { font-size: 28px; }
}

/* =========================================================
   About（会社概要）専用
   - 現行HTML構造：.company-section > .company-intro > img + .company-info
========================================================= */
/* PC：画像400px + 説明の2カラム */
.page-about .company-section .company-intro {
  max-width: 1100px; margin: 40px auto; padding: 0 20px;
  display: grid; grid-template-columns: 400px minmax(0,1fr);
  gap: 30px; align-items: start;
}
.page-about .company-section .company-intro > img {
  width: 400px !important; max-width: 400px !important; height: auto !important; display: block;
  border-radius: 10px; box-shadow: 0 4px 12px rgba(0,0,0,.2);
}
.page-about .company-section .company-info {
  max-width: 600px; color: #333; text-align: left;
}
.page-about .company-section .company-info h2 { margin: 0 0 10px; color:#007acc; }
.page-about .company-section .company-info p { line-height: 1.7; }

/* 拠点情報（オフィス情報）アコーディオン */
.office-info { padding: 60px 20px; background: #fff; color:#333; }
.office-info h2 { text-align: center; color:#007acc; margin-bottom: 20px; }
.office-info .accordion {
  width: 100%; max-width: 1100px;
  margin: 16px auto; border: 1px solid #ccc; border-radius: 6px; overflow: hidden;
}
.office-info .accordion-header {
  background: #f0f0f0; color: #000;
  padding: 1em; cursor: pointer; font-weight: 700;
  text-align: center; font-size: 18px;
}
.office-info .accordion-content {
  display: none; padding: 1em; background: #fff;
  text-align: left; font-size: 16px;
}
iframe.map { width: 100%; height: 300px; border: 0; margin-top: 1em; }

/* スマホ：縦並びへ（grid解除 + 画像の下に説明） */
@media (max-width: 768px) {
  .page-about .company-section { padding: 0; }
  .page-about .company-section .company-intro {
    display: block !important; grid-template-columns: none !important;
    max-width: 100%; margin: 20px 0; padding: 0 16px;
  }
  .page-about .company-section .company-intro > img {
    width: 100% !important; max-width: 100% !important; height: auto !important;
  }
  .page-about .company-section .company-info {
    max-width: 100% !important; width: 100% !important;
    margin-top: 16px; text-align: left; font-size: 14px;
  }
  .page-about .company-section .company-intro::after { content:""; display:block; clear:both; }
}

/* =========================================================
   Works Thumbnails（トップ実績サムネ）
========================================================= */
.works-thumbnails { position: relative; z-index: 2; }

@media (min-width: 769px) {
  .works-thumbnails {
    position: absolute; left: 0; right: 0; bottom: 20px;
    display: flex; justify-content: center; gap: 20px; padding: 0 20px; flex-wrap: wrap; z-index: 2;
  }
  .works-thumbnails img {
    width: 260px; height: auto; border-radius: 6px;
    box-shadow: 0 0 8px rgba(0,0,0,.5);
  }
}

@media (max-width: 768px) {
  header { height: auto; overflow: visible; }
  .background-video, #bgSwitcher { height: 260px; }

  .works-thumbnails {
    position: static !important;
    display: flex; flex-wrap: nowrap;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    gap: 10px; padding: 10px 12px; margin-top: 8px;
    scroll-snap-type: x mandatory; z-index: 3;
  }
  /* ▼ さらに小さく：70% → 48% に変更（2つが画面に収まる程度） */
  .works-thumbnails a { flex: 0 0 48%; max-width: 48%; scroll-snap-align: start; }
  /* ▼ 高さも 140px → 110px に縮小（必要なら 100px まで可） */
  .works-thumbnails img {
    width: 100%; height: 110px; object-fit: cover;
    border-radius: 6px; box-shadow: 0 0 8px rgba(0,0,0,0.35);
  }

  /* スマホ時のヘッダー詰まり回避 */
  .header-overlay { flex-wrap: wrap; gap: 8px; padding: 8px 12px; }
  .logo { max-width: 150px !important; margin-bottom: 8px; }
  .header-links { width: 100%; text-align: right; }
  .header-links a { font-size: 12px; padding: 3px 6px; }
}

/* =========================================================
   Contact（お問い合わせ）
========================================================= */
.contact-form {
  max-width: 640px; width: 92%;
  margin: 24px auto; background: #fff; padding: 24px;
  border-radius: 8px; box-shadow: 0 4px 10px rgba(0,0,0,.08);
}
.contact-form label { display: block; margin-top: 16px; font-weight: 700; color: #333; }
.contact-form input, .contact-form textarea, .contact-form select {
  width: 100%; margin-top: 6px; padding: 10px 12px;
  border: 1px solid #ccc; border-radius: 6px; font-size: 16px;
}
.contact-form input[type="checkbox"] { width: auto; margin-right: 6px; }
.btn-submit {
  margin-top: 18px; padding: 12px 20px; background: #0073e6; color: #fff;
  border: 0; border-radius: 6px; font-weight: 700; cursor: pointer;
}
.btn-submit:hover { background: #005bb5; }

@media (max-width: 768px) {
  .contact-form { padding: 20px; }
  .content-hero, .content-section:first-of-type { margin-top: 8px; }
  .content-section a img {
    width: 100%; height: auto; max-height: 220px; object-fit: cover; border-radius: 6px;
  }
  .content-section .grid, .content-section .cards, .content-section .link-list {
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  }
}


/* ============== 会社詳細情報（about 中間セクション） ============== */
.company-details {
  background: #fff;
  color: #333;
  padding: 40px 20px 56px;
}

.company-details .section-title {               /* 既存の帯デザインを利用 */
  background: url('img/bg0.jpg') repeat-x center;
  background-size: cover;
  padding: 22px 0;
  margin-bottom: 24px;
}
.company-details .section-title h2 { color: #fff; }

.company-details .details-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

.details-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

/* 1行＝dt+dd の並びを横並びに（PC） */
.details-grid .row {
  display: grid;
  grid-template-columns: 220px 1fr;
  align-items: start;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fafafa;
  overflow: hidden;
}

/* 見出しセル */
.details-grid dt {
  background: #f3f6fb;
  color: #0b63b6;
  font-weight: 700;
  padding: 14px 16px;
  border-right: 1px solid #e4e8ef;
  word-break: keep-all;
}
/* 内容セル */
.details-grid dd {
  padding: 14px 16px;
  margin: 0;
  line-height: 1.7;
  color: #333;
}

/* 行間のメリハリ */
.details-grid .row + .row { margin-top: 8px; }

/* スマホ：縦積み＆読みやすく */
@media (max-width: 768px) {
  .details-grid .row {
    grid-template-columns: 1fr;         /* 縦並び */
  }
  .details-grid dt {
    border-right: none;
    border-bottom: 1px solid #e4e8ef;
    padding: 12px 14px;
  }
  .details-grid dd {
    padding: 12px 14px;
    font-size: 14px;
  }
}


/* =========================================================
   Collaboration & Popup Banners (レスポンシブ対応)
========================================================= */
/*
.collaboration-thumbnails img,
.popup-thumbnails img {
  width: 100%;
  height: auto;      /* 比率を維持して自然縮小 
  display: block;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.collaboration-thumbnails,
.popup-thumbnails {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* PCは2列 
  gap: 20px;
  max-width: 1100px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .collaboration-thumbnails,
  .popup-thumbnails {
    grid-template-columns: 1fr; /* スマホは1列 
    gap: 16px;
  }
}
*/