/* Base Styles for Blog Page */
.page-blog {
    font-family: 'Arial', sans-serif;
    color: #333333; /* Default text color for light backgrounds */
    line-height: 1.6;
    background-color: #FFFFFF;
}

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

.page-blog__section-title {
    font-size: 36px;
    font-weight: 700;
    color: #017439;
    text-align: center;
    margin-bottom: 40px;
    line-height: 1.2;
}

.page-blog__section-title--light {
    color: #FFFFFF;
}

.page-blog__text-block {
    font-size: 17px;
    margin-bottom: 20px;
    text-align: justify;
}

.page-blog__text-block--light {
    color: #f0f0f0;
}

/* Hero Section */
.page-blog__hero-section {
    position: relative;
    width: 100%;
    padding-top: 10px; /* Small top padding, body handles header offset */
    background-color: #017439;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.page-blog__hero-image-wrapper {
    width: 100%;
    height: 675px; /* Fixed height for desktop hero image */
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.page-blog__hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Cover the area, may crop sides */
}

.page-blog__hero-content {
    text-align: center;
    padding: 40px 20px;
    max-width: 900px;
    color: #FFFFFF;
}

.page-blog__hero-title {
    font-size: clamp(2.5rem, 5vw, 3.5rem); /* Responsive font size */
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.2;
    color: #FFFF00; /* Special color for hero title based on custom palette */
}

.page-blog__hero-description {
    font-size: 19px;
    margin-bottom: 30px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

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

/* Buttons */
.page-blog__btn-primary,
.page-blog__btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    white-space: normal; /* Allow text wrapping */
    word-wrap: break-word; /* Allow text wrapping */
    box-sizing: border-box;
    max-width: 100%; /* Ensure buttons don't overflow */
}

.page-blog__btn-primary {
    background-color: #C30808; /* Custom color for register/login */
    color: #FFFF00; /* Custom color for register/login font */
    border: 2px solid #C30808;
}

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

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

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

.page-blog__btn-register {
    background-color: #C30808;
    color: #FFFF00;
    border: 2px solid #C30808;
}

.page-blog__btn-login {
    background-color: #C30808;
    color: #FFFF00;
    border: 2px solid #C30808;
}

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

/* Featured Posts Section */
.page-blog__featured-posts {
    padding: 60px 0;
    background-color: #017439; /* Main brand color */
    color: #FFFFFF;
}

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

.page-blog__blog-card {
    background-color: #FFFFFF;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    color: #333333;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

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

.page-blog__blog-card-image {
    width: 100%;
    height: 225px; /* Fixed height for blog card images */
    object-fit: cover;
    display: block;
}

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

.page-blog__blog-card-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.4;
    color: #017439;
}

.page-blog__blog-card-meta {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
}

.page-blog__blog-card-excerpt {
    font-size: 15px;
    margin-bottom: 15px;
    flex-grow: 1;
}

.page-blog__blog-card-readmore {
    font-weight: 600;
    color: #C30808;
    display: inline-block;
    margin-top: 10px;
}

.page-blog__btn-view-all {
    display: block;
    width: fit-content;
    margin: 40px auto 0;
    padding: 12px 25px;
    background-color: #C30808;
    color: #FFFF00;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.3s ease;
    box-sizing: border-box;
    max-width: 100%;
}

.page-blog__btn-view-all:hover {
    background-color: #a30606;
}

/* Article Section */
.page-blog__article-section {
    padding: 60px 0;
    background-color: #FFFFFF;
}

.page-blog__article-body {
    max-width: 900px; /* Constrain article width for readability */
    margin: 0 auto;
    padding: 0 20px;
}

.page-blog__article-subtitle {
    font-size: 28px;
    font-weight: 700;
    color: #017439;
    margin-top: 40px;
    margin-bottom: 20px;
    line-height: 1.3;
}

.page-blog__article-body p {
    margin-bottom: 15px;
    font-size: 17px;
    text-align: justify;
}

.page-blog__article-body ul {
    list-style: disc inside;
    margin-bottom: 20px;
    padding-left: 20px;
}

.page-blog__article-body li {
    margin-bottom: 8px;
    font-size: 17px;
}

.page-blog__article-figure {
    margin: 30px 0;
    text-align: center;
}

.page-blog__article-figure img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    display: block; /* Ensure it behaves as a block element for centering */
    margin: 0 auto;
}

.page-blog__article-figure figcaption {
    font-size: 14px;
    color: #666;
    margin-top: 10px;
}

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

.page-blog__cta-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
}

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

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

details.page-blog__faq-item summary.page-blog__faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 25px;
    cursor: pointer;
    user-select: none;
    list-style: none;
    transition: background-color 0.3s ease;
    font-weight: 600;
    font-size: 18px;
    color: #017439;
}

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

details.page-blog__faq-item summary.page-blog__faq-question:hover {
    background: #f5f5f5;
}

.page-blog__faq-qtext {
    flex: 1;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.5;
    text-align: left;
    color: #333333; /* Ensure contrast */
}

.page-blog__faq-toggle {
    font-size: 28px;
    font-weight: bold;
    color: #017439;
    flex-shrink: 0;
    margin-left: 15px;
    width: 30px;
    text-align: center;
    line-height: 1;
}

details.page-blog__faq-item .page-blog__faq-answer {
    padding: 0 25px 20px;
    background: #fcfcfc;
    border-radius: 0 0 8px 8px;
    font-size: 16px;
    line-height: 1.7;
    color: #555555;
}

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

.page-blog__faq-answer a {
    color: #C30808;
    text-decoration: underline;
}

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

    .page-blog__hero-image-wrapper {
        height: 500px;
    }

    .page-blog__hero-title {
        font-size: clamp(2.2rem, 4.5vw, 3rem);
    }

    .page-blog__section-title {
        font-size: 30px;
        margin-bottom: 30px;
    }

    .page-blog__blog-card-title {
        font-size: 18px;
    }

    .page-blog__article-subtitle {
        font-size: 24px;
    }
}

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

    .page-blog__container {
        padding: 0 15px; /* Ensure full width usage with padding */
    }

    /* HERO 主图区域 */
    .page-blog__hero-section {
        padding-top: 10px; /* Small top padding, body handles header offset */
    }

    .page-blog__hero-image-wrapper {
        height: auto; /* Allow height to adjust */
        min-height: 250px;
        aspect-ratio: unset; /* Remove aspect ratio if set */
    }
}