.page-blog {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333333; /* Default dark text for light body background */
    background-color: #FFFFFF; /* Default body background */
}

.page-blog__hero-section {
    padding-top: 10px; /* Small top padding as body handles header offset */
    margin-bottom: 40px;
    text-align: center;
}

.page-blog__hero-image {
    margin-bottom: 20px;
}

.page-blog__hero-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    max-height: 492px; /* Ensure hero image is not too tall */
}

.page-blog__hero-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 15px;
}

.page-blog__main-title {
    font-size: clamp(2em, 4vw, 2.8em); /* Use clamp for H1 */
    font-weight: 700;
    line-height: 1.2;
    color: #017439; /* Brand color for H1 */
    margin-bottom: 15px;
}

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

.page-blog__cta-button {
    display: inline-block;
    background-color: #017439;
    color: #ffffff;
    padding: 12px 25px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.3s ease;
    max-width: 100%; /* Ensure button adapts */
    box-sizing: border-box;
    white-space: normal;
    word-wrap: break-word;
}

.page-blog__cta-button:hover {
    background-color: #005a2e;
}

.page-blog__section-title {
    font-size: 2.2em;
    font-weight: 700;
    color: #017439;
    text-align: center;
    margin-bottom: 40px;
    padding-top: 20px;
}

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

/* Featured Posts & Latest Posts */
.page-blog__featured-posts,
.page-blog__latest-posts {
    padding: 60px 0;
}

.page-blog__featured-posts {
    background-color: #f9f9f9; /* Light background for contrast */
}

.page-blog__latest-posts {
    background-color: #017439; /* Dark background for contrast */
    color: #ffffff; /* White text for dark background */
}

.page-blog__latest-posts .page-blog__section-title {
    color: #ffffff;
}

.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: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.page-blog__latest-posts .page-blog__post-card {
    background-color: #005a2e; /* Slightly darker brand color for cards on dark section */
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}
.page-blog__latest-posts .page-blog__post-card:hover {
    background-color: #004222;
}

.page-blog__post-link {
    text-decoration: none;
    color: inherit; /* Inherit color from parent card */
    display: block;
}

.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;
    display: block;
}

.page-blog__post-title {
    font-size: 1.3em;
    font-weight: 600;
    margin-bottom: 10px;
    color: #017439; /* Brand color for title */
}
.page-blog__latest-posts .page-blog__post-title {
    color: #ffffff; /* White title on dark cards */
}

.page-blog__post-meta {
    font-size: 0.9em;
    color: #888888;
    margin-bottom: 15px;
}
.page-blog__latest-posts .page-blog__post-meta {
    color: #cccccc;
}

.page-blog__post-excerpt {
    font-size: 1em;
    color: #555555;
    margin-bottom: 15px;
}
.page-blog__latest-posts .page-blog__post-excerpt {
    color: #f0f0f0;
}

.page-blog__read-more {
    color: #017439;
    font-weight: 600;
    text-decoration: underline;
}
.page-blog__latest-posts .page-blog__read-more {
    color: #ffffff;
}

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

/* Long Form Content */
.page-blog__long-form-content {
    padding: 60px 0;
    background-color: #ffffff;
}

.page-blog__long-form-content p {
    margin-bottom: 1em;
    color: #333333;
}

.page-blog__long-form-content h2,
.page-blog__long-form-content h3 {
    color: #017439;
    margin-top: 30px;
    margin-bottom: 15px;
}

.page-blog__long-form-content h3 {
    font-size: 1.6em;
    font-weight: 600;
}
.page-blog__long-form-content h4 {
    font-size: 1.3em;
    font-weight: 600;
    color: #017439;
    margin-top: 20px;
    margin-bottom: 10px;
}

.page-blog__long-form-content strong {
    color: #017439;
}

.page-blog__cta-section {
    text-align: center;
    margin-top: 60px;
    padding: 40px;
    background-color: #f0f8f0; /* Light green background */
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex; /* For button alignment */
    flex-wrap: wrap; /* Allow buttons to wrap */
    justify-content: center;
    gap: 15px;
}

.page-blog__cta-text {
    font-size: 1.4em;
    font-weight: 600;
    color: #017439;
    margin-bottom: 25px;
    width: 100%; /* Ensure text takes full width */
}

.page-blog__btn-register {
    background-color: #C30808; /* Custom red for register */
    color: #FFFF00; /* Custom yellow for register font */
}

.page-blog__btn-register:hover {
    background-color: #a10707;
}

.page-blog__btn-login {
    background-color: #C30808; /* Custom red for login */
    color: #FFFF00; /* Custom yellow for login font */
}

.page-blog__btn-login:hover {
    background-color: #a10707;
}

/* Scroll to Top Button */
.page-blog__scroll-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #017439;
    color: #ffffff;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.8em;
    line-height: 50px;
    text-align: center;
    cursor: pointer;
    display: none; /* Hidden by default */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transition: background-color 0.3s ease;
}

.page-blog__scroll-to-top:hover {
    background-color: #005a2e;
}

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

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

    .page-blog__hero-section {
        margin-bottom: 20px;
    }

    .page-blog__hero-image img {
        max-height: 250px; /* Adjust hero image height for mobile */
    }

    .page-blog__main-title {
        font-size: clamp(1.8em, 7vw, 2.2em); /* Adjust H1 for mobile */
        margin-bottom: 10px;
    }

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

    .page-blog__cta-button {
        padding: 10px 20px;
        font-size: 0.9em;
        max-width: 100% !important; /* Force button width */
        width: 100% !important;
        box-sizing: border-box !important;
        white-space: normal !important;
        word-wrap: break-word !important;
        margin-bottom: 10px; /* Space between stacked buttons */
        margin-right: 0 !important; /* Remove right margin for stacking */
    }
    
    .page-blog__cta-section {
        padding: 20px 15px;
        flex-direction: column !important; /* Stack buttons vertically */
        display: flex;
        gap: 10px;
    }
    .page-blog__cta-text {
        font-size: 1.2em;
        margin-bottom: 15px;
    }

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

    .page-blog__featured-posts,
    .page-blog__latest-posts,
    .page-blog__long-form-content {
        padding: 30px 0;
    }

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

    .page-blog__post-thumbnail {
        height: 180px; /* Adjust thumbnail height */
    }

    .page-blog__post-title {
        font-size: 1.1em;
    }

    .page-blog__long-form-content h3 {
        font-size: 1.4em;
    }
    .page-blog__long-form-content h4 {
        font-size: 1.1em;
    }

    /* Mobile image adaptation */
    .page-blog img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
    }
    
    /* Mobile container adaptation */
    .page-blog__section,
    .page-blog__card,
    .page-blog__container,
    .page-blog__hero-content,
    .page-blog__cta-section {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
}