/* style/blog.css */

/* --- Base Styles & Variables (from Custom Palette) --- */
:root {
    --page-blog-primary-color: #11A84E; /* Main */
    --page-blog-secondary-color: #22C768; /* Auxiliary */
    --page-blog-button-gradient: linear-gradient(180deg, #2AD16F 0%, #13994A 100%);
    --page-blog-card-bg: #11271B;
    --page-blog-background: #08160F;
    --page-blog-text-main: #F2FFF6;
    --page-blog-text-secondary: #A7D9B8;
    --page-blog-border-color: #2E7A4E;
    --page-blog-glow-color: #57E38D;
    --page-blog-gold-color: #F2C14E;
    --page-blog-divider-color: #1E3A2A;
    --page-blog-deep-green-color: #0A4B2C;
}

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

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

/* Section Titles */
.page-blog__section-title {
    font-size: clamp(28px, 4vw, 42px); /* Clamp for H1 in hero, but for H2/H3 in sections, slightly smaller */
    font-weight: 700;
    text-align: center;
    margin-bottom: 20px;
    color: var(--page-blog-text-main);
}

.page-blog__tagline {
    font-size: clamp(16px, 2vw, 20px);
    text-align: center;
    margin-bottom: 40px;
    color: var(--page-blog-text-secondary);
}

/* Text blocks */
.page-blog__text-block {
    margin-bottom: 20px;
    font-size: 17px;
    line-height: 1.7;
    color: var(--page-blog-text-main);
}

.page-blog__light-bg {
    background-color: #ffffff; /* For contrast, using white background for light sections */
    color: #333333; /* Dark text for light background */
}

.page-blog__light-bg .page-blog__section-title,
.page-blog__light-bg .page-blog__tagline,
.page-blog__light-bg .page-blog__text-block,
.page-blog__light-bg .page-blog__feature-title,
.page-blog__light-bg .page-blog__feature-description,
.page-blog__light-bg .page-blog__faq-qtext,
.page-blog__light-bg .page-blog__faq-answer p {
    color: #333333; /* Ensure dark text on light background */
}

.page-blog__dark-section {
    background-color: var(--page-blog-background);
    color: var(--page-blog-text-main);
}

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

.page-blog__btn-primary {
    background: var(--page-blog-button-gradient);
    color: #ffffff;
    border: 2px solid transparent;
}

.page-blog__btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.page-blog__btn-secondary {
    background: #ffffff;
    color: var(--page-blog-primary-color);
    border: 2px solid var(--page-blog-primary-color);
}

.page-blog__btn-secondary:hover {
    background: var(--page-blog-primary-color);
    color: #ffffff;
    border-color: var(--page-blog-primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* CTA Buttons Group */
.page-blog__cta-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
    flex-wrap: wrap; /* Allow wrapping for multiple buttons */
    width: 100%; /* Ensure container responsiveness */
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

/* --- Hero Section --- */
.page-blog__hero-section {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 60px; /* Space for content below image */
    background-color: var(--page-blog-background); /* Fallback */
    padding-top: 10px; /* Small top padding, body handles header offset */
}

.page-blog__hero-image-wrapper {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
    display: block;
    margin-bottom: 30px; /* Space between image and content */
}

.page-blog__hero-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    filter: none; /* No image filter */
}

.page-blog__hero-content {
    text-align: center;
    max-width: 900px;
    padding: 0 20px;
    box-sizing: border-box;
    color: var(--page-blog-text-main);
}

.page-blog__main-title {
    font-size: clamp(36px, 5vw, 54px); /* H1 font size with clamp */
    font-weight: 800;
    margin-bottom: 15px;
    line-height: 1.2;
    color: var(--page-blog-gold-color); /* Use gold for prominence */
}

.page-blog__tagline {
    font-size: clamp(18px, 2.5vw, 24px);
    margin-bottom: 30px;
    color: var(--page-blog-text-secondary);
}

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

/* --- Topics Section --- */
.page-blog__topics-section {
    padding: 80px 0;
    background-color: var(--page-blog-background);
}

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

.page-blog__topic-card {
    background-color: var(--page-blog-card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    color: var(--page-blog-text-main);
}

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

.page-blog__card-image {
    width: 100%;
    height: 220px; /* Fixed height for consistency */
    object-fit: cover;
    display: block;
    filter: none; /* No image filter */
    min-height: 200px; /* Enforce min size */
}

.page-blog__card-title {
    font-size: 22px;
    font-weight: 700;
    margin: 20px 20px 10px;
    color: var(--page-blog-gold-color);
}

.page-blog__card-description {
    font-size: 15px;
    margin: 0 20px 20px;
    flex-grow: 1; /* Allow description to take available space */
    color: var(--page-blog-text-secondary);
}

.page-blog__card-link {
    display: block;
    text-align: center;
    padding: 12px 20px;
    background-color: var(--page-blog-primary-color);
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.3s ease;
    border-radius: 0 0 12px 12px;
    max-width: 100%;
    box-sizing: border-box;
    white-space: normal;
    word-wrap: break-word;
}

.page-blog__card-link:hover {
    background-color: var(--page-blog-secondary-color);
}

/* --- Why Read Section --- */
.page-blog__why-read-section {
    padding: 80px 0;
}

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

.page-blog__feature-item {
    background-color: #ffffff; /* Light background for features */
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
    color: #333333; /* Dark text */
}

.page-blog__feature-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--page-blog-primary-color);
}

.page-blog__feature-description {
    font-size: 16px;
    line-height: 1.6;
    color: #555555;
}

/* --- Featured Articles Section --- */
.page-blog__featured-articles-section {
    padding: 80px 0;
}

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

.page-blog__article-card {
    background-color: var(--page-blog-card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    color: var(--page-blog-text-main);
}

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

.page-blog__article-card .page-blog__card-image {
    height: 220px; /* Consistent image height */
    min-height: 200px;
}

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

.page-blog__article-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.3;
}

.page-blog__article-title a {
    color: var(--page-blog-gold-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.page-blog__article-title a:hover {
    color: var(--page-blog-glow-color);
}

.page-blog__article-meta {
    font-size: 14px;
    color: var(--page-blog-text-secondary);
    margin-bottom: 15px;
}

.page-blog__article-excerpt {
    font-size: 15px;
    color: var(--page-blog-text-secondary);
    margin-bottom: 20px;
    flex-grow: 1;
}

.page-blog__read-more {
    display: inline-block;
    padding: 8px 15px;
    background-color: var(--page-blog-deep-green-color);
    color: #ffffff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.3s ease;
    align-self: flex-start;
    max-width: 100%;
    box-sizing: border-box;
    white-space: normal;
    word-wrap: break-word;
}

.page-blog__read-more:hover {
    background-color: var(--page-blog-primary-color);
}

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

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

.page-blog__faq-list {
    margin-top: 40px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.page-blog__faq-item {
    background-color: #ffffff;
    border: 1px solid var(--page-blog-border-color);
    border-radius: 10px;
    margin-bottom: 15px;
    overflow: hidden;
    color: #333333; /* Dark text for light background */
}

.page-blog__faq-item[open] {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.page-blog__faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    color: var(--page-blog-primary-color);
    transition: background-color 0.3s ease;
    list-style: none; /* Remove default summary marker */
}

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

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

.page-blog__faq-toggle {
    font-size: 24px;
    font-weight: 700;
    color: var(--page-blog-primary-color);
    margin-left: 15px;
}

.page-blog__faq-answer {
    padding: 0 25px 20px;
    font-size: 16px;
    line-height: 1.7;
    color: #555555;
}

/* --- Conclusion Section --- */
.page-blog__conclusion-section {
    padding: 80px 0;
    text-align: center;
}

/* --- Responsive Design --- */
@media (max-width: 1024px) {
    .page-blog__hero-content {
        max-width: 700px;
    }

    .page-blog__topics-grid,
    .page-blog__articles-grid,
    .page-blog__features-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

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

    .page-blog__hero-section {
        padding-bottom: 40px;
        padding-top: 10px !important; /* body handles header offset */
    }

    .page-blog__hero-image-wrapper,
    .page-blog__hero-image {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        box-sizing: border-box !important;
    }

    .page-blog__main-title {
        font-size: 32px;
    }

    .page-blog__tagline {
        font-size: 18px;
    }

    .page-blog__cta-buttons {
        flex-direction: column !important;
        gap: 15px !important;
        padding: 0 15px !important; /* Add padding to buttons container */
    }

    .page-blog__btn-primary,
    .page-blog__btn-secondary,
    .page-blog a[class*="button"],
    .page-blog a[class*="btn"],
    .page-blog__card-link,
    .page-blog__read-more {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px !important; /* Ensure padding for full width buttons */
        padding-right: 15px !important;
        white-space: normal !important;
        word-wrap: break-word !important;
    }

    .page-blog__section-title {
        font-size: 26px;
    }

    .page-blog__text-block {
        font-size: 16px;
    }

    .page-blog__topic-card,
    .page-blog__article-card,
    .page-blog__feature-item {
        margin-left: 15px !important;
        margin-right: 15px !important;
        max-width: calc(100% - 30px) !important; /* Adjust for padding */
        width: calc(100% - 30px) !important;
        box-sizing: border-box !important;
    }

    .page-blog__card-image {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        min-height: 200px !important;
        box-sizing: border-box !important;
    }

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

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

    /* General image responsiveness */
    .page-blog img {
        max-width: 100% !important;
        height: auto !important;
        display: block !important;
        filter: none !important; /* Ensure no filters */
    }

    /* All containers with images/content */
    .page-blog__section,
    .page-blog__card,
    .page-blog__container,
    .page-blog__topics-section,
    .page-blog__why-read-section,
    .page-blog__featured-articles-section,
    .page-blog__faq-section,
    .page-blog__conclusion-section,
    .page-blog__hero-section,
    .page-blog__introduction-section,
    .page-blog__topics-grid,
    .page-blog__articles-grid,
    .page-blog__features-grid,
    .page-blog__faq-list {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important; /* Prevent horizontal scroll */
    }

    /* Specific padding for sections to ensure content doesn't touch edges */
    .page-blog__introduction-section,
    .page-blog__topics-section,
    .page-blog__why-read-section,
    .page-blog__featured-articles-section,
    .page-blog__faq-section,
    .page-blog__conclusion-section {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
}

@media (max-width: 480px) {
    .page-blog__main-title {
        font-size: 28px;
    }

    .page-blog__tagline {
        font-size: 16px;
    }

    .page-blog__section-title {
        font-size: 24px;
    }

    .page-blog__btn-primary,
    .page-blog__btn-secondary {
        padding: 10px 20px;
    }
}