/* ==========================================================================
   1. トップページ用：記事セクション＆記事カードのレイアウト
   ========================================================================== */

/* トップページの記事セクション全体 */
.home-articles-section {
    margin-top: 60px;
    margin-bottom: 40px;
}

/* ライフプラン別紹介 / 雑記 の各ブロック */
.article-category-block {
    margin-bottom: 50px;
}

/* 記事カードを並べるグリッド（レスポンシブ対応） */
.article-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 20px;
}

/* 記事カード単体のスタイル */
.article-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

/* カードにホバーした際のアニメーション */
.article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.05);
    border-color: var(--primary);
}

/* カード全体のリンク領域化 */
.article-card a {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* カード内のタイトル */
.article-card h3 {
    font-size: 1.15rem;
    line-height: 1.5;
    color: var(--text);
    margin: 12px 0 0 0;
    font-weight: 600;
}

/* カードのホバー時にリンクテキストの色も変わるように */
.article-card:hover h3 {
    color: var(--primary);
}

/* タグ（体験談、こだわり、など） */
.article-card-tag {
    display: inline-block;
    align-self: flex-start;
    font-size: 0.75rem;
    font-weight: bold;
    background: var(--bg);
    color: var(--muted);
    padding: 4px 10px;
    border-radius: 6px;
    text-transform: uppercase;
}


/* ==========================================================================
   2. 各記事ページ用：全体のレイアウト＆タイポグラフィ
   ========================================================================== */

/* 記事単体ページのメインコンテナ（重複を解消し、.article-body に統一） */
.article-body {
    max-width: 760px; /* 文章を読みやすくするための幅 */
    margin: 40px auto;
    padding: 40px 30px;
    background: var(--card);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
    border: 1px solid var(--border);
}

/* 記事ヘッダー（タイトルと日付） */
.article-header {
    border-bottom: 2px solid var(--bg);
    margin-bottom: 35px;
    padding-bottom: 25px;
    text-align: center;
}

.article-title {
    font-size: 1.8rem;
    line-height: 1.4;
    color: var(--text);
    margin: 0 0 12px 0;
    font-weight: 700;
}

.article-meta {
    color: var(--muted);
    font-size: 0.9rem;
}

/* 記事内の文章装飾 */
.article-content {
    line-height: 1.85;
    font-size: 1.05rem;
    color: #334155; /* 既存の var(--text) より少し柔らかく読みやすい黒 */
}

/* 記事内の見出し（h2）※ツール部分の見出しと差別化・統一 */
.article-content h2 {
    font-size: 1.45rem;
    color: var(--text);
    border-left: 5px solid var(--primary);
    padding: 6px 0 6px 15px;
    margin: 45px 0 20px;
    background: var(--bg); /* 背景を薄いグレーにして視認性を向上 */
}

/* 記事内の見出し（h3） */
.article-content h3 {
    font-size: 1.2rem;
    color: var(--text);
    margin: 30px 0 15px;
}

.article-content p {
    margin-bottom: 1.6em;
}

.article-content ul {
    margin-bottom: 1.6em;
    padding-left: 1.5em;
}

.article-content li {
    margin-bottom: 0.6em;
}


/* ==========================================================================
   3. 記事ページ内：特殊パーツ（体験談ボックス / 比較テーブル）
   ========================================================================== */

/* 運営者の「体験談」ボックス */
.experience-card {
    background-color: #fff9eb; /* 暖かい暖色系 */
    border: 1px solid var(--accent);
    padding: 25px;
    border-radius: 8px;
    margin: 35px 0;
    position: relative;
}

.experience-card::before {
    content: "My Experience";
    position: absolute;
    top: -12px;
    left: 20px;
    background: var(--accent);
    color: #ffffff;
    padding: 2px 12px;
    font-size: 0.75rem;
    font-weight: bold;
    border-radius: 4px;
    text-transform: uppercase;
}

/* 体験談ボックス内の段落調整 */
.experience-card p:last-child {
    margin-bottom: 0;
}

/* 比較テーブル */
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: 30px 0;
    font-size: 0.95rem;
    background: var(--card);
}

.comparison-table th, 
.comparison-table td {
    border: 1px solid var(--border);
    padding: 14px 16px;
    text-align: left;
}

.comparison-table th {
    background: var(--bg);
    font-weight: bold;
    color: var(--text);
}

/* テーブルの偶数行に薄い背景色を敷いて見やすくする（ゼブラストライプ） */
.comparison-table tbody tr:nth-child(even) {
    background: #f8fafc;
}


/* ==========================================================================
   4. レスポンシブ対応（スマートフォン表示の最適化）
   ========================================================================== */
@media (max-width: 768px) {
    .home-articles-section {
        margin-top: 40px;
    }
    
    .article-cards {
        grid-template-columns: 1fr; /* スマホでは1カラムに */
        gap: 16px;
    }

    .article-body {
        margin: 20px 10px;
        padding: 25px 20px;
    }

    .article-title {
        font-size: 1.45rem;
    }

    .article-content h2 {
        font-size: 1.25rem;
        padding: 4px 0 4px 12px;
    }

    .comparison-table th, 
    .comparison-table td {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
}