/* style/blog.css */

/* --- Base Styles --- */
.page-blog {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #F2FFF6; /* Default light text for dark body background */
    background-color: #08160F; /* Body background from custom colors */
}

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

.page-blog__section-title,
.page-blog__cta-title {
    font-size: clamp(2em, 4vw, 3em); /* H1 font size constraint */
    font-weight: bold;
    text-align: center;
    margin-bottom: 40px;
    color: #F2FFF6;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

/* --- Hero Section --- */
.page-blog__hero-section {
    position: relative;
    display: flex;
    flex-direction: column; /* Enforce image on top, content below */
    align-items: center;
    justify-content: center;
    padding-top: 10px; /* Small top padding, body handles header offset */
    padding-bottom: 60px;
    background-color: #08160F;
    overflow: hidden;
}

.page-blog__hero-image-wrapper {
    width: 100%;
    max-height: 500px; /* Limit height for hero image */
    overflow: hidden;
    margin-bottom: 30px;
}

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

.page-blog__hero-content {
    text-align: center;
    max-width: 800px;
    padding: 0 20px;
    z-index: 1; /* Ensure content is above any potential background elements */
    color: #F2FFF6;
}

.page-blog__hero-title {
    font-size: clamp(2.5em, 5vw, 3.8em);
    font-weight: 700;
    margin-bottom: 20px;
    color: #F2FFF6;
    line-height: 1.1;
    letter-spacing: -0.03em;
}

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

/* --- Buttons --- */
.page-blog__btn-primary,
.page-blog__btn-secondary {
    display: inline-block;
    padding: 15px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    text-align: center;
    box-sizing: border-box; /* Crucial for responsive buttons */
    white-space: normal; /* Allow text wrap */
    word-wrap: break-word; /* Allow text wrap */
    max-width: 100%; /* Ensure button does not overflow */
}

.page-blog__btn-primary {
    background: linear-gradient(180deg, #2AD16F 0%, #13994A 100%);
    color: #ffffff;
    border: none;
    margin: 10px;
}

.page-blog__btn-primary:hover {
    background: linear-gradient(180deg, #13994A 0%, #2AD16F 100%);
    transform: translateY(-2px);
}

.page-blog__btn-secondary {
    background: transparent;
    color: #11A84E;
    border: 2px solid #11A84E;
    margin: 10px;
}

.page-blog__btn-secondary:hover {
    background: #11A84E;
    color: #ffffff;
}

/* --- Latest Posts Section --- */
.page-blog__latest-posts {
    padding: 80px 0;
    background-color: #08160F; /* Dark background from custom colors */
    color: #F2FFF6;
}

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

.page-blog__article-card {
    background-color: #11271B; /* Card background from custom colors */
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    color: #F2FFF6; /* Light text for dark card background */
}

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

.page-blog__card-image {
    width: 100%;
    height: 225px; /* Fixed height for consistency */
    object-fit: cover;
    display: block;
    filter: none; /* Ensure no filter is applied */
}

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

.page-blog__card-title {
    font-size: 1.5em;
    margin-bottom: 10px;
    color: #F2FFF6;
}

.page-blog__card-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.page-blog__card-title a:hover {
    color: #57E38D; /* Highlight on hover */
}

.page-blog__card-meta {
    font-size: 0.9em;
    color: #A7D9B8;
    margin-bottom: 15px;
}

.page-blog__card-excerpt {
    font-size: 1em;
    color: #A7D9B8;
    margin-bottom: 20px;
}

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

/* --- Categories Section --- */
.page-blog__categories-section {
    padding: 60px 0;
    background-color: #08160F;
    border-top: 1px solid #1E3A2A;
    color: #F2FFF6;
}

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

.page-blog__category-item {
    display: inline-block;
    padding: 10px 20px;
    background-color: #0A4B2C;
    color: #F2FFF6;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.3s ease, color 0.3s ease;
    border: 1px solid #2E7A4E;
}

.page-blog__category-item:hover {
    background-color: #11A84E;
    color: #ffffff;
}

/* --- CTA Section --- */
.page-blog__cta-section {
    padding: 80px 0;
    text-align: center;
    background-color: #11A84E; /* Using main brand color for CTA background */
    color: #ffffff; /* White text for main brand color background */
}

.page-blog__cta-description {
    font-size: 1.1em;
    margin-bottom: 40px;
    color: #ffffff;
}

.page-blog__cta-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap; /* Allow buttons to wrap on smaller screens */
    gap: 20px;
    width: 100%; /* Ensure container takes full width */
    max-width: 100%; /* Ensure container takes full width */
    box-sizing: border-box;
    overflow: hidden;
}

/* --- FAQ Section --- */
.page-blog__faq-section {
    padding: 80px 0;
    background-color: #08160F;
    color: #F2FFF6;
    border-top: 1px solid #1E3A2A;
}

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

.page-blog__faq-item {
    background-color: #11271B;
    border: 1px solid #2E7A4E;
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
    color: #F2FFF6;
}

.page-blog__faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    font-size: 1.15em;
    font-weight: 600;
    cursor: pointer;
    background-color: #0A4B2C;
    color: #F2FFF6;
    user-select: none;
    transition: background-color 0.3s ease;
}

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

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

.page-blog__faq-toggle {
    font-size: 1.5em;
    line-height: 1;
    margin-left: 15px;
    color: #57E38D;
}

.page-blog__faq-item[open] .page-blog__faq-toggle {
    content: "−";
}

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

.page-blog__faq-answer p {
    margin-top: 15px;
    margin-bottom: 0;
}

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

    .page-blog__container {
        padding: 0 15px;
    }

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

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

    .page-blog__hero-description {
        font-size: 1em;
    }

    .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;
        margin-left: 0;
        margin-right: 0;
    }

    .page-blog__cta-buttons {
        flex-direction: column !important; /* Stack buttons vertically */
        gap: 10px;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px;
        padding-right: 15px;
        overflow: hidden !important;
    }

    .page-blog__latest-posts,
    .page-blog__categories-section,
    .page-blog__cta-section,
    .page-blog__faq-section {
        padding: 40px 0;
    }

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

    .page-blog__posts-grid {
        grid-template-columns: 1fr; /* Single column on mobile */
    }

    .page-blog__article-card {
        margin-bottom: 20px;
    }

    .page-blog__card-image {
        height: 200px; /* Adjust height for mobile */
    }

    .page-blog__categories-list {
        flex-direction: column;
        align-items: center;
    }

    .page-blog__category-item {
        width: 100%;
        max-width: 250px; /* Limit width for category items */
        text-align: center;
    }
    
    /* Ensure all images are responsive */
    .page-blog img {
      max-width: 100% !important;
      width: 100% !important;
      height: auto !important;
      display: block !important;
    }
    
    /* Ensure all image containers are responsive */
    .page-blog__hero-image-wrapper,
    .page-blog__posts-grid,
    .page-blog__article-card,
    .page-blog__card-image {
      max-width: 100% !important;
      width: 100% !important;
      box-sizing: border-box !important;
      overflow: hidden !important;
    }
    
    /* Ensure content sections have padding to prevent edge-to-edge content */
    .page-blog__section,
    .page-blog__card,
    .page-blog__container {
        padding-left: 15px;
        padding-right: 15px;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
}