/* style/blog.css */

/* General page styling */
.page-blog {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333333; /* Dark text for light body background */
    background-color: #FFFFFF; /* Explicitly set to match body */
}

/* Hero Section */
.page-blog__hero-section {
    position: relative;
    width: 100%;
    overflow: hidden;
    padding-top: 10px; /* Small top padding, body handles header offset */
    background-color: #f0f0f0; /* Light background for hero section */
}

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

.page-blog__hero-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.page-blog__hero-content {
    max-width: 1150px;
    margin: 20px auto;
    padding: 0 20px;
    text-align: center;
}

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

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

.page-blog__hero-cta {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap; /* Allow buttons to wrap */
}

/* General Section Styling */
.page-blog__section {
    padding: 40px 0;
}

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

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

.page-blog__section-title--light {
    color: #FFFFFF;
}

.page-blog__subsection-title {
    font-size: 1.8em;
    color: #017439;
    margin-top: 30px;
    margin-bottom: 15px;
    font-weight: 600;
}

/* Category Grid */
.page-blog__category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.page-blog__category-item {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.page-blog__category-item:hover {
    transform: translateY(-5px);
}

.page-blog__figure {
    margin: 0;
    position: relative;
}

.page-blog__image {
    width: 100%;
    height: 200px; /* Fixed height for category images */
    object-fit: cover;
    display: block;
}

.page-blog__figcaption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.6);
    color: #ffffff;
    padding: 10px;
    font-size: 1em;
    text-align: center;
}

.page-blog__category-heading {
    font-size: 1.3em;
    color: #017439;
    padding: 15px;
    margin: 0;
}

.page-blog__category-item p {
    padding: 0 15px 15px;
    font-size: 0.95em;
    color: #555555;
}

/* Latest Articles */
.page-blog__articles-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.page-blog__article-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.page-blog__article-card:hover {
    transform: translateY(-5px);
}

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

.page-blog__article-image {
    width: 100%;
    height: 200px; /* Fixed height for article images */
    object-fit: cover;
    display: block;
}

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

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

.page-blog__article-meta {
    font-size: 0.9em;
    color: #888888;
    margin-bottom: 10px;
}

.page-blog__article-excerpt {
    font-size: 0.95em;
    color: #555555;
}

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

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

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

.page-blog__btn-primary:hover {
    background-color: #a30606;
    border-color: #a30606;
    color: #ffffff;
}

.page-blog__btn-secondary {
    background-color: #017439; /* Main brand color for secondary */
    color: #FFFFFF;
    border: 2px solid #017439;
}

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

/* Call to Action Box */
.page-blog__cta-box {
    text-align: center;
    margin: 30px 0;
    padding: 20px;
    background-color: #f8f8f8;
    border-radius: 8px;
    border: 1px dashed #e0e0e0;
}

/* Why Choose Section */
.page-blog__benefits-list {
    list-style: none;
    padding: 0;
    margin-top: 20px;
}

.page-blog__benefits-list li {
    background: #ffffff;
    border-left: 5px solid #017439;
    padding: 15px 20px;
    margin-bottom: 15px;
    border-radius: 5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    font-size: 1.05em;
    color: #333333;
}

.page-blog__benefits-list li strong {
    color: #017439;
}

/* Dark Section (for final CTA) */
.page-blog__dark-section {
    background-color: #017439;
    color: #ffffff;
    padding: 60px 0;
}

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

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

/* Image Responsiveness */
.page-blog img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* --- Responsive Design for Tablets and Mobiles --- */
@media (max-width: 1024px) {
    .page-blog__hero-content {
        padding: 0 15px;
    }

    .page-blog__main-title {
        font-size: clamp(1.8em, 5vw, 2.8em);
    }

    .page-blog__description {
        font-size: 1em;
    }

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

    .page-blog__category-grid,
    .page-blog__articles-list {
        gap: 20px;
    }

    .page-blog__article-wrap {
        padding: 0 15px;
    }
}

@media (max-width: 768px) {
    /* 1. Top section title + Dual CTA */
    .page-blog__hero-section {
        padding-top: 10px !important; /* Small top padding for mobile */
    }

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

    .page-blog__main-title {
        font-size: clamp(1.5em, 7vw, 2.5em) !important; /* Smaller H1 for mobile */
        margin-bottom: 10px;
    }

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

    .page-blog__hero-cta {
        flex-direction: column !important; /* Stack buttons vertically */
        gap: 10px !important;
        margin-bottom: 20px;
        padding: 0 15px !important; /* Add padding to container */
    }

    /* 2. Single column long text container */
    .page-blog__article-wrap {
        padding: 0 15px !important; /* Ensure consistent padding */
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .page-blog__section {
        padding: 30px 0;
    }

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

    .page-blog__subsection-title {
        font-size: 1.5em;
        margin-top: 25px;
        margin-bottom: 10px;
    }

    .page-blog__category-grid {
        grid-template-columns: 1fr !important; /* Single column for categories */
        gap: 20px;
    }

    .page-blog__articles-list {
        grid-template-columns: 1fr !important; /* Single column for articles */
        gap: 20px;
    }

    .page-blog__category-item,
    .page-blog__article-card {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }

    .page-blog__image,
    .page-blog__article-image {
        height: 180px !important; /* Adjust image height for mobile */
    }

    /* 3. Generic images and figures */
    .page-blog img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
    }

    .page-blog__figure {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* 4. Buttons and button containers */
    .page-blog__btn,
    .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 !important;
        padding-right: 15px !important;
    }
    
    .page-blog__hero-cta,
    .page-blog__cta-box,
    .page-blog__cta-buttons,
    .page-blog__button-group,
    .page-blog__btn-container {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
        flex-direction: column !important; /* Ensure vertical stacking for multiple buttons */
        gap: 10px !important; /* Space between stacked buttons */
    }

    /* 5. Registration tutorial and FAQ blocks related styles */
    .page-blog__cta-box {
        padding: 15px;
    }

    .page-blog__benefits-list li {
        padding: 12px 15px;
        font-size: 1em;
    }

    .page-blog__dark-section {
        padding: 40px 0;
    }
}