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

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

/* Hero Section */
.page-blog__hero-section {
    position: relative;
    width: 100%;
    padding-top: 10px; /* Small top padding, body handles --header-offset */
    margin-bottom: 40px;
    box-sizing: border-box;
    overflow: hidden; /* Ensure no overflow */
}

.page-blog__hero-image-wrapper {
    width: 100%;
    height: auto;
    overflow: hidden;
}

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

.page-blog__hero-content {
    background: #ffffff; /* White background for text content */
    padding: 40px 20px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    margin-top: -60px; /* Overlap slightly with the image for visual effect */
    position: relative;
    z-index: 1;
}

.page-blog__main-title {
    font-size: clamp(2em, 3.5vw, 3em); /* Responsive font size */
    font-weight: 700;
    color: #017439; /* Primary brand color */
    margin-bottom: 15px;
    line-height: 1.2;
}

.page-blog__intro-text {
    font-size: 1.1em;
    color: #555555;
    max-width: 800px;
    margin: 0 auto 30px auto;
}

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

.page-blog__btn-primary {
    background-color: #017439; /* Primary brand color */
    color: #ffffff;
    border: 2px solid #017439;
}

.page-blog__btn-primary:hover {
    background-color: #005a2e;
    border-color: #005a2e;
}

.page-blog__btn-secondary {
    background-color: #ffffff;
    color: #017439; /* Primary brand color */
    border: 2px solid #017439;
}

.page-blog__btn-secondary:hover {
    background-color: #f0f0f0;
    color: #005a2e;
    border-color: #005a2e;
}

/* Recent Posts Section */
.page-blog__recent-posts-section {
    background-color: #017439; /* Dark section background */
    color: #ffffff;
    padding: 60px 0;
    margin-bottom: 40px;
}

.page-blog__section-title {
    font-size: 2.5em;
    font-weight: 700;
    text-align: center;
    margin-bottom: 20px;
    color: #ffffff;
}

.page-blog__section-description {
    font-size: 1.1em;
    text-align: center;
    max-width: 800px;
    margin: 0 auto 40px auto;
    color: #f0f0f0;
}

.page-blog__blog-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.page-blog__blog-card {
    background-color: #ffffff;
    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;
}

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

.page-blog__card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

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

.page-blog__card-content {
    padding: 20px;
}

.page-blog__card-title {
    font-size: 1.3em;
    font-weight: 600;
    color: #017439; /* Primary brand color */
    margin-bottom: 10px;
    line-height: 1.4;
}

.page-blog__card-title:hover {
    text-decoration: underline;
}

.page-blog__card-excerpt {
    font-size: 0.95em;
    color: #555555;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.page-blog__card-date {
    font-size: 0.85em;
    color: #888888;
    display: block;
}

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

/* FAQ Section */
.page-blog__faq-section {
    background-color: #f8f8f8; /* Light background for FAQ */
    padding: 60px 0;
    margin-bottom: 40px;
}

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

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

.page-blog__faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 25px;
    font-size: 1.1em;
    font-weight: 600;
    color: #017439;
    cursor: pointer;
    user-select: none;
    position: relative;
    list-style: none; /* For details/summary */
}

.page-blog__faq-question::-webkit-details-marker {
    display: none;
}

.page-blog__faq-toggle {
    font-size: 1.5em;
    line-height: 1;
    color: #017439;
    margin-left: 15px;
    transition: transform 0.3s ease;
}

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

.page-blog__faq-answer {
    padding: 0 25px 20px;
    font-size: 1em;
    color: #555555;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, padding 0.4s ease-out;
}

.page-blog__faq-item[open] .page-blog__faq-answer {
    max-height: 500px; /* Sufficiently large to show content */
    padding-top: 10px;
}

/* CTA Section */
.page-blog__cta-section {
    background-color: #017439; /* Dark section background */
    color: #ffffff;
    padding: 80px 0;
    text-align: center;
}

.page-blog__cta-section .page-blog__section-title {
    color: #ffffff;
    margin-bottom: 25px;
}

.page-blog__cta-section .page-blog__section-description {
    color: #f0f0f0;
    margin-bottom: 40px;
}

.page-blog__cta-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    width: 100%;
    max-width: 600px; /* Limit max width for button group */
    margin: 0 auto;
    box-sizing: border-box;
    overflow: hidden;
}

/* General image and container responsiveness */
.page-blog img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .page-blog__container {
        padding: 15px;
    }

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

    .page-blog__blog-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 25px;
    }

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

@media (max-width: 768px) {
    /* HERO 主图区域 */
    .page-blog__hero-section {
        padding-top: 10px !important; /* Ensure small top padding */
        margin-bottom: 20px;
    }

    .page-blog__hero-content {
        padding: 30px 15px;
        margin-top: -40px;
    }

    .page-blog__main-title {
        font-size: clamp(1.5em, 6vw, 2.2em) !important; /* Smaller on mobile */
        margin-bottom: 10px;
    }

    .page-blog__intro-text {
        font-size: 1em;
        margin-bottom: 20px;
    }

    /* 深色导语区 (Recent Posts Section) */
    .page-blog__recent-posts-section {
        padding: 40px 0;
        margin-bottom: 20px;
    }

    .page-blog__section-title {
        font-size: 1.8em;
        margin-bottom: 15px;
    }

    .page-blog__section-description {
        font-size: 1em;
        margin-bottom: 30px;
        padding: 0 15px;
    }

    /* 博客网格 */
    .page-blog__blog-grid {
        grid-template-columns: repeat(1, 1fr); /* Single column on mobile */
        gap: 20px;
        padding: 0 15px; /* Add padding to grid itself */
        box-sizing: border-box;
    }

    .page-blog__blog-card {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .page-blog__card-image {
        height: 180px; /* Adjust card image height */
    }

    .page-blog__card-title {
        font-size: 1.1em;
    }

    .page-blog__card-excerpt {
        font-size: 0.9em;
    }

    .page-blog__view-all-button-wrapper {
        margin-top: 30px;
        padding: 0 15px;
    }

    /* 通用图片与容器 */
    .page-blog img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        box-sizing: border-box !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__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;
        padding-right: 15px;
    }
    
    .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; /* Spacing between stacked buttons */
    }
    
    /* FAQ 与其他模块 */
    .page-blog__faq-section {
        padding: 40px 0;
        margin-bottom: 20px;
    }

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

    .page-blog__faq-question {
        font-size: 1em;
        padding: 15px 20px;
    }

    .page-blog__faq-answer {
        font-size: 0.95em;
        padding: 0 20px 15px;
    }

    /* CTA Section */
    .page-blog__cta-section {
        padding: 50px 0;
    }
}

@media (max-width: 549px) {
    .page-blog__blog-grid {
        grid-template-columns: 1fr; /* Ensure single column for very small screens */
    }
}

/* 颜色对比度保障 */
.page-blog__dark-section {
    background: #017439;
    color: #ffffff;
}

.page-blog__light-bg {
    background: #ffffff;
    color: #333333;
}

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

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