/* ============================================
   楽しい改善提案500 説明会スライド 共通スタイル
   ============================================ */

:root {
  --blue: #1a56db;
  --green: #0e9f6e;
  --amber: #f59e0b;
  --fg: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --bg: #ffffff;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: #0f172a;
  font-family: "Hiragino Sans", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  color: var(--fg);
}

/* ====== ナビゲーション UI ====== */
.nav-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 36px;
  background: rgba(15, 23, 42, .85);
  color: #e2e8f0;
  display: flex;
  align-items: center;
  padding: 0 16px;
  font-size: 13px;
  z-index: 100;
  opacity: 0;
  transition: opacity .25s ease;
}
.nav-bar:hover,
body:not(.idle) .nav-bar { opacity: 1; }
.nav-bar a { color: #93c5fd; text-decoration: none; margin-right: 12px; }
.nav-bar a:hover { text-decoration: underline; }
.nav-bar .title { color: #fff; font-weight: 600; }
.nav-bar .hint { margin-left: auto; color: #94a3b8; font-size: 12px; }

.counter {
  position: fixed;
  right: 16px;
  bottom: 14px;
  background: rgba(15, 23, 42, .8);
  color: #fff;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  z-index: 100;
  letter-spacing: .03em;
}

.dots {
  position: fixed;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 100;
}
.dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(100, 116, 139, .35);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .6);
  cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}
.dots span.active {
  background: var(--amber);
  transform: scale(1.4);
}

/* ====== スライド本体 ====== */
.deck {
  position: relative;
  width: 100vw;
  height: 100vh;
}
.slide {
  position: absolute;
  inset: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  padding: 56px 64px 56px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .28s ease;
}
.slide.active {
  opacity: 1;
  visibility: visible;
}

/* スライドヘッダ */
.slide-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 22px;
  flex-shrink: 0;
}
.step-no {
  display: inline-block;
  background: var(--blue);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 6px;
  letter-spacing: .04em;
  flex-shrink: 0;
}
.step-no.amber { background: var(--amber); }
.step-no.green { background: var(--green); }
.slide-head h2 {
  font-size: 32px;
  margin: 0;
  line-height: 1.3;
  color: var(--fg);
}
.slide-head .sub {
  margin-left: auto;
  color: var(--muted);
  font-size: 14px;
}

/* ====== レイアウトパターン ====== */
.slide-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* 左右2分割（テキスト ｜ 画像） */
.layout-split {
  flex-direction: row;
  gap: 36px;
  align-items: stretch;
}
.layout-split .col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.layout-split .col.fig {
  align-items: center;
  justify-content: center;
}
.layout-split .col img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0,0,0,.10);
}
/* 右カラムに画像を上下2枚並べたいとき */
.layout-split .col.fig-stack {
  flex-direction: column;
  gap: 16px;
  justify-content: center;
  align-items: stretch;
}
.layout-split .col.fig-stack figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 0;
  flex: 1 1 0;
}
.layout-split .col.fig-stack figure img {
  max-width: 100%;
  max-height: 32vh;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
}
.layout-split .col.fig-stack figcaption {
  margin-top: 8px;
  font-size: 13px;
  color: #4b5563;
  text-align: center;
  line-height: 1.4;
}

/* メイン画像1枚を中央配置 */
.layout-image {
  align-items: center;
  justify-content: center;
}
.layout-image img {
  max-width: 100%;
  max-height: 72vh;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0,0,0,.10);
}

/* 横並びステップ（複数画像） */
.layout-steps {
  flex-direction: row;
  gap: 18px;
  align-items: stretch;
  justify-content: center;
}
.layout-steps figure {
  margin: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 0;
}
.layout-steps figure img {
  max-width: 100%;
  max-height: 56vh;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.layout-steps figure.no-border img { border: none; }
.layout-steps figcaption {
  font-size: 14px;
  color: #4b5563;
  margin-top: 8px;
  line-height: 1.5;
}

/* テキスト中心 */
.layout-text {
  justify-content: center;
}

/* ====== 表紙 ====== */
.slide.title-slide {
  background: linear-gradient(135deg, #1a56db 0%, #0e9f6e 100%);
  color: #fff;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 40px;
}
.slide.title-slide .mascot {
  height: 170px;
  margin-bottom: 24px;
  filter: drop-shadow(2px 6px 12px rgba(0,0,0,.35));
}
.slide.title-slide h1 {
  font-size: 48px;
  margin: 0 0 16px;
  font-weight: 800;
  letter-spacing: .02em;
}
.slide.title-slide .subtitle {
  font-size: 22px;
  opacity: .9;
  margin: 0 0 36px;
}
.slide.title-slide .meta {
  font-size: 15px;
  opacity: .8;
}

/* ====== 共通テキスト要素 ====== */
.big-list {
  font-size: 22px;
  line-height: 1.85;
  padding-left: 0;
  list-style: none;
  margin: 0;
}
.big-list li {
  padding: 8px 0 8px 38px;
  position: relative;
}
.big-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.big-list.amber li::before { background: var(--amber); }
.big-list.green li::before { background: var(--green); }

.numbered-list {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 22px;
  line-height: 1.85;
}
.numbered-list li {
  padding: 10px 0 10px 56px;
  position: relative;
  counter-increment: step;
}
.numbered-list li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 8px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kbd {
  display: inline-block;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 1px 8px;
  font-family: Consolas, "Courier New", monospace;
  font-size: .92em;
  color: #111827;
}

.hl {
  background: linear-gradient(transparent 60%, #fde68a 60%);
  font-weight: 700;
  padding: 0 3px;
}

.badge-new {
  display: inline-block;
  background: var(--amber);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 6px;
  margin-left: 10px;
  vertical-align: middle;
  letter-spacing: .04em;
}

.callout {
  border-left: 5px solid var(--amber);
  background: #fff8e6;
  padding: 14px 20px;
  border-radius: 8px;
  font-size: 17px;
  color: #78350f;
  margin: 0;
}
.callout strong { color: #92400e; }

table.simple {
  border-collapse: collapse;
  font-size: 17px;
  background: #fff;
}
table.simple th,
table.simple td {
  border: 1px solid var(--border);
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
}
table.simple th {
  background: #f9fafb;
  font-weight: 700;
  white-space: nowrap;
}

/* タイトルスライドのバリエーション（管理者向けは緑→青グラデを反転） */
.slide.title-slide.admin {
  background: linear-gradient(135deg, #0e9f6e 0%, #1a56db 100%);
}

/* ====== 印刷時：A4横で1スライド=1ページ ======
   ブラウザの印刷ダイアログで「用紙: A4 / 向き: 横 / 余白: なし」が
   推奨。Chrome/Edge 等は @page の size 指定でデフォルト選択される。 */
@media print {
  html, body {
    overflow: visible;
    background: #fff;
    margin: 0;
    padding: 0;
  }
  .nav-bar, .counter, .dots { display: none; }
  .deck { height: auto; }

  .slide {
    position: relative;
    inset: auto;
    page-break-after: always;
    page-break-inside: avoid;
    opacity: 1 !important;
    visibility: visible !important;
    /* A4 横（297 × 210mm）に物理サイズで合わせる */
    width: 297mm;
    height: 210mm;
    /* プリンタ印字不能領域（端 5mm 程度）対策で余白確保 */
    padding: 11mm 14mm;
    overflow: hidden;
    box-shadow: none;
  }
  .slide:last-child { page-break-after: auto; }

  /* 見出し・本文を pt 指定で見た目を安定化 */
  .slide-head { margin-bottom: 6mm; }
  .slide-head h2 { font-size: 20pt; }
  .step-no { font-size: 10pt; padding: 2pt 8pt; }

  /* 画像の最大高さを A4 印刷領域基準で抑える */
  .layout-image img { max-height: 155mm; }
  .layout-split { gap: 10mm; }
  /* 印刷時はコンテンツを上から詰める（中央寄せだと縦の空白が目立つ） */
  .layout-split .col { justify-content: flex-start; }
  .layout-split .col.fig { justify-content: center; }
  .layout-split .col img { max-height: 155mm; }
  .layout-split .col.fig-stack figure img { max-height: 78mm; }
  .layout-split .col.fig-stack figcaption { font-size: 9pt; }
  .layout-steps { gap: 6mm; }
  .layout-steps figure img { max-height: 115mm; }
  .layout-steps figcaption { font-size: 9pt; }

  /* タイトルスライド：背景色を A4 全面に乗せる */
  .slide.title-slide {
    padding: 0;
    /* Chrome/Edge で背景色・グラデを印刷に出すには下記が必要 */
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .slide.title-slide .mascot { height: 40mm; margin-bottom: 8mm; }
  .slide.title-slide h1 { font-size: 32pt; margin-bottom: 6mm; }
  .slide.title-slide .subtitle { font-size: 16pt; margin-bottom: 8mm; }
  .slide.title-slide .meta { font-size: 11pt; }

  /* テキスト系のフォントサイズ調整 */
  .big-list { font-size: 13pt; line-height: 1.75; }
  .big-list li { padding: 4pt 0 4pt 24pt; }
  .big-list li::before {
    width: 18pt; height: 18pt; font-size: 9pt; top: 5pt;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .numbered-list { font-size: 13pt; line-height: 1.75; }
  .numbered-list li { padding: 5pt 0 5pt 32pt; }
  .numbered-list li::before {
    width: 24pt; height: 24pt; font-size: 12pt; top: 5pt;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .callout {
    font-size: 11pt;
    padding: 8pt 12pt;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  table.simple { font-size: 10pt; }
  table.simple th, table.simple td { padding: 4pt 8pt; }
  .hl {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .badge-new {
    font-size: 9pt;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  @page {
    size: A4 landscape;
    margin: 0;
  }
}

/* ====== レスポンシブ：1000px未満 ====== */
@media (max-width: 1000px) {
  .slide { padding: 40px 28px; }
  .slide-head h2 { font-size: 26px; }
  .big-list, .numbered-list { font-size: 18px; }
  .layout-split { flex-direction: column; gap: 18px; }
  .layout-steps { flex-wrap: wrap; }
  .layout-steps figure { flex: 1 1 40%; }
  .slide.title-slide h1 { font-size: 34px; }
  .slide.title-slide .subtitle { font-size: 17px; }
}
