/* style/blog.css */

/* General styles for the blog page */
.page-blog {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333333; /* Text Main */
    background: #F5F7FA; /* Background */
}

/* Hero Section */
.page-blog__hero-section {
    padding-top: 10px; /* Small top padding to respect shared header offset */
    padding-bottom: 40px;
    background: #F5F7FA; /* Match body background */
}

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

.page-blog__hero-content {
    flex: 1 1 45%;
    min-width: 300px;
    color: #333333; /* Ensure contrast on light background */
}

.page-blog__main-title {
    font-size: clamp(2em, 3.5vw, 2.8em); /* Responsive H1 font size */
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
    color: #E53935; /* Main color for title */
}

.page-blog__hero-description {
    font-size: 1.1em;
    margin-bottom: 30px;
    color: #333333;
}

.page-blog__cta-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap; /* Allow buttons to wrap on smaller screens */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.page-blog__btn-primary,
.page-blog__btn-secondary {
    display: inline-block;
    padding: 12px 25px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    text-align: center;
    transition: background-color 0.3s ease, color 0.3s ease;
    box-sizing: border-box;
    white-space: normal;
    word-wrap: break-word;
    max-width: 100%; /* Ensure buttons don't overflow */
}

.page-blog__btn-primary {
    background: linear-gradient(180deg, #FF5A4F 0%, #E53935 100%); /* Button color */
    color: #ffffff;
    border: none;
}

.page-blog__btn-primary:hover {
    opacity: 0.9;
}

.page-blog__btn-secondary {
    background: #ffffff; /* Card BG */
    color: #E53935; /* Main color */
    border: 2px solid #E53935; /* Main color */
}

.page-blog__btn-secondary:hover {
    background: #E53935; /* Main color */
    color: #ffffff;
}

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

.page-blog__hero-side-image {
    max-width: 600px;
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
    margin: 0 auto;
}

/* Latest Posts Section */
.page-blog__latest-posts-section {
    padding: 60px 0;
    background: #F5F7FA; /* Background */
}

.page-blog__content-area {
    max-width: 1170px;
    margin: 0 auto;
    padding: 0 16px;
}

.page-blog__section-title {
    font-size: 2.2em;
    font-weight: 700;
    color: #E53935; /* Main color */
    text-align: center;
    margin-bottom: 20px;
}

.page-blog__section-description {
    font-size: 1.1em;
    color: #333333; /* Text Main */
    text-align: center;
    margin-bottom: 40px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

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

.page-blog__blog-card {
    background: #ffffff; /* Card BG */
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

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

.page-blog__blog-card-media {
    width: 100%;
    height: 200px; /* Fixed height for image area */
    overflow: hidden;
}

.page-blog__blog-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.page-blog__blog-card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.page-blog__blog-card-title {
    font-size: 1.4em;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.3;
    flex-grow: 1;
}

.page-blog__blog-card-title a {
    color: #E53935; /* Main color */
    text-decoration: none;
    transition: color 0.3s ease;
}

.page-blog__blog-card-title a:hover {
    color: #FF5A4F; /* Auxiliary color */
}

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

.page-blog__blog-card-excerpt {
    font-size: 1em;
    color: #333333; /* Text Main */
    margin-bottom: 20px;
}

.page-blog__blog-card-link {
    display: inline-block;
    color: #E53935; /* Main color */
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
    margin-top: auto; /* Push link to bottom */
}

.page-blog__blog-card-link:hover {
    color: #FF5A4F; /* Auxiliary color */
}

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

/* FAQ Section */
.page-blog__faq-section {
    padding: 60px 0;
    background: #F5F7FA; /* Background */
}

.page-blog__faq-list {
    max-width: 800px;
    margin: 0 auto;
    border-top: 1px solid #E0E0E0; /* Border */
}

.page-blog__faq-item {
    border-bottom: 1px solid #E0E0E0; /* Border */
    padding: 15px 0;
}

.page-blog__faq-item summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 600;
    color: #E53935; /* Main color */
    list-style: none; /* Remove default marker */
}

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

.page-blog__faq-question {
    padding-right: 10px;
}

.page-blog__faq-toggle {
    font-size: 1.5em;
    color: #E53935; /* Main color */
    transition: transform 0.3s ease;
}

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

.page-blog__faq-answer {
    padding-top: 15px;
    font-size: 1em;
    color: #333333; /* Text Main */
}

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

.page-blog__faq-answer a {
    color: #E53935; /* Main color */
    text-decoration: underline;
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .page-blog__hero-container {
        flex-direction: column;
        text-align: center;
    }

    .page-blog__hero-content {
        order: 2; /* Content below image */
        flex: 1 1 100%;
        padding-bottom: 20px;
    }

    .page-blog__hero-image {
        order: 1; /* Image above content */
        flex: 1 1 100%;
        margin-bottom: 30px;
    }

    .page-blog__main-title,
    .page-blog__hero-description {
        text-align: center;
    }

    .page-blog__cta-buttons {
        justify-content: center;
    }
}

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

    .page-blog__hero-section {
        padding-top: 10px !important; /* Fixed top padding */
        padding-bottom: 30px;
    }

    .page-blog__hero-container {
        padding: 20px 15px;
        gap: 15px;
    }

    .page-blog__main-title {
        font-size: 2em; /* Adjust H1 for mobile */
        margin-bottom: 15px;
    }

    .page-blog__hero-description {
        font-size: 1em;
        margin-bottom: 20px;
    }

    /* Buttons */
    .page-blog__cta-buttons {
        flex-direction: column; /* Stack buttons vertically */
        gap: 10px;
        padding-left: 15px;
        padding-right: 15px;
    }

    .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: 12px 15px; /* Adjust padding for mobile */
    }

    /* Images */
    .page-blog img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        display: block;
    }
    
    .page-blog__hero-side-image {
        max-width: 100%;
    }

    /* Section containers */
    .page-blog__latest-posts-section,
    .page-blog__faq-section {
        padding: 40px 0;
    }

    .page-blog__content-area {
        padding: 0 15px; /* Add horizontal padding to content area */
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .page-blog__section-title {
        font-size: 1.8em;
        margin-bottom: 15px;
    }

    .page-blog__section-description {
        font-size: 1em;
        margin-bottom: 30px;
    }

    /* Blog Grid */
    .page-blog__posts-grid {
        grid-template-columns: 1fr; /* Single column for blog posts */
        gap: 20px;
    }

    .page-blog__blog-card {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .page-blog__blog-card-media {
        height: 180px; /* Adjust image height for mobile cards */
    }

    .page-blog__blog-card-content {
        padding: 15px;
    }

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

    .page-blog__faq-list {
        padding: 0 15px;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .page-blog__faq-item {
        padding: 10px 0;
    }

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

    .page-blog__faq-answer {
        font-size: 0.95em;
        padding-top: 10px;
    }
}