/* 公開ページ共通のヘッダ・フッタ（SiteHeader / SiteFooter）。
   LP（旧 .lp-header）のデザインを正として、体験デモ・学習ガイド・法務ページと
   共有する。カラーは global.css のテーマ変数（テーマ・ダークモード切替に追従）。
   認証後のアプリ画面のヘッダは Header.css（HeaderShell）側にある。 */

/* ---- header ---- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 2px solid var(--glass-border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
  transition: all 0.3s ease-in-out;
  /* 行高・スムージングはページ側ベース CSS から継承させない。SPA は LP=1.6・
     デモ/ガイド/法務=既定値、MPA(body.kk)=1.75 とページごとに違う値が流れ込み、
     同じヘッダなのに文字組みと CTA ピルの高さが微妙にずれていた。LP を正として
     ここで固定し、どのページでも同一に描画する（footer も同様）。 */
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ヘッダ高さは画面幅・ページ間で一定にする。縦 padding ではなく固定
   min-height + 中央寄せで高さを固定し、横 padding だけをブレークポイントで
   変える。 */
.site-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  min-height: 72px;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.site-logo {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--fg);
  text-decoration: none;
  transition: color 0.4s ease;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* テキストリンク（体験デモ・学習ガイド・ログイン）。ボタンとは視覚的な重みを
   分け、控えめなテキストリンクにする。 */
.site-nav-link {
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  transition: color 0.3s ease;
}

.site-nav-link:hover {
  color: var(--fg);
}

/* テーマ切替。操作可能な要素は外枠で示す（丸枠 + ホバーで塗る）。 */
.site-theme-toggle {
  background: transparent;
  border: 2px solid var(--glass-border);
  color: var(--fg);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0;
  flex-shrink: 0;
}

.site-theme-toggle:hover {
  background: var(--glass-border-hover);
  transform: scale(1.08) rotate(15deg);
}

.site-theme-toggle svg {
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.site-theme-toggle:hover svg {
  transform: rotate(45deg);
}

.site-theme-toggle .sun-icon {
  color: #fbbf24;
}

.site-theme-toggle .moon-icon {
  color: #3b82f6;
}

/* 会員登録 CTA。塗りのピルで唯一の強調要素にする。SPA(Link)・MPA(静的リンク)
   どちらもアンカー要素のため、下線の打ち消しをここで持つ。 */
/* ログインはアウトライン。公開面の主 CTA は試験カード(LP)側に置き、
   ヘッダでは塗りつぶしを使わない */
.site-nav-cta {
  background: transparent;
  color: var(--fg);
  border: 2px solid var(--fg);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.5rem 1.25rem;
  border-radius: 9999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.site-nav-cta:hover {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* ---- footer ---- */

/* 区切り線を持つのは footer 側（全ページ共通）。LP のみ直上の .lp-footer-cta が
   全幅の下線を持つため、線の二重化は LandingPage.css 側で打ち消す。 */
.site-footer {
  border-top: 1px solid var(--border-color);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 0.85rem;
  color: var(--fg-muted);
  max-width: 900px;
  margin: 0 auto;
  padding: 2.5rem 2rem 3rem;
  text-align: center;
  position: relative;
  z-index: 10;
  width: 100%;
}

.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.site-footer-links a {
  color: inherit;
  text-decoration: none;
  opacity: 0.85;
}

.site-footer-links a:hover {
  opacity: 1;
  text-decoration: underline;
}

/* ページ固有の出典表記（体験デモの試験出典等） */
.site-footer-attribution {
  font-size: 0.8rem;
  line-height: 1.8;
  margin-bottom: 1.25rem;
  text-align: left;
}

/* 出題時点の法令・制度に基づく旨の注意（exam-data#9）。出典表記の直上に置く */
.site-footer-currency {
  font-size: 0.8rem;
  line-height: 1.8;
  margin-bottom: 0.75rem;
  text-align: left;
}

.site-copyright {
  margin: 0;
}

/* 包括の出典・非提携表記。IPA 等の利用条件で出典の明示が求められている */
.site-footer-notice {
  margin-top: 1.25rem;
  font-size: 0.75rem;
  line-height: 1.7;
  opacity: 0.7;
}

@media (max-width: 768px) {
  .site-header-inner {
    padding: 0 1.5rem;
  }

  .site-nav {
    gap: 1rem;
  }

  /* モバイルはテーマ切替 + CTA で幅いっぱいのため、テキストリンクは畳む
     （体験デモ・学習ガイドへは本文とフッターから到達できる） */
  .site-nav-link {
    display: none;
  }
}

@media print {
  .site-header {
    position: static !important;
  }

  .site-nav {
    display: none !important;
  }
}
