:root {
    --primary-color: #017439;
    --secondary-color: #FFFFFF;
    --register-login-button-color: #C30808;
    --register-login-font-color: #FFFF00;
    --background-color: #FFFFFF;
    --text-color-dark: #333333; /* For text on white background */
    --text-color-light: #FFFFFF; /* For text on dark background */
}

/* Base styles for the page-khuynmi scope */
.page-khuynmi {
    background-color: var(--background-color);
    color: var(--text-color-dark);
    line-height: 1.6;
    padding-bottom: 40px; /* Add some padding at the bottom */
}

.page-khuynmi__hero-section {
    padding-top: 10px; /* Small top padding for the first section, assuming body handles main padding-top */
}

.page-khuynmi__section {
    padding: 40px 20px;
    max-width: 1200px;
    margin: 0 auto;
    box-sizing: border-box;
    overflow-x: hidden; /* Prevent horizontal overflow within sections */
}

.page-khuynmi__section-title {
    font-size: 2.2rem;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 30px;
    font-weight: 700;
    line-height: 1.2;
}

/* Hero Section */
.page-khuynmi__hero-section {
    display: flex;
    flex-direction: column; /* Default to column for upper image, lower content */
    align-items: center;
    text-align: center;
    background-color: var(--primary-color); /* Darker background for hero */
    color: var(--text-color-light);
    padding: 20px 0;
}

.page-khuynmi__hero-image-wrapper {
    width: 100%;
    max-width: 1200px;
    margin-bottom: 20px;
}

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

.page-khuynmi__hero-content {
    max-width: 800px;
    padding: 0 20px;
}

.page-khuynmi__hero-title {
    font-size: clamp(1.8rem, 5vw, 2.5rem); /* H1 font size constraint */
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 15px;
    color: var(--text-color-light); /* H1 on dark background */
    letter-spacing: -0.5px;
}

.page-khuynmi__hero-description {
    font-size: 1.1rem;
    margin-bottom: 25px;
    color: var(--text-color-light);
}

.page-khuynmi__hero-cta {
    display: inline-flex;
    background-color: var(--register-login-button-color); /* Use register/login color for main CTA */
    color: var(--register-login-font-color); /* Use register/login font color */
    padding: 12px 30px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: background-color 0.3s ease;
    min-width: 200px; /* Ensure CTA is not too small */
    min-height: 44px; /* Touch target size */
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
}

.page-khuynmi__hero-cta:hover {
    background-color: #A40707; /* Darkened #C30808 */
    opacity: 0.9;
}

/* Promotion Grid */
.page-khuynmi__promotion-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.page-khuynmi__promotion-card {
    background-color: var(--text-color-light);
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.page-khuynmi__promotion-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

.page-khuynmi__card-image {
    width: 100%;
    height: 250px; /* Fixed height for consistency */
    object-fit: cover;
    display: block;
    min-width: 200px; /* Min image size */
    min-height: 200px; /* Min image size */
}

.page-khuynmi__card-content {
    padding: 20px;
    flex-grow: 1; /* Allow content to take available space */
    display: flex;
    flex-direction: column;
}

.page-khuynmi__card-title {
    font-size: 1.4rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    font-weight: 600;
}

.page-khuynmi__card-description {
    font-size: 0.95rem;
    color: var(--text-color-dark);
    margin-bottom: 20px;
    flex-grow: 1; /* Allow description to push CTA to bottom */
}

.page-khuynmi__card-cta {
    display: inline-flex;
    background-color: var(--primary-color);
    color: var(--text-color-light);
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: background-color 0.3s ease;
    align-self: flex-start; /* Align button to start of flex container */
    min-height: 44px; /* Touch target size */
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
}

.page-khuynmi__card-cta:hover {
    background-color: #016231; /* Darkened #017439 */
    opacity: 0.9;
}

/* How to Participate Section */
.page-khuynmi__how-to-participate .page-khuynmi__content-wrapper {
    display: flex;
    flex-direction: column; /* Default to column */
    gap: 30px;
    align-items: center;
}

.page-khuynmi__steps-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 600px;
}

.page-khuynmi__step-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.page-khuynmi__step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: var(--text-color-light);
    font-weight: 700;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.page-khuynmi__step-title {
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.page-khuynmi__step-text {
    font-size: 0.95rem;
    color: var(--text-color-dark);
}

.page-khuynmi__steps-image-wrapper {
    width: 100%;
    max-width: 600px;
}

.page-khuynmi__steps-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    min-width: 200px; /* Min image size */
    min-height: 200px; /* Min image size */
}

/* FAQ Section */
.page-khuynmi__faq-list {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.page-khuynmi__faq-item {
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 20px;
}

.page-khuynmi__faq-question {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    cursor: pointer;
    font-weight: 600;
    /* Ensure good contrast */
}

.page-khuynmi__faq-answer {
    font-size: 0.95rem;
    color: var(--text-color-dark);
    display: none; /* Hidden by default, shown by JS */
}

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

    .page-khuynmi__hero-image-wrapper {
        margin-bottom: 30px;
    }

    .page-khuynmi__hero-content {
        padding: 0 40px;
    }

    .page-khuynmi__hero-title {
        font-size: clamp(2.5rem, 4vw, 3.5rem);
    }

    .page-khuynmi__hero-description {
        font-size: 1.2rem;
    }

    .page-khuynmi__section-title {
        font-size: 2.5rem;
    }

    .page-khuynmi__how-to-participate .page-khuynmi__content-wrapper {
        flex-direction: row; /* Side-by-side for desktop */
        align-items: flex-start;
        justify-content: space-between;
    }

    .page-khuynmi__steps-list {
        flex: 1;
        max-width: 50%;
    }

    .page-khuynmi__steps-image-wrapper {
        flex: 1;
        max-width: 45%;
    }
}

/* Mobile anti-overflow and image scaling */
@media (max-width: 768px) {
    .page-khuynmi__section {
        padding: 20px 15px;
    }

    /* Ensure all images within .page-khuynmi are responsive */
    .page-khuynmi img {
        max-width: 100%;
        height: auto;
        display: block;
    }

    .page-khuynmi__hero-title {
        font-size: clamp(1.8rem, 8vw, 2.5rem); /* Adjust clamp for smaller screens */
    }

    .page-khuynmi__hero-description {
        font-size: 1rem;
    }

    .page-khuynmi__section-title {
        font-size: 1.8rem;
        margin-bottom: 20px;
    }

    .page-khuynmi__promotion-grid {
        grid-template-columns: 1fr; /* Stack cards on mobile */
    }

    .page-khuynmi__card-image {
        height: 200px; /* Adjust card image height for mobile, ensuring min-height 200px */
    }

    .page-khuynmi__card-title {
        font-size: 1.2rem;
    }

    .page-khuynmi__card-description {
        font-size: 0.9rem;
    }

    .page-khuynmi__step-title {
        font-size: 1.1rem;
    }

    .page-khuynmi__step-text {
        font-size: 0.9rem;
    }

    .page-khuynmi__faq-question {
        font-size: 1rem;
    }

    .page-khuynmi__faq-answer {
        font-size: 0.9rem;
    }
}

/* Even smaller screens for fine-tuning */
@media (max-width: 480px) {
    .page-khuynmi__hero-cta {
        width: 100%;
        max-width: 280px; /* Constrain width for very small screens */
    }
    .page-khuynmi__step-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .page-khuynmi__step-number {
        margin-bottom: 10px;
    }
}