/* style/blog.css */

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

/* Base styles for the blog page */
.page-blog {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-main); /* #F2FFF6 */
    background-color: var(--bg-color-main); /* #08160F */
    padding-bottom: 50px; /* Ensure space above footer */
}

.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;
    overflow: hidden;
    padding-top: 10px; /* Small top padding, body handles header offset */
}

.page-blog__hero-image-wrapper {
    width: 100%;
    max-height: 700px; /* Limit height for hero image */
    overflow: hidden;
}

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

.page-blog__hero-content {
    width: 100%;
    padding: 60px 20px;
    text-align: center;
    background: var(--deep-green); /* #0A4B2C */
    color: var(--text-main); /* #F2FFF6 */
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.page-blog__hero-content .page-blog__container {
    max-width: 900px;
}

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

.page-blog__description {
    font-size: 1.1em;
    margin-bottom: 30px;
    color: var(--text-secondary); /* #A7D9B8 */
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

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

.page-blog__btn-primary,
.page-blog__btn-secondary,
.page-blog__read-more-btn {
    padding: 12px 25px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    display: inline-block;
    text-align: center;
    box-sizing: border-box;
    white-space: normal; /* Allow text to wrap */
    word-wrap: break-word; /* Ensure long words break */
    max-width: 100%; /* Ensure button doesn't overflow */
}

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

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

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

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

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

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

/* Card General Styles */
.page-blog__card {
    background-color: var(--card-bg); /* #11271B */
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    color: var(--text-main); /* #F2FFF6 */
}

.page-blog__card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Latest Posts Section */
.page-blog__latest-posts {
    padding: 80px 0;
    background-color: var(--bg-color-main); /* #08160F */
}

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

.page-blog__post-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%; /* Ensure cards are same height */
}

.page-blog__post-thumbnail-wrapper {
    width: 100%;
    height: 200px; /* Fixed height for thumbnails */
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 15px;
}

.page-blog__post-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

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

.page-blog__post-title {
    font-size: 1.3em;
    font-weight: bold;
    margin-bottom: 10px;
    line-height: 1.4;
    flex-grow: 1; /* Allow title to take up available space */
}

.page-blog__post-title a {
    color: var(--text-main); /* #F2FFF6 */
    text-decoration: none;
    transition: color 0.3s ease;
}

.page-blog__post-title a:hover {
    color: var(--glow); /* #57E38D */
}

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

.page-blog__post-excerpt {
    font-size: 1em;
    color: var(--text-secondary); /* #A7D9B8 */
    margin-bottom: 15px;
}

.page-blog__read-more-btn {
    align-self: flex-start; /* Keep button to the left */
    background: var(--deep-green); /* #0A4B2C */
    color: var(--text-main); /* #F2FFF6 */
    border: 1px solid var(--border-color); /* #2E7A4E */
    padding: 8px 15px;
    font-size: 0.9em;
    border-radius: 6px;
}

.page-blog__read-more-btn:hover {
    background: var(--border-color); /* #2E7A4E */
    color: #ffffff;
}

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

.page-blog__view-all-btn {
    padding: 15px 30px;
    font-size: 1.1em;
}

/* Categories Section */
.page-blog__categories-section {
    padding: 80px 0;
    background-color: var(--deep-green); /* #0A4B2C */
}

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

.page-blog__category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none;
    padding: 30px;
    height: 100%;
}

.page-blog__category-icon {
    width: 100%;
    height: 150px; /* Fixed height for category images */
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 20px;
    display: block;
}

.page-blog__category-title {
    font-size: 1.4em;
    font-weight: bold;
    color: var(--text-main); /* #F2FFF6 */
    margin-top: auto; /* Push title to bottom */
}

/* Why Choose Us Section */
.page-blog__why-choose-us {
    padding: 80px 0;
    background-color: var(--bg-color-main); /* #08160F */
}

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

.page-blog__feature-item {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.page-blog__feature-icon {
    width: 150px;
    height: 150px;
    object-fit: contain; /* Ensure full icon is visible */
    margin-bottom: 20px;
    border-radius: 50%; /* Make icons round */
    background-color: rgba(255, 255, 255, 0.05);
    padding: 15px;
    box-sizing: border-box;
}

.page-blog__feature-title {
    font-size: 1.3em;
    font-weight: bold;
    margin-bottom: 10px;
    color: var(--text-main); /* #F2FFF6 */
}

.page-blog__feature-text {
    font-size: 1em;
    color: var(--text-secondary); /* #A7D9B8 */
    flex-grow: 1;
}

/* CTA Section */
.page-blog__cta-section {
    padding: 80px 0;
    background-color: var(--deep-green); /* #0A4B2C */
}

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

.page-blog__faq-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.page-blog__faq-item {
    background-color: var(--card-bg); /* #11271B */
    border: 1px solid var(--border-color); /* #2E7A4E */
    border-radius: 12px;
    overflow: hidden;
}

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

.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-qtext {
    flex-grow: 1;
    margin-right: 15px;
}

.page-blog__faq-toggle {
    font-size: 1.5em;
    line-height: 1;
    width: 20px;
    text-align: center;
    color: var(--glow); /* #57E38D */
}

/* Details element open state for icon */
.page-blog__faq-item[open] .page-blog__faq-toggle {
    content: "−"; /* Change to minus when open */
}

/* Responsive Styles */
@media (max-width: 992px) {
    .page-blog__main-title {
        font-size: clamp(1.8em, 5vw, 2.5em);
    }
    .page-blog__post-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
    .page-blog__category-grid,
    .page-blog__features-grid {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    }
}

@media (max-width: 768px) {
    .page-blog {
        font-size: 16px;
        line-height: 1.6;
    }
    .page-blog__hero-content {
        padding: 40px 15px;
    }
    .page-blog__main-title {
        font-size: clamp(1.5em, 6vw, 2.2em);
    }
    .page-blog__description {
        font-size: 1em;
    }
    .page-blog__cta-buttons {
        flex-direction: column;
        gap: 15px;
    }
    .page-blog__btn-primary,
    .page-blog__btn-secondary,
    .page-blog__read-more-btn {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 15px;
        padding-right: 15px;
        box-sizing: border-box !important;
    }
    .page-blog__latest-posts,
    .page-blog__categories-section,
    .page-blog__why-choose-us,
    .page-blog__cta-section,
    .page-blog__faq-section {
        padding: 50px 0;
    }
    .page-blog__container {
        padding: 0 15px;
    }
    .page-blog__section-title {
        font-size: clamp(1.5em, 5.5vw, 2.2em);
    }
    .page-blog__section-description {
        font-size: 0.95em;
    }
    .page-blog__post-grid,
    .page-blog__category-grid,
    .page-blog__features-grid {
        grid-template-columns: 1fr;
    }
    .page-blog__post-thumbnail-wrapper {
        height: 180px;
    }
    .page-blog__category-icon {
        height: 120px;
    }
    .page-blog__feature-icon {
        width: 120px;
        height: 120px;
    }
    .page-blog__faq-item summary {
        font-size: 1.05em;
        padding: 15px 20px;
    }
    .page-blog__faq-answer {
        padding: 0 20px 15px;
    }

    /* Mobile image responsiveness */
    .page-blog img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        display: block !important;
    }

    .page-blog__hero-image-wrapper,
    .page-blog__post-thumbnail-wrapper,
    .page-blog__category-card,
    .page-blog__feature-item,
    .page-blog__container,
    .page-blog__hero-content,
    .page-blog__post-card,
    .page-blog__faq-item,
    .page-blog__cta-buttons,
    .page-blog__button-group,
    .page-blog__btn-container {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }
    /* Specific override for sections to remove padding-left/right if container already handles it */
    .page-blog__latest-posts,
    .page-blog__categories-section,
    .page-blog__why-choose-us,
    .page-blog__cta-section,
    .page-blog__faq-section {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    .page-blog__hero-content {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    .page-blog__hero-section {
        padding-top: 10px !important; /* body already has padding-top */
    }
    .page-blog__cta-buttons {
        flex-direction: column;
        gap: 10px;
    }
}