/* style/blog.css */

/* General Styles for the Blog Page */
.page-blog {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-main, #333333); /* Default text color from custom colors */
    background-color: var(--background-color, #F5F7FA); /* Background color from custom colors */
}

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

.page-blog__section-title {
    font-size: 2.5em;
    font-weight: bold;
    color: var(--text-main, #333333);
    text-align: center;
    margin-bottom: 40px;
    padding-top: 20px;
}

.page-blog__section-title--light {
    color: #ffffff;
}

/* Hero Section */
.page-blog__hero-section {
    padding-top: 10px; /* Small top padding, relying on body padding-top for header offset */
    padding-bottom: 60px;
    background: linear-gradient(180deg, #F5F7FA 0%, #FFFFFF 100%); /* Light gradient background */
}

.page-blog__hero-container {
    max-width: 1170px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 40px 16px;
    gap: 40px;
}

.page-blog__hero-content {
    flex: 1 1 50%;
    min-width: 300px;
    color: var(--text-main, #333333);
}

.page-blog__main-title {
    font-size: 2.8em;
    font-weight: bold;
    line-height: 1.2;
    margin-bottom: 20px;
    color: var(--text-main, #333333);
}

.page-blog__description {
    font-size: 1.1em;
    margin-bottom: 30px;
}

.page-blog__cta-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap; /* Ensure buttons wrap on smaller screens */
}

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

.page-blog__btn-primary {
    background: linear-gradient(180deg, #FF5A4F 0%, #E53935 100%); /* Custom button color */
    color: #ffffff;
    border: 2px solid transparent;
}

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

.page-blog__btn-secondary {
    background: #ffffff;
    color: #E53935; /* Using brand primary color for text */
    border: 2px solid #E53935; /* Custom border color */
}

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

.page-blog__hero-image {
    flex: 1 1 40%;
    text-align: center;
    min-width: 300px;
}

.page-blog__hero-side-image {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: block; /* Ensure it behaves as a block element */
    margin: 0 auto; /* Center image */
}

/* Latest Posts Section */
.page-blog__latest-posts-section {
    background-color: var(--card-bg, #FFFFFF); /* Custom background color */
    padding-top: 60px;
    padding-bottom: 60px;
}

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

.page-blog__post-card {
    background: var(--card-bg, #FFFFFF); /* Custom card background */
    border: 1px solid var(--border-color, #E0E0E0); /* Custom border color */
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

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

.page-blog__post-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.page-blog__post-thumbnail {
    width: 100%;
    height: 200px; /* Fixed height for consistency, object-fit will manage aspect */
    object-fit: cover;
    display: block;
}

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

.page-blog__post-title {
    font-size: 1.4em;
    font-weight: bold;
    margin-bottom: 10px;
    color: var(--text-main, #333333);
}

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

.page-blog__post-summary {
    font-size: 1em;
    color: #555555;
    margin-bottom: 20px;
}

.page-blog__read-more-btn {
    color: #E53935;
    border: 1px solid #E53935;
    padding: 8px 15px;
    border-radius: 5px;
    font-size: 0.9em;
}

.page-blog__read-more-btn:hover {
    background: #E53935;
    color: #ffffff;
}

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

/* FAQ Section */
.page-blog__faq-section {
    background: #E53935; /* Brand primary color for dark section */
    padding-top: 60px;
    padding-bottom: 60px;
    color: #ffffff;
}

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

.page-blog__faq-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
    color: #ffffff;
}

.page-blog__faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 25px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    list-style: none; /* For details/summary */
}

/* Hide default details marker */
.page-blog__faq-item summary::-webkit-details-marker {
    display: none;
}
.page-blog__faq-item summary::marker {
    display: none;
}

.page-blog__faq-question:hover {
    background: rgba(255, 255, 255, 0.1);
}

.page-blog__faq-qtext {
    flex-grow: 1;
    color: #ffffff;
}

.page-blog__faq-toggle {
    font-size: 1.5em;
    line-height: 1;
    margin-left: 15px;
    transition: transform 0.3s ease;
    color: #ffffff;
}

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

.page-blog__faq-answer {
    padding: 15px 25px 25px;
    font-size: 1em;
    color: #f0f0f0;
}

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

/* General Image & Container Responsive Styles */
.page-blog img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .page-blog__main-title {
        font-size: 2.5em;
    }
    .page-blog__section-title {
        font-size: 2em;
    }
    .page-blog__hero-container {
        flex-direction: column;
        text-align: center;
        gap: 30px;
    }
    .page-blog__hero-content {
        order: 2; /* Content below image on smaller screens */
    }
    .page-blog__hero-image {
        order: 1; /* Image above content on smaller screens */
    }
    .page-blog__cta-buttons {
        justify-content: center;
    }
    .page-blog__post-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    /* HERO Section */
    .page-blog__hero-section {
        padding-top: 10px !important; /* Small top padding, relying on body padding-top */
        padding-bottom: 40px;
    }
    .page-blog__hero-container {
        padding: 20px 15px;
        gap: 20px;
    }
    .page-blog__main-title {
        font-size: 2em;
        margin-bottom: 15px;
    }
    .page-blog__description {
        font-size: 0.95em;
        margin-bottom: 25px;
    }
    .page-blog__cta-buttons {
        flex-direction: column; /* Stack buttons vertically */
        gap: 10px;
        padding: 0 15px; /* Add padding to button container */
        width: 100%; /* Ensure container takes full width */
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }
    .page-blog__btn-primary,
    .page-blog__btn-secondary {
        max-width: 100% !important;
        width: 100% !important;
        padding: 12px 15px;
        white-space: normal !important;
        word-wrap: break-word !important;
        box-sizing: border-box !important;
    }

    /* Section Titles */
    .page-blog__section-title {
        font-size: 1.8em;
        margin-bottom: 30px;
        padding-top: 15px;
    }

    /* Blog Post Grid */
    .page-blog__post-grid {
        grid-template-columns: 1fr; /* Single column layout */
        gap: 20px;
        padding: 0 15px; /* Add padding to grid container */
    }
    .page-blog__post-card {
        max-width: 100%;
        box-sizing: border-box;
    }
    .page-blog__post-thumbnail {
        height: 180px; /* Slightly smaller height for mobile */
    }
    .page-blog__post-content {
        padding: 15px;
    }
    .page-blog__post-title {
        font-size: 1.2em;
    }
    .page-blog__read-more-btn {
        padding: 6px 12px;
        font-size: 0.85em;
    }

    /* View All Posts Button */
    .page-blog__view-all-posts {
        margin-top: 30px;
        padding: 0 15px;
    }
    .page-blog__view-all-posts .page-blog__btn-primary {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        white-space: normal !important;
        word-wrap: break-word !important;
    }

    /* FAQ Section */
    .page-blog__faq-section {
        padding-top: 40px;
        padding-bottom: 40px;
    }
    .page-blog__faq-list {
        padding: 0 15px; /* Add padding to FAQ list container */
    }
    .page-blog__faq-question {
        font-size: 1em;
        padding: 15px 20px;
    }
    .page-blog__faq-toggle {
        font-size: 1.2em;
    }
    .page-blog__faq-answer {
        padding: 10px 20px 20px;
    }

    /* General Image & Container Responsive */
    .page-blog img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
    }
    .page-blog__container,
    .page-blog__latest-posts-section,
    .page-blog__faq-section {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px;
        padding-right: 15px;
    }
    /* Specific override for hero container padding if needed, but general container should handle it */
    .page-blog__hero-container {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}