/* ===================================
 * Markdown Preview Styles - Minimal & Simple Design
 * 記事プレビュー用のミニマルスタイル
 * =================================== */

/* 基本設定 */
.markdown-preview,
.article-content,
#article-preview-content {
  line-height: 1.8;
  color: #374151;
  font-size: 16px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* 見出し - ミニマルデザイン */
.markdown-preview h1,
.article-content h1,
#article-preview-content h1 {
  font-size: 32px;
  font-weight: 700;
  color: #111827;
  margin-top: 48px;
  margin-bottom: 24px;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.markdown-preview h2,
.article-content h2,
#article-preview-content h2 {
  font-size: 26px;
  font-weight: 600;
  color: #111827;
  margin-top: 40px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e5e7eb;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.markdown-preview h3,
.article-content h3,
#article-preview-content h3 {
  font-size: 22px;
  font-weight: 600;
  color: #1f2937;
  margin-top: 32px;
  margin-bottom: 12px;
  line-height: 1.5;
}

.markdown-preview h4,
.article-content h4,
#article-preview-content h4 {
  font-size: 18px;
  font-weight: 600;
  color: #374151;
  margin-top: 24px;
  margin-bottom: 10px;
  line-height: 1.5;
}

/* 段落 */
.markdown-preview p,
.article-content p,
#article-preview-content p {
  margin-bottom: 20px;
  line-height: 1.8;
}

/* 強調（太字） - シンプルなマーカー */
.markdown-preview strong,
.article-content strong,
#article-preview-content strong {
  font-weight: 600;
  color: #111827;
  background: linear-gradient(transparent 65%, rgba(253, 224, 71, 0.3) 65%);
  padding: 0 3px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* イタリック */
.markdown-preview em,
.article-content em,
#article-preview-content em {
  font-style: italic;
  color: #4b5563;
}

/* 箇条書き - ミニマルデザイン */
.markdown-preview ul,
.article-content ul,
#article-preview-content ul {
  margin: 24px 0;
  padding-left: 0;
  list-style: none;
}

.markdown-preview ol,
.article-content ol,
#article-preview-content ol {
  margin: 24px 0;
  padding-left: 0;
  list-style: none;
  counter-reset: item;
}

.markdown-preview li,
.article-content li,
#article-preview-content li {
  margin-bottom: 12px;
  padding-left: 32px;
  position: relative;
  line-height: 1.7;
}

/* 箇条書きマーカー - シンプルな点 */
.markdown-preview ul > li::before,
.article-content ul > li::before,
#article-preview-content ul > li::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 12px;
  width: 5px;
  height: 5px;
  background-color: #6b7280;
  border-radius: 50%;
}

/* 番号付きリストマーカー */
.markdown-preview ol > li,
.article-content ol > li,
#article-preview-content ol > li {
  counter-increment: item;
}

.markdown-preview ol > li::before,
.article-content ol > li::before,
#article-preview-content ol > li::before {
  content: counter(item) ".";
  position: absolute;
  left: 8px;
  color: #6b7280;
  font-weight: 600;
  font-size: 14px;
}

/* 入れ子のリスト */
.markdown-preview ul ul,
.markdown-preview ol ul,
.markdown-preview ul ol,
.markdown-preview ol ol,
.article-content ul ul,
.article-content ol ul,
.article-content ul ol,
.article-content ol ol,
#article-preview-content ul ul,
#article-preview-content ol ul,
#article-preview-content ul ol,
#article-preview-content ol ol {
  margin-top: 8px;
  margin-bottom: 8px;
}

/* ネストした箇条書きマーカー */
.markdown-preview ul ul > li::before,
.article-content ul ul > li::before,
#article-preview-content ul ul > li::before {
  width: 4px;
  height: 4px;
  background-color: #9ca3af;
}

/* 引用 - ミニマルデザイン（背景のみ） */
.markdown-preview blockquote,
.article-content blockquote,
#article-preview-content blockquote {
  margin: 28px 0;
  padding: 16px 20px;
  border: none;
  background: #f3f4f6;
  border-radius: 8px;
  font-style: normal;
  color: #4b5563;
}

.markdown-preview blockquote p,
.article-content blockquote p,
#article-preview-content blockquote p {
  margin: 0;
  line-height: 1.7;
}

.markdown-preview blockquote strong,
.article-content blockquote strong,
#article-preview-content blockquote strong {
  background: transparent;
  color: #111827;
  font-weight: 600;
}

/* ポイント・注意ボックス（背景のみ、縦線なし） */
.markdown-preview blockquote:has(p:first-child:contains("💡")),
.article-content blockquote:has(p:first-child:contains("💡")),
#article-preview-content blockquote:has(p:first-child:contains("💡")) {
  background: #eff6ff;
  color: #1e40af;
}

.markdown-preview blockquote:has(p:first-child:contains("⚠️")),
.article-content blockquote:has(p:first-child:contains("⚠️")),
#article-preview-content blockquote:has(p:first-child:contains("⚠️")) {
  background: #fffbeb;
  color: #92400e;
}

.markdown-preview blockquote:has(p:first-child:contains("✅")),
.article-content blockquote:has(p:first-child:contains("✅")),
#article-preview-content blockquote:has(p:first-child:contains("✅")) {
  background: #f0fdf4;
  color: #065f46;
}

/* 表（テーブル） - シンプルデザイン */
.markdown-preview table,
.article-content table,
#article-preview-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 28px 0;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0;
  font-size: 15px;
}

.markdown-preview thead,
.article-content thead,
#article-preview-content thead {
  background: #f9fafb;
  border-bottom: 2px solid #e5e7eb;
}

.markdown-preview th,
.article-content th,
#article-preview-content th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 14px;
  color: #374151;
  border-bottom: 2px solid #e5e7eb;
}

.markdown-preview td,
.article-content td,
#article-preview-content td {
  padding: 12px 16px;
  border-bottom: 1px solid #f3f4f6;
  color: #4b5563;
}

.markdown-preview tr:last-child td,
.article-content tr:last-child td,
#article-preview-content tr:last-child td {
  border-bottom: none;
}

.markdown-preview tbody tr:hover,
.article-content tbody tr:hover,
#article-preview-content tbody tr:hover {
  background-color: #fafafa;
}

/* コードブロック - ダークテーマ */
.markdown-preview pre,
.article-content pre,
#article-preview-content pre {
  background: #1f2937;
  color: #e5e7eb;
  padding: 20px;
  border-radius: 6px;
  overflow-x: auto;
  margin: 28px 0;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.6;
  border: 1px solid #374151;
}

/* インラインコード */
.markdown-preview code,
.article-content code,
#article-preview-content code {
  background: #f3f4f6;
  color: #dc2626;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Courier New', monospace;
  font-size: 14px;
  border: 1px solid #e5e7eb;
}

.markdown-preview pre code,
.article-content pre code,
#article-preview-content pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  border: none;
}

/* リンク - シンプル */
.markdown-preview a,
.article-content a,
#article-preview-content a {
  color: #3b82f6;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.markdown-preview a:hover,
.article-content a:hover,
#article-preview-content a:hover {
  border-bottom-color: #3b82f6;
}

/* 画像 */
.markdown-preview img,
.article-content img,
#article-preview-content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 28px 0;
  display: block;
}

/* 水平線 - ミニマル */
.markdown-preview hr,
.article-content hr,
#article-preview-content hr {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 40px 0;
}

/* チェックリスト */
.markdown-preview input[type="checkbox"],
.article-content input[type="checkbox"],
#article-preview-content input[type="checkbox"] {
  margin-right: 8px;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .markdown-preview,
  .article-content,
  #article-preview-content {
    font-size: 15px;
  }

  .markdown-preview h1,
  .article-content h1,
  #article-preview-content h1 {
    font-size: 28px;
    margin-top: 32px;
  }

  .markdown-preview h2,
  .article-content h2,
  #article-preview-content h2 {
    font-size: 24px;
    margin-top: 28px;
  }

  .markdown-preview h3,
  .article-content h3,
  #article-preview-content h3 {
    font-size: 20px;
    margin-top: 24px;
  }

  .markdown-preview pre,
  .article-content pre,
  #article-preview-content pre {
    padding: 16px;
    font-size: 13px;
  }

  .markdown-preview table,
  .article-content table,
  #article-preview-content table {
    font-size: 14px;
  }

  .markdown-preview th,
  .article-content th,
  #article-preview-content th,
  .markdown-preview td,
  .article-content td,
  #article-preview-content td {
    padding: 10px 12px;
  }
}

/* プリント用スタイル */
@media print {
  .markdown-preview,
  .article-content,
  #article-preview-content {
    color: #000;
  }

  .markdown-preview a,
  .article-content a,
  #article-preview-content a {
    color: #000;
    border-bottom: 1px solid #000;
  }

  .markdown-preview pre,
  .article-content pre,
  #article-preview-content pre {
    background: #f5f5f5;
    color: #000;
    border: 1px solid #ddd;
  }
}
