/* General 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; /* Explicitly set body background for contrast */
}

/* Hero Section */
.page-blog__hero-section {
    padding-top: 10px; /* Fixed top padding, not var(--header-offset) */
    padding-bottom: 40px;
    background-color: #f8f8f8; /* Light background for the hero section */
}

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

.page-blog__hero-content {
    flex: 1 1 50%;
    min-width: 300px;
}

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

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

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

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

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

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

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

.page-blog__btn-primary:hover {
    background-color: #e00b0b;
    border-color: #e00b0b;
    color: #FFFFFF;
}

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

.page-blog__btn-secondary:hover {
    background-color: #015c2d;
    border-color: #015c2d;
    color: #FFFFFF;
}

/* Section Title */
.page-blog__section-title {
    font-size: clamp(1.8em, 3.5vw, 2.5em);
    font-weight: 700;
    color: #017439;
    text-align: center;
    margin-bottom: 40px;
}

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

/* Articles Section */
.page-blog__articles-section {
    padding: 60px 0;
    background-color: #FFFFFF;
}

.page-blog__articles-container {
    max-width: 1170px;
    margin: 0 auto;
    padding: 0 16px;
}

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

.page-blog__article-card {
    background-color: #FFFFFF;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

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

.page-blog__card-media {
    width: 100%;
    height: 200px; /* Fixed height for consistency */
    overflow: hidden;
}

.page-blog__card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.page-blog__article-card:hover .page-blog__card-media img {
    transform: scale(1.05);
}

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

.page-blog__card-title {
    font-size: 1.3em;
    font-weight: 600;
    margin-bottom: 10px;
    color: #017439; /* Brand color for article titles */
    line-height: 1.4;
}

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

.page-blog__card-excerpt {
    font-size: 1em;
    color: #555555;
}

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

/* FAQ Section */
.page-blog__faq-section {
    padding: 60px 0;
    background-color: #017439; /* Dark background */
    color: #FFFFFF; /* White text */
}

.page-blog__faq-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 16px;
}

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

.page-blog__faq-item {
    background-color: rgba(255, 255, 255, 0.1); /* Slightly transparent white for contrast */
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
}

.page-blog__faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 25px;
    font-size: 1.15em;
    font-weight: 600;
    color: #FFFFFF;
    cursor: pointer;
    position: relative;
    list-style: none; /* Hide default details marker */
}

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

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

.page-blog__faq-toggle {
    font-size: 1.5em;
    line-height: 1;
    margin-left: 15px;
    transition: transform 0.3s ease;
}

.page-blog__faq-item[open] .page-blog__faq-toggle {
    transform: rotate(45deg); /* Rotate to form an 'x' or just a different icon */
}

.page-blog__faq-answer {
    padding: 0 25px 20px;
    font-size: 1em;
    color: #f0f0f0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
}

.page-blog__faq-item[open] .page-blog__faq-answer {
    max-height: 500px; /* Sufficiently large to show content, adjust if needed */
    padding-top: 10px;
}

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

/* CTA Section (bottom) */
.page-blog__cta-section {
    padding: 60px 0;
    background-color: #f8f8f8; /* Light background */
    text-align: center;
}

.page-blog__cta-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 16px;
}

.page-blog__cta-section .page-blog__description {
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

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

/* Responsive styles */
@media (max-width: 1024px) {
    .page-blog__hero-container {
        flex-direction: column;
        text-align: center;
        gap: 30px;
    }
    .page-blog__hero-content,
    .page-blog__hero-image {
        flex: 1 1 100%;
        max-width: 600px; /* Constrain width even when stacked */
    }
    .page-blog__cta-buttons {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    /* General container and image rules for mobile */
    .page-blog__section,
    .page-blog__card,
    .page-blog__container,
    .page-blog__articles-container,
    .page-blog__faq-container,
    .page-blog__cta-container {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
    }

    .page-blog img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
    }
    
    /* Hero Section */
    .page-blog__hero-section {
        padding-top: 10px !important; /* Fixed top padding for mobile */
        padding-bottom: 30px !important;
    }
    .page-blog__main-title {
        font-size: 2em !important;
    }
    .page-blog__description {
        font-size: 1em !important;
    }
    .page-blog__cta-buttons {
        flex-direction: column !important; /* Stack buttons vertically */
        gap: 10px !important;
    }
    .page-blog__btn-primary,
    .page-blog__btn-secondary {
        max-width: 100% !important;
        width: 100% !important;
        padding: 10px 15px !important;
        font-size: 0.95em !important;
    }

    /* Articles Section */
    .page-blog__section-title {
        font-size: 1.8em !important;
        margin-bottom: 30px !important;
    }
    .page-blog__article-grid {
        grid-template-columns: 1fr !important; /* Single column for articles */
        gap: 20px !important;
    }
    .page-blog__card-media {
        height: 180px !important;
    }
    .page-blog__card-title {
        font-size: 1.1em !important;
    }
    .page-blog__card-excerpt {
        font-size: 0.9em !important;
    }

    /* FAQ Section */
    .page-blog__faq-section {
        padding: 40px 0 !important;
    }
    .page-blog__faq-question {
        padding: 15px 20px !important;
        font-size: 1em !important;
    }
    .page-blog__faq-answer {
        padding: 0 20px 15px !important;
        font-size: 0.9em !important;
    }

    /* CTA Section */
    .page-blog__cta-section {
        padding: 40px 0 !important;
    }
    .page-blog__cta-section .page-blog__description {
        font-size: 1em !important;
    }
}