/* 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; /* Default body background */
}

/* Hero Section */
.page-blog__hero-section {
    display: flex;
    flex-direction: column; /* Image then text on mobile, flex-direction: column for desktop to ensure image is above text */
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 15px 40px; /* Small top padding */
    align-items: center;
    text-align: center;
    gap: 30px;
}

.page-blog__hero-image {
    order: -1; /* Image first in DOM, but CSS makes it appear above content on desktop */
    width: 100%;
}

.page-blog__hero-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.page-blog__hero-content {
    width: 100%;
}

.page-blog__main-title {
    font-size: clamp(2rem, 5vw, 3.5rem); /* Responsive font size */
    color: #017439;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 15px;
}

.page-blog__description {
    font-size: 1.15rem;
    color: #555555;
    margin-bottom: 30px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.page-blog__cta-buttons {
    display: flex;
    flex-wrap: wrap; /* Allow buttons to wrap on smaller screens */
    gap: 15px;
    justify-content: center;
}

.page-blog__btn-primary,
.page-blog__btn-secondary {
    display: inline-block;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    max-width: 100%; /* Ensure responsiveness */
    box-sizing: border-box;
    white-space: normal;
    word-wrap: break-word;
}

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

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

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

.page-blog__btn-secondary:hover {
    background-color: #f0f0f0;
    color: #005f2e;
    border-color: #005f2e;
}

/* Section titles */
.page-blog__section-title {
    font-size: 2.5rem;
    color: #017439;
    text-align: center;
    margin-top: 50px;
    margin-bottom: 30px;
    font-weight: 700;
}

/* Featured Article Section */
.page-blog__featured-article {
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px 15px;
    background-color: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.page-blog__article-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
}

.page-blog__article-card .page-blog__card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.page-blog__article-card img {
    width: 100%;
    max-width: 800px; /* Adjust max-width for larger featured image */
    height: auto;
    display: block;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.page-blog__article-card .page-blog__card-content {
    padding: 15px 0;
    text-align: center;
}

.page-blog__article-card .page-blog__card-title {
    font-size: 2rem;
    color: #017439;
    margin-bottom: 10px;
    font-weight: 600;
    transition: color 0.3s ease;
}

.page-blog__article-card .page-blog__card-link:hover .page-blog__card-title {
    color: #005f2e;
}

.page-blog__article-card .page-blog__card-excerpt {
    font-size: 1.1rem;
    color: #555555;
    margin-bottom: 15px;
}

.page-blog__article-card .page-blog__post-date {
    font-size: 0.95rem;
    color: #888888;
    display: block;
    margin-bottom: 10px;
}

.page-blog__article-card .page-blog__read-more {
    font-size: 1rem;
    color: #017439;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.page-blog__icon-arrow-right {
    display: inline-block;
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 5px solid #017439;
    transition: transform 0.3s ease;
}

.page-blog__article-card .page-blog__card-link:hover .page-blog__icon-arrow-right {
    transform: translateX(5px);
}


/* Latest Posts Grid */
.page-blog__latest-posts {
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px 15px;
}

.page-blog__post-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 columns for desktop */
    gap: 30px;
}

.page-blog__post-card {
    background-color: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    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 25px rgba(0, 0, 0, 0.15);
}

.page-blog__post-card .page-blog__card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%; /* Ensure card stretches to fill grid item */
}

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

.page-blog__post-card .page-blog__card-content {
    padding: 20px;
    flex-grow: 1; /* Allow content to grow */
    display: flex;
    flex-direction: column;
}

.page-blog__post-card .page-blog__card-title {
    font-size: 1.35rem;
    color: #017439;
    margin-bottom: 10px;
    font-weight: 600;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.page-blog__post-card .page-blog__card-link:hover .page-blog__card-title {
    color: #005f2e;
}

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

.page-blog__post-card .page-blog__post-date {
    font-size: 0.9rem;
    color: #888888;
    display: block;
    margin-bottom: 10px;
}

.page-blog__post-card .page-blog__read-more {
    font-size: 0.95rem;
    color: #017439;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: auto; /* Push to bottom of card content */
}

.page-blog__post-card .page-blog__card-link:hover .page-blog__icon-arrow-right {
    transform: translateX(5px);
}

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

/* CTA Section */
.page-blog__cta-section {
    background-color: #017439; /* Brand primary color */
    color: #FFFFFF;
    padding: 60px 15px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    max-width: 1200px;
    margin: 60px auto;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.page-blog__cta-content {
    max-width: 800px;
}

.page-blog__cta-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.2;
}

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

.page-blog__btn-cta {
    display: inline-block;
    padding: 16px 32px;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: 700;
    text-decoration: none;
    transition: background-color 0.3s ease, transform 0.3s ease;
    margin: 0 10px 15px; /* Spacing for multiple buttons */
    max-width: 100%;
    box-sizing: border-box;
    white-space: normal;
    word-wrap: break-word;
}

.page-blog__btn-cta {
    background-color: #C30808; /* Custom color for register/login */
    color: #FFFF00; /* Custom font color */
    border: 2px solid #C30808;
}

.page-blog__btn-cta:hover {
    background-color: #a00606;
    border-color: #a00606;
    transform: translateY(-2px);
}

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

.page-blog__btn-cta--secondary:hover {
    background-color: #f0f0f0;
    border-color: #f0f0f0;
}

.page-blog__cta-image img {
    width: 100%;
    max-width: 600px;
    height: auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* FAQ Section */
.page-blog__faq-section {
    max-width: 900px;
    margin: 60px auto;
    padding: 20px 15px;
    background-color: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.page-blog__faq-list {
    margin-top: 30px;
}

.page-blog__faq-item {
    border-bottom: 1px solid #eeeeee;
    margin-bottom: 15px;
    padding-bottom: 15px;
}

.page-blog__faq-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.page-blog__faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    font-size: 1.15rem;
    font-weight: 600;
    color: #017439;
    cursor: pointer;
    list-style: none; /* Remove default marker for details summary */
}

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

.page-blog__faq-toggle {
    font-size: 1.5rem;
    font-weight: bold;
    color: #017439;
    transition: transform 0.3s ease;
}

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

.page-blog__faq-answer {
    padding: 0 15px 15px 0;
    font-size: 1rem;
    color: #555555;
    line-height: 1.6;
}

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

    /* Hero Section */
    .page-blog__hero-section {
        padding: 10px 15px 30px;
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }

    .page-blog__main-title {
        font-size: 2rem;
        margin-bottom: 10px;
    }

    .page-blog__description {
        font-size: 1rem;
        margin-bottom: 20px;
    }

    .page-blog__cta-buttons {
        flex-direction: column; /* Stack buttons vertically */
        gap: 10px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        padding: 0 15px; /* Add padding to container */
    }

    .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: 12px 20px;
        font-size: 1rem;
    }
    
    /* General images and containers */
    .page-blog img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
    }
    
    .page-blog__section,
    .page-blog__card,
    .page-blog__container,
    .page-blog__hero-section,
    .page-blog__featured-article,
    .page-blog__latest-posts,
    .page-blog__cta-section,
    .page-blog__faq-section {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px;
        padding-right: 15px;
    }

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

    /* Featured Article Section */
    .page-blog__article-card {
        gap: 15px;
    }

    .page-blog__article-card .page-blog__card-title {
        font-size: 1.5rem;
    }

    .page-blog__article-card .page-blog__card-excerpt {
        font-size: 0.95rem;
    }

    /* Latest Posts Grid */
    .page-blog__post-grid {
        grid-template-columns: 1fr; /* Single column on mobile */
        gap: 20px;
    }
    
    .page-blog__post-card img {
         /* Adjust height for mobile */
    }

    .page-blog__post-card .page-blog__card-title {
        font-size: 1.2rem;
    }

    .page-blog__post-card .page-blog__card-excerpt {
        font-size: 0.9rem;
    }

    /* CTA Section */
    .page-blog__cta-section {
        padding: 40px 15px;
        flex-direction: column;
        gap: 30px;
    }

    .page-blog__cta-title {
        font-size: 2rem;
    }

    .page-blog__cta-description {
        font-size: 1rem;
    }

    .page-blog__btn-cta {
        font-size: 1.05rem;
        padding: 14px 25px;
        margin: 0 0 10px; /* Adjust margin for stacked buttons */
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        white-space: normal !important;
        word-wrap: break-word !important;
    }
    
    /* FAQ Section */
    .page-blog__faq-question {
        font-size: 1rem;
        padding: 10px 0;
    }

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