/*
 * 記事詳細ページ (`articles/show.php`) 専用スタイル
 */

/* ページ全体のレイアウト */
.article-page-container {
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 40px;
    display: grid;
    grid-template-columns: 1fr 320px; /* メインコンテンツとサイドバーの幅 */
    gap: 40px;
    align-items: start;
}

/* メインコンテンツエリア */
.main-content {
    /* background: white; */ /* styles.cssでbodyに設定されているので不要 */
    padding: 30px 40px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

/* 記事ヘッダー */
.article-header .featured-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 25px;
    object-fit: cover;
}

.article-header .article-title {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
    line-height: 1.4;
    margin-bottom: 10px;
}

.article-header .article-published-date {
    font-size: 0.9rem;
    color: #888;
    display: block;
    margin-bottom: 30px;
}

/* 目次コンテナ */
.toc-container {
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 20px 25px;
    margin-bottom: 40px;
}

.toc-container h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
    color: #333;
}

.toc-container ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-container li {
    margin-bottom: 10px;
}

.toc-container a {
    text-decoration: none;
    color: #555;
    transition: color 0.2s ease;
}

.toc-container a:hover {
    color: #c20c24;
}

/* 記事本文 */
.article-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #444;
}

.article-content h2 {
    font-size: 1.6rem;
    font-weight: 600;
    color: #333;
    margin: 40px 0 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #c20c24; /* REVIのブランドカラー */
}

.article-content h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
    margin: 30px 0 15px;
    padding-left: 15px;
    border-left: 4px solid #c20c24; /* REVIのブランドカラー */
}

.article-content p {
    margin-bottom: 1.5em;
}

.article-content a {
    color: #c20c24;
    text-decoration: none;
    border-bottom: 1px dotted #c20c24;
    transition: all 0.2s ease;
}

.article-content a:hover {
    color: #fff;
    background-color: #c20c24;
    border-bottom-color: #c20c24;
}

.article-content strong {
    font-weight: 600;
    background: linear-gradient(transparent 60%, #ffd9e0 60%); /* REVIのブランドカラーに合わせたマーカー */
}

.article-content ul,
.article-content ol {
    margin: 20px 0 20px 20px;
    padding-left: 20px;
}

.article-content li {
    margin-bottom: 10px;
}

/* 記事一覧へ戻るボタン */
.back-to-list {
    display: inline-block;
    margin-top: 40px;
    padding: 12px 30px;
    background: #f1f1f1;
    color: #555;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.back-to-list:hover {
    background: #e0e0e0;
    color: #333;
}

/* サイドバー */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.sidebar-box {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.sidebar-box h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

/* サイドバー：関連商品 */
.related-product-item {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    color: inherit;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}
.related-product-item:last-child {
    border-bottom: none;
}
.related-product-item:hover {
    background-color: #fafafa;
}
.related-product-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 5px;
    flex-shrink: 0;
}
.related-product-info .related-product-name {
    font-size: 0.9rem;
    font-weight: 500;
    margin: 0 0 5px 0;
}
.related-product-info .related-product-price {
    font-size: 0.9rem;
    font-weight: 600;
    color: #c20c24;
    margin: 0;
}

/* サイドバー：関連記事・カテゴリ */
.related-link {
    display: block;
    padding: 10px;
    margin: 5px 0;
    color: #555;
    text-decoration: none;
    transition: all 0.3s;
    font-size: 0.9rem;
    border-radius: 5px;
}
.related-link:hover {
    background: #f5f5f5;
    color: #c20c24;
    transform: translateX(5px);
}

/* レスポンシブ対応 */
@media (max-width: 992px) {
    .article-page-container {
        grid-template-columns: 1fr; /* 1カラムレイアウトに */
        padding: 0 20px;
    }
    .main-content {
        padding: 20px;
    }
    .article-header .article-title {
        font-size: 1.8rem;
    }
    .article-content {
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    .article-page-container {
        margin: 20px auto;
    }
}
