/* style/blog.css */
/* Base styles for the blog page */
.page-blog {
    background-color: var(--background-color, #08160F); /* Fallback to custom color if shared var not set */
    color: var(--text-main-color, #F2FFF6); /* Light text for dark background */
    font-family: Arial, sans-serif;
    line-height: 1.6;
}

.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;
    align-items: center;
    padding-top: 10px; /* Small top padding, body handles --header-offset */
    padding-bottom: 60px;
    background: linear-gradient(180deg, #08160F 0%, #11271B 100%); /* Blend with body background */
    text-align: center;
}

.page-blog__hero-image {
    width: 100%;
    height: auto;
    max-height: 675px; /* Limit height for hero image */
    object-fit: cover;
    margin-bottom: 30px;
    border-radius: 8px;
}

.page-blog__hero-content {
    max-width: 800px;
    padding: 0 20px;
}

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

.page-blog__description {
    font-size: 1.1em;
    color: var(--text-secondary-color, #A7D9B8);
    margin-bottom: 30px;
}

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

/* Buttons */
.page-blog__btn-primary,
.page-blog__btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.05em;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 180px; /* Ensure minimum button width */
    box-sizing: border-box;
    white-space: normal; /* Allow text wrapping */
    word-wrap: break-word; /* Allow text wrapping */
}

.page-blog__btn-primary {
    background: linear-gradient(180deg, #2AD16F 0%, #13994A 100%);
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 15px rgba(42, 209, 111, 0.4);
}

.page-blog__btn-primary:hover {
    background: linear-gradient(180deg, #13994A 0%, #2AD16F 100%);
    box-shadow: 0 6px 20px rgba(42, 209, 111, 0.6);
}

.page-blog__btn-secondary {
    background: transparent;
    color: var(--text-main-color, #F2FFF6);
    border: 2px solid var(--border-color, #2E7A4E);
}

.page-blog__btn-secondary:hover {
    background: var(--border-color, #2E7A4E);
    color: #ffffff;
}

.page-blog__btn-text {
    color: var(--text-main-color, #F2FFF6);
    text-decoration: none;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color 0.3s ease;
}

.page-blog__btn-text:hover {
    color: var(--glow-color, #57E38D);
}

.page-blog__arrow {
    font-size: 1.2em;
    line-height: 1;
}

/* Section Titles */
.page-blog__section-title {
    font-size: clamp(1.8em, 3.5vw, 2.8em);
    color: var(--text-main-color, #F2FFF6);
    text-align: center;
    margin-bottom: 40px;
    margin-top: 60px;
    font-weight: bold;
}

.page-blog__sub-title {
    font-size: clamp(1.4em, 2.5vw, 2em);
    color: var(--text-main-color, #F2FFF6);
    margin-top: 30px;
    margin-bottom: 20px;
    font-weight: bold;
}

/* Content Grid */
.page-blog__content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
    margin-bottom: 60px;
}

.page-blog__content-grid--reverse {
    grid-template-areas: "image text"; /* For desktop, image on left, text on right */
}

.page-blog__content-grid--reverse .page-blog__text-block {
    grid-area: text;
}

.page-blog__content-grid--reverse .page-blog__image-content {
    grid-area: image;
}

.page-blog__text-block p {
    margin-bottom: 15px;
    color: var(--text-secondary-color, #A7D9B8);
    font-size: 1.05em;
}

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

/* Category Grid */
.page-blog__categories-section {
    padding: 60px 0;
    background-color: var(--card-bg-color, #11271B); /* Darker background for this section */
}

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

.page-blog__category-card {
    background-color: var(--background-color, #08160F); /* Slightly lighter card background */
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 220px;
}

.page-blog__category-card .page-blog__card-title {
    font-size: 1.5em;
    color: var(--text-main-color, #F2FFF6);
    margin-bottom: 15px;
}

.page-blog__category-card p {
    color: var(--text-secondary-color, #A7D9B8);
    margin-bottom: 20px;
    flex-grow: 1;
}

/* Latest Posts */
.page-blog__latest-posts {
    padding: 60px 0;
}

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

.page-blog__post-card {
    background-color: var(--card-bg-color, #11271B);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    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.3);
}

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

.page-blog__post-thumbnail {
    width: 100%;
    height: 200px; /* Fixed height for thumbnails */
    object-fit: cover;
    display: block;
    min-width: 200px;
    min-height: 200px;
}

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

.page-blog__post-title {
    font-size: 1.3em;
    color: var(--text-main-color, #F2FFF6);
    margin-bottom: 10px;
    line-height: 1.3;
}

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

.page-blog__post-excerpt {
    color: var(--text-secondary-color, #A7D9B8);
    font-size: 1em;
}

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

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

/* FAQ Section */
.page-blog__faq-section {
    padding: 60px 0;
    background-color: var(--background-color, #08160F);
}

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

.page-blog__faq-item {
    background-color: var(--card-bg-color, #11271B);
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
    color: var(--text-main-color, #F2FFF6);
}

.page-blog__faq-item summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.1em;
    list-style: none; /* Hide default marker */
    color: var(--text-main-color, #F2FFF6);
}

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

.page-blog__faq-question {
    flex-grow: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.page-blog__faq-answer {
    padding: 0 25px 20px;
    font-size: 1em;
    color: var(--text-secondary-color, #A7D9B8);
}

/* Responsive Design */
@media (max-width: 992px) {
    .page-blog__content-grid {
        grid-template-columns: 1fr; /* Stack on smaller screens */
        gap: 30px;
    }
    .page-blog__content-grid--reverse {
        grid-template-areas: unset; /* Reset grid area for stacking */
    }
    .page-blog__content-grid--reverse .page-blog__text-block,
    .page-blog__content-grid--reverse .page-blog__image-content {
        grid-area: unset;
    }
}

@media (max-width: 768px) {
    .page-blog__container {
        padding: 0 15px; /* Smaller padding on mobile */
    }

    .page-blog__hero-section {
        padding-bottom: 40px;
    }

    .page-blog__main-title {
        font-size: 2em; /* Adjust H1 for mobile */
    }

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

    .page-blog__cta-group {
        flex-direction: column; /* Stack buttons vertically */
        gap: 15px;
    }

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

    /* Force responsive for all images and their containers */
    .page-blog img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        display: block !important;
        min-width: 200px !important; /* Ensure min size is met */
        min-height: 200px !important; /* Ensure min size is met */
    }

    .page-blog__section,
    .page-blog__card,
    .page-blog__container,
    .page-blog__hero-section,
    .page-blog__about-section,
    .page-blog__categories-section,
    .page-blog__latest-posts,
    .page-blog__importance-section,
    .page-blog__cta-section,
    .page-blog__faq-section,
    .page-blog__post-card,
    .page-blog__category-card,
    .page-blog__faq-item {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px;
        padding-right: 15px;
        overflow: hidden !important; /* Prevent horizontal scroll */
    }

    .page-blog__post-thumbnail {
        height: auto !important; /* Allow thumbnail height to adjust */
        min-height: 200px !important;
    }
    
    .page-blog__video-section {
        padding-top: 10px !important; /* body already handles --header-offset */
    }

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

    .page-blog__sub-title {
        font-size: 1.2em;
    }

    .page-blog__category-grid,
    .page-blog__post-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .page-blog__category-card,
    .page-blog__post-card {
        padding-left: 0;
        padding-right: 0;
    }
    .page-blog__category-card .page-blog__card-title,
    .page-blog__category-card p,
    .page-blog__post-content {
        padding-left: 15px;
        padding-right: 15px;
    }
}