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

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

/* Hero Section */
.page-blog__hero-section {
    padding-top: 10px; /* Small top padding, body handles header offset */
    padding-bottom: 40px;
    background-color: #f8f8f8;
    text-align: center;
}

.page-blog__main-title {
    font-size: clamp(2.2em, 4vw, 3em); /* Responsive H1 font size */
    color: #017439;
    margin-bottom: 15px;
    font-weight: bold;
    line-height: 1.2;
}

.page-blog__description {
    font-size: 1.1em;
    max-width: 800px;
    margin: 0 auto 30px auto;
    color: #555555;
}

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

.page-blog__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 25px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    cursor: pointer;
    font-size: 1em;
    max-width: 100%; /* Ensure buttons don't overflow */
    box-sizing: border-box; /* Include padding and border in the element's total width and height */
    white-space: normal; /* Allow text to wrap */
    word-wrap: break-word; /* Break long words */
}

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

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

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

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

.page-blog__btn--primary {
    background-color: #017439;
    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: #f0f0f0;
    color: #005a2e;
    border-color: #005a2e;
}

/* Latest Articles Section */
.page-blog__latest-articles-section {
    padding: 60px 0;
    background-color: #ffffff; /* Light background for contrast */
}

.page-blog__section-title {
    font-size: clamp(1.8em, 3.5vw, 2.5em);
    color: #017439;
    text-align: center;
    margin-bottom: 25px;
    font-weight: bold;
}

.page-blog__section-intro {
    font-size: 1em;
    text-align: center;
    max-width: 900px;
    margin: 0 auto 40px auto;
    color: #555555;
}

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

.page-blog__article-card {
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.page-blog__article-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.page-blog__article-image {
    width: 100%;
    height: 250px; /* Fixed height for consistency */
    object-fit: cover;
    display: block;
    min-width: 200px; /* Min size enforcement */
    min-height: 200px; /* Min size enforcement */
}

.page-blog__article-content {
    padding: 20px;
}

.page-blog__article-title {
    font-size: 1.3em;
    color: #017439;
    margin-bottom: 10px;
    font-weight: bold;
    line-height: 1.4;
}

.page-blog__article-excerpt {
    font-size: 0.95em;
    color: #555555;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Limit to 3 lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.page-blog__article-date {
    font-size: 0.85em;
    color: #888888;
    display: block;
    margin-bottom: 15px;
}

.page-blog__read-more {
    color: #017439;
    font-weight: bold;
    font-size: 0.95em;
}

.page-blog__view-all {
    text-align: center;
}

/* Categories Section */
.page-blog__categories-section {
    padding: 60px 0;
    background-color: #017439; /* Dark background for contrast */
    color: #ffffff; /* Light text for dark background */
}

.page-blog__categories-section .page-blog__section-title {
    color: #ffffff; /* White title for dark background */
}

.page-blog__categories-section .page-blog__section-intro {
    color: #f0f0f0; /* Light grey intro for dark background */
}

.page-blog__categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.page-blog__category-card {
    background-color: rgba(255, 255, 255, 0.1); /* Semi-transparent white for dark background */
    border-radius: 10px;
    padding: 25px;
    text-align: center;
    text-decoration: none;
    color: #ffffff;
    transition: background-color 0.3s ease, transform 0.3s ease;
    display: block; /* Make the whole card clickable */
}

.page-blog__category-card:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-5px);
}

.page-blog__category-title {
    font-size: 1.4em;
    font-weight: bold;
    margin-bottom: 10px;
    color: #ffffff;
}

.page-blog__category-description {
    font-size: 0.95em;
    color: #f0f0f0;
}

/* About Us Promo Section */
.page-blog__about-us-promo {
    padding: 60px 0;
    background-color: #f8f8f8; /* Light background */
}

.page-blog__about-content {
    display: flex;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap; /* Allow content to wrap */
}

.page-blog__about-image {
    flex: 1;
    min-width: 300px; /* Minimum width for image */
    max-width: 680px;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    min-height: 200px; /* Min size enforcement */
}

.page-blog__about-text {
    flex: 2;
    min-width: 300px; /* Minimum width for text */
}

.page-blog__about-text p {
    margin-bottom: 15px;
    color: #555555;
}

/* Contact CTA Section */
.page-blog__contact-cta-section {
    padding: 60px 0;
    background-color: #017439; /* Dark background */
    color: #ffffff; /* Light text */
    text-align: center;
}

.page-blog__contact-cta-section .page-blog__section-title {
    color: #ffffff;
}

.page-blog__contact-cta-section .page-blog__description {
    color: #f0f0f0;
}


/* General Image Styles */
.page-blog img {
    max-width: 100%;
    height: auto;
    display: block;
    object-fit: cover; /* Ensure images fill their space nicely */
    min-width: 200px; /* Global min image size */
    min-height: 200px; /* Global min image size */
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .page-blog__container {
        padding: 0 15px;
    }

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

    .page-blog__about-content {
        flex-direction: column;
        text-align: center;
    }

    .page-blog__about-image {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    /* 1. Top section (h1, description, CTAs) */
    .page-blog__hero-section {
        padding-top: 10px !important; /* Ensure small top padding */
        padding-bottom: 30px;
    }
    .page-blog__main-title {
        font-size: 1.8em;
        margin-bottom: 10px;
    }
    .page-blog__description {
        font-size: 1em;
        margin-bottom: 20px;
        padding: 0 15px; /* Add padding to text to prevent edge-to-edge text */
    }
    .page-blog__cta-buttons {
        flex-direction: column; /* Stack buttons vertically */
        gap: 10px;
        padding: 0 15px; /* Add padding to button container */
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }
    .page-blog__btn {
        width: 100% !important; /* Full width for buttons */
        max-width: 100% !important;
        box-sizing: border-box !important;
        white-space: normal !important;
        word-wrap: break-word !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
    }

    /* 2. Single-column article container / Sections */
    .page-blog__container {
        padding: 0 15px !important;
    }
    .page-blog__section-title {
        font-size: 1.5em;
        margin-bottom: 20px;
    }
    .page-blog__section-intro {
        font-size: 0.95em;
        margin-bottom: 30px;
        padding: 0 10px; /* Add padding to intro text */
    }
    .page-blog__latest-articles-section,
    .page-blog__categories-section,
    .page-blog__about-us-promo,
    .page-blog__contact-cta-section {
        padding: 40px 0; /* Adjust section padding */
    }

    /* 3. Generic images */
    .page-blog img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        min-width: 200px !important; /* Maintain min size */
        min-height: 200px !important; /* Maintain min size */
    }
    .page-blog__article-image {
        height: 200px; /* Adjust article image height */
    }
    .page-blog__about-image {
        min-width: 200px !important; /* Maintain min size */
        min-height: 200px !important; /* Maintain min size */
    }

    /* 4. Buttons (general rules for all buttons) */
    .page-blog__btn--primary,
    .page-blog__btn--secondary {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        white-space: normal !important;
        word-wrap: break-word !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    .page-blog__view-all .page-blog__btn {
        margin: 0 auto; /* Center single button */
    }

    /* 5. Article cards and category cards for single column */
    .page-blog__articles-grid,
    .page-blog__categories-grid {
        grid-template-columns: 1fr; /* Single column layout for cards */
        gap: 25px;
    }
    .page-blog__article-card,
    .page-blog__category-card {
        padding: 15px;
        box-sizing: border-box !important;
        max-width: 100% !important;
        width: 100% !important;
    }
    .page-blog__about-content {
        flex-direction: column;
        gap: 20px;
    }
    .page-blog__about-text {
        padding: 0 10px; /* Add padding to about text */
    }
}