/* style/blog.css */

/* Variables for colors */
:root {
    --primary-color: #26A9E0;
    --secondary-color: #FFFFFF;
    --dark-bg-color: #0a0a0a; /* Body background from shared.css */
    --light-text-color: #ffffff;
    --dark-text-color: #333333;
    --login-button-color: #EA7C07;
}

/* Base styles for the page-blog scope */
.page-blog {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: var(--light-text-color); /* Text color for dark body background */
    background-color: transparent; /* Body background is handled by shared.css */
}

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

.page-blog__dark-bg {
    background-color: var(--dark-bg-color);
    color: var(--light-text-color);
}

.page-blog__light-bg {
    background-color: var(--secondary-color);
    color: var(--dark-text-color);
}

.page-blog__section-title {
    font-size: 2.5em;
    font-weight: bold;
    text-align: center;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.page-blog__section-description {
    font-size: 1.1em;
    text-align: center;
    margin-bottom: 40px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Hero Section */
.page-blog__hero-section {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    padding-top: 10px; /* Small top padding, body handles --header-offset */
    overflow: hidden;
    box-sizing: border-box;
}

.page-blog__hero-image-wrapper {
    width: 100%;
    max-width: 100%;
    height: auto;
    overflow: hidden;
    margin-bottom: 30px;
}

.page-blog__hero-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    border-radius: 8px;
}

.page-blog__hero-content {
    text-align: center;
    max-width: 900px;
    padding: 20px;
    box-sizing: border-box;
}

.page-blog__main-title {
    font-size: clamp(2.2em, 4vw, 3.2em); /* Use clamp for H1 font size */
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 15px;
    color: var(--light-text-color);
}

.page-blog__description {
    font-size: 1.2em;
    margin-bottom: 30px;
    color: var(--secondary-color);
}

/* Video Section */
.page-blog__video-section {
    padding: 40px 20px;
    box-sizing: border-box;
}

.page-blog__video-container {
    width: 100%; /* Ensure desktop width is 100% with max-width */
    max-width: 900px;
    margin: 0 auto;
    box-sizing: border-box;
}

.page-blog__video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    background-color: #000;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.page-blog__video-link {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.page-blog__video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* Latest Posts Section */
.page-blog__latest-posts {
    padding: 60px 20px;
    box-sizing: border-box;
}

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

.page-blog__post-card {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    background-color: var(--secondary-color);
    color: var(--dark-text-color);
}

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

.page-blog__post-image {
    width: 100%;
    height: 225px; /* Fixed height for consistency */
    object-fit: cover;
    display: block;
}

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

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

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

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

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

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

.page-blog__read-more-btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--light-text-color);
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease;
    text-align: center;
}

.page-blog__read-more-btn:hover {
    background-color: #1e87b3;
}

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

/* Why Choose Section */
.page-blog__why-choose {
    padding: 60px 20px;
    box-sizing: border-box;
}

.page-blog__features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    text-align: center;
}

.page-blog__feature-item {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.page-blog__feature-icon {
    width: 100px;
    height: 100px;
    margin-bottom: 20px;
    object-fit: contain;
}

.page-blog__feature-title {
    font-size: 1.8em;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.page-blog__feature-text {
    font-size: 1em;
    color: var(--secondary-color);
}

/* Guides Section */
.page-blog__guides {
    padding: 60px 20px;
    box-sizing: border-box;
}

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

.page-blog__guide-card {
    background-color: var(--secondary-color);
    color: var(--dark-text-color);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.page-blog__guide-title {
    font-size: 1.6em;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.page-blog__guide-text {
    font-size: 1em;
    color: #555;
    margin-bottom: 20px;
    flex-grow: 1;
}

/* CTA Section */
.page-blog__cta-section {
    padding: 80px 20px;
    text-align: center;
    box-sizing: border-box;
}

.page-blog__cta-section .page-blog__section-title {
    color: var(--light-text-color);
}

.page-blog__cta-section .page-blog__section-description {
    color: var(--secondary-color);
    margin-bottom: 40px;
}

.page-blog__cta-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

/* Buttons */
.page-blog__btn-primary,
.page-blog__btn-secondary,
.page-blog a[class*="button"],
.page-blog a[class*="btn"] {
    display: inline-block;
    padding: 15px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1em;
    transition: all 0.3s ease;
    box-sizing: border-box;
    max-width: 100%;
    white-space: normal;
    word-wrap: break-word;
}

.page-blog__btn-primary {
    background-color: var(--primary-color);
    color: var(--light-text-color);
    border: 2px solid var(--primary-color);
}

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

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

.page-blog__btn-secondary:hover {
    background-color: var(--primary-color);
    color: var(--light-text-color);
}

/* FAQ Section */
.page-blog__faq-section {
    padding: 60px 20px;
    box-sizing: border-box;
}

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

.page-blog__faq-item {
    background-color: var(--secondary-color);
    color: var(--dark-text-color);
    margin-bottom: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.page-blog__faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    background-color: #f9f9f9;
    color: var(--dark-text-color);
    border-bottom: 1px solid #eee;
    list-style: none; /* Remove default marker for details/summary */
}

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

.page-blog__faq-item[open] .page-blog__faq-question {
    border-bottom: 1px solid var(--primary-color);
}

.page-blog__faq-qtext {
    flex-grow: 1;
    color: var(--dark-text-color);
}

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

.page-blog__faq-item[open] .page-blog__faq-toggle {
    transform: rotate(45deg);
}

.page-blog__faq-answer {
    padding: 20px;
    font-size: 1em;
    color: #555;
    line-height: 1.8;
}

/* --- Responsive Design --- */

/* Tablet 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__post-grid,
    .page-blog__features-grid,
    .page-blog__guide-cards {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }

    .page-blog__hero-content,
    .page-blog__container {
        padding-left: 15px;
        padding-right: 15px;
    }
}

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

    .page-blog__hero-section {
        padding: 40px 15px;
        padding-top: 10px !important; /* body handles --header-offset */
    }

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

    .page-blog__description {
        font-size: 1em;
    }

    .page-blog__section-title {
        font-size: 1.8em;
    }

    .page-blog__section-description {
        font-size: 0.95em;
    }

    .page-blog__hero-image,
    .page-blog__post-image,
    .page-blog__feature-icon {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        display: block !important;
        min-width: 200px;
        min-height: 200px;
    }

    .page-blog__hero-image-wrapper,
    .page-blog__post-card,
    .page-blog__feature-item,
    .page-blog__guide-card,
    .page-blog__video-container,
    .page-blog__video-wrapper,
    .page-blog__latest-posts,
    .page-blog__why-choose,
    .page-blog__guides,
    .page-blog__cta-section,
    .page-blog__faq-section {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px;
        padding-right: 15px;
        overflow: hidden !important;
    }

    .page-blog__video {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        display: block !important;
    }

    .page-blog__cta-buttons {
        flex-direction: column;
        gap: 15px;
    }

    .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;
        padding-right: 15px;
    }

    .page-blog__post-grid,
    .page-blog__features-grid,
    .page-blog__guide-cards {
        grid-template-columns: 1fr;
    }

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

    .page-blog__feature-icon {
        width: 150px;
        height: 150px;
    }

    .page-blog__faq-question {
        font-size: 1.1em;
        padding: 15px;
    }

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

/* Ensure content images are not too small in content areas */
.page-blog__post-image,
.page-blog__feature-icon {
    min-width: 200px;
    min-height: 200px;
}

/* Contrast fixes for light-bg sections */
.page-blog__light-bg .page-blog__section-title,
.page-blog__light-bg .page-blog__section-description,
.page-blog__light-bg .page-blog__post-title a,
.page-blog__light-bg .page-blog__post-meta,
.page-blog__light-bg .page-blog__post-excerpt,
.page-blog__light-bg .page-blog__guide-title,
.page-blog__light-bg .page-blog__guide-text,
.page-blog__light-bg .page-blog__faq-qtext,
.page-blog__light-bg .page-blog__faq-answer p {
    color: var(--dark-text-color);
}

.page-blog__light-bg .page-blog__read-more-btn {
    background-color: var(--primary-color);
    color: var(--light-text-color);
}

.page-blog__light-bg .page-blog__btn-secondary {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background-color: transparent;
}

.page-blog__light-bg .page-blog__btn-secondary:hover {
    background-color: var(--primary-color);
    color: var(--light-text-color);
}