/* style/blog.css */
.page-blog {
    font-family: Arial, sans-serif;
    color: var(--text-main, #333333); /* Default text color for light background */
    background-color: var(--background, #F5F7FA); /* Default background color */
    line-height: 1.6;
}

.page-blog__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
}

/* Hero Section */
.page-blog__hero-section {
    position: relative;
    padding-top: 10px; /* Small top padding, assuming body has header offset */
    padding-bottom: 40px;
    padding-left: 0;
    padding-right: 0;
    text-align: center;
    background-color: var(--background, #F5F7FA);
}

.page-blog__hero-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    margin-top: 20px; /* Space between content and image */
    border-radius: 8px;
}

.page-blog__hero-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

.page-blog__main-title {
    font-size: clamp(2.2em, 4vw, 3.2em); /* Responsive font size */
    color: var(--main-color, #E53935);
    margin-bottom: 15px;
    font-weight: bold;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.page-blog__hero-description {
    font-size: 1.1em;
    color: var(--text-main, #333333);
    margin-bottom: 30px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* Buttons */
.page-blog__btn-primary,
.page-blog__btn-secondary {
    display: inline-block;
    padding: 12px 25px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: center;
    max-width: 100%; /* Ensure button adapts to width */
    box-sizing: border-box;
    white-space: normal; /* Allow text wrap */
    word-wrap: break-word; /* Allow text wrap */
}

.page-blog__btn-primary {
    background: linear-gradient(180deg, #FF5A4F 0%, #E53935 100%);
    color: #ffffff;
    border: none;
    margin-right: 15px;
}

.page-blog__btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.page-blog__btn-secondary {
    background-color: #ffffff;
    color: var(--main-color, #E53935);
    border: 2px solid var(--main-color, #E53935);
}

.page-blog__btn-secondary:hover {
    background-color: var(--main-color, #E53935);
    color: #ffffff;
}

.page-blog__cta-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

/* Section titles */
.page-blog__section-title {
    font-size: 2.2em;
    color: var(--main-color, #E53935);
    text-align: center;
    margin-bottom: 25px;
    font-weight: bold;
}

.page-blog__section-description {
    font-size: 1.1em;
    color: var(--text-main, #333333);
    text-align: center;
    margin-bottom: 40px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Latest Posts Grid */
.page-blog__latest-posts {
    padding-top: 60px;
    padding-bottom: 60px;
    background-color: var(--background, #F5F7FA);
}

.page-blog__posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.page-blog__post-card {
    background-color: var(--card-bg, #FFFFFF);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.page-blog__post-thumbnail {
    width: 100%;
    height: 225px; /* Fixed height for consistency */
    object-fit: cover;
    display: block;
}

.page-blog__post-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.page-blog__post-title {
    font-size: 1.4em;
    font-weight: bold;
    margin-bottom: 10px;
    line-height: 1.3;
    flex-shrink: 0;
}

.page-blog__post-title a {
    color: var(--text-main, #333333);
    text-decoration: none;
    transition: color 0.3s ease;
}

.page-blog__post-title a:hover {
    color: var(--main-color, #E53935);
}

.page-blog__post-meta {
    font-size: 0.9em;
    color: #666666;
    margin-bottom: 15px;
    flex-shrink: 0;
}

.page-blog__post-excerpt {
    font-size: 1em;
    color: var(--text-main, #333333);
    margin-bottom: 20px;
    flex-grow: 1;
}

.page-blog__read-more {
    display: inline-block;
    color: var(--main-color, #E53935);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
    flex-shrink: 0;
}

.page-blog__read-more:hover {
    text-decoration: underline;
}

.page-blog__view-all-button {
    text-align: center;
    margin-top: 50px;
}

/* Categories Section */
.page-blog__categories-section {
    padding-top: 60px;
    padding-bottom: 60px;
}

.page-blog__dark-section {
    background-color: var(--main-color, #E53935);
    color: #ffffff;
}

.page-blog__dark-section .page-blog__section-title,
.page-blog__dark-section .page-blog__section-description {
    color: #ffffff;
}

.page-blog__categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.page-blog__category-card {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 25px;
    text-align: center;
    text-decoration: none;
    color: #ffffff;
    transition: background-color 0.3s ease, transform 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 150px;
}

.page-blog__category-card:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-5px);
}

.page-blog__category-title {
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 10px;
    color: #ffffff;
}

.page-blog__category-count {
    font-size: 0.9em;
    opacity: 0.8;
    color: #ffffff;
}

/* Featured Posts */
.page-blog__featured-posts {
    padding-top: 60px;
    padding-bottom: 60px;
    background-color: var(--background, #F5F7FA);
}

.page-blog__posts-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

.page-blog__featured-item {
    background-color: var(--card-bg, #FFFFFF);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    display: flex;
    align-items: center;
    padding: 20px;
}

.page-blog__featured-thumbnail {
    width: 250px; /* Fixed width for featured image */
    height: 167px; /* Maintain aspect ratio */
    object-fit: cover;
    border-radius: 6px;
    margin-right: 25px;
    flex-shrink: 0;
    display: block;
}

.page-blog__featured-content {
    flex-grow: 1;
}

.page-blog__featured-title {
    font-size: 1.3em;
    font-weight: bold;
    margin-bottom: 8px;
    line-height: 1.3;
}

.page-blog__featured-title a {
    color: var(--text-main, #333333);
    text-decoration: none;
    transition: color 0.3s ease;
}

.page-blog__featured-title a:hover {
    color: var(--main-color, #E53935);
}

.page-blog__featured-meta {
    font-size: 0.9em;
    color: #666666;
    margin-bottom: 12px;
}

.page-blog__featured-excerpt {
    font-size: 1em;
    color: var(--text-main, #333333);
    margin-bottom: 15px;
}

/* CTA Section */
.page-blog__cta-section {
    padding-top: 80px;
    padding-bottom: 80px;
    text-align: center;
}

.page-blog__dark-bg {
    background: linear-gradient(180deg, #FF5A4F 0%, #E53935 100%);
    color: #ffffff;
}

.page-blog__dark-bg .page-blog__section-title,
.page-blog__dark-bg .page-blog__section-description {
    color: #ffffff;
}

/* FAQ Section */
.page-blog__faq-section {
    padding-top: 60px;
    padding-bottom: 60px;
    background-color: var(--background, #F5F7FA);
}

.page-blog__faq-list {
    max-width: 900px;
    margin: 0 auto;
}

.page-blog__faq-item {
    background-color: var(--card-bg, #FFFFFF);
    border: 1px solid var(--border-color, #E0E0E0);
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
}

.page-blog__faq-item summary {
    list-style: none; /* Remove default marker */
    cursor: pointer;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    font-size: 1.1em;
    color: var(--text-main, #333333);
    position: relative;
    outline: none;
}

.page-blog__faq-item summary::-webkit-details-marker {
    display: none; /* Hide Chrome/Safari marker */
}

.page-blog__faq-qtext {
    flex-grow: 1;
    margin-right: 15px;
}

.page-blog__faq-toggle {
    font-size: 1.5em;
    color: var(--main-color, #E53935);
    transition: transform 0.3s ease;
}

.page-blog__faq-item[open] .page-blog__faq-toggle {
    transform: rotate(45deg); /* Change '+' to 'x' or rotate */
}

.page-blog__faq-answer {
    padding: 0 25px 20px 25px;
    font-size: 1em;
    color: var(--text-main, #333333);
    line-height: 1.6;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
}

.page-blog__faq-item[open] .page-blog__faq-answer {
    max-height: 500px; /* Adjust as needed for content */
    transition: max-height 0.5s ease-in, padding 0.5s ease-in;
}

.page-blog__faq-answer p {
    margin-bottom: 0;
}


/* --- Responsive Styles --- */
/* General images and containers */
.page-blog img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Content area images min display size */
.page-blog__post-thumbnail,
.page-blog__featured-thumbnail {
    min-width: 200px;
    min-height: 150px; /* Adjust based on aspect ratio */
}

/* @media (max-width: 1024px) - Tablet */
@media (max-width: 1024px) {
    .page-blog__main-title {
        font-size: clamp(2em, 5vw, 2.8em);
    }

    .page-blog__section-title {
        font-size: 2em;
    }

    .page-blog__post-title {
        font-size: 1.3em;
    }

    .page-blog__featured-item {
        flex-direction: column;
        text-align: center;
        padding: 15px;
    }

    .page-blog__featured-thumbnail {
        margin-right: 0;
        margin-bottom: 15px;
        width: 100%;
        height: auto;
        max-height: 250px;
        object-fit: cover;
    }

    .page-blog__featured-content {
        padding: 0 10px;
    }
}


/* @media (max-width: 768px) - Mobile */
@media (max-width: 768px) {
    /* HERO 主图区域 */
    .page-blog__hero-section {
        padding-top: 10px !important; /* Small top padding for mobile */
        padding-bottom: 30px !important;
    }

    .page-blog__hero-content {
        padding: 0 15px !important;
    }

    .page-blog__main-title {
        font-size: clamp(1.8em, 7vw, 2.5em) !important;
        margin-bottom: 10px !important;
    }

    .page-blog__hero-description {
        font-size: 1em !important;
        margin-bottom: 20px !important;
    }

    /* Sản phẩm trưng bày khu vực - Không áp dụng cho blog, nhưng lưới chung cần thích ứng */
    .page-blog__posts-grid,
    .page-blog__categories-grid {
        grid-template-columns: 1fr !important; /* Single column */
        gap: 20px !important;
    }

    /* Hình ảnh và vùng chứa chung */
    .page-blog img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
    }

    .page-blog__section,
    .page-blog__card,
    .page-blog__container,
    .page-blog__post-card,
    .page-blog__category-card,
    .page-blog__featured-item,
    .page-blog__faq-item {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    
    .page-blog__post-thumbnail {
        height: 180px !important; /* Adjust height for mobile card */
        min-height: 180px !important;
    }
    .page-blog__featured-thumbnail {
        width: 100% !important;
        height: 180px !important;
        min-height: 180px !important;
        margin-bottom: 15px !important;
    }

    /* Nút và vùng chứa nút */
    .page-blog__cta-button,
    .page-blog__btn-primary,
    .page-blog__btn-secondary,
    .page-blog a[class*="button"],
    .page-blog a[class*="btn"] {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        white-space: normal !important;
        word-wrap: break-word !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    
    .page-blog__cta-buttons,
    .page-blog__button-group,
    .page-blog__btn-container {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
        flex-wrap: wrap !important;
        gap: 10px !important;
        flex-direction: column !important; /* Stack buttons vertically on mobile */
    }

    /* Các module nội dung khác */
    .page-blog__section-title {
        font-size: 1.8em !important;
        margin-bottom: 20px !important;
    }

    .page-blog__section-description {
        font-size: 0.95em !important;
        margin-bottom: 30px !important;
    }

    .page-blog__post-card {
        padding: 0 !important; /* Remove card padding if it interferes with inner content padding */
    }
    .page-blog__post-content {
        padding: 15px !important;
    }

    .page-blog__post-title {
        font-size: 1.2em !important;
    }

    .page-blog__post-meta,
    .page-blog__post-excerpt,
    .page-blog__read-more {
        font-size: 0.9em !important;
    }

    .page-blog__featured-item {
        flex-direction: column !important;
        text-align: center !important;
        padding: 15px !important;
    }
    .page-blog__featured-content {
        padding: 0 !important;
    }

    .page-blog__faq-item summary {
        font-size: 1em !important;
        padding: 15px !important;
    }
    .page-blog__faq-answer {
        padding: 0 15px 15px 15px !important;
    }
}