/* style/blog.css */

/* Base styles for the blog page */
.page-blog {
    background-color: #08160F; /* Background color from custom palette */
    color: #F2FFF6; /* Main text color for dark background */
    font-family: Arial, sans-serif;
    line-height: 1.6;
    padding-bottom: 60px; /* Ensure space above footer */
}

/* Hero Section */
.page-blog__hero-section {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column; /* Image above content */
    align-items: center;
    padding: 60px 20px;
    padding-top: 10px; /* Small top padding, body handles header offset */
    box-sizing: border-box;
    overflow: hidden; /* Ensure no overflow from image */
}

.page-blog__hero-image-wrapper {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
    margin-bottom: 30px; /* Space between image and text */
}

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

.page-blog__hero-content {
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 15px; /* Add some padding for smaller screens */
    box-sizing: border-box;
}

.page-blog__hero-title {
    font-size: clamp(2em, 4vw, 3em); /* Responsive H1 font size */
    font-weight: 700;
    line-height: 1.2;
    color: #F2FFF6; /* Main text color */
    margin-bottom: 20px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.page-blog__hero-description {
    font-size: 1.1em;
    color: #A7D9B8; /* Secondary text color */
    margin-bottom: 30px;
}

/* General Section Styling */
.page-blog__section {
    padding: 60px 20px;
    box-sizing: border-box;
    width: 100%;
}

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

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

.page-blog__section-title--light {
    color: #F2FFF6; /* Specifically for dark background sections */
}

/* Recent Posts Section */
.page-blog__recent-posts {
    background-color: #08160F; /* Consistent dark background */
}

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

.page-blog__post-card {
    background-color: #11271B; /* Card background color */
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.page-blog__post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

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

.page-blog__post-image {
    width: 100%;
    height: 220px; /* Fixed height for consistency */
    object-fit: cover;
    display: block;
    min-width: 200px; /* Enforce min size */
    min-height: 200px; /* Enforce min size */
}

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

.page-blog__post-title {
    font-size: 1.3em;
    font-weight: 600;
    color: #F2FFF6; /* Main text color for card title */
    margin-bottom: 10px;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.page-blog__post-link:hover .page-blog__post-title {
    color: #2AD16F; /* Highlight on hover */
}

.page-blog__post-excerpt {
    font-size: 0.95em;
    color: #A7D9B8; /* Secondary text color */
    margin-bottom: 15px;
}

.page-blog__post-date {
    font-size: 0.85em;
    color: #2E7A4E; /* Border/Accent color for date */
    display: block;
}

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

.page-blog__view-all-button {
    display: inline-block;
    background: linear-gradient(180deg, #2AD16F 0%, #13994A 100%); /* Button gradient */
    color: #F2FFF6; /* White text for button */
    padding: 12px 30px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.page-blog__view-all-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

/* Categories Section */
.page-blog__categories-section {
    background-color: #11271B; /* Card BG color for this section */
}

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

.page-blog__category-card {
    background-color: rgba(17, 168, 78, 0.1); /* Slightly transparent brand color */
    border: 1px solid #2E7A4E; /* Border color */
    border-radius: 8px;
    padding: 25px;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

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

.page-blog__category-title {
    font-size: 1.2em;
    font-weight: 600;
    color: #F2FFF6; /* Main text color */
    margin-bottom: 10px;
}

.page-blog__category-description {
    font-size: 0.9em;
    color: #A7D9B8; /* Secondary text color */
}

/* Call to Action Section */
.page-blog__cta-section {
    background-color: #08160F; /* Consistent dark background */
}

.page-blog__cta-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.page-blog__cta-content {
    flex: 1;
    text-align: left;
}

.page-blog__cta-title {
    font-size: clamp(1.8em, 3.5vw, 2.5em);
    font-weight: 700;
    color: #F2FFF6;
    margin-bottom: 20px;
}

.page-blog__cta-description {
    font-size: 1.1em;
    color: #A7D9B8;
    margin-bottom: 30px;
}

.page-blog__cta-buttons {
    display: flex;
    gap: 20px;
    flex-wrap: wrap; /* Allow buttons to wrap on smaller screens */
    width: 100%; /* Ensure container takes full width for wrapping */
}

.page-blog__btn-primary,
.page-blog__btn-secondary {
    display: inline-block;
    padding: 14px 30px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
    text-align: center;
    white-space: normal; /* Allow text to wrap */
    word-wrap: break-word; /* Allow long words to break */
    max-width: 100%; /* Ensure buttons don't overflow */
}

.page-blog__btn-primary {
    background: linear-gradient(180deg, #2AD16F 0%, #13994A 100%);
    color: #F2FFF6;
    border: 2px solid transparent;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.page-blog__btn-secondary {
    background: #11271B; /* Darker background for secondary button */
    color: #2AD16F; /* Green text for contrast */
    border: 2px solid #2AD16F; /* Green border */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.page-blog__btn-primary:hover,
.page-blog__btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.page-blog__cta-image-wrapper {
    flex: 0 0 auto; /* Don't grow, don't shrink */
    max-width: 500px; /* Max width for image */
    width: 100%;
    box-sizing: border-box;
    display: flex;
    justify-content: center; /* Center image if smaller */
}

.page-blog__cta-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    object-fit: cover;
    min-width: 200px; /* Enforce min size */
    min-height: 200px; /* Enforce min size */
}

/* FAQ Section */
.page-blog__faq-section {
    background-color: #11271B; /* Card BG color for this section */
}

.page-blog__faq-list {
    max-width: 900px;
    margin: 0 auto;
}

.page-blog__faq-item {
    background-color: rgba(17, 168, 78, 0.1); /* Slightly transparent brand color */
    border: 1px solid #2E7A4E;
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
    transition: background-color 0.3s ease;
}

.page-blog__faq-item[open] {
    background-color: rgba(17, 168, 78, 0.2);
}

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

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

.page-blog__faq-toggle {
    font-size: 1.5em;
    line-height: 1;
    color: #2AD16F;
    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 minus sign */
}

.page-blog__faq-answer {
    padding: 0 25px 20px;
    font-size: 1em;
    color: #A7D9B8;
}

/* Responsive Styles */
@media (min-width: 769px) {
    .page-blog__cta-section .page-blog__container {
        display: flex;
        flex-direction: row;
        align-items: center;
    }
    .page-blog__cta-content {
        order: 1;
        padding-right: 40px;
    }
    .page-blog__cta-image-wrapper {
        order: 2;
    }
}

@media (max-width: 768px) {
    .page-blog__hero-section {
        padding: 40px 15px;
        padding-top: 10px !important; /* body handles header offset */
    }

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

    .page-blog__hero-description {
        font-size: 1em;
    }

    .page-blog__section {
        padding: 40px 15px;
    }

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

    .page-blog__post-grid {
        grid-template-columns: 1fr; /* Single column for posts */
    }

    .page-blog__post-image {
        height: 180px; /* Adjust image height for mobile */
    }

    .page-blog__category-grid {
        grid-template-columns: 1fr; /* Single column for categories */
    }

    .page-blog__cta-section .page-blog__container {
        flex-direction: column; /* Stack CTA content and image */
    }

    .page-blog__cta-content {
        text-align: center;
        margin-bottom: 30px;
    }

    .page-blog__cta-buttons {
        flex-direction: column; /* Stack buttons vertically */
        align-items: center;
        width: 100%;
        gap: 15px;
    }

    .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;
        padding-right: 15px;
    }

    /* Mobile image and container responsiveness */
    .page-blog img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        display: block !important;
    }
    
    .page-blog__hero-image-wrapper,
    .page-blog__cta-image-wrapper,
    .page-blog__post-card,
    .page-blog__category-card,
    .page-blog__faq-item,
    .page-blog__container,
    .page-blog__section,
    .page-blog__cta-buttons {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px;
        padding-right: 15px;
        overflow: hidden !important; /* Ensure content doesn't overflow */
    }

    .page-blog__faq-question {
        font-size: 1em;
        padding: 15px 20px;
    }

    .page-blog__faq-answer {
        padding: 0 20px 15px;
    }
}

/* Ensure no filter on images */
.page-blog img {
    filter: none !important;
}

/* Content area images minimum size check for CSS (already handled in specific image classes) */
/* .page-blog__post-image, .page-blog__cta-image have min-width/height set directly */