/* style/blog.css */

/* Base styles for the blog page */
.page-blog {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333333; /* Default text color for light background */
    background-color: #ffffff; /* Assuming body background is light/white */
}

/* Hero Section */
.page-blog__hero-section {
    padding-top: 10px; /* Small top padding, body handles header offset */
    padding-bottom: 60px;
    background-color: #f8f8f8; /* Light background for the hero section */
}

.page-blog__hero-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    align-items: center;
    gap: 40px;
    padding: 40px 20px;
}

.page-blog__hero-content {
    flex: 1 1 50%; /* Takes about half width */
    min-width: 300px;
}

.page-blog__main-title {
    font-size: clamp(2.2rem, 4vw, 3.2rem); /* Responsive font size */
    font-weight: 700;
    line-height: 1.2;
    color: #017439; /* Brand primary color */
    margin-bottom: 20px;
}

.page-blog__description {
    font-size: 1.1rem;
    color: #333333;
    margin-bottom: 30px;
}

.page-blog__cta-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.page-blog__btn-primary,
.page-blog__btn-secondary {
    display: inline-block;
    padding: 14px 28px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    text-align: center;
    max-width: 100%; /* Ensure buttons don't overflow */
    box-sizing: border-box;
    white-space: normal;
    word-wrap: break-word;
}

.page-blog__btn-primary {
    background-color: #017439; /* Primary brand color */
    color: #ffffff;
    border: 2px solid #017439;
}

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

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

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

.page-blog__hero-image {
    flex: 1 1 40%; /* Takes about 40% width */
    text-align: center;
    min-width: 250px;
}

.page-blog__hero-image img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    display: block;
    margin: 0 auto;
}

/* Latest Posts Section */
.page-blog__latest-posts-section {
    padding: 60px 0;
    background-color: #ffffff;
}

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

.page-blog__section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #017439;
    text-align: center;
    margin-bottom: 40px;
}

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

.page-blog__post-card {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%; /* Ensure cards have equal height */
    display: flex;
    flex-direction: column;
}

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

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

.page-blog__post-thumbnail {
    width: 100%;
    height: 200px; /* Fixed height for thumbnails */
    overflow: hidden;
}

.page-blog__post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Cover the area, crop if necessary */
    display: block;
}

.page-blog__post-content {
    padding: 20px;
    flex-grow: 1; /* Allows content to expand and push 'Read More' down */
    display: flex;
    flex-direction: column;
}

.page-blog__post-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: #017439;
    margin-bottom: 10px;
}

.page-blog__post-meta {
    font-size: 0.9rem;
    color: #777777;
    margin-bottom: 15px;
}

.page-blog__post-excerpt {
    font-size: 1rem;
    color: #555555;
    margin-bottom: 15px;
    flex-grow: 1; /* Allow excerpt to take available space */
}

.page-blog__read-more {
    display: inline-block;
    color: #017439;
    font-weight: 600;
    text-decoration: underline;
    margin-top: auto; /* Push to the bottom */
}

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

.page-blog__pagination-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    text-decoration: none;
    color: #017439;
    font-weight: 600;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.page-blog__pagination-item.is-active,
.page-blog__pagination-item:hover {
    background-color: #017439;
    color: #ffffff;
    border-color: #017439;
}

/* CTA Section (dark background) */
.page-blog__cta-section {
    background-color: #017439; /* Brand primary color for dark section */
    color: #ffffff;
    padding: 80px 20px;
    text-align: center;
}

.page-blog__cta-content {
    max-width: 900px;
    margin: 0 auto;
}

.page-blog__cta-title {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 25px;
    line-height: 1.2;
    color: #FFFF00; /* Use specified color for prominent titles on dark background */
}

.page-blog__cta-description {
    font-size: 1.2rem;
    margin-bottom: 40px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

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

/* Adjust button styles for dark CTA section */
.page-blog__cta-section .page-blog__btn-primary {
    background-color: #C30808; /* Register/Login color */
    border-color: #C30808;
    color: #FFFF00; /* Register/Login font color */
}

.page-blog__cta-section .page-blog__btn-primary:hover {
    background-color: #a00606;
    border-color: #a00606;
}

.page-blog__cta-section .page-blog__btn-secondary {
    background-color: #ffffff;
    border-color: #ffffff;
    color: #017439;
}

.page-blog__cta-section .page-blog__btn-secondary:hover {
    background-color: #e0e0e0;
    border-color: #e0e0e0;
}


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

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

.page-blog__faq-item {
    background-color: #ffffff;
    border-radius: 12px;
    margin-bottom: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.page-blog__faq-item[open] {
    border-color: #017439;
}

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

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

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

.page-blog__faq-toggle {
    font-size: 1.8rem;
    font-weight: 300;
    margin-left: 15px;
    color: #017439;
    pointer-events: none; /* Prevent interaction with the toggle icon */
}

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

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

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

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

    /* General container padding for mobile */
    .page-blog__container,
    .page-blog__hero-container,
    .page-blog__cta-content {
        padding-left: 15px !important;
        padding-right: 15px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* HERO Section */
    .page-blog__hero-section {
        padding-top: 10px !important; /* Ensure small top padding */
        padding-bottom: 40px;
    }

    .page-blog__hero-container {
        flex-direction: column; /* Stack elements vertically */
        gap: 30px;
        padding-top: 20px;
        padding-bottom: 20px;
    }

    .page-blog__hero-content,
    .page-blog__hero-image {
        flex: 1 1 100%; /* Full width on mobile */
        min-width: unset;
    }

    .page-blog__main-title {
        font-size: 2rem; /* Adjusted for mobile */
        text-align: center;
    }

    .page-blog__description {
        font-size: 1rem;
        text-align: center;
    }

    .page-blog__cta-group {
        flex-direction: column; /* Stack buttons vertically */
        gap: 10px;
    }

    .page-blog__btn-primary,
    .page-blog__btn-secondary {
        max-width: 100% !important;
        width: 100% !important;
        padding-left: 15px;
        padding-right: 15px;
        white-space: normal !important;
        word-wrap: break-word !important;
    }

    /* Latest Posts Section */
    .page-blog__section-title {
        font-size: 2rem;
        margin-bottom: 30px;
    }

    .page-blog__post-grid {
        grid-template-columns: 1fr; /* Single column layout */
        gap: 20px;
    }

    .page-blog__post-thumbnail {
        height: 180px; /* Slightly smaller thumbnails on mobile */
    }

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

    .page-blog__cta-title {
        font-size: 2rem;
        margin-bottom: 20px;
    }

    .page-blog__cta-description {
        font-size: 1rem;
        margin-bottom: 30px;
    }

    .page-blog__cta-buttons {
        flex-direction: column; /* Stack buttons vertically */
        gap: 15px;
    }

    /* FAQ Section */
    .page-blog__faq-question {
        padding: 15px 20px;
        font-size: 1.1rem;
    }

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

    /* All images must be responsive */
    .page-blog img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
    }
    /* Specific image handling for blog post thumbnails (if needed, but general img rule should cover) */
    .page-blog__post-thumbnail img {
        object-fit: cover !important; /* Maintain aspect ratio and cover */
    }
}