/* style/blog.css */
/* Custom Colors */
:root {
    --cm88a-button-gradient: linear-gradient(180deg, #2AD16F 0%, #13994A 100%);
    --cm88a-card-bg: #11271B;
    --cm88a-background: #08160F;
    --cm88a-text-main: #F2FFF6;
    --cm88a-text-secondary: #A7D9B8;
    --cm88a-border: #2E7A4E;
    --cm88a-glow: #57E38D;
    --cm88a-gold: #F2C14E;
    --cm88a-divider: #1E3A2A;
    --cm88a-deep-green: #0A4B2C;
}

.page-blog {
    font-family: 'Arial', sans-serif;
    background-color: var(--cm88a-background); /* Dark background */
    color: var(--cm88a-text-main); /* Light text for dark background */
    line-height: 1.6;
    font-size: 16px;
}

.page-blog p,
.page-blog li {
  color: var(--cm88a-text-secondary);
}

/* Base container for content sections */
.page-blog__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

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

.page-blog__section-description {
    font-size: 18px;
    color: var(--cm88a-text-secondary);
    text-align: center;
    margin-bottom: 40px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Hero Section */
.page-blog__hero-section {
    position: relative;
    display: flex;
    flex-direction: column; /* Image above text */
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    padding-top: 10px; /* Small top padding, body handles header offset */
    background-color: var(--cm88a-background);
}

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

.page-blog__hero-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.page-blog__hero-content {
    max-width: 900px;
    width: 100%;
}

.page-blog__main-title {
    font-size: clamp(28px, 4vw, 48px); /* Responsive H1 */
    font-weight: 700;
    color: var(--cm88a-text-main);
    margin-bottom: 20px;
    line-height: 1.2;
}

.page-blog__description {
    font-size: clamp(16px, 2vw, 20px);
    color: var(--cm88a-text-secondary);
    margin-bottom: 30px;
}

.page-blog__cta-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap; /* Allow wrapping on small screens */
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.page-blog__btn-primary,
.page-blog__btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 30px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    white-space: normal;
    word-wrap: break-word;
    text-align: center;
    min-width: 180px;
}

.page-blog__btn-primary {
    background: var(--cm88a-button-gradient);
    color: var(--cm88a-text-main); /* White-ish text for dark gradient */
    border: 2px solid transparent;
}

.page-blog__btn-primary:hover {
    box-shadow: 0 6px 16px rgba(42, 209, 111, 0.4);
    transform: translateY(-2px);
}

.page-blog__btn-secondary {
    background-color: transparent;
    color: var(--cm88a-glow); /* Greenish text for transparent background */
    border: 2px solid var(--cm88a-border);
}

.page-blog__btn-secondary:hover {
    background-color: rgba(42, 209, 111, 0.1);
    color: var(--cm88a-text-main);
    border-color: var(--cm88a-glow);
    transform: translateY(-2px);
}

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

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

.page-blog__post-card {
    background-color: var(--cm88a-card-bg); /* Dark card background */
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%; /* Ensure cards are same height */
}

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

.page-blog__card-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

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

.page-blog__card-content {
    padding: 25px;
    flex-grow: 1; /* Allows content to expand and push "Read more" to bottom */
    display: flex;
    flex-direction: column;
}

.page-blog__card-title {
    font-size: 22px;
    font-weight: bold;
    color: var(--cm88a-text-main);
    margin-bottom: 10px;
    flex-grow: 1; /* Push meta and excerpt up, read more down */
}

.page-blog__post-meta {
    font-size: 14px;
    color: var(--cm88a-text-secondary);
    margin-bottom: 15px;
}

.page-blog__post-excerpt {
    font-size: 16px;
    color: var(--cm88a-text-secondary);
    margin-bottom: 20px;
}

.page-blog__read-more {
    display: inline-flex;
    align-items: center;
    color: var(--cm88a-glow);
    font-weight: bold;
    font-size: 16px;
    text-decoration: none;
    margin-top: auto; /* Push to the bottom */
}

.page-blog__read-more .page-blog__arrow {
    margin-left: 8px;
    transition: transform 0.3s ease;
}

.page-blog__read-more:hover .page-blog__arrow {
    transform: translateX(5px);
}

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

/* Categories Section */
.page-blog__categories {
    padding: 80px 0;
    background-color: var(--cm88a-card-bg); /* Use card-bg for a slightly lighter dark section */
    color: var(--cm88a-text-main); /* Light text */
}

.page-blog__category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); /* Min size 200px enforced */
    gap: 25px;
    justify-content: center;
}

.page-blog__category-card {
    background-color: var(--cm88a-background); /* Darker background for category cards */
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    text-decoration: none;
    color: var(--cm88a-text-main);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.page-blog__category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.page-blog__category-icon {
    width: 200px;
    height: 200px;
    object-fit: cover; 
    margin-bottom: 15px;
    border-radius: 8px; 
}

.page-blog__category-title {
    font-size: 18px;
    font-weight: bold;
    color: var(--cm88a-text-main);
}

/* Featured Video Section */
.page-blog__featured-video {
    padding: 80px 0;
    background-color: var(--cm88a-background);
}

.page-blog__video-wrapper {
    position: relative;
    width: 100%;
    max-width: 900px; /* Max width for the video player */
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    box-sizing: border-box;
    display: block; /* Ensure it behaves like a block element */
}

.page-blog__video {
    width: 100%;
    height: auto;
    display: block;
    cursor: pointer; /* Indicate it's clickable */
}

.page-blog__video-overlay-link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    cursor: pointer;
    background: transparent; /* Make it invisible */
}

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

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

.page-blog__faq-item {
    background-color: var(--cm88a-background); /* Darker background for FAQ items */
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.page-blog__faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    font-size: 18px;
    font-weight: bold;
    color: var(--cm88a-text-main);
    cursor: pointer;
    background-color: var(--cm88a-background);
    border-bottom: 1px solid var(--cm88a-divider);
    transition: background-color 0.3s ease;
    list-style: none; /* For details/summary */
}

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

.page-blog__faq-question:hover {
    background-color: rgba(46, 122, 78, 0.2); /* Lighter hover for dark background */
}

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

.page-blog__faq-toggle {
    font-size: 24px;
    line-height: 1;
    margin-left: 15px;
    color: var(--cm88a-glow);
}

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

.page-blog__faq-answer p {
    margin-top: 15px;
}

.page-blog__faq-answer a {
    color: var(--cm88a-glow);
    text-decoration: underline;
}


/* CTA Bottom Section */
.page-blog__cta-bottom {
    padding: 80px 0;
    text-align: center;
    background-color: var(--cm88a-deep-green); /* Use deep green for a strong CTA */
    color: var(--cm88a-text-main);
}

/* Responsive Styles */
@media (max-width: 992px) {
    .page-blog__section-title {
        font-size: 30px;
    }
    .page-blog__description {
        font-size: 18px;
    }
    .page-blog__post-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    .page-blog__category-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}

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

    .page-blog__container {
        padding: 0 15px;
    }

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

    .page-blog__main-title {
        font-size: 28px;
    }

    .page-blog__description {
        font-size: 16px;
    }

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

    .page-blog__btn-primary,
    .page-blog__btn-secondary {
        width: 100% !important;
        max-width: 100% !important;
        padding: 12px 20px;
        font-size: 16px;
        box-sizing: border-box !important;
        white-space: normal !important;
        word-wrap: break-word !important;
    }

    /* Images responsiveness */
    .page-blog img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        display: block !important;
    }
    
    .page-blog__hero-image-wrapper,
    .page-blog__post-card,
    .page-blog__category-card,
    .page-blog__video-wrapper,
    .page-blog__container,
    .page-blog__latest-posts,
    .page-blog__categories,
    .page-blog__featured-video,
    .page-blog__faq-section,
    .page-blog__cta-bottom {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px;
        padding-right: 15px;
        overflow: hidden !important;
    }

    .page-blog__post-grid,
    .page-blog__category-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

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

    .page-blog__card-title {
        font-size: 20px;
    }

    .page-blog__category-icon {
        width: 200px !important; /* Enforce min 200px */
        height: 200px !important; /* Enforce min 200px */
    }

    /* Video responsiveness */
    .page-blog video,
    .page-blog__video {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        display: block !important;
    }
    
    .page-blog__video-section {
        padding-top: 10px !important; /* body handles --header-offset, this is decorative */
    }

    /* FAQ */
    .page-blog__faq-question {
        padding: 15px 20px;
        font-size: 16px;
    }
    .page-blog__faq-answer {
        padding: 0 20px 15px;
        font-size: 15px;
    }
    .page-blog__faq-toggle {
        font-size: 20px;
    }
}