/* ========================================
   Header (logo / navigation / hamburger)
   対応HTML: header.php
======================================== */

/* ヘッダー高さはbase.cssで定義済み */

/* 固定ヘッダー */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 9999;
  backdrop-filter: blur(20px) saturate(180%);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(0, 102, 255, 0.08);
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
  transition: all 0.3s ease;
}

.site-header.scrolled {
  backdrop-filter: blur(24px) saturate(200%);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.1);
}

/* 内側コンテナ（ロゴ + ナビ） */
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
}

/* ブランドロゴ（Think by Doing.） */
.brand {
  display: inline-block;
  text-decoration: none;
  line-height: 1.4;
  font-weight: 600;
}

.brand img {
  height: 40px;
  width: auto;
  display: block;
}

.brand:hover,
.brand:focus-visible {
  text-decoration: none;
  opacity: 0.9;
}

/* ナビゲーションラッパー */
.nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* PCメニュー（横並び） */
.nav-list {
  display: flex;
  gap: 18px;
  list-style: none;
  padding: 0;
  margin: 0;
  align-items: center;
}

.nav-item a {
  display: inline-flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.4;
  color: var(--text);
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

/* CTAだけ少し丸く強調 */
.nav-item-cta .nav-cta {
  padding: 9px 16px;
  border-radius: 999px;
}

/* 既存 .btn と併用する場合の軽い調整 */
.nav-list .btn {
  padding: 10px 14px;
}

.nav-list a:hover,
.nav-list a:focus-visible {
  background: rgba(37, 99, 235, 0.12);
  outline: none;
  transform: translateY(-1px);
}

/* ハンバーガーボタン（SPのみ表示） */
.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 18px;
  color: var(--text);
  align-items: center;
  justify-content: center;
  line-height: 1;
  cursor: pointer;
}

/* 900px以下でモバイルナビに切り替え */
@media (max-width: 900px) {
  .nav-toggle {
    display: inline-flex;
  }

  /* PC時は横並び、SP時はドロップダウンに */
  .nav-list {
    position: absolute;
    top: calc(var(--header-height) + 10px);
    right: 4%;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 14px;
    display: none; /* デフォルトは閉じる */
    box-shadow: 0 24px 46px rgba(15, 23, 42, 0.12);
    width: fit-content;
    gap: 10px;
  }

  /* JSで .open を付与して表示 */
  .nav-list.open {
    display: flex;
    animation: slide-down 0.2s ease;
  }

  .nav-item a {
    width: 100%;
    border-radius: 12px;
    justify-content: flex-start;
  }

  .nav-item-cta .nav-cta {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .nav-list .btn.secondary {
    justify-content: center;
    border-color: rgba(37, 99, 235, 0.18);
    background: linear-gradient(
      135deg,
      rgba(37, 99, 235, 0.08),
      rgba(14, 165, 233, 0.08)
    );
    color: var(--accent);
    box-shadow: none;
  }
}

/* より狭い端末向けに少しだけ余白調整 */
@media (max-width: 768px) {
  .header-inner {
    padding: 14px 0;
  }
}

/* モバイルメニューオープン中は背面スクロールを止める */
body.nav-open {
  overflow: hidden;
}

/* ドロップダウンのアニメーション */
@keyframes slide-down {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
