/* 記事コンテンツのスタイリング */
.article-content {
  font-size: 16px;
  line-height: 1.9;
  color: #3a4657;
}

.article-content > * + * {
  margin-top: 1.5rem;
}

/* 見出しスタイル */
.article-content h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary-text);
  margin-top: 3rem;
  margin-bottom: 1.25rem;
  padding: 1rem;
  background-color: #f5f8fb;
  border-radius: var(--radius-lg);
  line-height: 1.4;
  scroll-margin-top: 80px; /* 固定ヘッダー対策：目次クリック時に見出しがヘッダーに隠れないよう調整 */
}

.article-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-primary-text);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-left: 1rem;
  border-left: 4px solid #8bb2f0;
  line-height: 1.5;
}

.article-content h4 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-primary-text);
  margin-top: 2rem;
  margin-bottom: 0.875rem;
  line-height: 1.5;
}

/* 段落 */
.article-content p {
  margin-bottom: 1.5rem;
}

/* リンク */
.article-content a {
  color: #2563eb;
  text-decoration: underline;
  transition: opacity 0.2s ease;
}

.article-content a:visited {
  color: #2563eb;
}

.article-content a:hover {
  opacity: 0.8;
}

/* 通常の箇条書きデザイン */
.article-content ul.normal {
  margin: 2rem auto;
  padding: 1.25rem 1.5rem;
  background: #f8f9fa;
  border-radius: 0.5rem;
  line-height: 1.8;
  list-style-type: none;
}

.article-content ul.normal li {
  position: relative;
  padding: 0;
  margin: 0;
  padding-left: 0.85rem;
}

.article-content ul.normal li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.45rem;
  width: 10px;
  height: 10px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23000000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12.1' cy='12.1' r='1'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

.article-content ul.normal li > p {
  margin-bottom: 0;
}

/* POINTキャプション付きulデザイン */
.article-content ul.point-list {
  position: relative;
  list-style-type: none;
  padding: 1.5rem 1.5rem 1rem 2rem;
  margin-bottom: 1.5rem;
  border: 2px solid #8bb2f0;
  border-radius: 0.5rem;
  background: var(--color-card-bg);
}

.article-content ul.point-list::before {
  content: "POINT";
  position: absolute;
  top: -1.05rem;
  left: 1.25rem;
  padding: 0 0.75rem;
  background: var(--color-card-bg);
  color: #8bb2f0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.article-content ul.point-list li {
  position: relative;
  padding: 0.5rem 0 0.5rem 1.25rem;
  margin-bottom: 0;
  border-bottom: 1px dashed #4e555e;
}

.article-content ul.point-list li:last-child {
  border-bottom: none;
}

.article-content ul.point-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 1.2rem;
  display: inline-block;
  width: 0.625rem;
  height: 0.3125rem;
  border-bottom: 2px solid #8bb2f0;
  border-left: 2px solid #8bb2f0;
  transform: rotate(-45deg);
}

.article-content ul.point-list li > p {
  margin-bottom: 0.5rem;
}

/* 参考リンク集デザイン */
.article-content ul.reference-links {
  list-style-type: none;
  padding-left: 0;
  margin-bottom: 1.5rem;
  font-size: 14px;
}

.article-content ul.reference-links li {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.50rem;
  padding: 0.5rem 0;
  margin-bottom: 0;
  border-bottom: 1px dashed #4e555e;
}

.article-content ul.reference-links li:last-child {
  border-bottom: none;
}

.article-content ul.reference-links li::before {
  content: '';
  display: block;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 0.35rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234a4a4a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='18' height='18' x='3' y='3' rx='2'/%3E%3Cpath d='m10 8 4 4-4 4'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

.article-content ul.reference-links a {
  color: #3a4657;
  text-decoration: underline;
  transition: filter 0.2s ease;
}

.article-content ul.reference-links a:visited {
  color: #3a4657;
}

.article-content ul.reference-links a:hover {
  filter: brightness(1.5);
}

/* 手順についてキャプション付きolデザイン */
.article-content ol.procedure-steps {
  position: relative;
  list-style-type: decimal;
  padding: 3rem 1.5rem 0.5rem 2.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid #dbc4a7;
  border-radius: 0.5rem;
  background: #fbf8f5;
  overflow: hidden;
}

.article-content ol.procedure-steps::before {
  content: "手順について";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 0.3rem 0;
  background: #dbc4a7;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.05em;
}

.article-content ol.procedure-steps li {
  padding: 0.5rem 0;
  margin-bottom: 0;
  border-bottom: 1px dashed #4e555e;
}

.article-content ol.procedure-steps li:last-child {
  border-bottom: none;
}

.article-content ol.procedure-steps li::marker {
  color: #dbc4a7;
  font-weight: 700;
}

.article-content ol.procedure-steps li > p {
  margin-bottom: 0.5rem;
}

/* スマホ時のol.procedure-steps余白調整 */
@media (max-width: 767px) {
  .article-content ol.procedure-steps {
    padding: 3.0rem 1.0rem 0.5rem 2.0rem;
  }
}

/* 通常の番号リスト */
.article-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}

.article-content ol li {
  margin-bottom: 0.5rem;
}

.article-content ol li > p {
  margin-bottom: 0.5rem;
}

/* 引用 */
.article-content blockquote {
  border-left: 4px solid var(--color-accent);
  background: var(--color-secondary-bg);
  padding: 1rem 1.25rem;
  margin: 2rem 0;
  border-radius: 0 0.5rem 0.5rem 0;
}

.article-content blockquote p {
  margin-bottom: 0;
}

/* コード */
.article-content code {
  background: var(--color-secondary-bg);
  color: var(--color-error);
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-size: 0.9em;
}

.article-content pre {
  background: var(--color-primary-text);
  color: white;
  padding: 1.25rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin: 2rem 0;
}

.article-content pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

/* 強調 */
.article-content strong {
  color: var(--color-primary-text);
  font-weight: 600;
  background: linear-gradient(transparent 60%, #fcf597 60%);
}

/* 水平線 */
.article-content hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 3rem 0;
}

/* 画像 */
.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  margin: 2rem 0;
}

/* テーブル */
.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
}

.article-content th,
.article-content td {
  border: 1px solid var(--color-border);
  padding: 0.75rem;
  text-align: left;
}

.article-content th {
  background: var(--color-secondary-bg);
  font-weight: 600;
  color: var(--color-primary-text);
}

/* 補足（asideタグ） */
.article-content aside {
  margin: 2rem auto;
  padding: 1.25rem 1.5rem;
  background: #fffcef;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  gap: 1.0rem;
  font-size: 0.875rem;
  line-height: 1.8;
}

.article-content aside::before {
  content: '';
  display: block;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%234a4a4a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4'/%3E%3Cpath d='M2 6h4'/%3E%3Cpath d='M2 10h4'/%3E%3Cpath d='M2 14h4'/%3E%3Cpath d='M2 18h4'/%3E%3Cpath d='M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

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

/* Amazonリンクボックス */
.article-content .amazon-box {
  margin: 2rem auto;
  padding: 1.25rem 1.5rem;
  background: #ffffff;
  border: 3px solid #f5f8fb;
  border-radius: 0.5rem;
  line-height: 1.8;
}

.article-content .amazon-box-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.article-content .amazon-box-title a {
  color: var(--color-accent);
  text-decoration: underline;
}

.article-content .amazon-box-title a:visited {
  color: var(--color-accent);
}

.article-content .amazon-box-title a:hover {
  opacity: 0.8;
}

.article-content .amazon-box-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.article-content .amazon-box-description {
  flex: 1;
  font-size: 14px;
  line-height: 1.35;
  color: var(--color-secondary-text);
}

.article-content .amazon-box-link {
  flex-shrink: 0;
  display: inline-block;
  padding: 0.5rem 1.25rem;
  background: #ffd814;
  color: #000000;
  text-decoration: none;
  border-radius: 0.375rem;
  font-size: 14px;
  font-weight: 600;
  transition: opacity 0.2s ease;
}

.article-content .amazon-box-link:visited {
  color: #000000;
}

.article-content .amazon-box-link:hover {
  opacity: 0.8;
}

/* サイドバー カスタマイズ枠 */
.sidebar-customize-area {
  width: 100%;
  margin-bottom: 1.5rem;
}

/* サイドバー 目次 */
.sidebar-toc-area {
  background: var(--color-secondary-bg);
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  padding: 1.5rem;
}

.sidebar-toc-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-primary-text);
  margin-bottom: 1rem;
}

.sidebar-toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-toc-item {
  margin-bottom: 0;
  padding-bottom: 0.75rem;
  border-bottom: 1px dashed #9ca3af;
}

.sidebar-toc-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.sidebar-toc-item:not(:last-child) {
  margin-bottom: 0.75rem;
}

.sidebar-toc-depth-2 {
  padding-left: 0;
}

.sidebar-toc-depth-3 {
  padding-left: 1.25rem;
  font-size: 0.9375rem;
}

.sidebar-toc-link {
  color: var(--color-accent);
  text-decoration: none;
  transition: text-decoration 0.2s ease;
  display: block;
  line-height: 1.6;
}

.sidebar-toc-link:hover {
  text-decoration: underline;
}

/* 記事フッター カテゴリリンク */
.article-category-link {
  display: inline-block;
  background: white;
  color: #2563eb;
  border: 1px solid #2563eb;
  border-radius: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
}

.article-category-link:visited {
  color: #2563eb;
}

.article-category-link:hover {
  background: #f8f9fa;
}

/* デスクトップ閲覧時の記事詳細ページ専用調整 */
@media (min-width: 768px) {
  /* テーブルスタイル */
  .article-content th,
  .article-content td {
    border: 1px solid #bbc4ce;
  }

  .article-content th {
    background: #f1f3f6;
    text-align: center;
  }
}

/* スマートフォン閲覧時の記事詳細ページ専用調整 */
@media (max-width: 767px) {
  /* 記事ページのcontainerの左右paddingを12pxに */
  .article-page-container {
    padding-left: 12px;
    padding-right: 12px;
  }

  /* h4のフォントサイズ調整 */
  .article-content h4 {
    font-size: 1.125rem;
  }

  /* スマホ時のul.normal余白調整 */
  .article-content ul.normal {
    padding: 1.0rem;
  }

  /* スマホ時のul.point-list余白調整 */
  .article-content ul.point-list {
    padding: 1.0rem;
  }

  /* カテゴリリンクボタンのスタイル調整 */
  .article-category-link {
    padding: 0.6rem 0.6rem;
    font-size: 0.85rem;
  }

  /* asideタグのスマホ調整 */
  .article-content aside {
    padding: 1.0rem;
  }

  .article-content aside::before {
    display: none;
  }

  /* amazon-boxのスマホ調整 */
  .article-content .amazon-box {
    padding: 1.0rem;
  }

  .article-content .amazon-box-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .article-content .amazon-box-link {
    width: 100%;
    text-align: center;
  }

  /* テーブルの横スクロール化（ハイブリッド案） */
  .article-content table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* スムーズなタッチスクロール */
    font-size: 1.0rem; /* 16px */
    margin: 1.5rem 0;
    /* 右端に軽い影を追加（スクロール可能であることを示唆） */
    box-shadow: 2px 0 4px -2px rgba(0, 0, 0, 0.1) inset;
    /* スクロールバーを常に表示（Firefox） */
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
  }

  /* スクロールバーを常に表示（Webkit: Chrome、Safari） */
  .article-content table::-webkit-scrollbar {
    height: 8px;
    -webkit-appearance: none;
  }

  .article-content table::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
  }

  .article-content table::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
  }

  .article-content table::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
  }

  .article-content th,
  .article-content td {
    padding: 0.5rem; /* 12px → 8px */
    white-space: nowrap; /* セル内テキストを折り返さない */
  }

  .article-content th {
    font-size: 1.0rem; /* 16px */
  }
}
