/* style/blog.css */

/* Custom Colors */
:root {
    --page-blog-button-gradient: linear-gradient(180deg, #2AD16F 0%, #13994A 100%);
    --page-blog-card-bg: #11271B;
    --page-blog-background: #08160F;
    --page-blog-text-main: #F2FFF6;
    --page-blog-text-secondary: #A7D9B8;
    --page-blog-border: #2E7A4E;
    --page-blog-glow: #57E38D;
    --page-blog-gold: #F2C14E;
    --page-blog-divider: #1E3A2A;
    --page-blog-deep-green: #0A4B2C;
}

/* Base styles for the blog page, ensuring text contrast with dark body background */
.page-blog {
    font-family: 'Arial', sans-serif;
    color: var(--page-blog-text-main); /* Light text for dark background */
    background-color: var(--page-blog-background); /* Deep green background */
    line-height: 1.6;
}

/* Container for content sections */
.page-blog__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* Hero Section */
.page-blog__hero-section {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column; /* Image above text */
    align-items: center;
    justify-content: center;
    padding: 60px 0;
    padding-top: 10px; /* Small top padding, body handles --header-offset */
    overflow: hidden;
    background-color: var(--page-blog-deep-green); /* Fallback background */
}

.page-blog__hero-image-wrapper {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.page-blog__hero-image {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    min-height: 300px; /* Ensure minimum size */
}

.page-blog__hero-content {
    text-align: center;
    padding: 40px 20px;
    max-width: 800px;
    width: 100%;
    box-sizing: border-box;
}

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

.page-blog__subtitle {
    font-size: 1.1em;
    color: var(--page-blog-text-secondary);
    margin-bottom: 30px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* CTA Buttons */
.page-blog__cta-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.page-blog__btn-primary,
.page-blog__btn-secondary {
    display: inline-block;
    padding: 12px 25px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    box-sizing: border-box;
    max-width: 100%;
    white-space: normal;
    word-wrap: break-word;
    text-align: center;
    min-width: 180px;
}

.page-blog__btn-primary {
    background: var(--page-blog-button-gradient);
    color: var(--page-blog-text-main); /* Light text for dark button */
    border: 2px solid transparent;
}

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

.page-blog__btn-secondary {
    background: transparent;
    color: var(--page-blog-text-main); /* Light text for dark background */
    border: 2px solid var(--page-blog-border);
}

.page-blog__btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* Section Titles */
.page-blog__section-title {
    font-size: clamp(1.8em, 3.5vw, 2.5em);
    color: var(--page-blog-text-main);
    text-align: center;
    margin-bottom: 20px;
    font-weight: 700;
}

.page-blog__section-description {
    font-size: 1.05em;
    color: var(--page-blog-text-secondary);
    text-align: center;
    margin-bottom: 40px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Latest Posts Section */
.page-blog__latest-posts-section {
    padding: 80px 0;
    background-color: var(--page-blog-background);
}

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

.page-blog__post-card {
    background-color: var(--page-blog-card-bg); /* Dark card background */
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

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

.page-blog__post-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

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

.page-blog__post-content {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    color: var(--page-blog-text-main); /* Light text for dark card */
}

.page-blog__post-title {
    font-size: 1.35em;
    font-weight: 600;
    color: var(--page-blog-text-main);
    margin-bottom: 10px;
    line-height: 1.3;
}

.page-blog__post-meta {
    font-size: 0.9em;
    color: var(--page-blog-text-secondary);
    margin-bottom: 15px;
}

.page-blog__post-excerpt {
    font-size: 1em;
    color: var(--page-blog-text-secondary);
    margin-bottom: 20px;
    flex-grow: 1;
}

.page-blog__read-more-btn {
    display: inline-block;
    color: var(--page-blog-glow);
    font-weight: 600;
    text-decoration: none;
    margin-top: auto; /* Push to bottom */
}

.page-blog__read-more-btn:hover {
    text-decoration: underline;
}

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

/* FAQ Section */
.page-blog__faq-section {
    padding: 80px 0;
    background-color: var(--page-blog-deep-green);
}

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

.page-blog__faq-item {
    background-color: var(--page-blog-card-bg); /* Dark background for FAQ items */
    border: 1px solid var(--page-blog-border);
    border-radius: 10px;
    margin-bottom: 15px;
    overflow: hidden;
}

.page-blog__faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    font-size: 1.15em;
    font-weight: 600;
    color: var(--page-blog-text-main);
    cursor: pointer;
    background-color: var(--page-blog-card-bg);
    transition: background-color 0.3s ease;
    list-style: none; /* For details/summary */
}

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

.page-blog__faq-item[open] .page-blog__faq-question {
    background-color: var(--page-blog-border); /* Slightly darker when open */
}

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

.page-blog__faq-toggle {
    font-size: 1.5em;
    line-height: 1;
    margin-left: 15px;
    color: var(--page-blog-glow);
}

.page-blog__faq-answer {
    padding: 0 25px 20px;
    font-size: 1em;
    color: var(--page-blog-text-secondary);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.page-blog__faq-item[open] .page-blog__faq-answer {
    max-height: 500px; /* Adjust as needed for content height */
    transition: max-height 0.5s ease-in;
}

/* Fallback for JS-less details (browser handles open/close, JS only for icon) */
.page-blog__faq-item[open] .page-blog__faq-toggle {
    content: '−';
}

/* CTA Section at bottom */
.page-blog__cta-section {
    padding: 80px 0;
    background-color: var(--page-blog-background);
    text-align: center;
}

.page-blog__cta-section .page-blog__container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.page-blog__cta-image {
    width: 100%;
    max-width: 600px;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.page-blog__cta-content {
    max-width: 700px;
}

.page-blog__cta-title {
    font-size: clamp(1.8em, 3.5vw, 2.5em);
    color: var(--page-blog-text-main);
    margin-bottom: 15px;
    font-weight: 700;
}

.page-blog__cta-description {
    font-size: 1.1em;
    color: var(--page-blog-text-secondary);
    margin-bottom: 30px;
}

/* --- Responsive Adjustments --- */
@media (max-width: 1024px) {
    .page-blog__posts-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .page-blog {
        font-size: 15px;
        line-height: 1.7;
    }

    .page-blog__hero-section {
        padding: 40px 0;
        padding-top: 10px !important;
    }

    .page-blog__hero-content {
        padding: 30px 15px;
    }

    .page-blog__main-title {
        font-size: 2em;
        line-height: 1.3;
    }

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

    .page-blog__cta-buttons {
        flex-direction: column;
        gap: 15px;
        padding: 0 15px;
    }
    
    .page-blog__btn-primary,
    .page-blog__btn-secondary,
    .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;
        padding-right: 15px;
        min-width: unset;
    }

    .page-blog__section-title {
        font-size: 2em;
        padding: 0 15px;
    }

    .page-blog__section-description {
        font-size: 0.95em;
        padding: 0 15px;
    }

    .page-blog__latest-posts-section,
    .page-blog__faq-section,
    .page-blog__cta-section {
        padding: 60px 0;
    }

    .page-blog__posts-grid {
        grid-template-columns: 1fr;
        padding: 0 15px;
    }

    .page-blog__post-image {
        height: 200px;
    }

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

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

    .page-blog__cta-section .page-blog__container {
        padding: 0 15px;
    }
    
    /* Mobile image responsiveness */
    .page-blog img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        display: block !important;
    }
    
    /* Mobile container responsiveness */
    .page-blog__section,
    .page-blog__card,
    .page-blog__container,
    .page-blog__hero-image-wrapper,
    .page-blog__post-card,
    .page-blog__faq-item,
    .page-blog__cta-section .page-blog__container {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Ensure no filter is applied to images */
    .page-blog img {
        filter: none !important;
    }
}

/* Ensure no filter is applied to images globally */
.page-blog img {
    filter: none;
}