/* style/blog.css */

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

/* Base styles for the blog page */
.page-blog {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color-main); /* Default text color for the page */
    background-color: var(--bg-color-main); /* Default background for sections not specifically styled */
}

/* Sections */
.page-blog__section {
    padding: 60px 20px;
    text-align: center;
}

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

.page-blog__section-title {
    font-size: 2.5em;
    font-weight: bold;
    margin-bottom: 20px;
    color: var(--gold-color);
    text-shadow: 0 0 8px rgba(242, 193, 78, 0.5);
}

.page-blog__main-title {
    font-weight: bold;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--gold-color);
    text-shadow: 0 0 10px rgba(242, 193, 78, 0.7);
    max-width: 900px;
    margin: 0 auto 20px;
    font-size: clamp(2.5em, 5vw, 3.5em); /* Using clamp for H1 */
}

.page-blog__description,
.page-blog__intro-text {
    font-size: 1.1em;
    margin-bottom: 30px;
    color: var(--text-color-secondary);
    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;
    justify-content: center;
    padding: 10px 0 60px 0; /* Small top padding, not var(--header-offset) */
    overflow: hidden;
    background-color: var(--bg-color-main);
}

.page-blog__hero-image-wrapper {
    width: 100%;
    max-height: 675px; /* Adjust based on desired aspect ratio for 1200x675 */
    overflow: hidden;
    margin-bottom: 30px;
}

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

.page-blog__hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 0 20px;
    max-width: 900px;
    margin: 0 auto;
}

/* Latest Posts Grid */
.page-blog__latest-posts {
    background-color: var(--bg-color-main);
    color: var(--text-color-main);
}

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

.page-blog__post-card {
    background-color: var(--bg-color-card);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: left;
    height: 100%; /* Ensure cards have equal height */
    display: flex;
    flex-direction: column;
}

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

.page-blog__card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.page-blog__card-image {
    width: 100%;
    height: 225px; /* Fixed height for consistent card image display */
    object-fit: cover;
    display: block;
}

.page-blog__card-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.page-blog__card-title {
    font-size: 1.4em;
    margin-bottom: 10px;
    color: var(--text-color-main);
    min-height: 2.8em; /* Ensure consistent title height */
}

.page-blog__card-excerpt {
    font-size: 0.95em;
    color: var(--text-color-secondary);
    margin-bottom: 15px;
    flex-grow: 1;
}

.page-blog__card-date {
    font-size: 0.85em;
    color: var(--text-color-secondary);
    opacity: 0.8;
}

.page-blog__view-all {
    margin-top: 40px;
}

/* Why Follow Section */
.page-blog__why-follow {
    background-color: var(--bg-color-main);
    color: var(--text-color-main);
}

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

.page-blog__feature-item {
    background-color: var(--bg-color-card);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.page-blog__feature-item:hover {
    transform: translateY(-5px);
}

.page-blog__feature-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    object-fit: contain;
    filter: none; /* Ensure no color filters */
}

.page-blog__feature-title {
    font-size: 1.5em;
    color: var(--text-color-main);
    margin-bottom: 10px;
}

.page-blog__feature-description {
    font-size: 1em;
    color: var(--text-color-secondary);
}

/* Categories Section */
.page-blog__categories {
    background-color: var(--bg-color-main);
    color: var(--text-color-main);
}

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

.page-blog__category-card {
    background-color: var(--bg-color-card);
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

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

.page-blog__category-image {
    width: 100%;
    height: 150px; /* Fixed height for consistent category image display */
    object-fit: cover;
    display: block;
}

.page-blog__category-title {
    font-size: 1.3em;
    color: var(--text-color-main);
    margin: 15px 15px 5px 15px;
}

.page-blog__category-description {
    font-size: 0.9em;
    color: var(--text-color-secondary);
    padding: 0 15px 15px 15px;
    flex-grow: 1;
}

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

.page-blog__faq-list {
    margin-top: 40px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

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

.page-blog__faq-item[open] {
    background-color: var(--deep-green-color);
}

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

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

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

.page-blog__faq-item[open] .page-blog__faq-toggle {
    transform: rotate(45deg); /* Rotate for 'x' or '-' effect */
}

.page-blog__faq-answer {
    padding: 0 20px 20px 20px;
    font-size: 1em;
    color: var(--text-color-secondary);
    text-align: left;
}

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

.page-blog__faq-answer a {
    color: var(--gold-color);
    text-decoration: underline;
}

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

.page-blog__cta-section .page-blog__section-title {
    color: var(--gold-color);
}

.page-blog__cta-section .page-blog__description {
    color: var(--text-color-main);
}

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

/* Buttons */
.page-blog__cta-button {
    display: inline-block;
    padding: 15px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1em;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    white-space: normal; /* Allow text wrapping */
    word-wrap: break-word; /* Break long words */
    box-sizing: border-box;
    max-width: 100%;
}

.page-blog__btn-primary {
    background: var(--button-gradient);
    color: #ffffff; /* White text for primary button */
    border: 2px solid transparent;
}

.page-blog__btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(42, 209, 111, 0.4);
}

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

.page-blog__btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(242, 193, 78, 0.4);
}

/* Global image styles */
.page-blog img {
    filter: none; /* Ensure no color filters */
}

/* Dark background for sections where needed */
.page-blog__dark-section {
    background-color: var(--bg-color-main);
    color: var(--text-color-main);
}

/* Light background for sections where needed, ensuring dark text */
.page-blog__light-bg {
    background-color: #f8f9fa; /* A very light background */
    color: var(--dark-text-on-light); /* Dark text on light background */
}

.page-blog__light-bg .page-blog__section-title,
.page-blog__light-bg .page-blog__feature-title {
    color: var(--primary-color); /* Use primary color for titles on light background */
}

.page-blog__light-bg .page-blog__feature-description {
    color: var(--dark-text-on-light);
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .page-blog__hero-image-wrapper {
        max-height: 500px;
    }
}

@media (max-width: 768px) {
    .page-blog__section {
        padding: 40px 15px;
    }

    .page-blog__section-title {
        font-size: 2em;
    }

    .page-blog__main-title {
        font-size: clamp(2em, 8vw, 2.5em);
    }

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

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

    .page-blog__post-grid,
    .page-blog__why-follow-grid,
    .page-blog__category-grid {
        grid-template-columns: 1fr;
    }

    .page-blog__card-image {
        height: 180px;
    }

    .page-blog__category-image {
        height: 120px;
    }

    .page-blog__cta-buttons {
        flex-direction: column;
        gap: 15px;
    }

    .page-blog__cta-button {
        width: 100% !important;
        padding: 12px 20px;
    }

    .page-blog img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
    }
    
    .page-blog__section,
    .page-blog__card,
    .page-blog__container,
    .page-blog__post-card,
    .page-blog__feature-item,
    .page-blog__category-card,
    .page-blog__faq-item,
    .page-blog__cta-buttons,
    .page-blog__hero-section,
    .page-blog__hero-image-wrapper,
    .page-blog__hero-content {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px;
        padding-right: 15px;
    }

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

    .page-blog__faq-question {
        font-size: 1em;
    }

    .page-blog__faq-answer {
        font-size: 0.9em;
    }
}

@media (max-width: 480px) {
    .page-blog__section-title {
        font-size: 1.8em;
    }

    .page-blog__main-title {
        font-size: clamp(1.8em, 9vw, 2.2em);
    }

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

    .page-blog__feature-title {
        font-size: 1.3em;
    }

    .page-blog__category-title {
        font-size: 1.1em;
    }
}