/* style/blog.css */

/* Base styles for the blog page */
.page-blog {
    font-family: 'Arial', sans-serif;
    color: #333333; /* Dark text for light body background */
    line-height: 1.6;
    background-color: #ffffff; /* Explicitly set for content area if needed, but body is white */
}

/* Hero Section */
.page-blog__hero-section {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column; /* Image on top, content below */
    align-items: center;
    text-align: center;
    padding: 60px 20px;
    padding-top: 10px; /* Small top padding, body handles --header-offset */
    background-color: #f8f8f8; /* Light background for the section */
}

.page-blog__hero-image {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px; /* Space between image and text */
}

.page-blog__hero-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

.page-blog__main-title {
    font-size: clamp(2.2rem, 4vw, 3.2rem); /* Responsive font size for H1 */
    color: #26A9E0; /* Brand color for title */
    margin-bottom: 20px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.page-blog__hero-description {
    font-size: 1.15rem;
    color: #555555;
    margin-bottom: 30px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* General Section Styling */
.page-blog__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.page-blog__section-title {
    font-size: clamp(1.8rem, 3.5vw, 2.5rem);
    color: #26A9E0;
    text-align: center;
    margin-bottom: 40px;
    font-weight: 600;
}

.page-blog__text-block {
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 20px;
    color: #333333;
    text-align: justify;
}

/* Introduction Section */
.page-blog__introduction-section {
    padding: 80px 0;
    background-color: #ffffff;
}

/* Featured Posts Section */
.page-blog__featured-posts-section {
    padding: 80px 0;
    background-color: #f0f7ff; /* Light blue tint */
}

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

.page-blog__post-card {
    background-color: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    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 8px 25px rgba(0, 0, 0, 0.15);
}

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

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

.page-blog__post-title {
    font-size: 1.4rem;
    margin-bottom: 10px;
    font-weight: 600;
    line-height: 1.4;
}

.page-blog__post-title a {
    color: #26A9E0; /* Brand color for link */
    text-decoration: none;
    transition: color 0.3s ease;
}

.page-blog__post-title a:hover {
    color: #1a7bb0; /* Darker shade on hover */
}

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

.page-blog__post-excerpt {
    font-size: 1rem;
    color: #555555;
    margin-bottom: 20px;
    flex-grow: 1;
}

.page-blog__read-more-link {
    display: inline-block;
    color: #26A9E0;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.page-blog__read-more-link:hover {
    text-decoration: underline;
    color: #1a7bb0;
}

.page-blog__view-all-wrapper {
    text-align: center;
}

/* Benefits Section */
.page-blog__benefits-section {
    padding: 80px 0;
    background-color: #ffffff;
}

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

.page-blog__benefit-item {
    background-color: #f8f8f8;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.page-blog__benefit-title {
    font-size: 1.5rem;
    color: #26A9E0;
    margin-bottom: 15px;
    font-weight: 600;
}

/* Platform Guide Section */
.page-blog__platform-guide-section {
    padding: 80px 0;
    background-color: #f0f7ff;
    text-align: center;
}

.page-blog__cta-buttons {
    display: flex;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
}

/* Call to Action Section */
.page-blog__cta-section {
    padding: 80px 0;
    background-color: #26A9E0; /* Brand color background */
    color: #ffffff; /* White text for contrast */
    text-align: center;
}

.page-blog__cta-section .page-blog__section-title,
.page-blog__cta-section .page-blog__text-block {
    color: #ffffff;
}

.page-blog__cta-section .page-blog__btn-primary {
    background-color: #EA7C07; /* Login color for primary CTA */
    border-color: #EA7C07;
}

.page-blog__cta-section .page-blog__btn-primary:hover {
    background-color: #d46f06;
    border-color: #d46f06;
}

/* Buttons */
.page-blog__btn-primary,
.page-blog__btn-secondary {
    display: inline-block;
    padding: 15px 30px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-sizing: border-box; /* Crucial for responsive buttons */
    white-space: normal; /* Allow text to wrap */
    word-wrap: break-word; /* Break long words */
    text-align: center;
}

.page-blog__btn-primary {
    background-color: #26A9E0;
    color: #ffffff;
    border: 2px solid #26A9E0;
}

.page-blog__btn-primary:hover {
    background-color: #1a7bb0;
    border-color: #1a7bb0;
}

.page-blog__btn-secondary {
    background-color: #ffffff;
    color: #26A9E0;
    border: 2px solid #26A9E0;
}

.page-blog__btn-secondary:hover {
    background-color: #e6f3ff;
    color: #1a7bb0;
    border-color: #1a7bb0;
}

/* FAQ Section */
.page-blog__faq-section {
    padding: 80px 0;
    background-color: #ffffff;
}

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

.page-blog__faq-item {
    background-color: #f8f8f8;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.page-blog__faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    font-size: 1.15rem;
    font-weight: 600;
    color: #26A9E0;
    cursor: pointer;
    background-color: #e6f3ff; /* Lighter brand color for question background */
    transition: background-color 0.3s ease;
}

.page-blog__faq-question:hover {
    background-color: #d9ecff;
}

.page-blog__faq-qtext {
    flex-grow: 1;
}

.page-blog__faq-toggle {
    font-size: 1.5rem;
    line-height: 1;
    margin-left: 15px;
    color: #26A9E0;
}

.page-blog__faq-answer {
    padding: 0 25px 20px;
    font-size: 1rem;
    color: #555555;
    max-height: 0; /* For JS toggle fallback */
    overflow: hidden; /* For JS toggle fallback */
    transition: max-height 0.3s ease-out, padding 0.3s ease-out; /* For JS toggle fallback */
}

/* For details tag native behavior */
.page-blog__faq-item[open] .page-blog__faq-answer {
    max-height: 1000px; /* Arbitrary large value for smooth transition */
    padding-top: 15px;
}

.page-blog__faq-item[open] .page-blog__faq-toggle {
    content: '−'; /* Change to minus when open */
}

/* Hide default details arrow */
.page-blog__faq-item summary::-webkit-details-marker {
    display: none;
}
.page-blog__faq-item summary {
    list-style: none;
}


/* Responsive styles */
@media (max-width: 1024px) {
    .page-blog__hero-image {
        height: auto; /* Allow image to scale */
    }
}

@media (max-width: 768px) {
    .page-blog {
        font-size: 16px;
        line-height: 1.6;
    }

    .page-blog__hero-section {
        padding: 40px 15px;
        padding-top: 10px !important; /* Ensure small top padding */
    }

    .page-blog__main-title {
        font-size: clamp(1.8rem, 7vw, 2.5rem);
    }

    .page-blog__hero-description {
        font-size: 1rem;
    }

    .page-blog__section-title {
        font-size: clamp(1.6rem, 6vw, 2.2rem);
        margin-bottom: 30px;
    }

    .page-blog__container {
        padding: 0 15px;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .page-blog__introduction-section,
    .page-blog__featured-posts-section,
    .page-blog__benefits-section,
    .page-blog__platform-guide-section,
    .page-blog__faq-section,
    .page-blog__cta-section {
        padding: 50px 0;
    }

    .page-blog__post-grid {
        grid-template-columns: 1fr; /* Single column on mobile */
    }

    .page-blog__post-card {
        margin-bottom: 20px;
    }

    .page-blog__post-image {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        display: block !important;
    }

    /* Images within content areas */
    .page-blog img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        display: block !important;
    }

    .page-blog__section,
    .page-blog__card,
    .page-blog__container {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .page-blog__video-section {
      padding-top: 10px !important; /* body đã承担 --header-offset，此处禁止 var(--header-offset) */
    }

    /* Buttons responsive */
    .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: 12px 15px; /* Adjust padding for mobile */
        font-size: 1rem;
    }
    
    .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;
        padding-right: 15px;
        flex-direction: column !important; /* Stack buttons vertically */
        gap: 15px;
        overflow: hidden !important;
    }

    /* FAQ */
    .page-blog__faq-question {
        font-size: 1rem;
        padding: 15px 20px;
    }

    .page-blog__faq-answer {
        padding: 0 20px 15px;
    }
}