/* ===============================================
   content.css - スレッド本文・コメント表示用CSS
   =============================================== */

/* スレッド本文とコメントのHTMLスタイル - 読みやすさを重視 */
.content h1, .content h2, .content h3, .content h4, .content h5, .content h6 {
  margin: 20px 0 12px 0;
  font-weight: 600; /* boldより少し軽く */
  line-height: 1.4;
  letter-spacing: 0.5px;
}

/* 見出しの直後にテーブルがある場合のマージン調整を強化 */
.content h1 + table,
.content h2 + table,
.content h3 + table,
.content h4 + table,
.content h5 + table,
.content h6 + table {
  margin-top: 8px !important; /* より自然な余白に調整 */
}

/* 見出しの直後にul/olがある場合も調整 */
.content h1 + ul,
.content h2 + ul,
.content h3 + ul,
.content h4 + ul,
.content h5 + ul,
.content h6 + ul,
.content h1 + ol,
.content h2 + ol,
.content h3 + ol,
.content h4 + ol,
.content h5 + ol,
.content h6 + ol {
  margin-top: 10px !important;
}

/* 見出しの直後に段落がある場合のマージン調整 */
.content h1 + p,
.content h2 + p,
.content h3 + p,
.content h4 + p,
.content h5 + p,
.content h6 + p {
  margin-top: 8px;
}

/* 見出しサイズを明確に階層化 */
.content h1 { 
  font-size: 2.2em; 
  color: #222; 
  border-bottom: 3px solid #007bff; 
  padding-bottom: 8px; 
  font-weight: 700;
}

.content h2 { 
  font-size: 1.8em; 
  color: #333; 
  border-bottom: 2px solid #dee2e6; 
  padding-bottom: 5px; 
  font-weight: 600;
}

.content h3 { 
  font-size: 1.4em; 
  color: #444; 
  font-weight: 600;
  margin-bottom: 10px;
}

.content h4 { 
  font-size: 1.2em; 
  color: #555; 
  font-weight: 600;
  margin-bottom: 8px;
}

.content h5 { 
  font-size: 1.1em; 
  color: #666; 
  font-weight: 600;
}

.content h6 { 
  font-size: 1.05em; 
  color: #777; 
  font-weight: 600;
}

/* 一般テキストは通常の太さに */
.content p {
  margin: 12px 0;
  line-height: 1.7;
  font-size: 16px;
  font-weight: 400; /* 通常の太さ */
  color: #333;
}

/* 強調タグのスタイルを調整 */
.content strong, .content b {
  font-weight: 600; /* boldより少し軽く */
  color: #222;
}

.content em, .content i {
  font-style: italic;
  font-weight: 400; /* 通常の太さ */
  color: #555;
}

.content u {
  text-decoration: underline;
  font-weight: 400; /* 通常の太さ */
  color: #444;
}

/* リストスタイルを読みやすく */
.content ul, .content ol {
  margin: 15px 0;
  padding-left: 30px;
  font-weight: 400; /* 通常の太さ */
}

.content li {
  margin: 8px 0;
  line-height: 1.6;
  font-size: 16px;
  font-weight: 400; /* 通常の太さ */
  color: #333;
}

/* リスト内の強調は控えめに */
.content li strong, .content li b {
  font-weight: 600;
  color: #222;
}

.content li em, .content li i {
  font-style: italic;
  color: #555;
}

.content li u {
  text-decoration: underline;
  color: #444;
}

.content blockquote {
  margin: 15px 0;
  padding: 12px 20px;
  background: #f8f9fa;
  border-left: 4px solid #007bff;
  border-radius: 6px;
  font-style: italic;
  color: #666;
}

.content code {
  background: #f1f3f4;
  padding: 3px 8px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
  color: #d63384;
}

.content pre {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
  border: 1px solid #e9ecef;
  overflow-x: auto;
  margin: 15px 0;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
  line-height: 1.5;
}

.content pre code {
  background: none;
  padding: 0;
  color: #333;
}

.content a {
  color: #007bff;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: all 0.2s;
}

.content a:hover {
  color: #0056b3;
  border-bottom-color: #0056b3;
}

.content hr {
  margin: 20px 0;
  border: none;
  border-top: 2px solid #dee2e6;
}

.content div {
  margin: 8px 0;
}

.content span {
  /* spanタグのための基本スタイル */
}

/* テーブルスタイルも読みやすく調整 */
.content table {
  width: 100%;
  border-collapse: collapse;
  margin: 15px 0;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  border-radius: 8px;
  overflow: hidden;
  font-weight: 400; /* 通常の太さ */
}

.content table th,
.content table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid #e9ecef;
  vertical-align: top;
  font-size: 15px;
}

.content table th {
  background: #f8f9fa;
  font-weight: 600; /* 見出しのみ少し太く */
  color: #495057;
  border-bottom: 2px solid #dee2e6;
  position: relative;
  font-size: 16px;
}

.content table th:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0;
  top: 20%;
  height: 60%;
  width: 1px;
  background: #dee2e6;
}

.content table tbody tr:hover {
  background: #f8f9fa;
  transition: background-color 0.2s;
}

.content table tbody tr:last-child td {
  border-bottom: none;
}

.content table td {
  color: #555;
  line-height: 1.6;
  font-weight: 400; /* セル内容は通常の太さ */
}

/* テーブル内の強調も控えめに */
.content table td strong, .content table td b,
.content table th strong, .content table th b {
  font-weight: 600;
  color: #222;
}

.content table td em, .content table td i,
.content table th em, .content table th i {
  font-style: italic;
  color: #666;
}

.content table td u, .content table th u {
  text-decoration: underline;
  color: #444;
}

.content table caption {
  caption-side: top;
  padding: 10px;
  font-weight: bold;
  color: #333;
  text-align: center;
  background: #e9ecef;
  border-radius: 6px 6px 0 0;
}

/* ストライプ表示（オプション） */
.content table tbody tr:nth-child(even) {
  background: #f9f9f9;
}

.content table tbody tr:nth-child(even):hover {
  background: #f1f1f1;
}