/* style/blog.css */

/* Custom Colors */
:root {
    --hd88in-primary: #11A84E;
    --hd88in-secondary: #22C768;
    --hd88in-text-main: #F2FFF6;
    --hd88in-text-secondary: #A7D9B8;
    --hd88in-bg-card: #11271B;
    --hd88in-bg-body: #08160F;
    --hd88in-border: #2E7A4E;
    --hd88in-glow: #57E38D;
    --hd88in-gold: #F2C14E;
    --hd88in-divider: #1E3A2A;
    --hd88in-deep-green: #0A4B2C;
    --hd88in-btn-gradient: linear-gradient(180deg, #2AD16F 0%, #13994A 100%);
    --text-on-dark: #ffffff;
    --text-on-light: #333333;
}

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

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

.page-blog__section-title {
    font-size: 2.5em;
    color: var(--hd88in-gold);
    text-align: center;
    margin-bottom: 40px;
    font-weight: bold;
    line-height: 1.2;
}

/* Hero Section */
.page-blog__hero-section {
    position: relative;
    padding-top: 10px; /* Small top padding, body handles header offset */
    padding-bottom: 60px;
    background-color: var(--hd88in-bg-body);
    overflow: hidden;
}

.page-blog__hero-image-wrapper {
    width: 100%;
    max-height: 500px; /* Limit height */
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 40px;
}

.page-blog__hero-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    filter: brightness(0.7); /* Slightly darken image for text readability */
}

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

.page-blog__main-title {
    font-size: clamp(2.2em, 4vw, 3.2em); /* Responsive font size */
    color: var(--hd88in-gold);
    margin-bottom: 20px;
    font-weight: bold;
    line-height: 1.2;
}

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

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

.page-blog__btn-primary,
.page-blog__btn-secondary {
    display: inline-block;
    padding: 14px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1em;
    transition: all 0.3s ease;
    box-sizing: border-box;
    max-width: 100%;
    white-space: normal;
    word-wrap: break-word;
}

.page-blog__btn-primary {
    background: var(--hd88in-btn-gradient);
    color: var(--text-on-dark);
    border: none;
    box-shadow: 0 4px 15px rgba(34, 199, 104, 0.4);
}

.page-blog__btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(34, 199, 104, 0.6);
}

.page-blog__btn-secondary {
    background: transparent;
    color: var(--hd88in-primary);
    border: 2px solid var(--hd88in-primary);
}

.page-blog__btn-secondary:hover {
    background: var(--hd88in-primary);
    color: var(--text-on-dark);
    transform: translateY(-2px);
}

/* Featured Posts Section */
.page-blog__featured-posts-section,
.page-blog__all-posts-section {
    padding: 60px 0;
    background-color: var(--hd88in-bg-body);
}

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

.page-blog__post-card {
    background-color: var(--hd88in-bg-card);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    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 30px rgba(0, 0, 0, 0.3);
}

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

.page-blog__post-image {
    width: 100%;
    height: 225px; /* Fixed height for consistency */
    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.4em;
    color: var(--hd88in-text-main);
    margin-bottom: 10px;
    font-weight: bold;
}

.page-blog__post-meta {
    font-size: 0.9em;
    color: var(--hd88in-text-secondary);
    margin-bottom: 15px;
}

.page-blog__post-excerpt {
    font-size: 1em;
    color: var(--hd88in-text-secondary);
    line-height: 1.5;
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Limit to 3 lines */
    -webkit-box-orient: vertical;
}

/* Categories Section */
.page-blog__categories-section {
    padding: 40px 0;
    background-color: var(--hd88in-bg-body);
    border-top: 1px solid var(--hd88in-divider);
    border-bottom: 1px solid var(--hd88in-divider);
}

.page-blog__categories-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

.page-blog__category-item {
    background-color: var(--hd88in-deep-green);
    color: var(--hd88in-text-main);
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.95em;
    transition: background-color 0.3s ease, color 0.3s ease;
    border: 1px solid var(--hd88in-border);
}

.page-blog__category-item:hover {
    background-color: var(--hd88in-primary);
    color: var(--text-on-dark);
}

/* All Posts Section (already combined with featured posts for padding) */
.page-blog__posts-grid--all {
    /* Specific styling if needed for all posts grid, e.g., different column count */
}

/* Pagination */
.page-blog__pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 50px;
}

.page-blog__pagination-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--hd88in-bg-card);
    color: var(--hd88in-text-secondary);
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease, color 0.3s ease;
    border: 1px solid var(--hd88in-border);
}

.page-blog__pagination-item:hover:not(.page-blog__pagination-item--active) {
    background-color: var(--hd88in-deep-green);
    color: var(--hd88in-text-main);
}

.page-blog__pagination-item--active {
    background: var(--hd88in-btn-gradient);
    color: var(--text-on-dark);
    cursor: default;
    border-color: transparent;
}

/* CTA Section */
.page-blog__cta-section {
    padding: 80px 0;
    text-align: center;
    background-color: var(--hd88in-deep-green);
    border-top: 1px solid var(--hd88in-divider);
}

.page-blog__cta-section .page-blog__section-title {
    color: var(--hd88in-gold);
    margin-bottom: 25px;
}

.page-blog__cta-section .page-blog__description {
    color: var(--hd88in-text-main);
    max-width: 800px;
    margin: 0 auto 40px auto;
}

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

.page-blog__section,
.page-blog__card,
.page-blog__container {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden; /* Ensure no horizontal scroll */
}

/* Contrast Fix (if needed, though colors are chosen for contrast) */
.page-blog__contrast-fix {
    background: #ffffff !important;
    color: #333333 !important;
    border: 1px solid #e0e0e0 !important;
}

.page-blog__text-contrast-fix {
    color: #333333 !important;
    text-shadow: none !important;
}

/* --- Tablet Responsive Styles (max-width: 1024px) --- */
@media (max-width: 1024px) {
    .page-blog__container {
        padding: 0 15px;
    }
    .page-blog__section-title {
        font-size: 2.2em;
        margin-bottom: 30px;
    }
    .page-blog__hero-image-wrapper {
        max-height: 400px;
        margin-bottom: 30px;
    }
    .page-blog__main-title {
        font-size: clamp(2em, 3.5vw, 2.8em);
    }
    .page-blog__description {
        font-size: 1em;
        margin-bottom: 25px;
    }
    .page-blog__cta-buttons {
        gap: 15px;
    }
    .page-blog__btn-primary,
    .page-blog__btn-secondary {
        padding: 12px 25px;
        font-size: 1em;
    }
    .page-blog__featured-posts-section,
    .page-blog__all-posts-section {
        padding: 50px 0;
    }
    .page-blog__posts-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 25px;
    }
    .page-blog__post-image {
        height: 200px;
    }
    .page-blog__post-title {
        font-size: 1.3em;
    }
    .page-blog__post-content {
        padding: 15px;
    }
    .page-blog__categories-section {
        padding: 35px 0;
    }
    .page-blog__categories-list {
        gap: 10px;
    }
    .page-blog__category-item {
        padding: 8px 18px;
        font-size: 0.9em;
    }
    .page-blog__pagination {
        margin-top: 40px;
    }
    .page-blog__cta-section {
        padding: 60px 0;
    }
}

/* --- Mobile Responsive Styles (max-width: 768px) --- */
@media (max-width: 768px) {
    .page-blog__container {
        padding: 0 15px !important; /* Mobile padding */
    }

    .page-blog__section-title {
        font-size: 2em !important;
        margin-bottom: 30px !important;
    }

    /* HERO 主图区域 */
    .page-blog__hero-section {
        padding-top: 10px !important; /* Small top padding for mobile */
        padding-bottom: 40px !important;
    }

    .page-blog__hero-image-wrapper {
        max-height: 300px !important;
        margin-bottom: 30px !important;
    }

    .page-blog__main-title {
        font-size: 2em !important;
        margin-bottom: 15px !important;
    }

    .page-blog__description {
        font-size: 1em !important;
        margin-bottom: 20px !important;
    }

    /* 按钮与按钮容器 */
    .page-blog__cta-buttons {
        flex-direction: column !important; /* Stack buttons vertically */
        gap: 15px !important;
        padding: 0 15px !important; /* Add padding to container */
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    .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 !important;
        padding-right: 15px !important;
        text-align: center !important;
    }

    /* 通用图片与容器 */
    .page-blog img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
    }
    
    .page-blog__section,
    .page-blog__card,
    .page-blog__container {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    /* 其他内容模块 (Featured Posts, All Posts) */
    .page-blog__featured-posts-section,
    .page-blog__all-posts-section {
        padding: 40px 0 !important;
    }

    .page-blog__posts-grid {
        grid-template-columns: 1fr !important; /* Single column for posts */
        gap: 20px !important;
    }

    .page-blog__post-card {
        margin-left: 0 !important; /* Remove horizontal margins if any */
        margin-right: 0 !important;
        width: auto !important; /* Allow card to take full available width */
    }

    .page-blog__post-image {
        height: 180px !important; /* Adjust height for smaller screens */
    }

    .page-blog__post-title {
        font-size: 1.2em !important;
    }

    .page-blog__post-meta,
    .page-blog__post-excerpt {
        font-size: 0.9em !important;
    }

    /* Categories Section */
    .page-blog__categories-section {
        padding: 30px 0 !important;
    }

    .page-blog__categories-list {
        flex-direction: column !important; /* Stack categories vertically */
        gap: 10px !important;
        align-items: center !important;
    }

    .page-blog__category-item {
        width: calc(100% - 30px) !important; /* Full width minus container padding */
        text-align: center !important;
        padding: 12px 15px !important;
        font-size: 1em !important;
    }

    /* Pagination */
    .page-blog__pagination {
        margin-top: 30px !important;
    }

    .page-blog__pagination-item {
        width: 36px !important;
        height: 36px !important;
        font-size: 0.9em !important;
    }

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

    .page-blog__cta-section .page-blog__description {
        font-size: 1em !important;
    }
}