/**
 * Versyne Noir完全準拠 - ページトップに戻るボタン
 * ネオプラズマ株式会社専用
 *
 * デザインテーマ: Versyne Noir
 * 実装: Versyne Noirのスクロールトップボタンを完全再現
 */

/* ============================================
   ページトップに戻るボタン
   ============================================ */

.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 90; /* ヘッダー(100)より低く */
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(252, 247, 241, 0.95); /* Versyne Noir背景色・半透明 */
  border: 1px solid rgba(68, 68, 68, 0.2);
  border-radius: 50%; /* 円形 */
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* スクロールしたら表示 */
.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ホバー時 */
.back-to-top:hover {
  background-color: #444444;
  border-color: #444444;
  transform: translateY(-4px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

/* タブレット */
@media (min-width: 768px) {
  .back-to-top {
    width: 52px;
    height: 52px;
    bottom: 32px;
    right: 32px;
  }
}

/* デスクトップ */
@media (min-width: 1024px) {
  .back-to-top {
    width: 56px;
    height: 56px;
    bottom: 40px;
    right: 40px;
  }
}

/* ============================================
   アイコン
   ============================================ */

.back-to-top svg {
  width: 20px;
  height: 20px;
  stroke: #444444;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  transition: stroke 0.3s ease;
}

.back-to-top:hover svg {
  stroke: #fcf7f1;
}

@media (min-width: 768px) {
  .back-to-top svg {
    width: 22px;
    height: 22px;
  }
}

@media (min-width: 1024px) {
  .back-to-top svg {
    width: 24px;
    height: 24px;
  }
}

/* ============================================
   アクセシビリティ
   ============================================ */

/* フォーカス時 */
.back-to-top:focus {
  outline: 2px solid #ff8c00;
  outline-offset: 2px;
}

/* キーボード操作時のみアウトライン表示 */
.back-to-top:focus:not(:focus-visible) {
  outline: none;
}

.back-to-top:focus-visible {
  outline: 2px solid #ff8c00;
  outline-offset: 2px;
}

/* ============================================
   Reduced Motion対応
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  .back-to-top {
    transition: opacity 0.3s ease, visibility 0.3s ease;
    transform: none;
  }

  .back-to-top.visible {
    transform: none;
  }

  .back-to-top:hover {
    transform: none;
  }
}

/* ============================================
   テキスト付きバリエーション（オプション）
   ============================================ */

.back-to-top.with-text {
  width: auto;
  height: auto;
  padding: 12px 20px;
  border-radius: 24px; /* 角丸カプセル型 */
  gap: 8px;
}

.back-to-top.with-text span {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.05em;
  color: #444444;
  transition: color 0.3s ease;
}

.back-to-top.with-text:hover span {
  color: #fcf7f1;
}

@media (min-width: 768px) {
  .back-to-top.with-text {
    padding: 14px 24px;
  }

  .back-to-top.with-text span {
    font-size: 14px;
  }
}

/* ============================================
   モバイル最適化
   ============================================ */

/* スマホでは小さめに */
@media (max-width: 767px) {
  .back-to-top {
    bottom: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
  }

  .back-to-top svg {
    width: 18px;
    height: 18px;
  }

  /* テキストなしバージョンのみ表示 */
  .back-to-top.with-text span {
    display: none;
  }

  .back-to-top.with-text {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
  }
}
