/* ========================================
   コラム・記事ページ共通CSS
   ======================================== */

/* 記事カード */
.article-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.article-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.1);
}
.article-card .card-thumbnail {
  position: relative;
  padding-top: 56.25%;
  overflow: hidden;
}
.article-card .card-thumbnail img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.article-card:hover .card-thumbnail img {
  transform: scale(1.05);
}
.article-card .card-body {
  padding: 20px 24px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.article-card .card-category {
  display: inline-flex;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 10px;
  width: fit-content;
}
.article-card .card-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.6;
  color: #1a1a2e;
  margin-bottom: 12px;
  flex: 1;
}
.article-card .card-meta {
  font-size: 0.8125rem;
  color: #9ca3af;
}

/* カテゴリカラー */
.category-form-abandonment { background: #eff6ff; color: #1E88E5; }
.category-channel { background: #f3e8ff; color: #7C3AED; }
.category-strategy { background: #ecfdf5; color: #059669; }
.category-case-study { background: #fef3c7; color: #d97706; }

/* 記事詳細 */
.article-detail {
  overflow: hidden;
}
.article-detail-header {
  padding: 2.5rem 2.5rem 0;
}
.article-detail-title {
  margin: 0;
}
.article-detail-thumbnail {
  aspect-ratio: 16 / 9;
  margin: 1.5rem 0;
  overflow: hidden;
  border-radius: 12px;
  background: #f3f4f6;
}
.article-detail-thumbnail img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.article-detail-title + .article-detail-summary {
  margin-top: 1.5rem;
}
.article-detail-summary {
  margin-bottom: 0;
  color: #4b5563;
  line-height: 1.9;
}
.article-detail-body {
  padding: 2rem 2.5rem 2.5rem;
}

/* サイドバー */
.article-sidebar {
  align-self: flex-start;
}
.sidebar-section {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  margin-bottom: 24px;
}
.sidebar-section h3 {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #e5e7eb;
}
.sidebar-tag {
  display: inline-flex;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8125rem;
  font-weight: 500;
  background: #f3f4f6;
  color: #4b5563;
  transition: all 0.2s;
}
.sidebar-tag:hover {
  background: #1E88E5;
  color: #fff;
}
.sidebar-article-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f3f4f6;
  transition: opacity 0.2s;
}
.sidebar-article-item:last-child {
  border-bottom: none;
}
.sidebar-article-item:hover {
  opacity: 0.7;
}
.sidebar-article-item .sidebar-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, #1E88E5, #7C3AED);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}
.sidebar-article-item .sidebar-title {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #374151;
  line-height: 1.5;
}

@media (min-width: 1024px) {
  .article-sidebar.is-toc-pinned {
    position: sticky;
    top: 104px;
    max-height: calc(100vh - 128px);
    overflow-y: scroll;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f8fafc;
  }
  .article-sidebar.is-toc-pinned::after {
    content: "";
    display: block;
    height: var(--article-sidebar-tail-space, 0px);
  }
  .article-sidebar.is-toc-pinned::-webkit-scrollbar {
    width: 8px;
  }
  .article-sidebar.is-toc-pinned::-webkit-scrollbar-track {
    background: #f8fafc;
    border-radius: 999px;
  }
  .article-sidebar.is-toc-pinned::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border: 2px solid #f8fafc;
    border-radius: 999px;
  }
  .article-sidebar.is-toc-pinned::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
  }
  .article-sidebar.is-toc-pinned .article-sidebar-toc h3 {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #fff;
  }
}

/* 記事目次 */
.article-toc-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.article-toc-list li {
  border-bottom: 1px solid #f3f4f6;
}
.article-toc-list li:last-child {
  border-bottom: none;
}
.article-toc-list a {
  display: block;
  padding: 10px 0;
  color: #4b5563;
  font-size: 0.8125rem;
  line-height: 1.6;
  transition: color 0.2s, background-color 0.2s, box-shadow 0.2s;
}
.article-toc-list a:hover {
  color: #1e88e5;
}
.article-toc-link {
  display: block;
  transition: color 0.2s, background-color 0.2s, box-shadow 0.2s;
}
.article-toc-link.is-active {
  padding-right: 12px;
  padding-left: 12px;
  border-radius: 0 8px 8px 0;
  background: #eff6ff;
  box-shadow: inset 3px 0 0 #1e88e5;
  color: #1565c0;
  font-weight: 700;
}
.article-mobile-toc {
  margin-bottom: 2rem;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #f9fafb;
}
.article-mobile-toc summary {
  cursor: pointer;
  padding: 16px 18px;
  color: #374151;
  font-size: 0.875rem;
  font-weight: 700;
}
.article-content .article-mobile-toc .article-toc-list {
  margin: 0;
  padding: 0 18px 14px;
  list-style: none;
}
.article-content .article-mobile-toc .article-toc-list li {
  margin: 0;
  font-size: inherit;
}
.article-content h2[id] {
  scroll-margin-top: 100px;
}

/* 関連記事 */
.article-related > h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1.5rem;
  color: #1a1a2e;
  font-size: 1.125rem;
  font-weight: 700;
}
.article-related > h2 > span {
  width: 4px;
  height: 24px;
  border-radius: 999px;
  background: linear-gradient(180deg, #1e88e5, #7c3aed);
}
.article-related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.related-article-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  border: 1px solid #f3f4f6;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  transition: transform 0.2s, box-shadow 0.2s;
}
.related-article-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(0,0,0,0.08);
}
.related-article-category {
  color: #1e88e5;
  font-size: 0.75rem;
  font-weight: 600;
}
.related-article-card strong {
  color: #374151;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.6;
}

/* 記事本文スタイル */
.article-content h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #1a1a2e;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-left: 16px;
  border-left: 4px solid #1E88E5;
  line-height: 1.6;
}
.article-content h2:first-of-type {
  margin-top: 0;
}
.article-content h3 {
  font-size: 1.0625rem;
  font-weight: 700;
  color: #1a1a2e;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  line-height: 1.6;
}
.article-content p {
  color: #4b5563;
  line-height: 2;
  margin-bottom: 1.25rem;
  font-size: 0.9375rem;
}
.article-content ul,
.article-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}
.article-content ul {
  list-style: disc;
}
.article-content ol {
  list-style: decimal;
}
.article-content ul li,
.article-content ol li {
  color: #4b5563;
  line-height: 2;
  margin-bottom: 0.375rem;
  font-size: 0.9375rem;
}
.article-content strong {
  color: #1a1a2e;
  font-weight: 700;
}
.article-content .text-red {
  color: #dc2626;
}
.article-content .text-font-size {
  font-size: var(--article-font-size);
}
.article-content .text-font-size code {
  font-size: inherit;
}

/* 記事内画像・出典 */
.article-content .article-image {
  margin: 2rem 0;
}
.article-content .article-image img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: 12px;
}
.article-content .article-image figcaption {
  margin-top: 0.5rem;
  color: #6b7280;
  font-size: 0.8125rem;
  line-height: 1.6;
  text-align: center;
}
.article-content .article-image .image-caption {
  display: block;
}
.article-content .article-image .image-source {
  display: block;
  margin: 0.25rem 0 0;
  color: #6b7280;
  font-size: 0.75rem;
  line-height: 1.6;
  text-align: center;
}
.article-content .article-image .image-source a {
  color: #6b7280;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.article-content .article-image .image-source a:hover {
  color: #1e88e5;
}

.article-content pre {
  overflow-x: auto;
  margin: 1.5rem 0;
  padding: 1rem;
  border-radius: 10px;
  background: #111827;
  color: #f9fafb;
  font-size: 0.875rem;
  line-height: 1.7;
}

.article-content blockquote {
  margin: 1.5rem 0;
  padding-left: 1rem;
  border-left: 4px solid #cbd5e1;
  color: #475569;
}

/* ティップスボックス */
.article-content .tip-box {
  background: #f0f9ff;
  border-left: 4px solid #1E88E5;
  padding: 16px 20px;
  border-radius: 0 12px 12px 0;
  margin: 1.5rem 0;
}
.article-content .tip-box p {
  margin-bottom: 0;
  font-size: 0.875rem;
  color: #374151;
  line-height: 1.8;
}

/* 注意ボックス */
.article-content .note-box {
  background: #fffbeb;
  border-left: 4px solid #f59e0b;
  padding: 16px 20px;
  border-radius: 0 12px 12px 0;
  margin: 1.5rem 0;
}
.article-content .note-box p {
  margin-bottom: 0;
  font-size: 0.875rem;
  color: #374151;
  line-height: 1.8;
}

/* 比較テーブル */
.article-content .comparison-table {
  overflow-x: auto;
  margin: 1.5rem 0;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
}
.article-content .comparison-table table {
  width: 100%;
  border-collapse: collapse;
  min-width: 400px;
}
.article-content .comparison-table th {
  background: #f9fafb;
  padding: 12px 16px;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #374151;
  text-align: left;
  border-bottom: 2px solid #e5e7eb;
  white-space: nowrap;
}
.article-content .comparison-table td {
  padding: 12px 16px;
  font-size: 0.875rem;
  color: #4b5563;
  border-bottom: 1px solid #f3f4f6;
}
.article-content .comparison-table tr:last-child td {
  border-bottom: none;
}

/* 図解ボックス */
.article-content .diagram-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 24px;
  margin: 1.5rem 0;
  text-align: center;
}
.article-content .diagram-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 1rem 0;
}
.article-content .diagram-flow .flow-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 600;
}
.article-content .diagram-flow .flow-arrow {
  color: #9ca3af;
  font-size: 1.25rem;
}

/* 記事内CTA */
.article-content .cta-box {
  background: linear-gradient(135deg, #eff6ff, #f3e8ff);
  border-radius: 16px;
  padding: 24px 28px;
  margin: 2rem 0;
  text-align: center;
}
.article-content .cta-box p {
  color: #1a1a2e;
}

/* ヒーロー */
.column-hero {
  background: linear-gradient(135deg, #1E88E5 0%, #7C3AED 100%);
  padding: 80px 0 48px;
}
@media (min-width: 1024px) {
  .column-hero {
    padding: 100px 0 56px;
  }
}

/* チャネル比較用スペック表 */
.article-content .spec-table {
  overflow-x: auto;
  margin: 1.5rem 0;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
}
.article-content .spec-table table {
  width: 100%;
  border-collapse: collapse;
  min-width: 500px;
}
.article-content .spec-table th {
  background: #f9fafb;
  padding: 12px 16px;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #374151;
  text-align: center;
  border-bottom: 2px solid #e5e7eb;
  border-right: 1px solid #e5e7eb;
}
.article-content .spec-table th:last-child {
  border-right: none;
}
.article-content .spec-table td {
  padding: 12px 16px;
  font-size: 0.875rem;
  color: #4b5563;
  text-align: center;
  border-bottom: 1px solid #f3f4f6;
  border-right: 1px solid #f3f4f6;
}
.article-content .spec-table td:first-child {
  text-align: left;
  font-weight: 600;
  background: #f9fafb;
  color: #374151;
}
.article-content .spec-table td:last-child {
  border-right: none;
}
.article-content .spec-table tr:last-child td {
  border-bottom: none;
}

/* レスポンシブ調整 */
@media (max-width: 640px) {
  .article-detail-header {
    padding: 1.5rem 1.5rem 0;
  }
  .article-detail-thumbnail {
    margin: 1.25rem 0;
    border-radius: 10px;
  }
  .article-detail-title + .article-detail-summary {
    margin-top: 1.25rem;
  }
  .article-detail-body {
    padding: 1.5rem;
  }
  .article-content .text-font-size {
    font-size: min(var(--article-font-size), 32px);
  }
  .article-content h2 {
    font-size: 1.125rem;
  }
  .article-content h3 {
    font-size: 1rem;
  }
  .article-content .cta-box {
    padding: 20px;
  }
  .sidebar-section {
    padding: 20px;
  }
  .article-related-grid {
    grid-template-columns: 1fr;
  }
}
