/* style/blog.css */

/* Base styles for the blog page, respecting shared body padding-top */
.page-blog {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333333; /* Default text color for light background */
    background-color: #ffffff; /* Explicitly set for content area if body is var(--bg-color) */
}

/* Ensure images maintain aspect ratio and don't overflow */
.page-blog img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 8px; /* Soften edges */
}

/* Hero Section */
.page-blog__hero-section {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column; /* Image on top, content below */
    align-items: center;
    padding: 20px 20px 40px; /* Small top padding, more bottom padding */
    background-color: #f0f8ff; /* Light blue background for hero */
}

.page-blog__hero-image-wrapper {
    width: 100%;
    max-width: 1200px;
    margin-bottom: 30px; /* Space between image and text */
}

.page-blog__hero-image {
    width: 100%; /* Ensure image fills its wrapper */
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.page-blog__hero-content {
    max-width: 900px;
    text-align: center;
    padding: 0 15px;
}

.page-blog__main-title {
    font-size: clamp(2em, 4vw, 3.2em); /* Responsive H1 font size */
    color: #26A9E0; /* Brand color */
    margin-bottom: 20px;
    font-weight: bold;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

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

/* Buttons */
.page-blog__btn-primary,
.page-blog__btn-secondary,
.page-blog a[class*="button"],
.page-blog a[class*="btn"] {
    display: inline-block;
    padding: 12px 25px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: center;
    max-width: 100%; /* Ensure button adapts to container */
    box-sizing: border-box; /* Include padding and border in the element's total width and height */
    white-space: normal; /* Allow text to wrap */
    word-wrap: break-word; /* Break long words */
}

.page-blog__btn-primary {
    background-color: #26A9E0; /* Main brand color */
    color: #ffffff;
    border: 2px solid #26A9E0;
    margin: 10px;
}

.page-blog__btn-primary:hover {
    background-color: #1a8cc7;
    border-color: #1a8cc7;
}

.page-blog__btn-secondary {
    background-color: #ffffff;
    color: #26A9E0; /* Main brand color */
    border: 2px solid #26A9E0;
    margin: 10px;
}

.page-blog__btn-secondary:hover {
    background-color: #e0f2f7;
    color: #1a8cc7;
}

/* Container for content sections */
.page-blog__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Section titles */
.page-blog__section-title {
    font-size: 2.2em;
    color: #26A9E0;
    text-align: center;
    margin-top: 50px;
    margin-bottom: 40px;
    font-weight: bold;
}

.page-blog__sub-title {
    font-size: 1.6em;
    color: #333333;
    margin-top: 30px;
    margin-bottom: 20px;
    font-weight: bold;
}

/* Blog Posts Grid */
.page-blog__latest-posts {
    padding: 60px 0;
    background-color: #f9f9f9;
}

.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: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

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

.page-blog__post-image {
    width: 100%;
    height: 225px; /* Fixed height for consistency */
    object-fit: cover;
    border-bottom: 1px solid #eee;
}

.page-blog__post-content {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.page-blog__post-title {
    font-size: 1.4em;
    margin-bottom: 10px;
    line-height: 1.4;
}

.page-blog__post-title a {
    color: #26A9E0;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.page-blog__post-title a:hover {
    color: #1a8cc7;
}

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

.page-blog__post-excerpt {
    font-size: 1em;
    color: #555555;
    margin-bottom: 20px;
    flex-grow: 1; /* Allow excerpt to take available space */
}

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

/* Content area for detailed articles */
.page-blog__content-area {
    padding: 60px 0;
    background-color: #ffffff;
}

.page-blog__content-area p {
    margin-bottom: 1.2em;
    color: #444444;
}

.page-blog__content-area ol,
.page-blog__content-area ul {
    margin-bottom: 1.5em;
    padding-left: 25px;
}

.page-blog__content-area li {
    margin-bottom: 0.5em;
    color: #444444;
}

.page-blog__numbered-list {
    list-style-type: decimal;
}

.page-blog__bullet-list {
    list-style-type: disc;
}

.page-blog__content-image {
    margin: 30px auto;
    max-width: 800px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

/* FAQ Section */
.page-blog__faq-list {
    margin-top: 40px;
    border-top: 1px solid #eee;
}

.page-blog__faq-item {
    background-color: #ffffff;
    border-bottom: 1px solid #eee;
    margin-bottom: 10px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.page-blog__faq-item summary {
    list-style: none; /* Hide default marker */
    cursor: pointer;
    padding: 20px 25px;
    font-weight: bold;
    font-size: 1.1em;
    color: #26A9E0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #eaf6ff;
    border-radius: 8px;
    margin-bottom: 0; /* Remove space between summary and content */
}

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

.page-blog__faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

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

.page-blog__faq-toggle {
    font-size: 1.5em;
    line-height: 1;
    width: 25px;
    height: 25px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid #26A9E0;
    border-radius: 50%;
    color: #26A9E0;
    background-color: #ffffff;
    flex-shrink: 0;
}

.page-blog__faq-answer {
    padding: 20px 25px 25px;
    background-color: #fcfcfc;
    color: #555555;
    font-size: 1em;
    line-height: 1.6;
    border-top: 1px dashed #eee;
}

.page-blog__faq-answer p:last-child {
    margin-bottom: 0; /* Remove bottom margin for last paragraph in answer */
}

/* Final CTA Section */
.page-blog__final-cta {
    text-align: center;
    margin-top: 60px;
    padding-bottom: 30px;
}

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


/* Responsive styles */
@media (max-width: 1024px) {
    .page-blog__main-title {
        font-size: clamp(2em, 5vw, 2.8em);
    }
    .page-blog__section-title {
        font-size: 2em;
    }
    .page-blog__sub-title {
        font-size: 1.4em;
    }
    .page-blog__hero-content {
        padding: 0 10px;
    }
}

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

    /* Images responsiveness */
    .page-blog img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        display: block !important;
    }
    
    /* Containers for images, videos, buttons */
    .page-blog__section,
    .page-blog__card,
    .page-blog__container,
    .page-blog__hero-section,
    .page-blog__latest-posts,
    .page-blog__content-area,
    .page-blog__faq-list,
    .page-blog__final-cta,
    .page-blog__video-section,
    .page-blog__video-container,
    .page-blog__video-wrapper,
    .page-blog__cta-buttons,
    .page-blog__button-group,
    .page-blog__btn-container {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
        overflow: hidden !important; /* Prevent horizontal scroll */
    }

    .page-blog__hero-section {
        padding-top: 10px !important; /* Small top padding, body handles header offset */
        padding-bottom: 30px !important;
    }

    .page-blog__hero-image-wrapper {
        margin-bottom: 20px;
    }

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

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

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

    .page-blog__sub-title {
        font-size: 1.2em;
        margin-top: 25px;
        margin-bottom: 15px;
    }

    .page-blog__posts-grid {
        grid-template-columns: 1fr; /* Single column on mobile */
        gap: 20px;
    }

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

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

    .page-blog__faq-item summary {
        padding: 15px 20px;
        font-size: 1em;
    }

    .page-blog__faq-answer {
        padding: 15px 20px 20px;
    }

    /* Button responsiveness */
    .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 !important; /* Add padding to prevent text touching edges */
        padding-right: 15px !important;
        margin: 5px 0 !important; /* Stack vertically */
    }

    .page-blog__cta-buttons {
        flex-direction: column !important; /* Stack buttons vertically */
        gap: 10px !important; /* Space between stacked buttons */
        margin-top: 20px !important;
    }
}