/* 記事ページ専用スタイル */

/* パンくずリスト */
.breadcrumb {
    background: var(--bg-light);
    padding: 1rem 0;
    margin-top: 80px;
}

.breadcrumb ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.breadcrumb li::after {
    content: '>';
    margin-left: 0.5rem;
    color: var(--text-light);
}

.breadcrumb li:last-child::after {
    display: none;
}

.breadcrumb a {
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition);
}

.breadcrumb a:hover {
    color: var(--primary-color);
}

/* 記事レイアウト */
.article-main {
    padding: 40px 0 80px;
}

.article-container {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 3rem;
}

/* 記事ヘッダー */
.article-header {
    margin-bottom: 2rem;
}

.article-meta-top {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

.article-title {
    font-size: 2.5rem;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.article-lead {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.article-info {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--bg-gray);
    font-size: 0.875rem;
    color: var(--text-light);
}

/* 目次 */
.table-of-contents {
    background: var(--bg-light);
    padding: 2rem;
    border-radius: 10px;
    margin: 2rem 0;
}

.table-of-contents h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.table-of-contents ol {
    list-style: none;
    counter-reset: toc-counter;
}

.table-of-contents li {
    counter-increment: toc-counter;
    position: relative;
    padding-left: 2rem;
    margin-bottom: 0.5rem;
}

.table-of-contents li::before {
    content: counter(toc-counter) ".";
    position: absolute;
    left: 0;
    font-weight: 600;
    color: var(--primary-color);
}

.table-of-contents a {
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
}

.table-of-contents a:hover {
    color: var(--primary-color);
}

/* 記事本文 */
.article-body {
    font-size: 1.0625rem;
    line-height: 1.8;
}

.article-body h2 {
    font-size: 1.875rem;
    margin: 3rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--primary-color);
}

.article-body h3 {
    font-size: 1.375rem;
    margin: 2rem 0 1rem;
    color: var(--text-color);
}

.article-body p {
    margin-bottom: 1.5rem;
}

.article-body ul,
.article-body ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

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

/* ハイライトボックス */
.highlight-box {
    background: var(--bg-light);
    border-left: 4px solid var(--primary-color);
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 0 10px 10px 0;
}

.highlight-box h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

/* ステップリスト */
.step-list {
    list-style: none;
    padding: 0;
    counter-reset: step-counter;
}

.step-list li {
    counter-increment: step-counter;
    position: relative;
    padding-left: 3rem;
    margin-bottom: 2rem;
}

.step-list li::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 0;
    width: 2.5rem;
    height: 2.5rem;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

/* データテーブル */
.table-wrapper {
    overflow-x: auto;
    margin: 2rem 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
}

/* スクロールヒント */
.table-wrapper::after {
    content: "← 横にスクロールできます →";
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8rem;
    color: var(--text-light);
    display: none;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px; /* テーブル最小幅を設定 */
    border: 1px solid var(--bg-gray);
}

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: left;
    border-right: 1px solid var(--bg-gray);
    border-bottom: 1px solid var(--bg-gray);
    font-size: 0.9rem;
    white-space: nowrap;
}

.data-table th:last-child,
.data-table td:last-child {
    border-right: none;
}

.data-table th {
    background: var(--bg-light);
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.85rem;
    border-top: none;
}

.data-table tr:hover {
    background: var(--bg-light);
}

/* 全テーブル共通の改善されたスタイル */
.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.article-body table th,
.article-body table td {
    padding: 0.75rem;
    text-align: left;
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.9rem;
}

.article-body table th:last-child,
.article-body table td:last-child {
    border-right: none;
}

.article-body table th {
    background: #e2e8f0;
    font-weight: 600;
    color: var(--text-color);
    border-top: none;
}

.article-body table tbody tr:nth-child(even) {
    background: #fafbfc;
}

.article-body table tbody tr:hover {
    background: #f1f5f9;
}

/* サマリーボックス */
.summary-box {
    background: #f5f3ff;
    border: 2px solid var(--primary-color);
    padding: 2rem;
    border-radius: 10px;
    margin: 2rem 0;
}

.summary-box h3 {
    margin-top: 0;
    color: var(--primary-color);
}

/* 記事CTA */
.article-cta {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 3rem;
    border-radius: 10px;
    text-align: center;
    margin: 3rem 0;
}

.article-cta h3 {
    color: var(--white);
    margin-bottom: 1rem;
}

.article-cta p {
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

/* 関連記事 */
.related-articles {
    margin-top: 4rem;
    margin-bottom: 4rem;
    padding-top: 3rem;
    border-top: 1px solid var(--bg-gray);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.related-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: var(--transition);
}

.related-card {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: 10px;
    transition: var(--transition);
    height: 100%;
    cursor: pointer;
}

.related-card-link:hover .related-card {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.related-card h3 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    transition: var(--transition);
}

.related-card p {
    color: var(--text-light);
    transition: var(--transition);
}

.related-card-link:hover .related-card h3 {
    color: var(--primary-color);
}

/* サイドバー */
.article-sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.sidebar-widget {
    background: var(--white);
    border: 1px solid var(--bg-gray);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.sidebar-widget h3 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

/* 著者プロフィール */
.author-profile {
    text-align: center;
}

.author-avatar {
    width: 80px;
    height: 80px;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    margin: 0 auto 1rem;
}

.author-profile h4 {
    margin-bottom: 0.5rem;
}

.author-profile p {
    font-size: 0.875rem;
    color: var(--text-light);
}

/* 人気記事リスト */
.popular-list {
    list-style: none;
    counter-reset: popular-counter;
}

.popular-list li {
    counter-increment: popular-counter;
    position: relative;
    padding-left: 2rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--bg-gray);
}

.popular-list li:last-child {
    border-bottom: none;
}

.popular-list li::before {
    content: counter(popular-counter);
    position: absolute;
    left: 0;
    top: 0;
    width: 1.5rem;
    height: 1.5rem;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

.popular-list a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.875rem;
    line-height: 1.4;
    transition: var(--transition);
}

.popular-list a:hover {
    color: var(--primary-color);
}

/* カテゴリーリスト */
.category-list {
    list-style: none;
}

.category-list li {
    margin-bottom: 0.5rem;
}

.category-list a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.875rem;
    transition: var(--transition);
    display: flex;
    justify-content: space-between;
}

.category-list a:hover {
    color: var(--primary-color);
}

/* レスポンシブ */
@media (max-width: 1024px) {
    .article-container {
        grid-template-columns: 1fr;
    }
    
    .article-sidebar {
        position: static;
        margin-top: 3rem;
    }
    
    .sidebar-widget {
        display: inline-block;
        width: calc(50% - 1rem);
        margin-right: 2rem;
        vertical-align: top;
    }
    
    .sidebar-widget:nth-child(even) {
        margin-right: 0;
    }
}

@media (max-width: 768px) {
    /* 記事タイトル */
    .article-title {
        font-size: 1.8rem;
        line-height: 1.3;
    }
    
    /* 記事本文 */
    .article-body {
        font-size: 14px;
        line-height: 1.6;
    }
    
    .article-body h2 {
        font-size: 1.4rem;
        margin: 2rem 0 1rem;
    }
    
    .article-body h3 {
        font-size: 1.2rem;
        margin: 1.5rem 0 0.8rem;
    }
    
    .article-body p {
        margin-bottom: 1.2rem;
    }
    
    /* テーブル改善 */
    .table-wrapper::after {
        display: block; /* スクロールヒントを表示 */
    }
    
    .data-table th,
    .data-table td {
        padding: 0.6rem 0.5rem;
        font-size: 0.8rem;
    }
    
    .data-table th {
        font-size: 0.75rem;
    }
    
    /* その他要素 */
    .related-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .sidebar-widget {
        display: block;
        width: 100%;
        margin-right: 0;
        margin-bottom: 1.5rem;
    }
    
    .article-cta {
        padding: 2rem 1.5rem;
    }
    
    .summary-box {
        padding: 1.5rem;
        margin: 1.5rem 0;
    }
}

@media (max-width: 480px) {
    /* 小画面記事調整 */
    .article-title {
        font-size: 1.5rem;
        line-height: 1.3;
    }
    
    .article-body {
        font-size: 13px;
        line-height: 1.6;
    }
    
    .article-body h2 {
        font-size: 1.3rem;
        margin: 1.5rem 0 0.8rem;
    }
    
    .article-body h3 {
        font-size: 1.1rem;
        margin: 1.2rem 0 0.6rem;
    }
    
    /* テーブル最適化 */
    .data-table th,
    .data-table td {
        padding: 0.5rem 0.4rem;
        font-size: 0.75rem;
        line-height: 1.3;
    }
    
    .data-table th {
        font-size: 0.7rem;
    }
    
    .data-table {
        min-width: 400px; /* 小画面用最小幅 */
    }
    
    /* メタ情報 */
    .article-meta-top {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .article-info {
        gap: 0.8rem;
        font-size: 0.8rem;
    }
    
    /* その他 */
    .article-cta {
        padding: 1.5rem 1rem;
    }
    
    .summary-box {
        padding: 1.2rem;
        margin: 1.2rem 0;
    }
    
    .breadcrumb {
        padding: 0.8rem 0;
    }
    
    .breadcrumb ul {
        font-size: 0.75rem;
    }
}