/* ================================================
   カスタムプロパティ
   ================================================ */
:root {
  --header-height-sp: 60px;
  --header-height-pc: 72px;
  --push-nav-width: 280px;
  --push-transition: 0.3s ease;

  /* ===== z-index 階層管理 ===== */
  --z-header: 20; /* ヘッダー背景 */
  --z-drawer: 40; /* プッシュナビ（ドロワーと同等の階層） */
}

/* ================================================
   ベースレイアウト（スニペット共通）
   ================================================ */
.l-container {
  margin-block: 40px;
}

.l-inner {
  max-width: calc(1200px + 20px * 2);
  margin-inline: auto;
  padding-inline: 20px;
}

@media (min-width: 768px) {
  .l-inner {
    padding-inline: 40px;
  }
}

.p-snippet-title {
  font-size: 24px;
  line-height: 1.6;
  font-weight: bold;
  text-align: center;
}

@media (min-width: 768px) {
  .p-snippet-title {
    font-size: 32px;
  }
}

.p-snippet-content {
  margin-block-start: 24px;
  font-size: 16px;
  line-height: 1.8;
  color: #555;
}

/* ================================================
   c-push-nav: プッシュナビゲーション（右からスライドイン）
   ================================================ */
.c-push-nav {
  /* 初期状態: 画面右外に待機（固定配置） */
  position: fixed;
  top: 0;
  right: 0;
  z-index: var(--z-drawer);
  width: var(--push-nav-width);
  height: 100%;
  background-color: #2c2c2c;
  transform: translateX(100%);
  transition: transform var(--push-transition);

  /* パネル境界を明確化するための影（画面外側から差し込む光の逆側に落とす） */
  box-shadow: -4px 0 16px rgba(0, 0, 0, 0.24);

  /* ナビ内スクロール対応 */
  overflow-y: auto;
}

/* is-open クラスでスライドイン（画面内に表示） */
.c-push-nav.is-open {
  transform: translateX(0);
}

@media (min-width: 768px) {
  /* PCでは非表示 */
  .c-push-nav {
    display: none;
  }
}

/* ================================================
   c-push-nav__list / item / link: プッシュナビメニューリスト
   ================================================ */
.c-push-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  padding-block-start: var(--header-height-sp); /* ヘッダーの高さ分だけ上に余白を取り、コンテンツとの視覚的な整合性を保つ */
}

.c-push-nav__item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.c-push-nav__item:last-child {
  border-bottom: none;
}

.c-push-nav__link {
  display: block;
  padding: 16px 24px;
  color: #fff;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.05em;
  transition: background-color 0.2s ease;
}

/* マウス系デバイスかつホバー操作が可能な場合のみ適用（タッチデバイス・ハイブリッドのタッチ操作を除外） */
@media (any-hover: hover) and (pointer: fine) {
  .c-push-nav__link:hover {
    background-color: rgba(255, 255, 255, 0.1);
  }
}

/* ================================================
   c-push-wrapper: ページコンテンツラッパー
   push時に左にスライドする要素（main のみを包む）
   固定ヘッダー分の padding-top を確保し、ヘッダーは wrapper の外側で独立して固定表示される
   ================================================ */
.c-push-wrapper {
  position: relative;
  min-height: 100vh;
  padding-top: var(--header-height-sp); /* 固定ヘッダーの高さ分の余白 */
  transition: transform var(--push-transition);
}

@media (min-width: 768px) {
  .c-push-wrapper {
    padding-top: var(--header-height-pc);
  }
}

/* is-pushed クラスでコンテンツを左に押し出す */
.c-push-wrapper.is-pushed {
  transform: translateX(calc(-1 * var(--push-nav-width)));
}

@media (min-width: 768px) {
  /* PCではpush動作を無効化 */
  .c-push-wrapper {
    transform: none !important;
  }
}

/* ================================================
   c-push-cover: プッシュ時の全面カバー
   is-pushed 状態のときのみ前面に重ね、クリックでメニューを閉じるための透明レイヤー。
   wrapper 全体に click を張ると内部のインタラクティブ要素が誤動作するため、
   専用のカバー要素として分離する。
   ================================================ */
.c-push-cover {
  /* 通常時は非表示かつ干渉しない */
  display: none;
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* is-pushed 時のみ全面カバーを有効化 */
.c-push-wrapper.is-pushed .c-push-cover {
  display: block;
  pointer-events: auto;
}

@media (min-width: 768px) {
  /* PCではpush動作しないためカバー不要 */
  .c-push-cover {
    display: none !important;
  }
}

/* ================================================
   c-header: ヘッダー全体（固定配置）
   c-push-wrapper の外側に配置することで、wrapper の transform の影響を受けず、
   push 時もビューポート上部に常に固定される。
   ================================================ */
.c-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: var(--z-header);
  background-color: #fff;
  border-bottom: 1px solid #e0e0e0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.c-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: calc(1200px + 20px * 2);
  margin-inline: auto;
  padding-inline: 20px;
  height: var(--header-height-sp);
}

@media (min-width: 768px) {
  .c-header__inner {
    padding-inline: 40px;
    height: var(--header-height-pc);
  }
}

.c-header__logo {
  font-size: 20px;
  font-weight: bold;
  color: #333;
  text-decoration: none;
  letter-spacing: 0.05em;
}

@media (min-width: 768px) {
  .c-header__logo {
    font-size: 24px;
  }
}

/* ================================================
   c-hamburger: ハンバーガーボタン
   ================================================ */
.c-hamburger {
  /* ボタンリセット */
  appearance: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin: -8px;

  /* 3本線を縦に並べるレイアウト */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
}

@media (min-width: 768px) {
  /* PCでは非表示 */
  .c-hamburger {
    display: none;
  }
}

/* ハンバーガーの1本線 */
.c-hamburger__line {
  display: block;
  width: 24px;
  height: 2px;
  background-color: #333;
  border-radius: 2px;
  transform-origin: center;
  transition:
    transform 0.3s ease,
    opacity 0.3s ease;
}

/* ×（バツ）アニメーション */
/* is-active クラスが付いたとき、3本線 → ×に変形 */

/* 1本目: 右上がりの斜線 */
.c-hamburger.is-active .c-hamburger__line:nth-child(1) {
  /* 線の高さ(2px) + gap(5px) = 7px（中央線との距離） */
  transform: translateY(7px) rotate(45deg);
}

/* 2本目: 非表示 */
.c-hamburger.is-active .c-hamburger__line:nth-child(2) {
  opacity: 0;
}

/* 3本目: 右下がりの斜線 */
.c-hamburger.is-active .c-hamburger__line:nth-child(3) {
  /* 線の高さ(2px) + gap(5px) = 7px（中央線との距離） */
  transform: translateY(-7px) rotate(-45deg);
}

/* ================================================
   c-nav: PCナビゲーション（横並び）
   ================================================ */
.c-nav {
  /* モバイル: 非表示 */
  display: none;
}

@media (min-width: 768px) {
  /* PC: 常に表示（横並び） */
  .c-nav {
    display: block;
  }
}

.c-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (min-width: 768px) {
  .c-nav__list {
    display: flex;
    gap: 32px;
  }
}

.c-nav__link {
  display: block;
  padding: 0;
  color: #333;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.05em;
  transition: color 0.2s ease;
}

/* マウス系デバイスかつホバー操作が可能な場合のみ適用（タッチデバイス・ハイブリッドのタッチ操作を除外） */
@media (any-hover: hover) and (pointer: fine) {
  .c-nav__link:hover {
    color: #0066cc;
  }
}
