/* ========================================
   情報セキュリティ研修スライド
   Light Theme / Rich Animations
   ======================================== */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700;800;900&family=Noto+Sans+JP:wght@300;400;500;600;700;900&display=swap');

/* --- CSS Variables --- */
:root {
  /* カラーパレット */
  --bg-primary: #f8f9fc;
  --bg-slide: #ffffff;
  --bg-gradient-start: #e8edf5;
  --bg-gradient-end: #f8f9fc;

  --text-primary: #1a1d2e;
  --text-secondary: #2d334a;
  --text-muted: #5c637a;

  --accent-blue: #2563eb;
  --accent-blue-light: #60a5fa;
  --accent-cyan: #06b6d4;
  --accent-purple: #7c3aed;
  --accent-gradient: linear-gradient(135deg, #2563eb 0%, #06b6d4 50%, #7c3aed 100%);
  --accent-gradient-warm: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
  --accent-gradient-cool: linear-gradient(135deg, #06b6d4 0%, #2563eb 100%);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.12);
  --shadow-glow-blue: 0 0 30px rgba(37, 99, 235, 0.15);

  /* レイアウト */
  --slide-width: 1440px;
  --slide-height: 810px;
  --slide-padding: 32px 48px;
  --slide-radius: 0;

  /* フォント */
  --font-main: 'Noto Sans JP', 'Inter', sans-serif;
  --font-accent: 'Inter', 'Noto Sans JP', sans-serif;

  /* アニメーション */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-spring: cubic-bezier(0.22, 1.2, 0.36, 1);

  /* ========================================
     文字サイズ調整エリア (定数管理)
     ========================================
     スライド全体の文字サイズをここで一括管理しています。
     文字がはみ出す場合、以下の数値を調整してください。

     【使用法】
     1. 全体のサイズを変えたい場合: ここの数値を変更してください。
     2. 特定のスライドだけ変えたい場合: 
        HTML側の <div class="slide ..."> に style="--fs-bullet-main: 1.5rem;" 
        のように記述すると、そのスライド内だけで設定が上書きされます。
  ======================================== */

  --fs-title-main: 5rem;
  /* タイトルスライド: メインタイトル */
  --fs-title-sub: 2.5rem;
  /* タイトルスライド: サブタイトル */
  --fs-section-num: 8rem;
  /* セクション表紙: 番号(01, 02...) */
  --fs-section-title: 4.2rem;
  /* セクション表紙: タイトル */
  --fs-section-desc: 2.4rem;
  /* セクション表紙: 説明文 */

  --fs-h2: 2.8rem;
  /* 各スライド: 見出し(h2) */
  --fs-bullet-main: 2rem;
  /* 箇条書き: 親アイテム */
  --fs-bullet-sub: 1.7rem;
  /* 箇条書き: 子アイテム(ネスト) */
  --fs-bullet-note: 1.6rem;
  /* 箇条書き: 注釈(小さなグレー文字) */

  --fs-box-title: 1.9rem;
  /* 強調ボックス: タイトル (共通) */
  --fs-box-text: 1.8rem;
  /* 強調ボックス: 本文 (共通) */
  --fs-box-list: 1.5em;
  /* 強調ボックス: リスト(ul/ol)内の文字サイズ */
  --fs-box-note: 1.5rem;
  /* 強調ボックス: 補足説明などの小さい文字 */

  --fs-badge: 1.1rem;
  /* ヘッダー右上のバッジ */
  --fs-bullet-icon: 1.3rem;
  /* 箇条書きのアイコン内数字/絵文字 */
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-main);
  background: #f0f2f7;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

/* --- スライドコンテナ --- */
#slide-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #dee4ef, #f0f2f7);
  padding-bottom: 80px;
  box-sizing: border-box;
}

/* --- 個別スライド --- */
.slide {
  position: absolute;
  width: var(--slide-width);
  height: var(--slide-height);
  padding: var(--slide-padding);
  background: var(--bg-slide);
  border-radius: var(--slide-radius);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;

  /* 初期状態: 非表示 */
  opacity: 0;
  visibility: hidden;
  transform: translateX(100px) scale(0.95);
  transition: none;
}

.slide.active {
  opacity: 1;
  visibility: visible;
  transform: translateX(0) scale(var(--slide-scale, 1));
  z-index: 10;
}

.slide.exit-left {
  opacity: 0;
  visibility: visible;
  transform: translateX(-100px) scale(calc(var(--slide-scale, 1) * 0.95));
  z-index: 5;
}

.slide.exit-right {
  opacity: 0;
  visibility: visible;
  transform: translateX(100px) scale(calc(var(--slide-scale, 1) * 0.95));
  z-index: 5;
}

/* アニメーション適用クラス */
.slide.animating {
  transition: opacity 0.7s var(--ease-out-expo),
    transform 0.7s var(--ease-out-expo),
    visibility 0.7s;
}

/* --- 背景装飾 (各スライド) --- */
.slide::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.slide>* {
  position: relative;
  z-index: 1;
}

/* ========================================
   スライドタイプ別レイアウト
   ======================================== */

/* --- タイトルスライド --- */
.slide--title {
  text-align: center;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, #ffffff 0%, #f0f4ff 100%);
}

.slide--title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: var(--accent-gradient);
}

.slide--title .title-main {
  font-size: var(--fs-title-main);
  font-weight: 900;
  line-height: 1.3;
  letter-spacing: -0.02em;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 24px;
}

.slide--title .title-sub {
  font-size: var(--fs-title-sub);
  font-weight: 400;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.slide--title .title-date {
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--text-muted);
  font-family: var(--font-accent);
}

.slide--title .title-tips-guide {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff !important;
  background: var(--accent-gradient) !important;
  padding: 14px 32px !important;
  border-radius: 40px !important;
  margin-top: 32px;
  border: none !important;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
  display: inline-block;
  cursor: pointer;
  /* ここではアニメーションを定義せず、active時に付与する */
}

/* スライド表示時に、ふわっと出現（fadeUp）してから、ホワンホワン（pulse）をスタートさせる */
.slide.active.slide--title .title-tips-guide {
  animation: fadeUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards,
             pulse-guide-btn 2s cubic-bezier(0.4, 0, 0.2, 1) infinite 0.7s !important;
}

/* tip-trigger のデフォルトのアイコンとアニメーションを上書きしてさらに目立たせる */
.slide--title .title-tips-guide::after {
  content: '👆' !important;
  font-size: 1.2em;
  margin-left: 8px !important;
  display: inline-block;
  animation: point-finger 0.8s infinite alternate !important;
  opacity: 1 !important;
}

@keyframes pulse-guide-btn {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.7), 0 0 0 8px rgba(37, 99, 235, 0.2);
    opacity: 1;
  }
}

@keyframes point-finger {
  0% { transform: translateY(0) scale(1); }
  100% { transform: translateY(-5px) scale(1.2); }
}

.slide--title .title-logo {
  width: 80px;
  height: 80px;
  margin-bottom: 24px;
  object-fit: contain;
}

/* --- スワイプガイド (スマホ用) --- */
.swipe-guide {
  display: none; /* デフォルト非表示 */
  position: absolute;
  bottom: 15%;
  left: 50%;
  transform: translateX(-50%);
  flex-direction: column;
  align-items: center;
  gap: 12px;
  z-index: 10;
  pointer-events: none;
}

.swipe-hand {
  font-size: 2.8rem;
  filter: drop-shadow(0 2px 5px rgba(0,0,0,0.2));
  animation: swipe-move 2.2s infinite ease-in-out;
}

.swipe-text {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  background: rgba(255,255,255,0.6);
  padding: 4px 16px;
  border-radius: 20px;
  backdrop-filter: blur(4px);
}

@keyframes swipe-move {
  0% { transform: translateX(40px) rotate(10deg); opacity: 0; }
  15% { opacity: 1; }
  40% { transform: translateX(-40px) rotate(-10deg); }
  65% { transform: translateX(-40px) rotate(-10deg); opacity: 1; }
  85% { opacity: 0; }
  100% { transform: translateX(40px) rotate(10deg); opacity: 0; }
}

/* スマホ時のみ表示 */
@media (max-width: 768px) {
  .swipe-guide {
    display: flex;
  }
}
@media (orientation: landscape) and (max-height: 500px) {
  .swipe-guide {
    display: flex;
    bottom: 10%; /* 横向き時は少し下げる */
  }
}

/* --- セクション表紙スライド --- */
.slide--section {
  text-align: left;
  justify-content: center;
  padding-left: 100px;
  background: linear-gradient(135deg, #ffffff 0%, #f5f7ff 100%);
}

.slide--section::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 8px;
  height: 100%;
  background: var(--accent-gradient);
}

.slide--section .section-number {
  font-family: var(--font-accent);
  font-size: var(--fs-section-num);
  font-weight: 900;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 12px;
}

.slide--section .section-title {
  font-size: var(--fs-section-title);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.slide--section .section-desc {
  font-size: var(--fs-section-desc);
  color: var(--text-secondary);
  margin-top: 32px;
  max-width: 1000px;
}

/* --- コンテンツスライド (箇条書き) --- */
.slide--content {
  justify-content: flex-start;
  padding-top: 40px;
}

.slide--content .slide-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid #d1d9e6;
}

.slide--content .slide-header .header-accent {
  width: 5px;
  height: 36px;
  background: var(--accent-gradient);
  border-radius: 3px;
  flex-shrink: 0;
}

.slide--content .slide-header h2 {
  font-size: var(--fs-h2);
  font-weight: 700;
  color: var(--text-primary);
}

.slide--content .slide-header .section-badge {
  font-family: var(--font-accent);
  font-size: var(--fs-badge);
  font-weight: 600;
  color: var(--accent-blue);
  background: rgba(37, 99, 235, 0.08);
  padding: 6px 16px;
  border-radius: 24px;
  margin-left: auto;
}

.slide--content .content-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* --- 箇条書きアイテム --- */
.bullet-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 12px 16px;
  border-radius: 12px;
  transition: background 0.3s ease;
}

.bullet-item:hover {
  background: rgba(37, 99, 235, 0.03);
}

.bullet-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: var(--accent-gradient-cool);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
  font-size: var(--fs-bullet-icon);
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.2);
}

.bullet-item .bullet-text {
  font-size: var(--fs-bullet-main);
  line-height: 1.6;
  color: var(--text-primary);
}

.bullet-item .bullet-text .highlight {
  color: var(--accent-blue);
  font-weight: 600;
}

.bullet-item .bullet-text .note {
  display: block;
  font-size: var(--fs-bullet-note);
  color: var(--text-muted);
  margin-top: 6px;
}

/* 入れ子の箇条書き */
.bullet-sub {
  margin-left: 48px;
  padding: 8px 16px;
  border-left: 3px solid rgba(37, 99, 235, 0.15);
}

.bullet-sub .bullet-icon {
  width: 32px;
  height: 32px;
  font-size: 1.0rem;
  background: var(--accent-gradient);
}

.bullet-sub .bullet-text {
  font-size: var(--fs-bullet-sub);
}

/* --- 2カラムスライド --- */
.slide--two-col {
  justify-content: flex-start;
  padding-top: 40px;
}

.slide--two-col .slide-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid #d1d9e6;
}

.slide--two-col .slide-header .header-accent {
  width: 5px;
  height: 36px;
  background: var(--accent-gradient);
  border-radius: 3px;
  flex-shrink: 0;
}

.slide--two-col .slide-header h2 {
  font-size: var(--fs-h2);
  font-weight: 700;
  color: var(--text-primary);
}

.slide--two-col .slide-header .section-badge {
  font-family: var(--font-accent);
  font-size: var(--fs-badge);
  font-weight: 600;
  color: var(--accent-blue);
  background: rgba(37, 99, 235, 0.08);
  padding: 6px 16px;
  border-radius: 24px;
  margin-left: auto;
}

.two-col-body {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: stretch;
  /* 子要素を縦いっぱいに広げる */
}

.col-left,
.col-right {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  /* 高さを確保 */
}

/* --- 図解スライド --- */
.slide--visual {
  justify-content: flex-start;
  padding-top: 40px;
}

.slide--visual .slide-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 2px solid #d1d9e6;
}

.slide--visual .slide-header .header-accent {
  width: 5px;
  height: 36px;
  background: var(--accent-gradient);
  border-radius: 3px;
  flex-shrink: 0;
}

.slide--visual .slide-header h2 {
  font-size: var(--fs-h2);
  font-weight: 700;
  color: var(--text-primary);
}

.slide--visual .slide-header .section-badge {
  font-family: var(--font-accent);
  font-size: var(--fs-badge);
  font-weight: 600;
  color: var(--accent-blue);
  background: rgba(37, 99, 235, 0.08);
  padding: 6px 16px;
  border-radius: 24px;
  margin-left: auto;
}

.visual-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- 画像プレースホルダー --- */
.image-placeholder {
  width: 100%;
  max-width: 800px;
  height: 100%;
  /* 親要素(col-right)の高さに合わせる */
  min-height: 400px;
  /* 少し高めに確保 */
  border: 3px dashed #b0bccd;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: linear-gradient(135deg, #f8faff, #f0f3fa);
  color: var(--text-muted);
  transition: all 0.3s ease;
}

.image-placeholder:hover {
  border-color: var(--accent-blue-light);
  background: linear-gradient(135deg, #f0f4ff, #eaefff);
}

.image-placeholder .placeholder-icon {
  font-size: 2.5rem;
  opacity: 0.5;
}

.image-placeholder .placeholder-text {
  font-size: 1.2rem;
  font-weight: 500;
}

/* 画像が入った場合 */
.image-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 13px;
}

.image-placeholder.has-image {
  border: none;
  background: transparent;
  min-height: auto;
}

/* 小さめの画像プレースホルダー */
.image-placeholder--sm {
  max-width: 400px;
  min-height: 200px;
}

/* --- 強調ボックス --- */
.highlight-box {
  padding: 18px 22px;
  border-radius: 14px;
  background: linear-gradient(135deg, #eff6ff, #f0f9ff);
  border-left: 4px solid var(--accent-blue);
  box-shadow: var(--shadow-sm);
}

.highlight-box--warning {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border-left-color: #f59e0b;
}

.highlight-box--success {
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  border-left-color: #10b981;
}

.highlight-box p {
  font-size: var(--fs-box-text);
  line-height: 1.6;
  color: var(--text-primary);
}

.highlight-box .box-title {
  font-size: var(--fs-box-title);
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--accent-blue);
}

.highlight-box--warning .box-title {
  color: #d97706;
}

.highlight-box ul,
.highlight-box ol {
  font-size: var(--fs-box-list);
}

.flow-diagram {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px;
}

.flow-step {
  padding: 16px 24px;
  background: var(--bg-slide);
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s var(--ease-out-back);
}

.flow-step:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-blue-light);
}

.flow-step--accent {
  background: var(--accent-gradient-cool);
  color: #fff;
  border: none;
}

.flow-arrow {
  font-size: 1.5rem;
  color: var(--accent-blue);
  font-weight: 700;
}

/* ========================================
   アニメーション (要素単位)
   ======================================== */

/* スライドがactiveになったとき、子要素にstaggerアニメーション */
.slide.active .anim-fade-up {
  animation: fadeUp 0.7s var(--ease-out-expo) forwards;
}

.slide.active .anim-fade-left {
  animation: fadeLeft 0.8s var(--ease-out-expo) forwards;
}

.slide.active .anim-fade-right {
  animation: fadeRight 0.8s var(--ease-out-expo) forwards;
}

.slide.active .anim-scale-in {
  animation: scaleIn 0.6s var(--ease-out-back) forwards;
}

.slide.active .anim-pop {
  animation: popIn 0.5s var(--ease-spring) forwards;
}

.slide.active .anim-slide-up {
  animation: slideUp 0.8s var(--ease-out-expo) forwards;
}

.slide.active .anim-bounce-in {
  animation: bounceIn 0.8s var(--ease-spring) forwards;
}

/* stagger delay用ユーティリティ */
.delay-1 {
  animation-delay: 0.1s !important;
}

.delay-2 {
  animation-delay: 0.2s !important;
}

.delay-3 {
  animation-delay: 0.3s !important;
}

.delay-4 {
  animation-delay: 0.4s !important;
}

.delay-5 {
  animation-delay: 0.5s !important;
}

.delay-6 {
  animation-delay: 0.6s !important;
}

.delay-7 {
  animation-delay: 0.7s !important;
}

.delay-8 {
  animation-delay: 0.8s !important;
}

.delay-9 {
  animation-delay: 0.9s !important;
}

.delay-10 {
  animation-delay: 1.0s !important;
}

/* 初期状態 (アニメーション前) */
.anim-fade-up,
.anim-fade-left,
.anim-fade-right,
.anim-scale-in,
.anim-pop,
.anim-slide-up,
.anim-bounce-in {
  opacity: 0;
}

/* --- キーフレーム --- */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeLeft {
  from {
    opacity: 0;
    transform: translateX(-60px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeRight {
  from {
    opacity: 0;
    transform: translateX(60px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.7);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.5);
  }

  60% {
    transform: scale(1.08);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(80px) rotate(-2deg);
  }

  to {
    opacity: 1;
    transform: translateY(0) rotate(0deg);
  }
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: translateY(40px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes gradientShift {

  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

/* タイトルスライドの背景アニメーション */
.slide--title .bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.15;
  animation: orbFloat 8s ease-in-out infinite;
  z-index: 0;
}

.slide--title .bg-orb--1 {
  width: 300px;
  height: 300px;
  background: var(--accent-blue);
  top: -50px;
  right: -50px;
  animation-delay: 0s;
}

.slide--title .bg-orb--2 {
  width: 250px;
  height: 250px;
  background: var(--accent-cyan);
  bottom: -30px;
  left: -30px;
  animation-delay: -3s;
}

.slide--title .bg-orb--3 {
  width: 200px;
  height: 200px;
  background: var(--accent-purple);
  top: 50%;
  left: 60%;
  animation-delay: -5s;
}

@keyframes orbFloat {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  33% {
    transform: translate(20px, -20px) scale(1.05);
  }

  66% {
    transform: translate(-15px, 15px) scale(0.95);
  }
}

/* ========================================
   UI コントロール
   ======================================== */

/* --- プログレスバー --- */
#progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  background: var(--accent-gradient);
  transition: width 0.5s var(--ease-out-expo);
  z-index: 1000;
  border-radius: 0 2px 2px 0;
}

/* --- スライド番号 --- */
#slide-counter {
  position: fixed;
  bottom: 20px;
  right: 30px;
  font-family: var(--font-accent);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-muted);
  z-index: 1000;
  letter-spacing: 0.05em;
}

#slide-counter .current {
  color: var(--accent-blue);
  font-size: 1.5rem;
}

/* --- ナビゲーションボタン --- */
.nav-btn {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-md);
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 1000;
  transition: all 0.3s var(--ease-out-back);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}

.nav-btn:hover {
  background: var(--accent-blue);
  color: #fff;
  box-shadow: var(--shadow-glow-blue);
  transform: translateY(-50%) scale(1.1);
}

.nav-btn:active {
  transform: translateY(-50%) scale(0.95);
}

#btn-prev {
  left: 20px;
}

#btn-next {
  right: 20px;
}

/* --- 目次ドット --- */
#slide-dots {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 1000;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #d0d7e6;
  cursor: pointer;
  transition: all 0.3s var(--ease-out-back);
}

.dot:hover {
  background: var(--accent-blue-light);
  transform: scale(1.3);
}

.dot.active {
  background: var(--accent-blue);
  width: 28px;
  border-radius: 5px;
}

/* ========================================
   レスポンシブ（ウィンドウサイズに合わせてスケール）
   ======================================== */
@media (max-width: 1400px) {
  .slide {
    transform-origin: center center;
  }
}

/* ========================================
   モバイル対応
   ======================================== */

/* --- スマホ共通 (縦持ち 768px以下 / または横向きかつ画面が低い場合) --- */
@media (max-width: 768px), (orientation: landscape) and (max-height: 500px) {
  /* 2枚目以降: ヘルプアイコン群を非表示 (スライドへの被り防止) */
  body:not(.slide-first) #back-to-top,
  body:not(.slide-first) #spotlight-toggle,
  body:not(.slide-first) #tips-toggle,
  body:not(.slide-first) #tips-hint-banner {
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
    transition: opacity 0.3s ease, visibility 0.3s !important;
  }

  /* 1枚目: ヘルプアイコン群を表示 */
  body.slide-first #back-to-top,
  body.slide-first #spotlight-toggle,
  body.slide-first #tips-toggle {
    opacity: 1 !important;
    pointer-events: auto !important;
    visibility: visible !important;
  }
}

/* --- スマホ横向き特化 (画面を最大限に活用) --- */
@media (orientation: landscape) and (max-height: 500px) {
  /* ドットナビを非表示 */
  #slide-dots {
    display: none !important;
  }

  /* スライドカウンターも非表示 */
  #slide-counter {
    display: none !important;
  }

  /* 下部パディングを削減してスライドを広く使う */
  #slide-container {
    padding-bottom: 20px;
  }

  /* ナビボタンをスライド中央に被らないよう下部コーナーへ移動 (案A) */
  .nav-btn {
    top: auto !important;
    bottom: 12px !important;
    transform: none !important;
    width: 36px !important;
    height: 36px !important;
    background: rgba(255, 255, 255, 0.85) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
  }

  #btn-prev {
    left: 12px !important;
  }

  #btn-next {
    right: 12px !important;
  }

  /* ホバー・アクティブ時の位置ずれ防止 */
  .nav-btn:hover {
    transform: scale(1.1) !important;
  }
  .nav-btn:active {
    transform: scale(0.95) !important;
  }
}

/* --- スマホ縦向き --- */
@media (max-width: 768px) and (orientation: portrait) {
  /* ナビボタンを少し大きく・タッチしやすく */
  .nav-btn {
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
  }

  #btn-prev {
    left: 8px;
  }

  #btn-next {
    right: 8px;
  }
}

/* プリント対策 */
@media print {
  .slide {
    page-break-after: always;
    position: relative;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
  }

  .nav-btn,
  #progress-bar,
  #slide-counter,
  #slide-dots {
    display: none;
  }
}

/* ========================================
   スポットライト機能
   ======================================== */

/* オーバーレイ全体 (SVGでクリッピング) */
#spotlight-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

#spotlight-overlay.active {
  opacity: 1;
  pointer-events: auto;
  cursor: crosshair;
}

#spotlight-overlay svg {
  width: 100%;
  height: 100%;
}

/* ドラッグ中の選択範囲プレビュー */
#spotlight-selection {
  position: fixed;
  border: 2px solid rgba(96, 165, 250, 0.8);
  border-radius: 4px;
  background: rgba(96, 165, 250, 0.08);
  pointer-events: none;
  z-index: 901;
  display: none;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.3);
}

/* トップへ戻るボタン */
#back-to-top {
  position: fixed;
  bottom: 20px;
  left: 30px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-md);
  color: var(--text-secondary);
  font-size: 1.4rem;
  cursor: pointer;
  z-index: 1000;
  transition: all 0.3s var(--ease-out-back);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  text-decoration: none;
}

#back-to-top:hover {
  background: var(--accent-blue);
  color: #fff;
  box-shadow: var(--shadow-glow-blue);
  transform: scale(1.1);
}

/* トグルボタン */
#spotlight-toggle {
  position: fixed;
  bottom: 20px;
  left: 84px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-md);
  color: var(--text-secondary);
  font-size: 1.4rem;
  cursor: pointer;
  z-index: 1000;
  transition: all 0.3s var(--ease-out-back);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  line-height: 1;
}

#spotlight-toggle:hover {
  background: var(--accent-blue);
  color: #fff;
  box-shadow: var(--shadow-glow-blue);
  transform: scale(1.1);
}

#spotlight-toggle.active {
  background: var(--accent-blue);
  color: #fff;
  box-shadow: 0 0 20px rgba(37, 99, 235, 0.4);
}

/* ヒントツールチップ */
#spotlight-hint {
  position: fixed;
  bottom: 70px;
  right: 30px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 400;
  z-index: 1001;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
  backdrop-filter: blur(4px);
  text-align: right;
  line-height: 1.5;
}

#spotlight-hint.visible {
  opacity: 1;
}