/* style/blog.css */

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

/* Base styles for the blog page, ensuring text contrast on dark background */
.page-blog {
    font-family: 'Arial', sans-serif;
    color: var(--text-main-color); /* Default text color for dark backgrounds */
    background-color: var(--background-color); /* Ensure consistency */
    line-height: 1.6;
    font-size: 16px;
}

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

/* Hero Section */
.page-blog__hero-section {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
    overflow: hidden;
    background-color: var(--card-bg-color); /* Using a dark background color */
    padding-top: 10px; /* Small top padding as body handles --header-offset */
}

.page-blog__hero-image-wrapper {
    width: 100%;
    max-height: 500px; /* Limit height for hero image */
    overflow: hidden;
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
}

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

.page-blog__hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin-top: 20px; /* Separates content from image */
}

.page-blog__main-title {
    font-size: clamp(2.2rem, 4vw, 3.5rem); /* Responsive H1 font size */
    font-weight: 700;
    color: var(--text-main-color);
    margin-bottom: 20px;
    line-height: 1.2;
}

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

.page-blog__cta-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap; /* Allow wrapping on small screens */
}

.page-blog__btn-primary,
.page-blog__btn-secondary {
    display: inline-block;
    padding: 14px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    max-width: 100%;
    box-sizing: border-box;
    white-space: normal; /* Allow text wrap */
    word-wrap: break-word; /* Allow text wrap */
    text-align: center;
}

.page-blog__btn-primary {
    background: var(--button-gradient);
    color: var(--text-main-color);
    border: none;
}

.page-blog__btn-primary:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.page-blog__btn-secondary {
    background: transparent;
    color: var(--glow-color);
    border: 2px solid var(--border-color);
}

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

/* Blog Posts Section */
.page-blog__posts-section, 
.page-blog__faq-section {
    padding: 60px 0;
    background-color: var(--text-main-color); /* Light background for contrast */
    color: #333333; /* Dark text for light background */
}

.page-blog__dark-bg {
    background-color: var(--card-bg-color);
    color: var(--text-main-color);
}

.page-blog__light-bg {
    background-color: var(--text-main-color);
    color: #333333;
}

.page-blog__section-title {
    font-size: 2.2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 20px;
    color: inherit; /* Inherit color from section */
}

.page-blog__section-description {
    font-size: 1.1rem;
    text-align: center;
    margin-bottom: 40px;
    color: inherit; /* Inherit color from section */
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

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

.page-blog__post-card {
    background-color: #ffffff; /* White background for cards on light sections */
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    min-height: 200px; /* Ensure min size for cards */
}

.page-blog__posts-section .page-blog__post-card {
    color: #333333; /* Dark text for cards on light background */
}

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

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

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

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

.page-blog__post-title a {
    color: inherit; /* Inherit color from card */
    text-decoration: none;
    transition: color 0.3s ease;
}

.page-blog__post-title a:hover {
    color: var(--main-color);
}

.page-blog__post-meta {
    font-size: 0.9rem;
    color: #666666;
    margin-bottom: 15px;
}

.page-blog__post-excerpt {
    font-size: 1rem;
    color: #555555;
    margin-bottom: 20px;
    flex-grow: 1;
}

.page-blog__read-more-btn {
    display: inline-block;
    color: var(--main-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

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

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

/* Categories Section */
.page-blog__categories-section {
    padding: 60px 0;
    background-color: var(--card-bg-color); /* Dark background */
    color: var(--text-main-color); /* Light text */
}

.page-blog__category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); /* Min card width to hold 200px img */
    gap: 20px;
}

.page-blog__category-card {
    background-color: var(--deep-green-color); /* Darker green for category cards */
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    text-decoration: none;
    color: var(--text-main-color);
    transition: background-color 0.3s ease, transform 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 280px; /* Ensure card is large enough for 200x200px image + text */
}

.page-blog__category-card:hover {
    background-color: var(--border-color);
    transform: translateY(-3px);
}

.page-blog__category-icon {
    width: 100%; /* Fill card width */
    max-width: 200px; /* Set max width to 200px for the icon itself */
    height: auto;
    min-width: 200px; /* Ensure minimum display size is 200px */
    min-height: 200px; /* Ensure minimum display size is 200px */
    object-fit: contain;
    margin-bottom: 10px;
    filter: brightness(1.2); /* Slightly brighten icon on dark background */
}

.page-blog__category-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 10px;
}

/* FAQ Section */
.page-blog__faq-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.page-blog__faq-item {
    background-color: #ffffff; /* White background for FAQ items on light sections */
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    color: #333333; /* Dark text for light background */
}

.page-blog__faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    font-size: 1.15rem;
    font-weight: 600;
    cursor: pointer;
    background-color: #f9f9f9;
    border-bottom: 1px solid #eeeeee;
    color: #333333;
}

.page-blog__faq-item[open] .page-blog__faq-question {
    border-bottom: none;
}

.page-blog__faq-toggle {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--main-color);
    margin-left: 15px;
    transition: transform 0.3s ease;
}

.page-blog__faq-item[open] .page-blog__faq-toggle {
    transform: rotate(45deg); /* Rotate '+' to 'x' or just change to '-' */
}
/* For details/summary, the default marker is usually hidden with list-style: none */
.page-blog__faq-item summary {
    list-style: none; /* Hide default marker */
}
.page-blog__faq-item summary::-webkit-details-marker {
    display: none; /* Hide default marker for webkit */
}

.page-blog__faq-answer {
    padding: 0 25px 20px;
    font-size: 1rem;
    color: #555555;
    line-height: 1.7;
}

/* CTA Section */
.page-blog__cta-section {
    padding: 80px 0;
    text-align: center;
    background-color: var(--deep-green-color); /* Dark background */
    color: var(--text-main-color); /* Light text */
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .page-blog__main-title {
        font-size: clamp(2rem, 5vw, 3rem);
    }
    .page-blog__section-title {
        font-size: 2rem;
    }
}

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

    .page-blog__hero-section {
        padding: 60px 15px;
        padding-top: 10px !important; /* body handles --header-offset, small top padding */
    }

    .page-blog__hero-image-wrapper {
        max-height: 300px;
    }

    .page-blog__main-title {
        font-size: clamp(1.8rem, 6vw, 2.8rem);
        margin-bottom: 15px;
    }

    .page-blog__description {
        font-size: 1rem;
        margin-bottom: 25px;
    }

    .page-blog__cta-buttons {
        flex-direction: column;
        gap: 10px;
        width: 100%;
        max-width: 350px; /* Limit width for stacked buttons */
        margin: 0 auto;
    }

    .page-blog__btn-primary,
    .page-blog__btn-secondary {
        width: 100% !important;
        padding: 12px 20px;
        font-size: 0.95rem;
        max-width: 100% !important;
        box-sizing: border-box !important;
        white-space: normal !important;
        word-wrap: break-word !important;
    }

    .page-blog__posts-section,
    .page-blog__categories-section,
    .page-blog__faq-section,
    .page-blog__cta-section {
        padding: 40px 0;
    }

    .page-blog__section-title {
        font-size: 1.8rem;
        margin-bottom: 15px;
    }

    .page-blog__section-description {
        font-size: 1rem;
        margin-bottom: 30px;
    }

    .page-blog__post-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .page-blog__post-image {
        height: 180px; /* Adjust height for mobile */
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        display: block !important;
    }

    .page-blog__post-card {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 0; /* Content padding is inside */
        padding-right: 0; /* Content padding is inside */
    }
    .page-blog__post-content {
        padding: 20px;
    }

    .page-blog__category-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }
    .page-blog__category-card {
        min-height: 250px;
        padding-left: 15px;
        padding-right: 15px;
    }
    .page-blog__category-icon {
        max-width: 180px; 
        min-width: 180px;
        min-height: 180px;
        width: 100% !important;
        height: auto !important;
        display: block !important;
    }

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

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

/* Ensure all images are responsive */
.page-blog img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Mobile specific image and container overrides */
@media (max-width: 768px) {
    .page-blog img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        display: block !important;
    }
    
    .page-blog__section,
    .page-blog__card,
    .page-blog__container,
    .page-blog__hero-section,
    .page-blog__posts-section,
    .page-blog__categories-section,
    .page-blog__faq-section,
    .page-blog__cta-section {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        /* Padding added to sections for content margin */
    }

    /* Video section top padding (if any, ensures small value) */
    .page-blog__video-section {
        padding-top: 10px !important;
    }
}