/* style/blog.css */

/* Custom Colors */
:root {
    --page-blog-bg: #08160F;
    --page-blog-card-bg: #11271B;
    --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;
    --page-blog-btn-primary-gradient: linear-gradient(180deg, #2AD16F 0%, #13994A 100%);
    --page-blog-btn-primary-text: #F2FFF6; /* Text Main */
    --page-blog-btn-secondary-bg: #F2FFF6; /* Text Main */
    --page-blog-btn-secondary-text: #11A84E; /* Primary Brand Color */
}

.page-blog {
    background-color: var(--page-blog-bg);
    color: var(--page-blog-text-main);
    font-family: Arial, sans-serif;
    line-height: 1.6;
}

/* General Layout */
.page-blog__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

.page-blog__section-title {
    font-size: 2.5em;
    color: var(--page-blog-text-main);
    text-align: center;
    margin-bottom: 20px;
    font-weight: bold;
    line-height: 1.2;
}

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

/* Hero Section */
.page-blog__hero-section {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 60px 20px;
    padding-top: 10px; /* Small top padding, body handles header offset */
    background-color: var(--page-blog-deep-green); /* Darker green for hero */
    overflow: hidden; /* Ensure no image overflow */
}

.page-blog__hero-image-wrapper {
    width: 100%;
    max-width: 100%;
    margin-bottom: 40px;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
}

.page-blog__hero-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.page-blog__hero-content {
    text-align: center;
    max-width: 900px;
    z-index: 1;
}

.page-blog__main-title {
    font-size: clamp(2.5em, 5vw, 3.5em); /* Responsive H1 font size */
    color: var(--page-blog-gold); /* Gold for main title */
    margin-bottom: 20px;
    font-weight: 700;
    line-height: 1.1;
    text-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

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

/* Buttons */
.page-blog__btn-primary,
.page-blog__btn-secondary {
    display: inline-block;
    padding: 15px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1em;
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: center;
    box-sizing: border-box;
    max-width: 100%; /* Ensure buttons are responsive */
    white-space: normal; /* Allow text wrapping */
    word-wrap: break-word; /* Allow text breaking */
}

.page-blog__btn-primary {
    background: var(--page-blog-btn-primary-gradient);
    color: var(--page-blog-btn-primary-text);
    border: 2px solid transparent;
    margin: 10px;
}

.page-blog__btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
    opacity: 0.9;
}

.page-blog__btn-secondary {
    background-color: var(--page-blog-btn-secondary-bg);
    color: var(--page-blog-btn-secondary-text);
    border: 2px solid var(--page-blog-btn-secondary-text);
    margin: 10px;
}

.page-blog__btn-secondary:hover {
    background-color: var(--page-blog-btn-secondary-text);
    color: var(--page-blog-btn-secondary-bg);
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

/* Latest Posts & Featured Articles Grid */
.page-blog__post-grid,
.page-blog__featured-grid,
.page-blog__category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.page-blog__post-card,
.page-blog__featured-card,
.page-blog__category-card {
    background-color: var(--page-blog-card-bg);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    text-decoration: none; /* For category cards */
    color: var(--page-blog-text-main); /* For category cards */
}

.page-blog__post-card:hover,
.page-blog__featured-card:hover,
.page-blog__category-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.3);
}

.page-blog__post-image,
.page-blog__featured-image,
.page-blog__category-icon {
    width: 100%;
    height: 225px; /* Fixed height for consistency */
    object-fit: cover;
    display: block;
    min-height: 200px; /* Minimum size requirement */
}

.page-blog__category-icon {
    height: 150px; /* Smaller for categories */
}

.page-blog__card-content {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.page-blog__post-title,
.page-blog__featured-title,
.page-blog__category-title {
    font-size: 1.4em;
    margin-bottom: 10px;
    font-weight: 600;
    line-height: 1.3;
}

.page-blog__post-title a,
.page-blog__featured-title a {
    color: var(--page-blog-gold); /* Gold for article titles */
    text-decoration: none;
    transition: color 0.3s ease;
}

.page-blog__post-title a:hover,
.page-blog__featured-title a:hover {
    color: var(--page-blog-glow);
}

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

.page-blog__post-excerpt,
.page-blog__featured-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);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
    margin-top: auto; /* Push to bottom of card */
}

.page-blog__read-more-btn:hover {
    text-decoration: underline;
    color: var(--page-blog-gold);
}

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

/* Why Follow Section */
.page-blog__reason-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.page-blog__reason-item {
    background-color: var(--page-blog-card-bg);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.page-blog__reason-title {
    font-size: 1.5em;
    color: var(--page-blog-gold);
    margin-bottom: 15px;
}

.page-blog__reason-item p {
    color: var(--page-blog-text-secondary);
}

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

.page-blog__faq-item {
    background-color: var(--page-blog-card-bg);
    border: 1px solid var(--page-blog-border);
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
}

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

.page-blog__faq-question::-webkit-details-marker {
    display: none;
}

.page-blog__faq-question:hover {
    background-color: var(--page-blog-border);
}

.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;
    color: var(--page-blog-text-secondary);
    font-size: 1em;
    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; /* Adjust as needed for content */
    padding-top: 15px;
}

/* For JS-controlled FAQ (if not using <details>) */
.page-blog__faq-item.active .page-blog__faq-answer {
    max-height: 500px !important; /* Ensure it overrides transition */
    padding-top: 15px;
}
.page-blog__faq-item.active .page-blog__faq-question .page-blog__faq-toggle {
    content: '−';
}


/* Call to Action Section */
.page-blog__cta-section {
    text-align: center;
    padding: 80px 20px;
    background-color: var(--page-blog-deep-green);
}

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


/* Color Contrast / Background handling */
.page-blog__dark-section {
    background-color: var(--page-blog-deep-green);
    color: var(--page-blog-text-main);
}

.page-blog__light-bg {
    background-color: var(--page-blog-bg); /* Using main background for light sections, as it's dark green */
    color: var(--page-blog-text-main); /* Keeping text light for contrast */
}

/* Ensure paragraph and list item text color is readable */
.page-blog p,
.page-blog li {
    color: var(--page-blog-text-secondary);
}

/* Specific overrides for sections with different backgrounds */
.page-blog__latest-posts .page-blog__section-title,
.page-blog__categories .page-blog__section-title,
.page-blog__faq-section .page-blog__section-title {
    color: var(--page-blog-gold);
}
.page-blog__latest-posts .page-blog__section-description,
.page-blog__categories .page-blog__section-description,
.page-blog__faq-section .page-blog__section-description {
    color: var(--page-blog-text-secondary);
}


/* --- Responsive Design --- */
@media (max-width: 1024px) {
    .page-blog__main-title {
        font-size: clamp(2em, 4vw, 3em);
    }
    .page-blog__section-title {
        font-size: 2em;
    }
    .page-blog__post-grid,
    .page-blog__featured-grid,
    .page-blog__category-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .page-blog__container {
        padding: 0 15px !important; /* Add padding for mobile content areas */
    }

    .page-blog__hero-section {
        padding: 40px 15px;
        padding-top: 10px !important; /* body handles --header-offset, this is for aesthetic */
    }

    .page-blog__main-title {
        font-size: clamp(1.8em, 7vw, 2.5em) !important;
    }

    .page-blog__section-title {
        font-size: 1.8em !important;
    }

    .page-blog__intro-text,
    .page-blog__section-description,
    .page-blog p,
    .page-blog li {
        font-size: 1em !important;
    }

    /* Images */
    .page-blog img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        display: block !important;
    }
    .page-blog__hero-image-wrapper,
    .page-blog__post-card,
    .page-blog__featured-card,
    .page-blog__category-card,
    .page-blog__reason-item,
    .page-blog__faq-item {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        margin-left: auto;
        margin-right: auto;
    }

    /* Buttons */
    .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;
        margin: 10px 0 !important; /* Stack buttons vertically */
        padding: 12px 20px !important;
    }
    .page-blog__cta-buttons {
        flex-direction: column !important; /* Stack buttons vertically */
        gap: 10px !important;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important; /* Prevent overflow */
        padding: 0 15px !important; /* Add padding to button container */
    }

    /* Grids */
    .page-blog__post-grid,
    .page-blog__featured-grid,
    .page-blog__category-grid,
    .page-blog__reason-list {
        grid-template-columns: 1fr !important; /* Single column layout */
        gap: 20px !important;
    }
    .page-blog__post-image,
    .page-blog__featured-image,
    .page-blog__category-icon {
        height: auto !important; /* Allow height to adjust */
        min-height: 200px !important; /* Maintain minimum size */
    }

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