﻿/* Blog Page Section */
.blog-page-section {
    padding: 10px 0 60px;
    overflow: hidden;
}

.blog-page-section .custom-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Blog Title Section */
.blog-title-section {
    text-align: center;
    margin-bottom: 40px;
}

.blog-main-title {
    font-size: 48px;
    font-weight: 800;
    color: #8105BD;
    margin: 0;
    line-height: 1.2;
}

/* Layout: Sidebar + Content */
.blog-page-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    width: 100%;
    box-sizing: border-box;
}

/* Left Sidebar: Categories */
.blog-categories-sidebar {
    flex: 0 0 280px;
    max-width: 280px;
    min-width: 0;
    background: #ffffff;
    border-radius: 8px;
    padding: 24px 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 100px;
    height: fit-content;
}

.categories-title {
    font-size: 24px;
    font-weight: 700;
    color: #8105BD;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #EEE3F8;
}

.categories-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-item {
    margin-bottom: 8px;
}

.category-item:last-child {
    margin-bottom: 0;
}

.category-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #EEE3F8;
    text-decoration: none;
    color: #2E2E2E;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    background-color: transparent;
}

.category-link:hover {
    background-color: #EEE3F8;
    color: #8105BD;
    border-color: #d8b4fe;
}

.category-item.active .category-link {
    background-color: #8105BD;
    color: #ffffff;
    border-color: #8105BD;
}

.category-item.active .category-link:hover {
    background-color: #6d0499;
    border-color: #6d0499;
}

.category-name {
    flex: 1;
}

.category-count {
    font-size: 14px;
    opacity: 0.7;
    margin-left: 8px;
}

.category-item.active .category-count {
    opacity: 0.9;
}

/* Right Content: Articles Grid */
.blog-articles-content {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

/* Article Card - Reuse styles from latest-insights-section */
.article-card {
    background: #ffffff;
    border-radius: 8px;
    padding: 16px 10px 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.article-thumb-placeholder {
    width: 100%;
    height: 208px;
    background-color: #EEE3F8;
    border-radius: 8px;
    margin-bottom: 20px;
    background-image: linear-gradient(135deg, #EEE3F8 0%, #d8b4fe 100%);
}

/* Article thumbnail image */
.article-thumb-wrapper {
    width: 100%;
    height: 208px;
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
}

.article-thumb-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.article-meta-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.meta-data {
    display: flex;
    align-items: center;
    gap: 8px;
}

.meta-icon {
    width: 24px;
    height: 24px;
}

.meta-value {
    font-size: 14px;
    color: #2E2E2E;
    font-weight: 500;
}

/* Title & Desc */
.article-heading {
    font-size: 20px;
    font-weight: 600;
    color: #2E2E2E;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.article-desc {
    font-size: 14px;
    color: #2E2E2E;
    line-height: 1.5;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    overflow-wrap: break-word;
    flex: 1;
}

/* Button Support */
.article-action {
    text-align: right;
    margin-top: auto;
}

.article-btn {
    background-color: #EEE3F8;
    color: #2E2E2E;
    border: none;
    padding: 6px 48px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: 0.3s;
    text-decoration: none;
    display: inline-block;
}

.article-btn:hover {
    background-color: #d8b4fe;
    color: #8105BD;
}

/* No Articles Message */
.no-articles-message {
    text-align: center;
    padding: 0px 20px;
    color: #666;
    font-size: 18px;
}

/* Loading Message */
.loading-message {
    text-align: center;
    padding: 0px 20px;
    color: #8105BD;
    font-size: 18px;
}

.loading-message p {
    margin: 0;
}

/* Blog Detail Page */
.blog-detail-section {
    padding: 0 0 30px;
    overflow: hidden;
}

.blog-detail-section .custom-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 15px;
}

.blog-detail-back {
    margin-bottom: 10px;
    text-align: right;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #8105BD;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: #6d0499;
}

.back-icon {
    font-size: 20px;
    font-weight: bold;
}

.blog-detail-header {
    margin-bottom: 20px;
    padding-bottom: 30px;
    border-bottom: 2px solid #EEE3F8;
}

.blog-detail-title {
    font-size: 64px;
    font-weight: 800;
    color: #F72585;
    margin-bottom: 20px;
    line-height: 1.3;
}

.blog-detail-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.blog-detail-content {
    line-height: 1.8;
    color: #2E2E2E;
}

.blog-detail-short-desc {
    font-size: 20px;
    font-weight: 500;
    color: #666;
    margin-bottom: 30px;
    padding: 20px;
    background-color: #F9F5FC;
    border-radius: 8px;
    border-left: 4px solid #8105BD;
}

.blog-detail-body {
    font-size: 16px;
    line-height: 1.8;
}

.blog-detail-body h1,
.blog-detail-body h2,
.blog-detail-body h3,
.blog-detail-body h4,
.blog-detail-body h5,
.blog-detail-body h6 {
    color: #2E2E2E;
    margin-top: 30px;
    margin-bottom: 15px;
    font-weight: 700;
}

.blog-detail-body h2 {
    font-size: 32px;
}

.blog-detail-body h3 {
    font-size: 26px;
}

.blog-detail-body h4 {
    font-size: 22px;
}

.blog-detail-body p {
    margin-bottom: 20px;
}

.blog-detail-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
}

.blog-detail-body ul,
.blog-detail-body ol {
    margin-bottom: 20px;
    padding-left: 30px;
}

.blog-detail-body li {
    margin-bottom: 10px;
}

.blog-detail-body a {
    color: #8105BD;
    text-decoration: none;
    transition: color 0.3s ease;
}

.blog-detail-body a:hover {
    color: #6d0499;
    text-decoration: underline;
}

.blog-detail-body blockquote {
    border-left: 4px solid #8105BD;
    padding-left: 20px;
    margin: 20px 0;
    font-style: italic;
    color: #666;
}

.no-article-message {
    text-align: center;
    padding: 60px 20px;
}

.no-article-message p {
    font-size: 18px;
    color: #666;
    margin-bottom: 20px;
}

.back-to-blog-btn {
    display: inline-block;
    background-color: #8105BD;
    color: #ffffff;
    padding: 12px 32px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.back-to-blog-btn:hover {
    background-color: #6d0499;
    color: #ffffff;
}

/* Responsive for Blog Detail */
@media (max-width: 768px) {
    .blog-detail-section {
        padding: 0;
    }

    .blog-detail-title {
        font-size: 32px;
    }

    .blog-detail-short-desc {
        font-size: 18px;
        padding: 16px;
    }

    .blog-detail-body {
        font-size: 15px;
    }

    .blog-detail-body h2 {
        font-size: 26px;
    }

    .blog-detail-body h3 {
        font-size: 22px;
    }
}

@media (max-width: 480px) {
    .blog-detail-title {
        font-size: 26px;
    }

    .blog-detail-short-desc {
        font-size: 16px;
    }

    .blog-detail-body h2 {
        font-size: 22px;
    }

    .blog-detail-body h3 {
        font-size: 20px;
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .blog-page-layout {
        flex-direction: column;
        gap: 30px;
    }

    .blog-categories-sidebar {
        flex: 1 1 100%;
        max-width: 100%;
        min-width: 0;
        position: static;
        top: auto;
        width: 100%;
    }

    .categories-list {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        justify-content: flex-start;
    }

    .category-item {
        margin-bottom: 0;
        flex: 1 1 calc(33.33% - 7px);
        min-width: calc(33.33% - 7px);
        max-width: calc(33.33% - 7px);
    }

    .category-link {
        padding: 10px 20px;
        font-size: 14px;
        width: 100%;
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        gap: 8px;
        line-height: 1.4;
        text-align: left;
    }
    
    .category-name {
        word-wrap: break-word;
        overflow-wrap: break-word;
        flex: 1;
        min-width: 0;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        line-height: 1.4;
    }
    
    .category-count {
        white-space: nowrap;
        flex-shrink: 0;
        margin-left: 0;
        font-size: 14px;
        opacity: 0.7;
        align-self: baseline;
    }
    
    .category-item.active .category-count {
        opacity: 0.9;
    }

    .articles-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .blog-page-section .custom-container {
        padding: 0 10px 10px;
    }

    .blog-page-section {
        padding: 0;
    }

    .blog-title-section {
        margin-bottom: 30px;
    }

    .blog-main-title {
        font-size: 36px;
    }

    .blog-categories-sidebar {
        padding: 20px 16px;
    }

    .categories-title {
        font-size: 20px;
        margin-bottom: 16px;
    }

    .categories-list {
        gap: 8px;
    }

    .category-item {
        flex: 1 1 calc(50% - 4px);
        min-width: calc(50% - 4px);
        max-width: calc(50% - 4px);
    }

    .category-link {
        padding: 10px 16px;
        font-size: 13px;
    }

    .articles-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .article-card {
        padding: 16px 12px 18px;
    }

    .article-thumb-placeholder {
        height: 180px;
        margin-bottom: 16px;
    }

    .article-heading {
        font-size: 18px;
    }

    .article-desc {
        font-size: 13px;
    }
}

@media (max-width: 576px) {
    .category-item {
        flex: 1 1 100%;
        min-width: 100%;
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .blog-title-section {
        margin-bottom: 24px;
    }

    .blog-main-title {
        font-size: 28px;
    }

    .blog-categories-sidebar {
        padding: 16px 12px;
    }

    .categories-title {
        font-size: 18px;
        margin-bottom: 12px;
    }

    .categories-list {
        gap: 6px;
    }

    .category-link {
        padding: 8px 14px;
        font-size: 12px;
    }

    .category-count {
        font-size: 12px;
    }

    .article-card {
        padding: 12px 10px 16px;
    }

    .article-thumb-placeholder {
        height: 160px;
    }
}

