/* style/news.css */
:root {
    --primary-color: #017439;
    --secondary-color: #FFFFFF;
    --register-color: #C30808;
    --login-color: #C30808;
    --bg-color: #FFFFFF;
    --register-login-font-color: #FFFF00;
    --text-color-dark-bg: #ffffff;
    --text-color-light-bg: #333333;
    --border-color: #e0e0e0;
}

.page-news {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color-light-bg); /* Default text color for light background */
}

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

/* Color Contrast Fixes */
.page-news__dark-bg {
    background-color: var(--primary-color);
    color: var(--text-color-dark-bg);
}

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

/* Hero Section */
.page-news__hero-section {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    padding-top: var(--header-offset, 120px); /* Ensure spacing from fixed header */
    overflow: hidden;
}

.page-news__hero-container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.page-news__hero-image {
    width: 100%;
    margin-bottom: 30px;
}

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

.page-news__hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    width: 100%;
    padding: 0 15px;
    box-sizing: border-box;
}

.page-news__main-title {
    font-size: 48px;
    font-weight: bold;
    margin-bottom: 20px;
    line-height: 1.2;
    color: var(--text-color-dark-bg);
}

.page-news__hero-description {
    font-size: 20px;
    margin-bottom: 30px;
    color: var(--text-color-dark-bg);
}

.page-news__cta-button {
    display: inline-block;
    padding: 15px 40px;
    background: var(--register-color); /* Using register color for CTA */
    color: var(--register-login-font-color);
    text-decoration: none;
    border-radius: 5px;
    font-size: 18px;
    font-weight: bold;
    margin-top: 30px;
    transition: all 0.3s ease;
    border: none;
}

.page-news__cta-button:hover {
    background: #a80707;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Section Titles and Descriptions */
.page-news__section-title {
    font-size: 36px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.page-news__section-description {
    font-size: 18px;
    text-align: center;
    max-width: 800px;
    margin: 0 auto 40px auto;
    color: var(--text-color-light-bg);
}

/* Latest Articles Section */
.page-news__latest-articles {
    padding: 80px 0;
}

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

.page-news__article-card {
    background: var(--secondary-color);
    border-radius: 10px;
    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;
}

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

.page-news__article-image {
    width: 100%;
    height: 220px;
    overflow: hidden;
}

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

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

.page-news__article-title {
    font-size: 22px;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 10px;
    line-height: 1.3;
}

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

.page-news__article-title a:hover {
    color: #005a2e;
}

.page-news__article-date {
    font-size: 14px;
    color: #777;
    margin-bottom: 15px;
}

.page-news__article-summary {
    font-size: 16px;
    color: var(--text-color-light-bg);
    margin-bottom: 20px;
    flex-grow: 1;
}

.page-news__read-more-button {
    display: inline-block;
    padding: 10px 20px;
    background: var(--primary-color);
    color: var(--secondary-color);
    text-decoration: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    transition: background-color 0.3s ease;
    align-self: flex-start;
}

.page-news__read-more-button:hover {
    background: #005a2e;
}

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

.page-news__view-all-button {
    display: inline-block;
    padding: 15px 30px;
    background: var(--primary-color);
    color: var(--secondary-color);
    text-decoration: none;
    border-radius: 5px;
    font-size: 18px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.page-news__view-all-button:hover {
    background: #005a2e;
}

/* FAQ Section */
.page-news__faq-section {
    padding: 80px 0;
    background-color: var(--primary-color);
    color: var(--text-color-dark-bg);
}

.page-news__faq-section .page-news__section-title {
    color: var(--text-color-dark-bg);
}

.page-news__faq-section .page-news__section-description {
    color: var(--text-color-dark-bg);
}

.page-news__faq-list {
    margin-top: 40px;
    margin-bottom: 40px;
}

.page-news__faq-item {
    margin-bottom: 15px;
    border-radius: 5px;
    overflow: hidden;
    background-color: var(--secondary-color);
}

.page-news__faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s ease, opacity 0.4s ease;
    padding: 0 15px;
    opacity: 0;
    color: var(--text-color-light-bg);
}

.page-news__faq-item.active .page-news__faq-answer {
    max-height: 2000px !important;
    padding: 20px 15px !important;
    opacity: 1;
    background: #f9f9f9;
    border-radius: 0 0 5px 5px;
}

.page-news__faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    background: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    position: relative;
    color: var(--text-color-light-bg);
}

.page-news__faq-question:hover {
    background: #f5f5f5;
    border-color: #d0d0d0;
}

.page-news__faq-question:active {
    background: #eeeeee;
}

.page-news__faq-question h3 {
    margin: 0;
    padding: 0;
    flex: 1;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5;
    pointer-events: none;
    color: var(--primary-color);
}

.page-news__faq-toggle {
    font-size: 24px;
    font-weight: bold;
    line-height: 1;
    color: #666;
    transition: transform 0.3s ease, color 0.3s ease;
    flex-shrink: 0;
    margin-left: 15px;
    pointer-events: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

.page-news__faq-item.active .page-news__faq-toggle {
    color: var(--primary-color);
    transform: rotate(45deg);
}

.page-news__faq-image-container {
    text-align: center;
    margin-top: 40px;
}

.page-news__faq-image-container img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* CTA Bottom Section */
.page-news__cta-bottom {
    padding: 60px 0;
    text-align: center;
}

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

.page-news__cta-title {
    font-size: 38px;
    font-weight: bold;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.page-news__cta-description {
    font-size: 18px;
    margin-bottom: 40px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    color: var(--text-color-light-bg);
}

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

.page-news__btn-primary,
.page-news__btn-secondary {
    display: inline-block;
    padding: 15px 30px;
    text-decoration: none;
    border-radius: 5px;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-sizing: border-box;
    max-width: 100%;
    white-space: normal;
    word-wrap: break-word;
}

.page-news__btn-primary {
    background: var(--register-color);
    color: var(--register-login-font-color);
    border: 2px solid transparent;
}

.page-news__btn-primary:hover {
    background: #a80707;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.page-news__btn-secondary {
    background: var(--secondary-color);
    color: var(--register-color);
    border: 2px solid var(--register-color);
}

.page-news__btn-secondary:hover {
    background: #f0f0f0;
    color: #a80707;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .page-news__main-title {
        font-size: 42px;
    }
    .page-news__section-title {
        font-size: 32px;
    }
    .page-news__cta-title {
        font-size: 34px;
    }
    .page-news__article-title {
        font-size: 20px;
    }
}

@media (max-width: 768px) {
    .page-news {
        font-size: 16px;
        line-height: 1.6;
    }
    .page-news__hero-section {
        padding-top: var(--header-offset, 120px) !important;
        padding-bottom: 40px;
        padding-left: 15px;
        padding-right: 15px;
    }
    .page-news__main-title {
        font-size: 32px;
        margin-bottom: 15px;
    }
    .page-news__hero-description {
        font-size: 18px;
        margin-bottom: 20px;
    }
    .page-news__cta-button {
        padding: 12px 30px;
        font-size: 16px;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        white-space: normal !important;
        word-wrap: break-word !important;
    }

    .page-news__section-title {
        font-size: 28px;
        margin-bottom: 15px;
    }
    .page-news__section-description {
        font-size: 16px;
        margin-bottom: 30px;
    }

    .page-news__articles-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .page-news__article-image {
        height: 180px;
    }
    .page-news__article-content {
        padding: 20px;
    }
    .page-news__article-title {
        font-size: 18px;
    }
    .page-news__article-summary {
        font-size: 15px;
    }
    .page-news__read-more-button {
        padding: 8px 15px;
        font-size: 15px;
    }
    .page-news__view-all-button {
        padding: 12px 25px;
        font-size: 16px;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        white-space: normal !important;
        word-wrap: break-word !important;
    }

    .page-news__faq-question {
        padding: 15px;
        flex-wrap: wrap;
    }
    .page-news__faq-question h3 {
        font-size: 15px;
        margin-bottom: 0;
        width: calc(100% - 40px);
    }
    .page-news__faq-toggle {
        margin-left: 10px;
        width: 24px;
        height: 24px;
        font-size: 20px;
    }
    .page-news__faq-answer {
        padding: 0 15px;
    }
    .page-news__faq-item.active .page-news__faq-answer {
        padding: 15px !important;
    }

    .page-news__cta-bottom {
        padding: 40px 0;
    }
    .page-news__cta-title {
        font-size: 28px;
    }
    .page-news__cta-description {
        font-size: 16px;
    }
    .page-news__cta-buttons {
        flex-direction: column;
        gap: 15px;
        padding: 0 15px;
    }
    .page-news__btn-primary,
    .page-news__btn-secondary {
        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;
    }

    /* Ensure all images are responsive in mobile */
    .page-news img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
    }
    .page-news__section,
    .page-news__card,
    .page-news__container,
    .page-news__hero-container,
    .page-news__articles-grid,
    .page-news__faq-list,
    .page-news__cta-content,
    .page-news__cta-buttons {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px;
        padding-right: 15px;
    }
}

@media (max-width: 480px) {
    .page-news__main-title {
        font-size: 28px;
    }
    .page-news__hero-description {
        font-size: 16px;
    }
    .page-news__section-title {
        font-size: 24px;
    }
    .page-news__cta-title {
        font-size: 26px;
    }
}