/* ページ遷移フェードアニメーション（TOPページ以外） */
body {
  opacity: 0;
  transition: opacity 0.5s ease;
}

body.fade-in {
  opacity: 1;
}

/* リンククリック時のフェードアウトアニメーション */
body.fade-out {
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* スムーズなページ遷移のための基本設定 */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

/* ページ読み込み中のちらつき防止 */
.page-content {
  opacity: 0;
  animation: pageContentFadeIn 0.5s ease forwards 0.1s;
}

@keyframes pageContentFadeIn {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* モーダルやポップアップとの競合を避けるため */
.modal-open body,
.popup-open body {
  transition: none !important;
}

/* 印刷時はアニメーションを無効化 */
@media print {
  body {
    opacity: 1 !important;
    transition: none !important;
  }
}