/* style/blog.css */

/* Variables based on provided color scheme */
:root {
    --page-blog-primary: #F2C14E;
    --page-blog-secondary: #FFD36B;
    --page-blog-card-bg: #111111;
    --page-blog-background: #0A0A0A;
    --page-blog-text-main: #FFF6D6;
    --page-blog-border: #3A2A12;
    --page-blog-glow: #FFD36B;
    --page-blog-button-gradient: linear-gradient(180deg, #FFD86A 0%, #DDA11D 100%);
    --page-blog-light-section-bg: #ffffff; /* Assuming body is dark, light sections will use white */
    --page-blog-light-section-text: #333333; /* Dark text for light sections */
}

/* Base styles for the blog page content - assuming shared.css sets body background to dark */
.page-blog {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: var(--page-blog-text-main); /* Default text color for dark sections */
    background-color: var(--page-blog-background); /* Should be overridden by shared.css body bg */
}

/* HERO Section */
.page-blog__hero-section {
    padding-top: 10px; /* Small top padding, relying on body padding-top for header offset */
    padding-bottom: 60px;
    background-color: var(--page-blog-background); /* Dark background for hero */
    color: var(--page-blog-text-main);
}

.page-blog__hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    display: flex;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

.page-blog__hero-image {
    flex: 1 1 500px; /* Flexible base width */
    text-align: center;
    order: 2; /* Image on right for desktop */
}

.page-blog__hero-side-image {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.page-blog__hero-content {
    flex: 1 1 400px; /* Flexible base width */
    order: 1; /* Content on left for desktop */
}

.page-blog__main-title {
    font-size: clamp(2.2rem, 4vw, 3.5rem); /* Responsive font size */
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
    color: var(--page-blog-primary); /* Use primary color for title */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.page-blog__intro-text {
    font-size: 1.1rem;
    margin-bottom: 30px;
    color: var(--page-blog-text-main);
}

.page-blog__cta-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap; /* Allow buttons to wrap */
}

.page-blog__btn-primary,
.page-blog__btn-secondary {
    display: inline-block;
    padding: 14px 28px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s ease;
    text-align: center;
    box-sizing: border-box; /* Crucial for mobile responsiveness */
    white-space: normal;
    word-wrap: break-word;
    max-width: 100%; /* Ensure buttons don't overflow */
}

.page-blog__btn-primary {
    background: var(--page-blog-button-gradient);
    color: #ffffff; /* White text for gradient button */
    border: none;
    box-shadow: 0 4px 10px rgba(var(--page-blog-primary), 0.4);
}

.page-blog__btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.6);
    opacity: 0.9;
}

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

.page-blog__btn-secondary:hover {
    background: var(--page-blog-primary);
    color: #ffffff;
    transform: translateY(-2px);
}

/* Latest Posts Section */
.page-blog__latest-posts-section {
    padding: 60px 0;
    background-color: var(--page-blog-light-section-bg); /* Light background */
    color: var(--page-blog-light-section-text); /* Dark text */
}

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

.page-blog__section-title {
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    font-weight: 700;
    text-align: center;
    margin-bottom: 40px;
    color: var(--page-blog-light-section-text);
}

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

.page-blog__post-card {
    background-color: var(--page-blog-light-section-bg);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    border: 1px solid #e0e0e0; /* Added for contrast */
}

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

.page-blog__post-image-wrapper {
    width: 100%;
    height: 250px; /* Fixed height for consistency */
    overflow: hidden;
}

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

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

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

.page-blog__post-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.3;
}

.page-blog__post-title a {
    color: var(--page-blog-light-section-text);
    text-decoration: none;
    transition: color 0.3s ease;
}

.page-blog__post-title a:hover {
    color: var(--page-blog-primary);
}

.page-blog__post-meta {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 15px;
}

.page-blog__post-excerpt {
    font-size: 1rem;
    color: #555;
    margin-bottom: 20px;
}

.page-blog__read-more-btn {
    display: inline-block;
    color: var(--page-blog-primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.page-blog__read-more-btn:hover {
    text-decoration: underline;
    color: var(--page-blog-secondary);
}

.page-blog__view-all-wrapper {
    text-align: center;
}

/* CTA Section */
.page-blog__cta-section {
    padding: 80px 0;
    background-color: var(--page-blog-primary); /* Primary color background for CTA */
    color: #ffffff; /* White text for primary background */
    text-align: center;
}

.page-blog__cta-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.page-blog__cta-title {
    font-size: clamp(2rem, 3.5vw, 3rem);
    font-weight: 700;
    margin-bottom: 20px;
    color: #ffffff;
}

.page-blog__cta-description {
    font-size: 1.15rem;
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* FAQ Section */
.page-blog__faq-section {
    padding: 60px 0;
    background-color: var(--page-blog-light-section-bg); /* Light background */
    color: var(--page-blog-light-section-text); /* Dark text */
}

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

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

.page-blog__faq-item[open] {
    background-color: #f9f9f9;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.page-blog__faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    font-size: 1.15rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--page-blog-light-section-text);
    list-style: none; /* Hide default marker */
}

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

.page-blog__faq-qtext {
    flex-grow: 1;
    margin-right: 15px;
}

.page-blog__faq-toggle {
    font-size: 1.8rem;
    line-height: 1;
    color: var(--page-blog-primary);
    transition: transform 0.3s ease;
}

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

.page-blog__faq-answer {
    padding: 0 25px 20px 25px;
    font-size: 1rem;
    color: #555;
}

/* General image responsiveness for all images within .page-blog */
.page-blog img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* General container responsiveness */
.page-blog__container,
.page-blog__hero-container,
.page-blog__cta-content {
    box-sizing: border-box;
    width: 100%; /* Ensure full width on mobile */
}

/* Ensure no CSS filter on images */
.page-blog img {
    filter: none;
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    .page-blog {
        font-size: 15px;
        line-height: 1.5;
    }

    /* HERO Section */
    .page-blog__hero-section {
        padding-top: 10px !important; /* Ensure small top padding */
        padding-bottom: 40px;
    }
    
    .page-blog__hero-container {
        flex-direction: column; /* Stack image and content vertically */
        padding: 30px 15px;
        gap: 30px;
    }

    .page-blog__hero-image {
        order: 1; /* Image on top for mobile */
    }

    .page-blog__hero-content {
        order: 2; /* Content below image for mobile */
        text-align: center; /* Center content */
    }

    .page-blog__main-title {
        font-size: clamp(1.8rem, 8vw, 2.5rem);
        margin-bottom: 15px;
    }

    .page-blog__intro-text {
        font-size: 1rem;
        margin-bottom: 25px;
    }

    .page-blog__cta-buttons {
        flex-direction: column; /* Stack buttons vertically */
        gap: 10px;
        width: 100%;
        padding: 0 15px;
    }

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

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

    .page-blog__section-title {
        font-size: clamp(1.6rem, 7vw, 2.2rem);
        margin-bottom: 30px;
    }

    .page-blog__posts-grid {
        grid-template-columns: 1fr; /* Single column for posts */
        gap: 20px;
        padding: 0 15px; /* Add horizontal padding */
    }

    .page-blog__post-image-wrapper {
        height: 200px; /* Adjust height for mobile */
    }

    .page-blog__post-title {
        font-size: 1.2rem;
    }

    .page-blog__post-excerpt {
        font-size: 0.95rem;
    }

    .page-blog__view-all-wrapper {
        padding: 0 15px;
    }

    /* CTA Section */
    .page-blog__cta-section {
        padding: 50px 15px;
    }

    .page-blog__cta-title {
        font-size: clamp(1.8rem, 8vw, 2.5rem);
        margin-bottom: 15px;
    }

    .page-blog__cta-description {
        font-size: 1rem;
        margin-bottom: 30px;
        padding: 0 15px;
    }

    /* FAQ Section */
    .page-blog__faq-section {
        padding: 40px 0;
    }

    .page-blog__faq-list {
        padding: 0 15px;
    }

    .page-blog__faq-question {
        font-size: 1rem;
        padding: 15px 20px;
    }

    .page-blog__faq-toggle {
        font-size: 1.5rem;
    }

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

    /* General image and container responsiveness for all images within .page-blog */
    .page-blog img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
    }
    
    .page-blog__container,
    .page-blog__hero-container,
    .page-blog__cta-content,
    .page-blog__post-card {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    .page-blog__latest-posts-section .page-blog__container,
    .page-blog__faq-section .page-blog__container {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
}