/* style/blog.css */

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

/* Base styles for the blog page */
.page-blog {
    background-color: var(--color-background);
    color: var(--color-text-main); /* Default text color for the page */
    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;
}

/* Section titles and descriptions */
.page-blog__section-title {
    font-size: clamp(24px, 4vw, 38px); 
    color: var(--color-gold);
    text-align: center;
    margin-bottom: 15px;
    font-weight: bold;
    line-height: 1.2;
}

.page-blog__section-description {
    font-size: clamp(16px, 2vw, 18px);
    color: var(--color-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;
    width: 100%;
    min-height: 500px;
    display: flex;
    flex-direction: column; /* Stacks content and image vertically */
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding-top: 10px; /* Small top padding, body handles --header-offset */
    padding-bottom: 60px;
    background-color: var(--color-deep-green); /* Fallback if image fails */
}

.page-blog__hero-image {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
    margin-top: 20px; /* Space between content and image */
    max-width: 100%;
    min-height: 200px; /* Min size */
}

.page-blog__hero-content-wrapper {
    text-align: center;
    position: relative; 
    z-index: 2; 
    max-width: 900px;
    padding: 20px;
}

.page-blog__main-title {
    font-size: clamp(32px, 5vw, 48px); /* Using clamp for H1 */
    color: var(--color-gold);
    margin-bottom: 15px;
    font-weight: bold;
    line-height: 1.2;
    text-shadow: 0 0 10px rgba(242, 193, 78, 0.5); /* Subtle glow for gold text */
}

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

/* CTA Buttons */
.page-blog__cta-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

.page-blog__btn-primary,
.page-blog__btn-secondary,
.page-blog__read-more-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 25px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 16px;
    box-sizing: border-box;
    white-space: normal;
    word-wrap: break-word;
    max-width: 100%;
    min-width: 150px; /* Ensure buttons are not too small */
}

.page-blog__btn-primary {
    background: var(--color-button-gradient);
    color: #ffffff;
    border: 2px solid var(--color-glow);
}

.page-blog__btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(87, 227, 141, 0.4);
}

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

.page-blog__btn-secondary:hover {
    background-color: var(--color-glow);
    color: var(--color-background);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(87, 227, 141, 0.4);
}

/* Latest Posts Section */
.page-blog__latest-posts-section,
.page-blog__featured-guides-section,
.page-blog__faq-section,
.page-blog__cta-section {
    padding: 60px 0;
    background-color: var(--color-background);
}

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

.page-blog__post-card,
.page-blog__guide-card {
    background-color: var(--color-card-bg);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    min-height: 450px; /* Ensure cards have a minimum height */
}

.page-blog__post-card:hover,
.page-blog__guide-card:hover {
    transform: translateY(-5px);
}

.page-blog__post-image-wrapper,
.page-blog__guide-image-wrapper {
    width: 100%;
    height: 225px; /* Fixed height for image area */
    overflow: hidden;
}

.page-blog__post-card-image,
.page-blog__guide-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    min-width: 200px;
    min-height: 200px;
}

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

.page-blog__post-card-title,
.page-blog__guide-card-title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 10px;
    line-height: 1.3;
}

.page-blog__post-card-title a,
.page-blog__guide-card-title a {
    color: var(--color-text-main);
    text-decoration: none;
    transition: color 0.3s ease;
}

.page-blog__post-card-title a:hover,
.page-blog__guide-card-title a:hover {
    color: var(--color-gold);
}

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

.page-blog__post-excerpt,
.page-blog__guide-excerpt {
    font-size: 15px;
    color: var(--color-text-secondary);
    margin-bottom: 20px;
    flex-grow: 1; /* Allows excerpt to take available space */
}

.page-blog__read-more-btn {
    align-self: flex-start;
    background-color: var(--color-deep-green);
    color: var(--color-glow);
    border: 1px solid var(--color-border);
    padding: 8px 15px;
    font-size: 14px;
    border-radius: 5px;
}

.page-blog__read-more-btn:hover {
    background-color: var(--color-glow);
    color: var(--color-deep-green);
    border-color: var(--color-glow);
}

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

/* FAQ Section */
.page-blog__faq-section {
    background-color: var(--color-deep-green);
    padding: 60px 0;
}

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

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

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

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

.page-blog__faq-item[open] .page-blog__faq-question {
    background-color: var(--color-deep-green); /* Keep consistent or slightly darker */
}

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

.page-blog__faq-answer {
    padding: 0 20px 20px;
    font-size: 16px;
    color: var(--color-text-secondary);
    line-height: 1.6;
    max-height: 0; /* Hidden by default for JS fallback */
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
}

.page-blog__faq-item[open] .page-blog__faq-answer {
    max-height: 500px; /* Adjust as needed for content */
    padding-top: 15px;
}

/* CTA Section at bottom */
.page-blog__cta-section {
    background-color: var(--color-background);
    padding: 80px 0;
    text-align: center;
}

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

.page-blog__section-description--cta {
    color: var(--color-text-main);
    margin-bottom: 40px;
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .page-blog__post-grid,
    .page-blog__guide-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

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

    .page-blog__container {
        padding-left: 15px !important;
        padding-right: 15px !important;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .page-blog__hero-section {
        padding-top: 10px !important;
        padding-bottom: 40px;
    }

    .page-blog__main-title {
        font-size: clamp(28px, 7vw, 40px);
    }

    .page-blog__hero-description {
        font-size: clamp(16px, 3vw, 20px);
    }

    .page-blog__cta-buttons {
        flex-direction: column !important; /* Stack buttons vertically */
        gap: 15px;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        padding: 0 15px;
    }

    .page-blog__btn-primary,
    .page-blog__btn-secondary,
    .page-blog a[class*="button"],
    .page-blog a[class*="btn"] {
        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__post-card,
    .page-blog__guide-card {
        min-height: auto; /* Allow height to adjust */
    }

    .page-blog__post-card-image,
    .page-blog__guide-card-image,
    .page-blog__hero-image,
    .page-blog img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        display: block !important;
        min-width: 200px;
        min-height: 200px;
    }

    /* Video specific rules (even if not on this page, must include for robustness) */
    .page-blog video,
    .page-blog__video {
      max-width: 100% !important;
      width: 100% !important;
      height: auto !important;
      display: block !important;
    }
    
    .page-blog__video-section,
    .page-blog__video-container,
    .page-blog__video-wrapper {
      max-width: 100% !important;
      width: 100% !important;
      box-sizing: border-box !important;
      padding-left: 15px;
      padding-right: 15px;
      overflow: hidden !important;
    }
    .page-blog__video-section {
        padding-top: 10px !important;
    }

    .page-blog__post-grid,
    .page-blog__guide-grid {
        grid-template-columns: 1fr;
    }

    .page-blog__section-title {
        font-size: clamp(20px, 6vw, 32px);
    }

    .page-blog__section-description {
        font-size: clamp(15px, 3vw, 17px);
    }

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

    .page-blog__faq-answer {
        font-size: 15px;
        padding: 0 15px 15px;
    }
    .page-blog__card,
    .page-blog__section,
    .page-blog__box {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px;
        padding-right: 15px;
    }
}