/* style/blog.css */
/* body đã padding-top: var(--header-offset) từ shared.css; không lặp lại tại đây */

:root {
    --page-blog-primary-color: #26A9E0;
    --page-blog-secondary-color: #FFFFFF;
    --page-blog-text-dark: #333333;
    --page-blog-text-light: #ffffff;
    --page-blog-bg-light: #ffffff;
    --page-blog-bg-dark: #26A9E0; /* Using brand color as dark background for contrast */
    --page-blog-btn-login-color: #EA7C07; /* Not directly used in this page's content, but defined */
}

.page-blog {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: var(--page-blog-text-dark); /* Default text color for light background */
    background-color: var(--page-blog-bg-light); /* Default background */
}

/* Hero Section */
.page-blog__hero-section {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column; /* Ensure image is above text */
    align-items: center;
    padding-top: 10px; /* Small top padding, body handles --header-offset */
    margin-bottom: 40px;
    overflow: hidden; /* Ensure no overflow */
}

.page-blog__hero-image-wrapper {
    width: 100%;
    max-height: 675px; /* Limit height for aesthetic */
    overflow: hidden;
}

.page-blog__hero-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    object-position: center;
}

.page-blog__hero-content {
    width: 100%;
    background-color: var(--page-blog-bg-light);
    color: var(--page-blog-text-dark);
    padding: 40px 20px;
    text-align: center;
    box-sizing: border-box;
}

.page-blog__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px; /* Consistent padding for content */
    box-sizing: border-box;
}

.page-blog__main-title {
    font-size: clamp(2em, 3.5vw, 3em); /* H1 font size constraint */
    color: var(--page-blog-primary-color);
    margin-bottom: 15px;
    font-weight: 700;
    line-height: 1.2;
}

.page-blog__lead-text {
    font-size: 1.1em;
    margin-bottom: 30px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    color: var(--page-blog-text-dark);
}

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

.page-blog__btn-primary {
    background-color: var(--page-blog-primary-color);
    color: var(--page-blog-text-light);
    border: 2px solid var(--page-blog-primary-color);
    margin: 10px;
}

.page-blog__btn-primary:hover {
    background-color: #208bc4; /* Manually darkened version of primary color */
}

.page-blog__btn-secondary {
    background-color: var(--page-blog-bg-light);
    color: var(--page-blog-primary-color);
    border: 2px solid var(--page-blog-primary-color);
    margin: 10px;
}

.page-blog__btn-secondary:hover {
    background-color: var(--page-blog-primary-color);
    color: var(--page-blog-text-light);
}

.page-blog__cta-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap; /* Allow buttons to wrap on smaller screens */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

/* Section Titles */
.page-blog__section-title {
    font-size: 2.2em;
    color: var(--page-blog-primary-color);
    text-align: center;
    margin-bottom: 30px;
    font-weight: 600;
}

/* Latest Posts Section */
.page-blog__latest-posts-section {
    padding: 60px 0;
    background-color: var(--page-blog-bg-light);
}

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

.page-blog__post-card {
    background-color: var(--page-blog-bg-light);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.page-blog__post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.page-blog__post-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.page-blog__post-thumbnail {
    width: 100%;
    height: 225px; /* Fixed height for thumbnails */
    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.3em;
    color: var(--page-blog-primary-color);
    margin-bottom: 10px;
    font-weight: 600;
    line-height: 1.3;
}

.page-blog__post-meta {
    font-size: 0.9em;
    color: #777;
    margin-bottom: 15px;
}

.page-blog__post-excerpt {
    font-size: 1em;
    color: var(--page-blog-text-dark);
    flex-grow: 1;
}

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

/* About Blog Section */
.page-blog__about-blog-section {
    padding: 60px 0;
    background-color: var(--page-blog-bg-dark); /* Using brand color for dark section */
    color: var(--page-blog-text-light); /* Light text for dark background */
}

.page-blog__about-blog-section .page-blog__section-title {
    color: var(--page-blog-text-light); /* Ensure title is white */
}

.page-blog__about-blog-section p {
    color: var(--page-blog-text-light); /* Ensure paragraphs are white */
}

.page-blog__content-wrapper {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 30px;
}

.page-blog__about-image {
    width: 100%;
    max-width: 500px;
    height: auto;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}

.page-blog__about-text {
    flex: 1;
    min-width: 300px;
}

/* FAQ Section */
.page-blog__faq-section {
    padding: 60px 0;
    background-color: var(--page-blog-bg-light);
}

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

.page-blog__faq-item {
    background-color: var(--page-blog-bg-light);
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
    color: var(--page-blog-text-dark);
}

.page-blog__faq-item summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 25px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.1em;
    color: var(--page-blog-primary-color);
    list-style: none; /* Remove default marker */
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
}

.page-blog__faq-item summary::-webkit-details-marker {
    display: none; /* Remove default marker for Webkit */
}

.page-blog__faq-toggle {
    font-size: 1.5em;
    line-height: 1;
    color: var(--page-blog-primary-color);
    transition: transform 0.3s ease;
}

/* Rotate plus to cross when open, handled by JS for consistency */
.page-blog__faq-item[open] .page-blog__faq-toggle {
    transform: rotate(45deg);
}

.page-blog__faq-answer {
    padding: 0 25px 18px;
    font-size: 1em;
    color: var(--page-blog-text-dark);
}

/* Bottom CTA Section */
.page-blog__cta-bottom-section {
    padding: 60px 0;
    background-color: var(--page-blog-bg-dark); /* Using brand color for dark section */
    color: var(--page-blog-text-light); /* Light text for dark background */
    text-align: center;
}

.page-blog__cta-bottom-section .page-blog__section-title,
.page-blog__cta-bottom-section p {
    color: var(--page-blog-text-light);
    margin-bottom: 25px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .page-blog__main-title {
        font-size: clamp(1.8em, 4vw, 2.5em);
    }
    .page-blog__section-title {
        font-size: 2em;
    }
    .page-blog__posts-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    .page-blog__about-image {
        max-width: 100%;
    }
    .page-blog__content-wrapper {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .page-blog {
        font-size: 16px;
        line-height: 1.6;
    }
    .page-blog__hero-content {
        padding: 30px 15px;
    }
    .page-blog__main-title {
        font-size: clamp(1.5em, 6vw, 2.2em) !important; /* Mobile H1 font size constraint */
    }
    .page-blog__lead-text {
        font-size: 1em;
    }
    .page-blog__section-title {
        font-size: 1.8em;
    }
    .page-blog__posts-grid {
        grid-template-columns: 1fr;
    }
    .page-blog__post-thumbnail {
        height: 200px;
    }
    .page-blog__post-card {
        margin: 0 10px; /* Add some horizontal margin for cards */
    }
    .page-blog__about-image {
        max-width: 100% !important;
        width: 100% !important;
    }
    .page-blog__about-text,
    .page-blog__faq-list {
        padding: 0 10px;
    }
    .page-blog__btn-primary,
    .page-blog__btn-secondary {
        max-width: 100% !important;
        width: 100% !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
        margin: 5px 0 !important; /* Stack buttons */
    }
    .page-blog__cta-buttons {
        flex-direction: column !important; /* Stack buttons vertically */
        gap: 10px !important;
        max-width: 100% !important;
        width: 100% !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    /* Mobile image responsiveness */
    .page-blog img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        display: block !important;
        box-sizing: border-box !important;
    }
    /* All containers that might hold images or text should be responsive */
    .page-blog__section,
    .page-blog__card,
    .page-blog__container,
    .page-blog__hero-section,
    .page-blog__latest-posts-section,
    .page-blog__about-blog-section,
    .page-blog__faq-section,
    .page-blog__cta-bottom-section,
    .page-blog__hero-image-wrapper,
    .page-blog__post-card,
    .page-blog__post-content,
    .page-blog__content-wrapper,
    .page-blog__faq-item {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        /* Add horizontal padding to prevent content from touching edges */
        padding-left: 15px;
        padding-right: 15px;
    }
    /* Override padding for sections that already have container padding */
    .page-blog__hero-content,
    .page-blog__container {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    /* Specific padding for sections */
    .page-blog__hero-section,
    .page-blog__latest-posts-section,
    .page-blog__about-blog-section,
    .page-blog__faq-section,
    .page-blog__cta-bottom-section {
        padding-left: 0;
        padding-right: 0;
    }
    .page-blog__hero-section {
        padding-top: 10px !important; /* Small top padding, body handles --header-offset */
    }
}