/* ========================================
   Blog Index - Card Grid
   ======================================== */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.blog-card {
    display: block;
    background: var(--bg-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    text-decoration: none;
    color: inherit;
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    opacity: 1;
}

.blog-card-thumb {
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.blog-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.blog-card:hover .blog-card-thumb img {
    transform: scale(1.05);
}

.blog-card-body {
    padding: 20px 24px 24px;
}

.blog-card-date {
    display: block;
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 8px;
}

.blog-card-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: 8px;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-excerpt {
    font-size: 14px;
    color: var(--text-sub);
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-empty {
    text-align: center;
    color: var(--text-sub);
    font-size: 16px;
    padding: 80px 0;
}

/* ========================================
   Blog Article Page
   ======================================== */
.blog-article-header {
    padding-top: calc(var(--header-height) + 48px);
    padding-bottom: 32px;
    background: var(--bg-light);
}

.blog-article-header-inner {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 24px;
}

.blog-back-link {
    display: inline-block;
    font-size: 14px;
    color: var(--text-sub);
    text-decoration: none;
    margin-bottom: 24px;
    transition: color 0.2s;
}

.blog-back-link:hover {
    color: var(--primary-dark);
    opacity: 1;
}

.blog-article-date {
    display: block;
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 12px;
}

.blog-article-title {
    font-size: clamp(24px, 4vw, 36px);
    font-weight: 700;
    line-height: 1.5;
    color: var(--text-main);
}

.blog-article-hero-image {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px;
}

.blog-article-hero-image img {
    width: 100%;
    border-radius: 8px;
    margin-top: -16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

/* Article Body */
.blog-article-body {
    max-width: 800px;
    margin: 0 auto;
    padding: 48px 24px 80px;
}

.blog-article-body h2 {
    font-size: 22px;
    font-weight: 700;
    margin-top: 48px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary);
    color: var(--text-main);
}

.blog-article-body h3 {
    font-size: 18px;
    font-weight: 600;
    margin-top: 32px;
    margin-bottom: 12px;
    color: var(--text-main);
}

.blog-article-body p {
    margin-bottom: 20px;
    font-size: 15.5px;
    line-height: 2;
    color: #333;
}

.blog-article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 24px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.blog-article-body ul,
.blog-article-body ol {
    margin-bottom: 20px;
    padding-left: 24px;
}

.blog-article-body li {
    margin-bottom: 8px;
    font-size: 15px;
    line-height: 1.9;
    color: var(--text-sub);
}

.blog-article-body blockquote {
    margin: 24px 0;
    padding: 20px 24px;
    border-left: 4px solid var(--primary);
    background: var(--bg-light);
    border-radius: 0 8px 8px 0;
    font-size: 15px;
    line-height: 1.9;
    color: var(--text-sub);
}

/* Read Time */
.read-time {
    display: inline-block;
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 16px;
    padding: 4px 10px;
    background: var(--bg-white);
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

/* Table of Contents */
.toc {
    margin-bottom: 40px;
    padding: 24px 28px;
    background: var(--bg-light);
    border-radius: 8px;
    border: 1px solid #e8e8e8;
}

.toc .toc-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 12px;
    padding: 0;
    border: none;
    color: var(--text-main);
}

.toc ol {
    margin: 0;
    padding-left: 20px;
}

.toc li {
    margin-bottom: 6px;
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-sub);
}

.toc a {
    color: var(--text-sub);
    text-decoration: none;
    transition: color 0.2s;
}

.toc a:hover {
    color: var(--primary-dark);
    opacity: 1;
}

/* Blog CTA */
.blog-cta {
    text-align: center;
    padding: 64px 24px;
    background: var(--bg-light);
}

.blog-cta-inner {
    max-width: 600px;
    margin: 0 auto;
}

.blog-cta h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-main);
}

.blog-cta p {
    font-size: 15px;
    color: var(--text-sub);
    margin-bottom: 24px;
    line-height: 1.7;
}

.blog-cta .btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background: var(--primary);
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: background 0.2s;
}

.blog-cta .btn-primary:hover {
    background: var(--primary-dark);
    opacity: 1;
}

/* ========================================
   Blog Responsive
   ======================================== */
@media (max-width: 768px) {
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .blog-article-header {
        padding-top: calc(var(--header-height) + 32px);
    }

    .blog-article-body {
        padding: 32px 20px 56px;
    }

    .blog-article-body h2 {
        font-size: 20px;
        margin-top: 36px;
    }

    .blog-article-body p {
        font-size: 15px;
        line-height: 1.95;
    }

    .blog-cta {
        padding: 48px 20px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 関連記事 */
.related-articles {
    margin-top: 3rem;
    padding: 1.5rem 2rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #2d6a4f;
}

.related-articles-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2d6a4f;
    margin-bottom: 0.8rem;
}

.related-articles ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.related-articles li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #e9ecef;
}

.related-articles li:last-child {
    border-bottom: none;
}

.related-articles a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.related-articles a:hover {
    color: #2d6a4f;
    text-decoration: underline;
}

.related-articles a::before {
    content: "▸ ";
    color: #2d6a4f;
}

/* ========================================
   Blog Series TOC (Accordion)
   ======================================== */
.blog-series-toc-section {
    padding: 0 24px 8px;
}

.blog-series-toc-inner {
    max-width: 900px;
    margin: 0 auto;
}

.blog-series-toc-heading {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 16px;
    padding-left: 4px;
}

.blog-series-item {
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    margin-bottom: 8px;
    background: var(--bg-white);
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.blog-series-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.blog-series-header {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 14px 18px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-family: inherit;
    color: var(--text-main);
    text-align: left;
    gap: 10px;
    transition: background 0.15s;
}

.blog-series-header:hover {
    background: var(--bg-light);
}

.blog-series-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-dark);
}

.blog-series-icon svg {
    width: 20px;
    height: 20px;
}

.blog-series-name {
    flex: 1;
    font-weight: 600;
}

.blog-series-count {
    font-size: 12px;
    color: var(--text-light);
    background: var(--bg-light);
    padding: 2px 8px;
    border-radius: 10px;
    flex-shrink: 0;
}

.blog-series-arrow {
    font-size: 12px;
    color: var(--text-light);
    transition: transform 0.25s;
    flex-shrink: 0;
}

.blog-series-item.open .blog-series-arrow {
    transform: rotate(180deg);
}

.blog-series-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.blog-series-item.open .blog-series-list {
    max-height: 800px;
    padding: 0 18px 14px 56px;
}

.blog-series-list li {
    padding: 6px 0;
    border-top: 1px solid #f0f0f0;
}

.blog-series-list li:first-child {
    border-top: none;
}

.blog-series-list a {
    color: var(--text-sub);
    text-decoration: none;
    font-size: 14px;
    line-height: 1.6;
    transition: color 0.15s;
}

.blog-series-list a:hover {
    color: var(--primary-dark);
    opacity: 1;
}

/* ========================================
   Blog Tag Filter
   ======================================== */
.blog-tag-filter-section {
    padding: 16px 24px 24px;
}

.blog-tag-filter-inner {
    max-width: 900px;
    margin: 0 auto;
}

.blog-tag-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.blog-tag-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 16px;
    border: 1px solid #ddd;
    border-radius: 20px;
    background: var(--bg-white);
    color: var(--text-sub);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.blog-tag-btn:hover {
    border-color: var(--primary);
    color: var(--primary-dark);
    background: #fdf5e8;
}

.blog-tag-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    font-weight: 600;
}

.blog-tag-btn.active:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.blog-tag-count {
    font-size: 11px;
    opacity: 0.7;
}

.blog-tag-btn.active .blog-tag-count {
    opacity: 0.9;
}

/* ========================================
   Blog Responsive - TOC & Filters
   ======================================== */
@media (max-width: 768px) {
    .blog-series-toc-section {
        padding: 0 16px 8px;
    }

    .blog-series-toc-heading {
        font-size: 18px;
    }

    .blog-series-header {
        padding: 12px 14px;
        font-size: 14px;
    }

    .blog-series-item.open .blog-series-list {
        padding: 0 14px 12px 44px;
    }

    .blog-tag-filter-section {
        padding: 12px 16px 20px;
    }

    .blog-tag-filter {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
        scrollbar-width: none;
    }

    .blog-tag-filter::-webkit-scrollbar {
        display: none;
    }

    .blog-tag-btn {
        flex-shrink: 0;
        padding: 6px 14px;
        font-size: 12px;
    }
}

/* noscript blog list */
.blog-noscript-list {
    list-style: none;
    padding: 0;
    max-width: 800px;
    margin: 0 auto;
}

.blog-noscript-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid #e9ecef;
}

.blog-noscript-list a {
    color: #2d6a4f;
    text-decoration: none;
    font-weight: 500;
}

.blog-noscript-list a:hover {
    text-decoration: underline;
}
