/* ─────────────────────────────────────────────
   FFTrans Neu Help — shared/help.css
   macOS ライクな2ペインレイアウト
   ───────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --sidebar-w: 220px;

  /* ライト / ダーク 自動対応 */
  --bg:          #f5f5f7;
  --sidebar-bg:  #e8e8ed;
  --content-bg:  #ffffff;
  --border:      #d1d1d6;
  --text:        #1d1d1f;
  --text-muted:  #6e6e73;
  --accent:      #0071e3;
  --accent-dark: #0051a3;

  --callout-info-bg:    #e8f4fd;
  --callout-info-bdr:   #2997ff;
  --callout-warn-bg:    #fff8e6;
  --callout-warn-bdr:   #f5a623;

  --step-num-bg: #0071e3;
  --step-num-fg: #ffffff;

  --radius-sm: 6px;
  --radius-md: 10px;

  font-family: -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:          #1c1c1e;
    --sidebar-bg:  #2c2c2e;
    --content-bg:  #1c1c1e;
    --border:      #3a3a3c;
    --text:        #f5f5f7;
    --text-muted:  #8e8e93;
    --accent:      #2997ff;
    --accent-dark: #5ac8fa;

    --callout-info-bg:    #1a2d44;
    --callout-info-bdr:   #2997ff;
    --callout-warn-bg:    #2d2006;
    --callout-warn-bdr:   #f5a623;
  }
}

/* ── Layout ──────────────────────────────────── */

html, body {
  height: 100%;
  background: var(--bg);
}

body {
  display: flex;
  overflow: hidden;
}

/* ── Sidebar ─────────────────────────────────── */

#sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  user-select: none;
}

.sidebar-header {
  padding: 20px 16px 14px;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.app-icon {
  font-size: 36px;
  margin-bottom: 6px;
}

.app-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.app-version {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.nav-list {
  list-style: none;
  padding: 8px 0;
  flex: 1;
}

.nav-section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 16px 4px;
}

.nav-link {
  display: block;
  padding: 5px 16px 5px 20px;
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
  border-radius: var(--radius-sm);
  margin: 1px 6px;
  transition: background 0.12s;
}

.nav-link:hover {
  background: rgba(0,0,0,0.06);
}

.nav-link.active {
  background: var(--accent);
  color: #fff;
}

@media (prefers-color-scheme: dark) {
  .nav-link:hover { background: rgba(255,255,255,0.08); }
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.lang-switch {
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
}

.lang-switch:hover { text-decoration: underline; }

/* ── Content area ────────────────────────────── */

#content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  background: var(--content-bg);
  padding: 32px 40px 60px;
  scroll-behavior: smooth;
}

/* ── Typography ──────────────────────────────── */

.help-section {
  max-width: 680px;
  margin-bottom: 56px;
  scroll-margin-top: 24px;
}

h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin-bottom: 10px;
  color: var(--text);
}

h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 18px 0 6px;
  color: var(--text);
}

h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text);
}

p {
  color: var(--text);
  margin-bottom: 10px;
}

.lead {
  font-size: 16px;
  line-height: 1.55;
  color: var(--text-muted);
  margin-bottom: 22px;
}

ul, ol {
  padding-left: 20px;
  margin-bottom: 12px;
}

li { margin-bottom: 4px; }

code {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  background: var(--sidebar-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--text);
}

/* ── Feature grid ────────────────────────────── */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 18px 0;
}

.feature-card {
  background: var(--sidebar-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
}

.feature-icon {
  font-size: 26px;
  margin-bottom: 8px;
}

.feature-card h3 {
  font-size: 13px;
  margin: 0 0 4px;
}

.feature-card p {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
}

/* ── Step list ───────────────────────────────── */

.step-list {
  list-style: none;
  padding: 0;
  counter-reset: none;
}

.step-list li {
  display: flex;
  gap: 14px;
  margin-bottom: 20px;
  align-items: flex-start;
}

.step-list.compact li { margin-bottom: 12px; }

.step-num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  background: var(--step-num-bg);
  color: var(--step-num-fg);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.step-body { flex: 1; }
.step-body p { margin-bottom: 6px; }
.step-body h4 { margin-bottom: 4px; }

/* ── Callout ─────────────────────────────────── */

.callout {
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  margin: 14px 0;
  font-size: 13px;
  border-left: 3px solid transparent;
}

.callout-info {
  background: var(--callout-info-bg);
  border-left-color: var(--callout-info-bdr);
}

.callout-warning {
  background: var(--callout-warn-bg);
  border-left-color: var(--callout-warn-bdr);
}

.callout strong { font-weight: 600; }

/* ── Table ───────────────────────────────────── */

.format-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0 16px;
  font-size: 13px;
}

.format-table th,
.format-table td {
  text-align: left;
  padding: 8px 12px;
  border: 1px solid var(--border);
}

.format-table th {
  background: var(--sidebar-bg);
  font-weight: 600;
  font-size: 12px;
}

.format-table tr:nth-child(even) td {
  background: rgba(0,0,0,0.02);
}

@media (prefers-color-scheme: dark) {
  .format-table tr:nth-child(even) td { background: rgba(255,255,255,0.03); }
}

/* ── FAQ (details/summary) ───────────────────── */

.faq {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  overflow: hidden;
}

.faq summary {
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
  background: var(--sidebar-bg);
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::before {
  content: "›";
  font-size: 16px;
  color: var(--accent);
  transition: transform 0.15s;
  display: inline-block;
  width: 14px;
  text-align: center;
}

.faq[open] summary::before { transform: rotate(90deg); }

.faq p {
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

/* ── Screenshot placeholder ──────────────────── */

.screenshot-placeholder {
  margin: 10px 0;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  background: var(--sidebar-bg);
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 実際のスクリーンショットが存在する場合は画像表示に切り替え（JS側で制御） */
.screenshot-placeholder img {
  max-width: 100%;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 12px rgba(0,0,0,0.12);
  display: block;
}

/* ── Scrollbar ───────────────────────────────── */

#sidebar::-webkit-scrollbar,
#content::-webkit-scrollbar { width: 6px; }

#sidebar::-webkit-scrollbar-thumb,
#content::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.15);
  border-radius: 3px;
}

@media (prefers-color-scheme: dark) {
  #sidebar::-webkit-scrollbar-thumb,
  #content::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); }
}

.newicon {
  color: #ff0000;
  font-weight: bold;
  margin-right: 6px;
  font-size: 1em;
}
.proicon {
  color: #0000ff;
  font-weight: bold;
  margin-right: 6px;
  font-size: 1em;
}
.freeicon {
  color: #00ff00;
  font-weight: bold;
  margin-right: 6px;
  font-size: 1em;
}

  .price-section h3 {
    margin-bottom: 0.5em;
  }
  .price-section .price-amount {
    font-size: 1.4em;
  }
  .price-section .price-body {
    margin-left: 1.5em;
  }
  .purchase-info {
    margin-top: 1em;
    font-size: 0.95em;
  }
  .purchase-info, .trial-info {
    margin-top: 1em;
    font-size: 1.2em;
  }
.wp-block-button__link {
  color: #FFFFFF;
  background-color: #66DD66;
  padding: 12px 32px;
  border: none;
  border-radius: 6px;
  font-size: 1.1em;
  font-weight: bold;
  box-shadow: 0 3px 6px rgba(0,0,0,0.1);
  text-decoration: none;
  display: inline-block;
  transition: background 0.2s, transform 0.1s;
}
.wp-block-button__link:hover {
  background-color: #66DD66;
  transform: translateY(-2px) scale(1.03);
}

.purchase-info-box {
  background-color: #f0f8ff; /* 淡い青で視線を集める */
  border-radius: 8px;
  padding: 15px 20px;
  max-width: 320px;
  margin-bottom: 15px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  font-family: "Noto Sans JP", sans-serif;
}

.price {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 10px;
  color: #003366;
}

.price span {
  font-size: 22px;
  color: #d9534f; /* 赤系で価格を強調 */
  margin-left: 8px;
}

.features {
  list-style: none;
  padding-left: 0;
  font-size: 14px;
  line-height: 1.5;
  color: #333333;
}

.features li {
  margin-bottom: 6px;
}

/* ─────────────────────────────────────────────
   Mobile / Responsive
   ───────────────────────────────────────────── */

/* ── ハンバーガーボタン（モバイルのみ表示） ── */

#menu-toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  width: 40px;
  height: 40px;
  background: var(--sidebar-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  -webkit-tap-highlight-color: transparent;
}

#menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

/* 開いているときはXに変形 */
body.sidebar-open #menu-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
body.sidebar-open #menu-toggle span:nth-child(2) {
  opacity: 0;
}
body.sidebar-open #menu-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── オーバーレイ ── */

#sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 90;
  opacity: 0;
  transition: opacity 0.25s;
}

@media (max-width: 700px) {

  /* body のスクロールをコンテンツ側に戻す */
  body {
    overflow: auto;
    flex-direction: column;
  }

  /* ハンバーガーを表示 */
  #menu-toggle {
    display: flex;
  }

  /* サイドバーはドロワーとして画面外に退避 */
  #sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 260px;
    min-width: 0;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: none;
  }

  body.sidebar-open #sidebar {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,0.18);
  }

  body.sidebar-open #sidebar-overlay {
    display: block;
    opacity: 1;
  }

  /* コンテンツ：フル幅・適切なパディング */
  #content {
    flex: none;
    overflow: visible;
    padding: 20px 18px 60px;
    padding-top: 64px; /* ハンバーガーボタン分の余白 */
  }

  .help-section {
    max-width: 100%;
    margin-bottom: 40px;
    scroll-margin-top: 16px;
  }

  /* フィーチャーグリッドを1〜2列に */
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  /* テーブルのはみ出し防止 */
  .format-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* スクリーンショット */
  .screenshot-placeholder {
    padding: 12px;
  }

  /* ステップリスト */
  .step-list li {
    gap: 10px;
  }

  /* h1/h2 サイズ調整 */
  h1 { font-size: 22px; }
  h2 { font-size: 17px; }
}

@media (max-width: 400px) {
  .feature-grid {
    grid-template-columns: 1fr;
  }

  #content {
    padding-left: 14px;
    padding-right: 14px;
  }
}
