/* style/blog.css */

/* Variables from shared.css or global context, assuming a light background for body */
:root {
    --primary-color: #2F6BFF;
    --secondary-color: #6FA3FF;
    --card-bg-color: #FFFFFF;
    --page-bg-color: #F4F7FB; /* Body background color */
    --text-main-color: #1F2D3D;
    --text-black-color: #000000;
    --border-color: #D6E2FF;
    --button-gradient: linear-gradient(180deg, #4A8BFF 0%, #2F6BFF 100%);
    --glow-color: #A5C4FF;
}

.page-blog {
    font-family: Arial, sans-serif;
    color: var(--text-main-color); /* Body background is light, so text is dark */
    background-color: var(--page-bg-color); /* Explicitly setting for clarity, though body handles it */
}

/* Hero Section */
.page-blog__hero-section {
    padding-top: 10px; /* Small top padding, body handles header offset */
    padding-bottom: 60px;
    background-color: var(--card-bg-color); /* White background for hero */
    color: var(--text-main-color);
}

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

.page-blog__hero-content {
    flex: 1 1 50%;
    min-width: 300px;
    color: var(--text-main-color); /* Dark text on light background */
}

.page-blog__main-title {
    font-size: 2.8em;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
    color: var(--text-black-color); /* Stronger black for H1 */
    max-width: clamp(300px, 80vw, 700px); /* Limit H1 size */
}

.page-blog__description {
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 30px;
    color: var(--text-main-color);
}

.page-blog__cta-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    width: 100%; /* Ensure container takes full width for responsive buttons */
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.page-blog__btn-primary,
.page-blog__btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 1.05em;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    max-width: 100%; /* Button responsiveness */
    box-sizing: border-box;
    white-space: normal; /* Allow text wrapping */
    word-wrap: break-word; /* Allow text wrapping */
}

.page-blog__btn-primary {
    background: var(--button-gradient);
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 15px rgba(47, 107, 255, 0.3);
}

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

.page-blog__btn-secondary {
    background: #ffffff;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.page-blog__btn-secondary:hover {
    background: var(--primary-color);
    color: #ffffff;
    box-shadow: 0 6px 20px rgba(47, 107, 255, 0.4);
}

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

.page-blog__hero-side-image {
    max-width: 600px;
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

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

.page-blog__container {
    max-width: 1170px;
    margin: 0 auto;
    padding: 0 16px;
    box-sizing: border-box; /* Ensure padding is included in width */
}

.page-blog__section-title {
    font-size: 2.2em;
    font-weight: 700;
    text-align: center;
    margin-bottom: 40px;
    color: var(--text-black-color);
}

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

.page-blog__post-card {
    background: var(--card-bg-color);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    color: var(--text-main-color);
}

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

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

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

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

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

.page-blog__post-title {
    font-size: 1.4em;
    font-weight: 600;
    margin: 20px 20px 10px;
    line-height: 1.4;
    color: var(--text-black-color);
}

.page-blog__post-meta {
    font-size: 0.9em;
    color: #666;
    margin: 0 20px 15px;
}

.page-blog__post-excerpt {
    font-size: 1em;
    line-height: 1.6;
    margin: 0 20px 20px;
    flex-grow: 1; /* Pushes button to bottom */
    color: var(--text-main-color);
}

.page-blog__read-more-btn {
    display: inline-block;
    padding: 10px 20px;
    margin: 0 20px 20px;
    background-color: var(--primary-color);
    color: #ffffff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.95em;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.page-blog__read-more-btn:hover {
    background-color: #2558d4;
}

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

/* CTA Section */
.page-blog__cta-section {
    padding: 80px 0;
    background-color: var(--primary-color);
    color: #ffffff;
}

.page-blog__cta-section .page-blog__container {
    text-align: center;
}

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

.page-blog__description--light {
    color: #f0f0f0;
    max-width: 800px;
    margin: 0 auto 40px;
}

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

.page-blog__btn-primary--light {
    background: var(--button-gradient);
    color: #ffffff;
    border: none;
}

.page-blog__btn-secondary--light {
    background: #ffffff;
    color: var(--primary-color);
    border: 2px solid #ffffff;
}
.page-blog__btn-secondary--light:hover {
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary-color);
    border-color: rgba(255, 255, 255, 0.9);
}

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

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

.page-blog__faq-item {
    background-color: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 15px;
    overflow: hidden;
    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: 18px 25px;
    font-size: 1.15em;
    font-weight: 600;
    color: var(--text-black-color);
    cursor: pointer;
    background-color: #fcfdff;
    transition: background-color 0.3s ease;
    list-style: none; /* For details/summary */
}

.page-blog__faq-item[open] .page-blog__faq-question {
    background-color: #eef4ff;
}

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

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

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

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

.page-blog__faq-item[open] .page-blog__faq-toggle {
    content: "−";
}

.page-blog__faq-answer {
    padding: 0 25px 20px;
    font-size: 1em;
    line-height: 1.7;
    color: var(--text-main-color);
}

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

/* Mobile responsive styles */
@media (max-width: 768px) {
    /* HERO Section */
    .page-blog__hero-section {
        padding-top: 10px !important; /* Ensure small top padding */
        padding-bottom: 40px;
    }
    .page-blog__hero-container {
        flex-direction: column;
        padding: 20px 15px;
        gap: 30px;
    }
    .page-blog__main-title {
        font-size: 2em;
        text-align: center;
        margin-bottom: 15px;
    }
    .page-blog__description {
        font-size: 1em;
        text-align: center;
        margin-bottom: 25px;
    }
    .page-blog__cta-buttons {
        flex-direction: column;
        gap: 10px;
        padding: 0 15px;
    }
    .page-blog__btn-primary,
    .page-blog__btn-secondary {
        max-width: 100% !important;
        width: 100% !important;
        padding: 12px 20px;
        font-size: 1em;
        box-sizing: border-box !important;
        white-space: normal !important;
        word-wrap: break-word !important;
    }
    .page-blog__hero-image {
        order: -1; /* Image appears above text on mobile */
        width: 100%;
    }
    .page-blog__hero-side-image {
        max-width: 100%;
        width: 100%;
        border-radius: 8px;
    }

    /* Latest Posts Section */
    .page-blog__latest-posts-section {
        padding: 40px 0;
    }
    .page-blog__container {
        padding: 0 15px;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    .page-blog__section-title {
        font-size: 1.8em;
        margin-bottom: 30px;
    }
    .page-blog__post-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    .page-blog__post-thumbnail {
        height: 180px;
    }
    .page-blog__post-title {
        font-size: 1.2em;
        margin: 15px 15px 8px;
    }
    .page-blog__post-meta,
    .page-blog__post-excerpt {
        margin: 0 15px 10px;
        font-size: 0.95em;
    }
    .page-blog__read-more-btn {
        padding: 8px 15px;
        margin: 0 15px 15px;
        font-size: 0.9em;
    }

    /* CTA Section */
    .page-blog__cta-section {
        padding: 50px 0;
    }
    .page-blog__cta-section .page-blog__container {
        padding: 0 15px;
    }
    .page-blog__description--light {
        font-size: 1em;
        margin-bottom: 30px;
    }
    .page-blog__cta-section .page-blog__cta-buttons {
        flex-direction: column;
        gap: 10px;
    }

    /* FAQ Section */
    .page-blog__faq-section {
        padding: 40px 0 60px;
    }
    .page-blog__faq-question {
        padding: 15px 20px;
        font-size: 1em;
    }
    .page-blog__faq-answer {
        padding: 0 20px 15px;
        font-size: 0.95em;
    }

    /* Universal image responsiveness for mobile */
    .page-blog img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
    }
    .page-blog__section,
    .page-blog__card,
    .page-blog__container {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px;
        padding-right: 15px;
    }
}