/* style/blog.css */

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

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

.page-blog__section {
    padding: 60px 0;
    position: relative;
    overflow: hidden; /* Prevent content overflow */
}

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

.page-blog__section-title {
    font-size: clamp(28px, 4vw, 48px); /* Responsive font size for H2 */
    color: var(--jdb-text-main);
    text-align: center;
    margin-bottom: 20px;
    font-weight: bold;
    line-height: 1.2;
}

.page-blog__section-intro {
    font-size: clamp(16px, 2vw, 20px);
    color: var(--jdb-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;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px 0 80px; /* Small top padding, body handles header offset */
    background-color: var(--jdb-deep-green); /* A darker green for hero background */
    overflow: hidden;
}

.page-blog__hero-image-wrapper {
    width: 100%;
    max-height: 600px; /* Limit hero image height */
    overflow: hidden;
    position: relative;
    margin-bottom: 40px; /* Space between image and content */
}

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

.page-blog__hero-content {
    max-width: 900px;
    padding: 0 20px;
    box-sizing: border-box;
}

.page-blog__hero-title {
    font-size: clamp(32px, 5vw, 60px); /* H1: Responsive font size */
    color: var(--jdb-gold); /* Gold for emphasis */
    margin-bottom: 20px;
    font-weight: bold;
    line-height: 1.1;
    text-shadow: 0 0 10px rgba(242, 193, 78, 0.5);
}

.page-blog__hero-description {
    font-size: clamp(18px, 2.5vw, 24px);
    color: var(--jdb-text-main);
    margin-bottom: 40px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.page-blog__hero-cta-button {
    background: var(--jdb-button-gradient);
    color: #FFFFFF;
    padding: 15px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    font-size: 18px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: inline-block;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.page-blog__hero-cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

/* Latest Articles Section */
.page-blog__latest-articles {
    background-color: var(--jdb-background);
}

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

.page-blog__article-card {
    background-color: var(--jdb-card-bg); /* Dark card background */
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--jdb-border);
    display: flex;
    flex-direction: column;
}

.page-blog__article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.page-blog__article-image-wrapper {
    width: 100%;
    height: 220px; /* Fixed height for consistent card appearance */
    overflow: hidden;
}

.page-blog__article-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.page-blog__article-card:hover .page-blog__article-image {
    transform: scale(1.05);
}

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

.page-blog__article-title {
    font-size: 24px;
    margin-bottom: 10px;
    font-weight: bold;
    line-height: 1.3;
}

.page-blog__article-title a {
    color: var(--jdb-text-main);
    text-decoration: none;
    transition: color 0.3s ease;
}

.page-blog__article-title a:hover {
    color: var(--jdb-gold);
}

.page-blog__article-meta {
    font-size: 14px;
    color: var(--jdb-text-secondary);
    margin-bottom: 15px;
}

.page-blog__article-excerpt {
    font-size: 16px;
    color: var(--jdb-text-secondary);
    margin-bottom: 20px;
    flex-grow: 1; /* Allow excerpt to take available space */
}

.page-blog__article-readmore {
    color: var(--jdb-gold);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
    align-self: flex-start; /* Align to the start of the flex container */
}

.page-blog__article-readmore:hover {
    color: var(--jdb-glow);
}

.page-blog__cta-center {
    text-align: center;
    margin-top: 50px;
}

.page-blog__view-all-button {
    background: var(--jdb-button-gradient);
    color: #FFFFFF;
    padding: 15px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    font-size: 18px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: inline-block;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.page-blog__view-all-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

/* Categories Section */
.page-blog__categories {
    background-color: var(--jdb-deep-green); /* Darker green background */
}

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

.page-blog__category-card {
    background-color: var(--jdb-card-bg);
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    text-decoration: none;
    color: var(--jdb-text-main);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    border: 1px solid var(--jdb-border);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.page-blog__category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    border-color: var(--jdb-gold);
}

.page-blog__category-title {
    font-size: 22px;
    margin-bottom: 10px;
    color: var(--jdb-gold);
    font-weight: bold;
}

.page-blog__category-description {
    font-size: 15px;
    color: var(--jdb-text-secondary);
}

/* Featured Article Section */
.page-blog__featured-article {
    background-color: var(--jdb-background);
}

.page-blog__featured-content {
    display: flex;
    gap: 40px;
    align-items: flex-start; /* Align items to the start */
}

.page-blog__featured-image-wrapper {
    flex: 1;
    min-width: 400px; /* Ensure image takes significant space */
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--jdb-border);
}

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

.page-blog__featured-text {
    flex: 2; /* Text takes more space */
    color: var(--jdb-text-main);
}

.page-blog__featured-text p {
    margin-bottom: 20px;
    font-size: 17px;
    color: var(--jdb-text-secondary); /* Use secondary color for paragraph text */
}

.page-blog__read-full-article-button {
    background: var(--jdb-button-gradient);
    color: #FFFFFF;
    padding: 15px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    font-size: 18px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: inline-block;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    margin-top: 20px;
}

.page-blog__read-full-article-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}


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

.page-blog__cta-container {
    max-width: 900px;
}

.page-blog__cta-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
}

.page-blog__btn-primary,
.page-blog__btn-secondary {
    padding: 15px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    font-size: 18px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: inline-block;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    box-sizing: border-box; /* Crucial for responsive buttons */
}

.page-blog__btn-primary {
    background: var(--jdb-button-gradient);
    color: #FFFFFF;
}

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

.page-blog__btn-primary:hover,
.page-blog__btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

/* FAQ Section */
.page-blog__faq-section {
    background-color: var(--jdb-background);
}

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

.page-blog__faq-item {
    background-color: var(--jdb-card-bg);
    border: 1px solid var(--jdb-border);
    border-radius: 10px;
    margin-bottom: 15px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease;
}

.page-blog__faq-item:hover {
    background-color: var(--jdb-deep-green);
}

.page-blog__faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    font-size: 18px;
    font-weight: bold;
    color: var(--jdb-text-main);
    cursor: pointer;
    user-select: none;
    transition: color 0.3s ease;
    list-style: none; /* For details/summary */
}

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

.page-blog__faq-item[open] .page-blog__faq-question {
    color: var(--jdb-gold);
}

.page-blog__faq-toggle {
    font-size: 24px;
    line-height: 1;
    margin-left: 15px;
    color: var(--jdb-gold);
}

.page-blog__faq-answer {
    padding: 0 25px 20px;
    font-size: 16px;
    color: var(--jdb-text-secondary);
}

.page-blog__faq-answer p {
    margin-bottom: 0;
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .page-blog__featured-content {
        flex-direction: column;
        align-items: center;
    }
    .page-blog__featured-image-wrapper {
        min-width: unset;
        width: 100%;
        max-width: 800px;
    }
}

@media (max-width: 768px) {
    .page-blog__section {
        padding: 40px 0;
    }
    .page-blog__hero-section {
        padding-top: 10px !important; /* body handles header offset */
        padding-bottom: 60px;
    }
    .page-blog__hero-title {
        font-size: 32px;
    }
    .page-blog__hero-description {
        font-size: 16px;
    }
    .page-blog__hero-cta-button,
    .page-blog__view-all-button,
    .page-blog__read-full-article-button,
    .page-blog__btn-primary,
    .page-blog__btn-secondary {
        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;
    }

    .page-blog__cta-buttons {
        flex-direction: column !important;
        gap: 15px;
        padding: 0 15px; /* Add padding to container */
    }
    
    .page-blog__container {
        padding: 0 15px;
    }

    /* Images */
    .page-blog img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        display: block !important;
    }
    
    /* Ensure all image containers are responsive */
    .page-blog__hero-image-wrapper,
    .page-blog__article-image-wrapper,
    .page-blog__featured-image-wrapper {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    .page-blog__article-image-wrapper {
        height: auto; /* Allow height to adjust */
    }

    .page-blog__category-grid {
        grid-template-columns: 1fr;
    }

    .page-blog__featured-text p {
        font-size: 15px;
    }

    .page-blog__faq-question {
        font-size: 16px;
        padding: 15px 20px;
    }
    .page-blog__faq-answer {
        padding: 0 20px 15px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .page-blog__hero-title {
        font-size: 28px;
    }
    .page-blog__section-title {
        font-size: 24px;
    }
    .page-blog__article-title {
        font-size: 20px;
    }
    .page-blog__category-title {
        font-size: 18px;
    }
}