/* style/blog.css */
/* BEM naming convention: .page-blog__element-name */

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

/* Base styles for the blog page */
.page-blog {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-main); /* Assuming dark body background, light text */
    background-color: var(--bg-dark); /* Using custom background color */
    padding-top: 0; /* body padding-top handled by shared.css */
}

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

.page-blog__section {
    padding: 60px 0;
    text-align: center;
}

.page-blog__section-intro {
    font-size: 1.1em;
    color: var(--text-secondary);
    max-width: 800px;
    margin: -20px auto 40px auto;
    line-height: 1.5;
}

.page-blog__section-title {
    font-size: 2.5em;
    color: var(--text-main);
    margin-bottom: 40px;
    font-weight: bold;
    line-height: 1.2;
}

/* Hero Section */
.page-blog__hero-section {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 0 60px 0; /* body padding-top handled by shared.css, this is a small decorative top padding */
    background-color: var(--bg-dark);
}

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

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

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

.page-blog__hero-title {
    font-weight: bold;
    color: var(--text-main);
    margin-bottom: 20px;
    line-height: 1.2;
    letter-spacing: -0.02em;
    font-size: clamp(2em, 4vw, 3.5em); /* Responsive H1 font size */
}

.page-blog__hero-description {
    font-size: 1.1em;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

/* Buttons */
.page-blog__btn-primary,
.page-blog__btn-secondary {
    display: inline-block;
    padding: 12px 25px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    box-sizing: border-box;
    max-width: 100%; /* For mobile responsiveness */
    white-space: normal; /* For mobile button text wrapping */
    word-wrap: break-word; /* For mobile button text wrapping */
}

.page-blog__btn-primary {
    background: var(--btn-gradient);
    color: #ffffff; /* Explicitly white for contrast */
    border: none;
    margin: 0 10px 10px 10px;
}

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

.page-blog__btn-secondary {
    background: transparent;
    color: var(--glow-color); /* Using glow color for secondary button text */
    border: 2px solid var(--glow-color);
    margin: 0 10px 10px 10px;
}

.page-blog__btn-secondary:hover {
    background: var(--glow-color);
    color: var(--bg-dark); /* Dark text on hover */
}

/* Latest Posts Section */
.page-blog__latest-posts {
    background-color: var(--bg-dark);
}

.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: var(--card-bg); /* Card background color */
    border-radius: 12px;
    overflow: hidden;
    text-align: left;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
}

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

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

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

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

.page-blog__post-date {
    font-size: 0.9em;
    color: var(--text-secondary);
    margin-bottom: 10px;
    display: block;
}

.page-blog__post-title {
    font-size: 1.4em;
    font-weight: bold;
    margin-bottom: 15px;
    line-height: 1.3;
}

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

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

.page-blog__post-excerpt {
    font-size: 1em;
    color: var(--text-secondary);
    margin-bottom: 20px;
    flex-grow: 1;
}

.page-blog__read-more {
    color: var(--glow-color);
    text-decoration: none;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    transition: color 0.3s ease;
}

.page-blog__read-more:hover {
    color: var(--gold-color);
}

.page-blog__arrow {
    margin-left: 5px;
    font-size: 1.2em;
}

.page-blog__view-all-button {
    margin-top: 30px;
}

/* Categories Section */
.page-blog__categories-section {
    background-color: var(--deep-green-color); /* Different background for variety */
}

.page-blog__categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.page-blog__category-card {
    background-color: var(--card-bg);
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    text-decoration: none;
    color: var(--text-main);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

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

.page-blog__category-title {
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 10px;
    color: var(--text-main);
}

.page-blog__category-description {
    font-size: 0.95em;
    color: var(--text-secondary);
}

/* CTA Section */
.page-blog__cta-section {
    background-color: var(--deep-green-color);
    padding: 80px 0;
    background-image: url("[GALLERY:cta_banner:1200x675:bay789 đăng ký, khuyến mãi, cá cược trực tuyến, chủ đề xanh vàng]"); /* Background image for CTA */
    background-size: cover;
    background-position: center;
    position: relative;
    z-index: 1;
}

.page-blog__cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6); /* Dark overlay for text readability */
    z-index: -1;
}

.page-blog__cta-content {
    max-width: 800px;
}

.page-blog__cta-title {
    font-size: 2.8em;
    color: var(--text-main);
    margin-bottom: 25px;
    font-weight: bold;
    line-height: 1.2;
}

.page-blog__cta-description {
    font-size: 1.2em;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

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

/* FAQ Section */
.page-blog__faq-section {
    background-color: var(--bg-dark);
}

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

.page-blog__faq-item {
    background-color: var(--card-bg);
    border-radius: 10px;
    margin-bottom: 15px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

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

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

.page-blog__faq-item[open] .page-blog__faq-question {
    background-color: var(--deep-green-color);
}

.page-blog__faq-question:hover {
    background-color: rgba(var(--deep-green-color), 0.5);
}

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

.page-blog__faq-toggle {
    font-size: 1.5em;
    line-height: 1;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

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

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

/* Responsive adjustments */
@media (max-width: 768px) {
    .page-blog__section {
        padding: 40px 0;
    }

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

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

    .page-blog__hero-description {
        font-size: 1em;
    }

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

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

    .page-blog__posts-grid,
    .page-blog__categories-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .page-blog__post-image-wrapper {
        height: 180px; /* Adjust height for mobile */
    }

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

    .page-blog__cta-section {
        padding: 60px 0;
    }

    .page-blog__cta-title {
        font-size: 2em;
    }

    .page-blog__cta-description {
        font-size: 1em;
    }
    
    /* Mobile image responsive adaptations (mandatory) */
    .page-blog img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        display: block !important;
        filter: none !important; /* Ensure no image filters */
    }
    
    /* Video responsive adaptations (if video were present) */
    .page-blog video,
    .page-blog__video {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        display: block !important;
    }
    
    .page-blog__video-section,
    .page-blog__video-container,
    .page-blog__video-wrapper {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px;
        padding-right: 15px;
        overflow: hidden !important;
    }
    .page-blog__video-section {
        padding-top: 10px !important;
    }

    /* General container and section mobile padding/overflow */
    .page-blog__section,
    .page-blog__card,
    .page-blog__container,
    .page-blog__hero-image-wrapper,
    .page-blog__post-image-wrapper,
    .page-blog__cta-content,
    .page-blog__faq-list {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px;
        padding-right: 15px;
        overflow: hidden !important; /* Ensure no overflow */
    }

    /* Specific top padding for hero section on mobile, if it's the first element in main */
    .page-blog__hero-section {
      padding-top: 10px !important; /* body already handles --header-offset */
      padding-left: 15px;
      padding-right: 15px;
    }

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

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

/* Ensure images don't have filters */
.page-blog img {
    filter: none !important;
}

/* Ensure content area images CSS size is not less than 200px (implicitly handled by grid/flex layout and minmax) */
.page-blog .page-blog__latest-posts img,
.page-blog .page-blog__post-image {
    min-width: 200px; /* Explicitly ensure minimum size on desktop */
    min-height: 200px;
}