/* Base styles for the blog page */
.page-blog {
    font-family: 'Arial', sans-serif;
    color: #333333; /* Default text color for light background */
    line-height: 1.6;
    background-color: var(--background-color, #FFFFFF); /* Inherit from shared or default to white */
}

/* Hero Section */
.page-blog__hero-section {
    position: relative;
    padding-top: 10px; /* Small top padding, relying on body for header offset */
    background-color: #F8F8F8;
    text-align: center;
    overflow: hidden;
}

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

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

.page-blog__hero-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
    background-color: #FFFFFF; /* Explicitly white for contrast */
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-50px); /* Slightly lift content over image */
    position: relative;
    z-index: 1; /* Ensure content is above image if any overlap */
}

.page-blog__hero-title {
    font-size: clamp(2em, 4vw, 2.8em); /* Responsive font size */
    color: #26A9E0;
    margin-bottom: 20px;
    font-weight: 700;
    line-height: 1.2;
}

.page-blog__hero-description {
    font-size: 1.1em;
    color: #555555;
    margin-bottom: 30px;
}

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

/* Section Titles */
.page-blog__section-title {
    font-size: clamp(1.8em, 3.5vw, 2.5em);
    color: #26A9E0;
    text-align: center;
    margin-bottom: 30px;
    font-weight: 700;
}

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

/* Call to Action Buttons */
.page-blog__cta-button {
    display: inline-block;
    padding: 15px 30px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1em;
    transition: background-color 0.3s ease, transform 0.2s ease;
    max-width: 100%;
    box-sizing: border-box;
    white-space: normal;
    word-wrap: break-word;
}

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

.page-blog__btn-primary:hover {
    background-color: #1a8cc7;
    transform: translateY(-2px);
}

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

.page-blog__btn-secondary:hover {
    background-color: #e0f2f7;
    transform: translateY(-2px);
}

.page-blog__btn-outline {
    display: inline-block;
    padding: 8px 15px;
    border: 1px solid #26A9E0;
    color: #26A9E0;
    border-radius: 3px;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 500;
    transition: background-color 0.3s ease, color 0.3s ease;
    margin-top: auto; /* Push to bottom of card */
}

.page-blog__btn-outline:hover {
    background-color: #26A9E0;
    color: #FFFFFF;
}

/* Latest Posts Section */
.page-blog__latest-posts-section {
    background-color: #F8F8F8; /* Light background for this section */
    padding-top: 20px;
}

.page-blog__blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 40px;
    align-items: stretch; /* Ensure cards in a row have same height */
}

.page-blog__blog-card {
    background-color: #FFFFFF;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%; /* Ensure card takes full height of grid cell */
    transition: transform 0.2s ease;
}

.page-blog__blog-card:hover {
    transform: translateY(-5px);
}

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

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

.page-blog__blog-card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Allow content to grow and push button down */
}

.page-blog__blog-card-title {
    font-size: 1.3em;
    color: #26A9E0;
    margin-bottom: 10px;
    font-weight: 600;
    line-height: 1.3;
}

.page-blog__blog-card-meta {
    font-size: 0.9em;
    color: #888888;
    margin-bottom: 15px;
}

.page-blog__blog-card-excerpt {
    font-size: 1em;
    color: #555555;
    margin-bottom: 20px;
    flex-grow: 1; /* Allow excerpt to take up available space */
}

.page-blog__cta-buttons {
    text-align: center;
    margin-top: 50px;
}

/* Categories Section */
.page-blog__categories-section {
    background-color: #26A9E0; /* Darker background for contrast */
    color: #FFFFFF; /* White text for dark background */
    padding: 60px 0;
}

.page-blog__categories-section .page-blog__section-title,
.page-blog__categories-section .page-blog__section-description {
    color: #FFFFFF;
}

.page-blog__categories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 40px;
}

.page-blog__category-card {
    background-color: rgba(255, 255, 255, 0.15); /* Semi-transparent white */
    border-radius: 8px;
    padding: 25px;
    text-align: center;
    text-decoration: none;
    color: #FFFFFF;
    transition: background-color 0.3s ease, transform 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

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

.page-blog__category-title {
    font-size: 1.25em;
    margin-bottom: 10px;
    font-weight: 600;
    color: #FFFFFF;
}

.page-blog__category-description {
    font-size: 0.95em;
    color: #F0F0F0;
}

/* Why Swin8 Section */
.page-blog__why-swin8-section {
    padding: 60px 0;
    background-color: #FFFFFF;
}

.page-blog__why-swin8-content {
    display: flex;
    gap: 40px;
    align-items: center;
    margin-top: 40px;
}

.page-blog__why-swin8-image {
    flex: 1;
    max-width: 50%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: block; /* Ensure it respects max-width */
    min-width: 200px; /* Min size requirement */
    min-height: 200px;
}

.page-blog__why-swin8-text {
    flex: 1;
    max-width: 50%;
    color: #555555;
}

.page-blog__why-swin8-text p {
    margin-bottom: 20px;
    font-size: 1.05em;
}

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

.page-blog__faq-list {
    max-width: 900px;
    margin: 40px auto 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 8px rgba(0,0,0,0.05);
}

.page-blog__faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    font-size: 1.15em;
    font-weight: 600;
    color: #26A9E0;
    cursor: pointer;
    list-style: none; /* Hide default marker */
}

.page-blog__faq-question::-webkit-details-marker {
    display: none; /* Hide default marker for webkit browsers */
}

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

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

.page-blog__faq-item[open] .page-blog__faq-toggle {
    transform: rotate(45deg); /* Rotate plus to cross */
}

.page-blog__faq-answer {
    padding: 0 20px 20px 20px;
    font-size: 1em;
    color: #555555;
}

/* Newsletter CTA Section */
.page-blog__newsletter-cta {
    background-color: #26A9E0;
    color: #FFFFFF;
    padding: 60px 0;
    text-align: center;
}

.page-blog__newsletter-cta .page-blog__section-title,
.page-blog__newsletter-cta .page-blog__section-description {
    color: #FFFFFF;
}

.page-blog__newsletter-content {
    max-width: 800px;
    margin: 0 auto;
}

.page-blog__newsletter-content .page-blog__cta-button {
    margin-top: 30px;
    background-color: #EA7C07; /* Login color for prominent CTA */
    border-color: #EA7C07;
}

.page-blog__newsletter-content .page-blog__cta-button:hover {
    background-color: #d46c06;
    border-color: #d46c06;
}

/* --- Responsive Styles (Mobile First Approach) --- */
@media (max-width: 1024px) {
    .page-blog__container {
        padding: 30px 20px;
    }

    .page-blog__hero-content {
        padding: 30px 20px;
        transform: translateY(-40px);
    }

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

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

    .page-blog__categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .page-blog__why-swin8-content {
        flex-direction: column;
        gap: 30px;
    }

    .page-blog__why-swin8-image,
    .page-blog__why-swin8-text {
        max-width: 100%;
    }
}


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

    .page-blog__hero-content {
        padding: 25px 15px;
        transform: translateY(-30px);
    }

    .page-blog__hero-title {
        font-size: clamp(1.5em, 6vw, 2em); /* Smaller on mobile */
        margin-bottom: 15px;
    }

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

    /* 通用容器和图片适配 */
    .page-blog__container {
        padding: 20px 15px; /* Add side padding for content areas */
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

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

    /* 博客卡片区 */
    .page-blog__blog-grid {
        grid-template-columns: 1fr; /* Single column on mobile */
        gap: 20px;
        margin-top: 30px;
    }

    .page-blog__blog-card-image {
        height: 180px; /* Adjust height for mobile */
    }

    .page-blog__blog-card-title {
        font-size: 1.15em;
    }

    .page-blog__blog-card-excerpt {
        font-size: 0.95em;
    }

    .page-blog__cta-buttons {
        margin-top: 40px;
        display: flex;
        flex-direction: column; /* Stack buttons vertically */
        gap: 15px;
        padding: 0 15px; /* Ensure buttons have side padding */
    }

    /* 按钮与按钮容器 */
    .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; /* Ensure text inside button has padding */
        padding-right: 15px;
        text-align: center;
    }

    .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-wrap: wrap !important;
        gap: 10px;
    }

    /* Categories Section */
    .page-blog__categories-grid {
        grid-template-columns: 1fr; /* Single column on mobile */
        gap: 15px;
    }

    /* Why Swin8 Section */
    .page-blog__why-swin8-content {
        flex-direction: column;
    }
    .page-blog__why-swin8-image,
    .page-blog__why-swin8-text {
        max-width: 100%;
    }

    /* FAQ Section */
    .page-blog__faq-list {
        margin-top: 30px;
    }
    .page-blog__faq-question {
        font-size: 1em;
        padding: 15px;
    }
    .page-blog__faq-answer {
        padding: 0 15px 15px 15px;
        font-size: 0.95em;
    }

    /* Newsletter CTA */
    .page-blog__newsletter-cta .page-blog__section-title {
        font-size: clamp(1.5em, 6vw, 2em);
    }
    .page-blog__newsletter-cta .page-blog__section-description {
        font-size: 1em;
    }
}

/* Specific color contrast classes (as per smart contrast system) */
.page-blog__dark-bg {
  background: #26A9E0; /* Using brand color */
  color: #ffffff; /* Forced white text */
}

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

.page-blog__light-bg {
  background: #ffffff;
  color: #333333; /* Forced dark text */
}

/* Ensure no `filter` properties are used */
.page-blog img {
    filter: none !important; /* Explicitly ensure no filters are applied */
}