/* ================================================
   カスタムプロパティ
   ================================================ */
:root {
  --header-height-sp: 60px;
  --header-height-pc: 72px;
  --drawer-width: 280px;
  --overlay-color: rgba(0, 0, 0, 0.5);
  --drawer-transition: 0.3s ease;

  /* ===== z-index 階層管理 ===== */
  --z-header:  20; /* ヘッダー背景 */
  --z-overlay: 30; /* オーバーレイ（半透明背景） */
  --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-header: ヘッダー全体
   ================================================ */
.c-header {
  position: sticky;
  top: 0;
  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;
  }
}

/* ================================================
   c-overlay: オーバーレイ（ドロワー開放時の背景暗幕）
   ================================================ */
.c-overlay {
  /* 初期状態: 非表示 */
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  background-color: var(--overlay-color);
  opacity: 0;
  visibility: hidden;
  pointer-events: none; /* 非表示状態はクリック無効 */
  transition:
    opacity var(--drawer-transition),
    visibility var(--drawer-transition);
}

/* is-visible クラスで表示 */
.c-overlay.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto; /* 表示中のみクリック有効 */
}

/* ================================================
   c-drawer: ドロワーナビゲーション（右スライドイン）
   ================================================ */
.c-drawer {
  /* 初期状態: 画面右外に待機 */
  position: fixed;
  top: 0;
  right: 0;
  z-index: var(--z-drawer);
  width: var(--drawer-width);
  height: 100%;
  background-color: #fff;
  box-shadow: -4px 0 16px rgba(0, 0, 0, 0.12);
  transform: translateX(100%);
  transition: transform var(--drawer-transition);

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

/* is-open クラスでスライドイン */
.c-drawer.is-open {
  transform: translateX(0);
}

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

/* ================================================
   c-drawer__close: ドロワー内の閉じるボタン
   ================================================ */
.c-drawer__close {
  /* ボタンリセット */
  appearance: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;

  /* ドロワー右上に配置 */
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-inline-start: auto;
  margin-block: 8px; /* ドロワー上端からの縦余白: タッチターゲット確保のため最小 8px */
  margin-inline-end: 12px; /* ドロワー右端からの余白: ドロワー内パディングと視覚的に揃える値 */
}

/* ×アイコン（疑似要素で描画） */
.c-drawer__close-icon {
  position: relative;
  display: block;
  width: 20px;
  height: 20px;
}

.c-drawer__close-icon::before,
.c-drawer__close-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: #333;
  border-radius: 2px;
  transform-origin: center;
}

.c-drawer__close-icon::before {
  transform: translateY(-50%) rotate(45deg);
}

.c-drawer__close-icon::after {
  transform: translateY(-50%) rotate(-45deg);
}

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

/* ================================================
   c-drawer__list / item / link: ドロワーメニューリスト
   ================================================ */
.c-drawer__list {
  list-style: none;
  margin: 0;
  padding: 0;
  padding-block-start: 8px; /* 閉じるボタン下部とリスト上端の間隔: 視覚的な余白として 8px */
}

.c-drawer__item {
  border-bottom: 1px solid #f0f0f0;
}

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

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

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