/* ============================================================
   CSS Variables
   ============================================================ */
:root {
  --color-primary:  #2D6A4F;   /* トロピカルグリーン */
  --color-accent:   #F4845F;   /* ウォームコーラル  */
  --color-bg:       #F8F5F0;   /* ウォームオフホワイト */
  --color-text:     #2C2C2C;
  --color-muted:    #888;
  --color-white:    #ffffff;
  --color-border:   #E5E0D8;
  --header-h:       52px;
  --nav-h:          52px;
  --photo-pct:      42%;       /* スライド高さに対する写真の割合 */
  --font:           'Noto Sans JP', sans-serif;
  --ease:           cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ============================================================
   Reset & Base
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  overflow: hidden;
  background: #1a1a1a; /* 背景（デスクトップ時に見える） */
}

body {
  font-family: var(--font);
  color: var(--color-text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   App Container
   ============================================================ */
.app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
  position: relative;
  background: var(--color-bg);

  /* デスクトップではスマホフレームとして表示 */
  max-width: 430px;
  margin: 0 auto;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.4);
}

/* ============================================================
   Header
   ============================================================ */
.app-header {
  flex-shrink: 0;
  background: var(--color-primary);
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: var(--header-h);
}

.blog-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-white);
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.blog-title span {
  font-weight: 400;
  font-size: 12px;
  opacity: 0.8;
  margin-left: 5px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.slide-counter {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.75);
  font-weight: 500;
  white-space: nowrap;
}

.toc-btn {
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font);
  color: var(--color-primary);
  background: var(--color-white);
  border: none;
  border-radius: 20px;
  padding: 3px 10px;
  cursor: pointer;
  white-space: nowrap;
  letter-spacing: 0.5px;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.15s;
}

.toc-btn:active {
  opacity: 0.7;
}

/* プログレスバー */
.progress-bar {
  height: 3px;
  background: rgba(255, 255, 255, 0.2);
}

.progress-fill {
  height: 100%;
  background: var(--color-accent);
  transition: width 0.35s var(--ease);
  width: 4.35%; /* 1/23 */
}

/* ============================================================
   Slider
   ============================================================ */
.slider-wrapper {
  flex: 1;
  overflow: hidden;
  position: relative;
  min-height: 0; /* flex 内で縮まるように */
}

.slides-track {
  display: flex;
  height: 100%;
  transition: transform 0.38s var(--ease);
  will-change: transform;
}

/* ============================================================
   Individual Slide
   ============================================================ */
.slide {
  min-width: 100vw;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* デスクトップではアプリ幅（980px）に揃え、横並びにする */
@media (min-width: 769px) {
  .slide {
    min-width: 980px;
    flex-direction: row; /* 写真左・テキスト右 */
  }

  /* 写真なしスライド（目次）は縦並びを維持 */
  .slide--no-photo {
    flex-direction: column;
    min-width: 980px;
  }
}

/* --- 写真エリア --- */
.slide-photo {
  flex: 0 0 var(--photo-pct);
  overflow: hidden;
  background: linear-gradient(135deg, #c9b99a 0%, #b5a68e 100%);
  position: relative;
}

.slide-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 写真に薄いグラデーションオーバーレイ（下部を読みやすく） */
.slide-photo::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.15));
  pointer-events: none;
}

/* --- テキストエリア --- */
.slide-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 20px 24px;
  background: var(--color-bg);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

/* ============================================================
   Content Typography
   ============================================================ */

/* タグ */
.slide-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--color-accent);
  background: rgba(244, 132, 95, 0.1);
  border: 1px solid rgba(244, 132, 95, 0.35);
  border-radius: 20px;
  padding: 3px 10px;
  margin-bottom: 10px;
}

/* H2（スライドタイトル） */
.slide-content h2 {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.45;
  color: var(--color-text);
  margin-bottom: 4px;
}

/* サブタイトル */
.slide-content .subtitle {
  font-size: 12px;
  color: var(--color-muted);
  margin-bottom: 14px;
  font-style: italic;
}

/* H3（セクション内見出し） */
.slide-content h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-primary);
  border-left: 3px solid var(--color-accent);
  padding-left: 9px;
  margin: 18px 0 8px;
}

/* 本文 */
.slide-content p {
  font-size: 13.5px;
  line-height: 1.85;
  color: var(--color-text);
  margin-bottom: 10px;
}

/* リスト */
.slide-content ul,
.slide-content ol {
  padding-left: 20px;
  margin-bottom: 10px;
}

.slide-content li {
  font-size: 13.5px;
  line-height: 1.75;
  margin-bottom: 3px;
  color: var(--color-text);
}

/* 強調 */
.slide-content strong {
  font-weight: 700;
  color: var(--color-primary);
}

/* 引用ブロック（会話など） */
.slide-content blockquote {
  background: #F0ECE6;
  border-left: 3px solid var(--color-accent);
  border-radius: 0 8px 8px 0;
  padding: 11px 14px;
  margin: 12px 0;
  font-size: 13px;
  line-height: 1.75;
  color: #555;
  font-style: italic;
}

/* まとめルートリスト */
.route-summary {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 16px;
  margin-top: 20px;
}

.route-summary h3 {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text);
  border-left: none;
  padding-left: 0;
  margin: 0 0 10px;
}

.route-summary ol {
  padding-left: 18px;
}

.route-summary li {
  font-size: 12px;
  color: var(--color-muted);
  margin-bottom: 4px;
  line-height: 1.6;
}

/* ============================================================
   目次スライド（写真なし）
   ============================================================ */

/* 写真エリアを非表示にして全高をコンテンツで使う */
.slide--no-photo .slide-photo {
  display: none;
}

/* 目次ヘッダー */
.toc-header {
  text-align: center;
  padding: 28px 4px 20px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 16px;
}

.toc-eyebrow {
  font-size: 10px;
  letter-spacing: 2.5px;
  color: var(--color-accent);
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.toc-main-title {
  font-size: 19px;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.4;
  margin-bottom: 6px;
}

.toc-sub {
  font-size: 12px;
  color: var(--color-muted);
  font-style: italic;
  margin-bottom: 8px;
}

.toc-author {
  font-size: 12px;
  color: var(--color-muted);
}

/* "目次" ラベル */
.toc-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--color-muted);
  text-align: center;
  margin-bottom: 8px;
}

/* 目次リスト（.slide-content ol より詳細度を上げて上書き） */
.slide-content .toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.slide-content .toc-list li + li {
  border-top: 1px solid var(--color-border);
}

.toc-item {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  padding: 9px 4px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
  border-radius: 6px;
}

.toc-item:active {
  background: rgba(244, 132, 95, 0.08);
}

.toc-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-accent);
  min-width: 22px;
  flex-shrink: 0;
  padding-top: 2px;
  font-variant-numeric: tabular-nums;
}

.toc-body {
  flex: 1;
}

.toc-tag {
  display: block;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: var(--color-muted);
  margin-bottom: 1px;
}

.toc-body-title {
  font-size: 12.5px;
  color: var(--color-text);
  line-height: 1.45;
}

/* ============================================================
   Navigation Arrows（写真エリアの左右に表示）
   ============================================================ */
.nav-arrow {
  position: absolute;
  /* ヘッダー下＋写真高さの中央に配置 */
  top: calc(var(--header-h) + 3px + (100dvh - var(--header-h) - var(--nav-h) - 3px) * var(--photo-pct) / 100 / 2);
  transform: translateY(-50%);
  z-index: 20;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.92);
  color: var(--color-text);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: opacity 0.2s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
  /* .app の position:relative からの絶対配置 */
}

.nav-arrow:active {
  background: var(--color-white);
}

.nav-prev { left: 10px; }
.nav-next { right: 10px; }

.nav-arrow:disabled {
  opacity: 0;
  pointer-events: none;
}

/* ============================================================
   Bottom Navigation（ドットインジケーター）
   ============================================================ */
.bottom-nav {
  flex-shrink: 0;
  height: var(--nav-h);
  background: var(--color-white);
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.nav-dots {
  display: flex;
  gap: 5px;
  align-items: center;
  flex-wrap: nowrap;
  max-width: calc(100% - 24px);
  overflow: hidden; /* はみ出し防止 */
}

.nav-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-border);
  border: none;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.25s, transform 0.25s;
  -webkit-tap-highlight-color: transparent;
}

.nav-dot.active {
  background: var(--color-accent);
  transform: scale(1.45);
}

/* ============================================================
   Desktop（769px以上）: 横長レイアウト
   ============================================================ */
@media (min-width: 769px) {
  .app {
    height: 100vh;
    max-width: 980px; /* PC用横長サイズ */
  }

  /* 写真エリアを左カラムに固定 */
  .slide-photo {
    flex: 0 0 45%;
    height: 100%;
  }

  /* グラデーションを右端方向に変更 */
  .slide-photo::after {
    height: auto;
    width: 60px;
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    background: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.12));
  }

  .nav-arrow {
    display: flex;
    top: calc(var(--header-h) + 3px + (100vh - var(--header-h) - var(--nav-h) - 3px) / 2);
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    font-size: 26px;
  }

  .slide-content h2 {
    font-size: 22px;
  }

  .slide-content p,
  .slide-content li {
    font-size: 16px;
  }
}

/* ============================================================
   Scroll bar（コンテンツエリア）
   ============================================================ */
.slide-content::-webkit-scrollbar {
  width: 3px;
}

.slide-content::-webkit-scrollbar-track {
  background: transparent;
}

.slide-content::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 2px;
}
