/**
 * Layouts CSS
 * レイアウトコンポーネント - ページ構造、ヘッダー、フッター、ナビゲーション
 * 高橋運輸興業 Webサイトリニューアル
 *
 * このファイルはサイト全体のレイアウト構造を定義します。
 * ヘッダー、フッター、ナビゲーション、ページレイアウトなど。
 */

/* ===================================
   ヘッダー
   全ページ共通のヘッダー構造
   =================================== */

/* ヘッダートップ（連絡先情報） */
.header-top {
  background: var(--primary-blue);
  color: var(--text-white);
  padding: 0.5rem 0;
  font-size: 0.9rem;
}

.header-top-content {
  max-width: var(--max-width-content);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.contact-info {
  display: flex;
  gap: 2rem;
}

/* メインヘッダー */
.main-header {
  background: var(--bg-white);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-content {
  max-width: var(--max-width-content);
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
}

/* ロゴエリア */
.logo-area {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.logo-image {
  max-height: 50px;
  width: auto;
  object-fit: contain;
}

/* デフォルトロゴの場合は高さを40pxに拡大 */
.logo-image--default {
  height: 40px;
  max-height: none;
}

/* モバイルメニュートグル */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
}

.mobile-menu-toggle span {
  width: 30px;
  height: 3px;
  background: var(--primary-blue);
  margin: 3px 0;
  transition: var(--transition);
}

/* ===================================
   ナビゲーション
   メインナビゲーションとサブメニュー
   =================================== */

.main-nav ul {
  display: flex;
  list-style: none;
  gap: 1.5rem;
}

.main-nav > ul > li {
  position: relative;
}

.main-nav a {
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 500;
  padding: 0.6rem 0 0.4rem 0;
  border-bottom: 3px solid transparent;
  transition: all var(--transition);
  font-size: 0.95rem;
  display: block;
}

.main-nav > ul > li > a:hover {
  color: var(--secondary-blue);
  border-bottom-color: var(--secondary-blue);
}

/* アクティブ状態 */
.main-nav a.nav-active {
  border-bottom: 3px solid var(--secondary-blue);
}

/* サブメニュー */
.main-nav .submenu {
  position: absolute;
  top: calc(100% + 3px);
  left: 0;
  background: var(--bg-white);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-radius: var(--border-radius-lg);
  min-width: 220px;
  display: none;
  padding: 0.5rem 0;
  z-index: 1000;
}

/* サブメニューとの間のブリッジ（ホバー解除防止） */
.main-nav .submenu::before {
  content: '';
  position: absolute;
  top: -3px;
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
}

.main-nav li:hover .submenu {
  display: block;
  animation: submenuFadeIn 0.3s ease forwards;
}

@keyframes submenuFadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.main-nav .submenu li {
  list-style: none;
}

.main-nav .submenu a {
  padding: 0.8rem 1.5rem;
  font-size: 0.9rem;
  white-space: nowrap;
  border-bottom: none;
}

.main-nav .submenu a:hover {
  background: var(--light-blue);
  color: var(--primary-blue);
  padding-left: 1.8rem;
}

/* ===================================
   フッター
   全ページ共通のフッター構造
   =================================== */

footer {
  background: var(--primary-blue);
  color: var(--text-white);
  padding: 3rem 0 1rem;
}

.footer-content {
  max-width: var(--max-width-content);
  margin: 0 auto;
  padding: 0 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 2rem;
}

.footer-company h3 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
}

.footer-section h4 {
  margin-bottom: 1rem;
  color: var(--text-white);
}

.footer-section ul {
  list-style: none;
}

.footer-section li {
  margin-bottom: 0.5rem;
}

.footer-section a {
  color: var(--text-white);
  text-decoration: none;
  opacity: 0.8;
  transition: opacity var(--transition);
}

.footer-section a:hover {
  opacity: 1;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.2);
  padding-top: 1rem;
  text-align: center;
  opacity: 0.8;
}

/* ===================================
   ページ構造
   各ページの基本レイアウト
   =================================== */

/* ページヘッダー（各ページのタイトル部分） */
.page-header {
  background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
  padding: 3rem 0;
  text-align: center;
  color: var(--text-white);
}

.page-header h1 {
  font-size: var(--text-4xl);
  margin-bottom: 0.5rem;
}

/* パンくずリスト */
.breadcrumb {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
  font-size: 0.9rem;
  opacity: 0.9;
}

.breadcrumb a {
  color: var(--text-white);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb-item {
  display: inline-block;
  color: var(--text-secondary);
}

.breadcrumb-item + .breadcrumb-item::before {
  content: ">";
  margin: 0 0.5rem;
  color: var(--text-secondary);
}

.breadcrumb-item.active {
  color: var(--primary-blue);
  font-weight: 600;
}

/* ページコンテンツエリア */
.page-content {
  padding: 4rem 0;
  background: var(--bg-white);
}

.content-container {
  max-width: var(--max-width-content);
  margin: 0 auto;
  padding: 0 2rem;
}

/* ===================================
   Heroセクション
   トップページのメインビジュアル
   =================================== */

.hero {
  position: relative;
  height: 500px;
  background: var(--primary-blue);
  overflow: hidden;
}

.slider-container {
  position: relative;
  height: 100%;
  width: 100%;
}

.slide {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 1s ease-in-out, visibility 1s;
  display: flex;
  align-items: center;
  justify-content: center;
  /* デフォルト背景：SCFで画像未設定時に使用（contact-ctaと同じグラデーション） */
  background-image: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.slide.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* スライド背景のオーバーレイ（背景画像がある場合のみ適用、テキスト視認性向上） */
.slide--has-bg::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* ヒーローオーバーレイパターン */
/* パターンA: 均一オーバーレイ（70%） */
.hero.pattern-a .slide--has-bg::before {
  background: rgba(65, 80, 205, 0.7);
}

/* パターンB: 均一オーバーレイ（50%） */
.hero.pattern-b .slide--has-bg::before {
  background: rgba(65, 80, 205, 0.5);
}

/* パターンC: 均一オーバーレイ（30%） */
.hero.pattern-c .slide--has-bg::before {
  background: rgba(65, 80, 205, 0.3);
}

/* パターンD: グラデーション（上下） */
.hero.pattern-d .slide--has-bg::before {
  background: linear-gradient(to bottom, rgba(65, 80, 205, 0.2), rgba(65, 80, 205, 0.7));
}

/* パターンE: グラデーション（斜め）【デフォルト】 */
.hero.pattern-e .slide--has-bg::before {
  background: linear-gradient(135deg, rgba(65, 80, 205, 0.2), rgba(65, 80, 205, 0.7));
}

/* パターンF: テキスト周辺のみ（カード型） */
.hero.pattern-f .slide--has-bg::before {
  display: none;
}

.hero.pattern-f .hero-content {
  background: rgba(65, 80, 205, 0.8);
  padding: 3rem 4rem;
  border-radius: 16px;
  backdrop-filter: blur(8px);
}

/* パターンG: テキストバー（横幅いっぱい） */
.hero.pattern-g .slide--has-bg::before {
  display: none;
}

.hero.pattern-g .hero-content {
  background: rgba(65, 80, 205, 0.75);
  padding: 3rem 4rem;
  width: 100%;
  max-width: 100%;
  backdrop-filter: blur(8px);
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: var(--text-white);
  max-width: 800px;
  padding: 0 2rem;
}

.hero h1 {
  font-size: var(--text-4xl);
  margin-bottom: 1rem;
  font-weight: 700;
}

.hero-subtitle {
  font-size: var(--text-xl);
  margin-bottom: 2rem;
  opacity: 0.95;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

/* ===================================
   その他のレイアウトコンポーネント
   =================================== */

/* 認証バッジセクション */
.trust-badges {
  background: var(--bg-white);
  padding: 2rem 0;
  border-bottom: 1px solid var(--border-color);
}

.badges-container {
  max-width: var(--max-width-content);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 3rem;
}

.cert-badge {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.cert-badge img {
  height: 60px;
}

/* メインメッセージセクション */
.main-message {
  padding: 4rem 2rem;
  background: var(--bg-gray);
}

.message-container {
  max-width: var(--max-width-content);
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 3rem;
  align-items: center;
}

.message-content h2 {
  font-size: var(--text-3xl);
  color: var(--heading-primary);
  margin-bottom: 1rem;
}

.message-content p {
  color: var(--text-secondary);
  line-height: var(--leading-loose);
  margin-bottom: 1rem;
}

.message-image {
  text-align: center;
}

.message-image img {
  max-width: 100%;
  border-radius: var(--border-radius-xl);
}

/* お問い合わせCTAセクション */
.contact-cta {
  background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
  padding: 4rem 0;
  text-align: center;
  color: var(--text-white);
}

.cta-container {
  max-width: var(--max-width-narrow);
  margin: 0 auto;
  padding: 0 2rem;
}

.cta-container h2 {
  font-size: var(--text-3xl);
  margin-bottom: 1rem;
}

.cta-container p {
  font-size: var(--text-lg);
  margin-bottom: 2rem;
  opacity: 0.95;
}

/* ===================================
   レスポンシブ対応
   =================================== */

@media (max-width: 768px) {
  /* ヘッダー */
  .header-top {
    display: none;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  /* モバイルナビゲーション */
  .main-nav {
    display: none;
  }

  .main-nav.active {
    display: block;
    position: fixed;
    top: 61px;
    left: 0;
    right: 0;
    background: var(--bg-white);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 999;
    max-height: calc(100vh - 61px);
    overflow-y: auto;
  }

  .main-nav.active ul {
    flex-direction: column;
    gap: 0;
  }

  .main-nav.active a {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f0f0f0 !important;
  }

  /* モバイルメニューではアクティブ状態の緑ボーダーを非表示 */
  .main-nav.active a.nav-active {
    border-bottom: 1px solid #f0f0f0 !important;
  }

  .main-nav.active > ul > li > a:hover {
    color: var(--text-primary);
    border-bottom: 1px solid #f0f0f0 !important;
  }

  /* タッチ操作時のフォーカスアウトラインを非表示（キーボード操作時は表示） */
  .main-nav.active a:focus {
    outline: none;
  }

  .main-nav.active a:focus-visible {
    outline: 2px solid var(--secondary-blue);
    outline-offset: 2px;
  }

  /* Mobile submenu indicator */
  .main-nav.active .has-submenu > a {
    position: relative;
    padding-right: 2.5rem;
  }

  .main-nav.active .has-submenu > a:after {
    content: "▼";
    position: absolute;
    right: 1rem;
    color: #999;
    font-size: 0.7rem;
    transition: transform 0.3s ease;
  }

  .main-nav.active .has-submenu.expanded > a:after {
    transform: rotate(180deg);
  }

  /* Mobile submenu */
  .main-nav.active .submenu {
    display: none !important;
    position: static;
    animation: none;
    box-shadow: none;
    background: #f8f9fa;
    border-radius: 0;
    padding: 0;
  }

  .main-nav.active .expanded .submenu {
    display: block !important;
  }

  .main-nav.active .submenu a {
    padding-left: 2.5rem;
    font-size: 0.88rem;
    background: white;
    color: #666;
    font-weight: 400;
  }

  .main-nav.active .submenu a:hover {
    background: var(--light-blue);
    padding-left: 2.5rem;
  }

  /* フッター */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  /* Hero */
  .hero {
    height: 400px;
  }

  .hero h1 {
    font-size: var(--text-2xl);
  }

  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }

  /* メッセージセクション */
  .message-container {
    grid-template-columns: 1fr;
  }

  /* バッジ */
  .badges-container {
    flex-direction: column;
    gap: 1rem;
  }
}