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

/* Base styles for the blog page */
.page-blog {
    background-color: var(--kingbet86-background);
    color: var(--kingbet86-text-main);
    font-family: Arial, sans-serif;
    line-height: 1.6;
    padding-top: 10px; /* Small top padding, body already handles --header-offset */
}

/* Section styling */
.page-blog__hero-section,
.page-blog__post-list-section,
.page-blog__categories-section,
.page-blog__cta-section,
.page-blog__faq-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    box-sizing: border-box;
}

.page-blog__hero-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-bottom: 60px;
}

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

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

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

.page-blog__main-title {
    color: var(--kingbet86-text-main);
    font-size: clamp(2em, 4vw, 3.5em); /* Using clamp for H1 */
    font-weight: bold;
    margin-bottom: 20px;
    line-height: 1.2;
}

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

.page-blog__cta-button {
    display: inline-block;
    background: var(--kingbet86-button-gradient);
    color: var(--kingbet86-text-main);
    padding: 15px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    transition: background 0.3s ease, transform 0.3s ease;
    border: none;
    cursor: pointer;
    white-space: normal;
    word-wrap: break-word;
    box-sizing: border-box;
}

.page-blog__cta-button:hover {
    transform: translateY(-2px);
    background: linear-gradient(180deg, #13994A 0%, #2AD16F 100%); /* Slight inverse for hover */
}

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

.page-blog__cta-button--secondary:hover {
    background: var(--kingbet86-color-primary);
    color: var(--kingbet86-text-main);
}

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

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

.page-blog__post-card {
    background-color: var(--kingbet86-card-bg);
    border: 1px solid var(--kingbet86-border);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

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

.page-blog__post-image {
    width: 100%;
    height: 225px; /* Fixed height for consistency, will be overridden by responsive rules */
    object-fit: cover;
    display: block;
}

.page-blog__post-content {
    padding: 20px;
}

.page-blog__post-title {
    color: var(--kingbet86-text-main);
    font-size: 1.4em;
    margin-bottom: 10px;
    line-height: 1.3;
    min-height: 3.9em; /* Ensure consistent height for titles */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Limit to 3 lines */
    -webkit-box-orient: vertical;
}

.page-blog__post-excerpt {
    color: var(--kingbet86-text-secondary);
    font-size: 0.95em;
    margin-bottom: 15px;
    min-height: 4.5em; /* Ensure consistent height for excerpts */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Limit to 3 lines */
    -webkit-box-orient: vertical;
}

.page-blog__post-date {
    font-size: 0.85em;
    color: var(--kingbet86-text-secondary);
    display: block;
    text-align: right;
}

.page-blog__view-all-wrapper {
    text-align: center;
    margin-top: 40px;
}

.page-blog__categories-section {
    text-align: center;
}

.page-blog__category-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

.page-blog__category-item {
    background-color: var(--kingbet86-deep-green);
    border-radius: 25px;
    padding: 10px 20px;
    transition: background-color 0.3s ease;
}

.page-blog__category-item:hover {
    background-color: var(--kingbet86-color-primary);
}

.page-blog__category-link {
    text-decoration: none;
    color: var(--kingbet86-text-main);
    font-weight: bold;
    font-size: 1.05em;
}

.page-blog__dark-section {
    background-color: var(--kingbet86-deep-green);
    color: var(--kingbet86-text-main);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    border-radius: 12px;
    padding: 50px;
    margin-bottom: 40px;
}

.page-blog__cta-content {
    flex: 1;
}

.page-blog__cta-title {
    color: var(--kingbet86-text-main);
    font-size: 2.2em;
    margin-bottom: 15px;
    line-height: 1.2;
}

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

.page-blog__cta-buttons {
    display: flex;
    gap: 20px;
    flex-wrap: wrap; /* Ensure buttons wrap on smaller screens */
}

.page-blog__cta-image-wrapper {
    flex: 0 0 auto;
    width: 40%;
    max-width: 400px;
    border-radius: 8px;
    overflow: hidden;
}

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

/* FAQ Section */
.page-blog__faq-section {
    padding-bottom: 60px;
}

.page-blog__faq-list {
    margin-top: 30px;
}

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

.page-blog__faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 25px;
    cursor: pointer;
    font-size: 1.15em;
    font-weight: bold;
    color: var(--kingbet86-text-main);
    user-select: none;
}

/* Remove default details arrow */
.page-blog__faq-item summary {
    list-style: none;
}
.page-blog__faq-item summary::-webkit-details-marker {
    display: none;
}

.page-blog__faq-toggle {
    font-size: 1.5em;
    line-height: 1;
    transition: transform 0.3s ease;
}

.page-blog__faq-item[open] .page-blog__faq-toggle {
    transform: rotate(45deg); /* Rotate for 'x' effect */
}

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

/* --- Responsive Design --- */
@media (max-width: 992px) {
    .page-blog__dark-section {
        flex-direction: column;
        text-align: center;
        padding: 40px;
    }
    .page-blog__cta-image-wrapper {
        width: 100%;
        max-width: 600px;
        margin-top: 30px;
    }
    .page-blog__cta-buttons {
        justify-content: center;
    }
}

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

    .page-blog__hero-section,
    .page-blog__post-list-section,
    .page-blog__categories-section,
    .page-blog__cta-section,
    .page-blog__faq-section {
        padding: 20px 15px !important; /* Adjust padding for mobile */
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .page-blog__main-title {
        font-size: clamp(1.8em, 8vw, 2.5em);
    }

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

    .page-blog__post-grid {
        grid-template-columns: 1fr;
    }

    .page-blog__post-image {
        height: 200px;
    }

    .page-blog__post-title {
        font-size: 1.2em;
        min-height: auto;
        -webkit-line-clamp: unset;
    }

    .page-blog__post-excerpt {
        font-size: 0.9em;
        min-height: auto;
        -webkit-line-clamp: unset;
    }

    .page-blog__category-list {
        flex-direction: column;
        gap: 10px;
    }

    .page-blog__category-item {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }

    .page-blog__dark-section {
        padding: 30px 20px;
    }

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

    .page-blog__cta-buttons {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }
    
    .page-blog__cta-button,
    .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__hero-image,
    .page-blog__post-image,
    .page-blog__cta-image,
    .page-blog img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        display: block !important;
    }
    
    .page-blog__hero-image-wrapper,
    .page-blog__cta-image-wrapper,
    .page-blog__post-card,
    .page-blog__section,
    .page-blog__container {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important; /* Ensure no overflow on containers */
    }
    
    .page-blog__faq-question {
        font-size: 1em;
        padding: 15px 20px;
    }
    .page-blog__faq-answer {
        padding: 0 20px 15px;
    }
}