/**
 * 投稿・固定ページのコンテンツスタイル
 * .contentクラス内のみに適用
 */

/* ============================================
   見出しスタイル (Heading Styles)
   ============================================ */

.content h1 {
  font-size: 2em;
  font-weight: 700;
  line-height: 1.6;
  color: #333;
  margin: 1.8em 0 1em;
  padding-bottom: 0.5em;
  border-bottom: 2px solid #e8e8e8;
  letter-spacing: -0.02em;
}

.content h1:first-child {
  margin-top: 0;
}

.content h2 {
  font-size: 1.75em;
  font-weight: 700;
  line-height: 1.6;
  color: #333;
  margin: 1.6em 0 0.9em;
  padding: 0.3em 0 0.3em 0.6em;
  position: relative;
  letter-spacing: -0.01em;
}

.content h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.5em;
  bottom: 0.5em;
  width: 4px;
  background: linear-gradient(180deg, #00A040 0%, #4DB366 100%);
  border-radius: 2px;
}

.content h3 {
  font-size: 1.5em;
  font-weight: 700;
  line-height: 1.6;
  color: #333;
  margin: 1.4em 0 0.7em;
  padding-top: 0.2em;
  padding-bottom: 0.2em;
  border-left: none !important;
  padding-left: 0 !important;
}

.content h4 {
  font-size: 1.3em;
  font-weight: 700;
  line-height: 1.6;
  color: #333;
  margin: 1.2em 0 0.5em;
  padding-top: 0.2em;
  padding-bottom: 0.2em;
  border-left: none !important;
  padding-left: 0 !important;
}

.content h5 {
  font-size: 1.3em;
  font-weight: 700;
  line-height: 1.7;
  color: #444;
  margin: 1.2em 0 0.5em;
}

.content h6 {
  font-size: 1.15em;
  font-weight: 700;
  line-height: 1.7;
  color: #555;
  margin: 1em 0 0.4em;
}

/* ============================================
   段落とテキストスタイル (Paragraph & Text Styles)
   ============================================ */

.content {
  font-size: 16px;
}

.content p {
  font-size: 1em;
  line-height: 1.9;
  color: #333;
  margin: 0 0 1.3em;
  letter-spacing: 0.01em;
}

.content p:last-child {
  margin-bottom: 0;
}

/* ============================================
   太字スタイル (Bold Styles)
   ============================================ */

.content strong,
.content b {
  font-weight: 700;
  color: #2c3e50;
  background: linear-gradient(transparent 60%, rgba(0, 160, 64, 0.15) 60%);
  padding: 0 0.1em;
}

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

/* ============================================
   箇条書きスタイル (List Styles)
   ============================================ */

.content ul,
.content ol {
  margin: 1.5em 0;
  padding-left: 0;
  list-style: none;
}

.content ul li,
.content ol li {
  position: relative;
  padding-left: 1.8em;
  margin-bottom: 0.7em;
  line-height: 1.9;
  color: #333;
  font-size: 1em;
}

.content ul li:before {
  content: "•";
  position: absolute;
  left: 0.5em;
  color: #00A040;
  font-size: 1.2em;
  font-weight: bold;
  line-height: 1.5;
}

.content ol {
  counter-reset: list-counter;
}

.content ol li {
  counter-increment: list-counter;
  padding-left: 2.2em;
}

.content ol li:before {
  content: counter(list-counter) ".";
  position: absolute;
  left: 0.5em;
  color: #00A040;
  font-weight: 700;
  font-size: 1em;
  min-width: 1.5em;
  text-align: right;
}

/* ネストされたリスト */
.content ul ul,
.content ol ol,
.content ul ol,
.content ol ul {
  margin: 0.8em 0 0.8em 1.5em;
}

.content ul ul li:before {
  content: "◦";
  color: #4DB366;
  font-size: 1em;
}

.content ul ul ul li:before {
  content: "▪";
  color: #80C680;
  font-size: 0.9em;
}

/* ============================================
   引用スタイル (Blockquote Styles)
   ============================================ */

.content blockquote {
  margin: 1.5em 0;
  padding: 1em 1.5em;
  border-left: 4px solid #00A040;
  background-color: #f0f8f3;
  color: #555;
  font-style: italic;
  line-height: 1.9;
  font-size: 1em;
  border-radius: 0 4px 4px 0;
}

.content blockquote p {
  margin: 0;
  color: #555;
}

.content blockquote p:not(:last-child) {
  margin-bottom: 0.8em;
}

/* ============================================
   リンクスタイル (Link Styles)
   ============================================ */

.content a {
  color: #00A040;
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 160, 64, 0.3);
  transition: all 0.2s ease;
}

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

/* ============================================
   コードスタイル (Code Styles)
   ============================================ */

/* インラインコード（pre内でないもの） */
.content code:not(pre code) {
  background-color: #e8f5eb;
  color: #008030;
  padding: 0.15em 0.5em;
  border-radius: 4px;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', 'Droid Sans Mono', 'Source Code Pro', 'Courier New', Courier, monospace;
  font-size: 0.9em;
  line-height: 1.5;
  border: 1px solid #b8d9c0;
  font-weight: 500;
}

/* コードブロック */
.content pre {
  background-color: #1e1e1e;
  color: #d4d4d4;
  padding: 1.5em;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1.8em 0;
  border: 1px solid #3e3e3e;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  position: relative;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', 'Droid Sans Mono', 'Source Code Pro', 'Courier New', Courier, monospace;
  font-size: 0.9em;
  line-height: 1.6;
}


.content pre code {
  background-color: transparent;
  padding: 0;
  color: #d4d4d4;
  border-radius: 0;
  border: none;
  font-size: inherit;
  display: block;
  white-space: pre;
}

/* シンタックスハイライト風の色分け（基本的な要素） */
.content pre code .keyword {
  color: #569cd6;
}

.content pre code .string {
  color: #ce9178;
}

.content pre code .comment {
  color: #6a9955;
  font-style: italic;
}

.content pre code .function {
  color: #dcdcaa;
}

.content pre code .number {
  color: #b5cea8;
}

.content pre code .variable {
  color: #9cdcfe;
}

.content pre code .operator {
  color: #d4d4d4;
}

/* スクロールバーのスタイル */
.content pre::-webkit-scrollbar {
  height: 8px;
}

.content pre::-webkit-scrollbar-track {
  background: #2d2d2d;
  border-radius: 4px;
}

.content pre::-webkit-scrollbar-thumb {
  background: #555;
  border-radius: 4px;
}

.content pre::-webkit-scrollbar-thumb:hover {
  background: #666;
}

/* ============================================
   水平線スタイル (HR Styles)
   ============================================ */

.content hr {
  border: none;
  border-top: 2px solid #e8e8e8;
  margin: 2em 0;
  height: 0;
}

/* ============================================
   テーブルスタイル (Table Styles)
   ============================================ */

.content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 1.05em;
}

.content table th {
  background-color: #f8f9fa;
  font-weight: 700;
  padding: 0.8em;
  text-align: left;
  border-bottom: 2px solid #dee2e6;
  color: #333;
}

.content table td {
  padding: 0.8em;
  border-bottom: 1px solid #e8e8e8;
  color: #555;
}

.content table tr:hover {
  background-color: #f8f9fa;
}

/* ============================================
   画像スタイル (Image Styles)
   ============================================ */

.content img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 1.5em 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.content img.alignleft {
  float: left;
  margin: 0 1.5em 1em 0;
}

.content img.alignright {
  float: right;
  margin: 0 0 1em 1.5em;
}

.content img.aligncenter {
  display: block;
  margin: 1.5em auto;
}

/* ============================================
   定義リストスタイル (Definition List Styles)
   ============================================ */

.content dl {
  margin: 1.5em 0;
}

.content dt {
  font-weight: 700;
  color: #333;
  margin-top: 1em;
  margin-bottom: 0.3em;
}

.content dd {
  margin-left: 1.5em;
  color: #555;
  line-height: 1.9;
  margin-bottom: 0.8em;
  font-size: 1em;
}

/* ============================================
   レスポンシブ対応 (Responsive)
   ============================================ */

@media screen and (max-width: 768px) {
  .content {
    font-size: 15px;
  }

  .content h1 {
    font-size: 1.75em;
    margin: 1.5em 0 0.9em;
  }

  .content h2 {
    font-size: 1.5em;
    margin: 1.3em 0 0.7em;
    padding-left: 0.5em;
  }

  .content h2::before {
    left: 0;
    top: 0.4em;
    bottom: 0.4em;
  }

  .content h3 {
    font-size: 1.3em;
    margin: 1.2em 0 0.6em;
  }

  .content h4 {
    font-size: 1.15em;
    margin: 1em 0 0.5em;
  }

  .content p {
    font-size: 1em;
    line-height: 1.8;
  }

  .content ul li,
  .content ol li {
    padding-left: 1.65em;
    margin-bottom: 0.6em;
    font-size: 1em;
  }

  .content ul li:before {
    left: 0em;
  }

  .content ol li:before {
    left: 0em;
  }

  .content blockquote {
    padding: 0.8em 1em;
    margin: 1.2em 0;
    font-size: 1em;
  }

  .content table {
    font-size: 0.95em;
  }

  .content table th,
  .content table td {
    padding: 0.6em 0.5em;
  }

  .content pre {
    padding: 1em;
    font-size: 0.85em;
    margin: 1.5em 0;
  }

  .content code:not(pre code) {
    font-size: 0.85em;
    padding: 0.12em 0.4em;
  }
}

