/* style/news.css */

/* Base Styles for the News Page */
.page-news {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333333; /* Default text color for light background */
    background-color: var(--background-color, #ffffff); /* Fallback to white if --background-color is not defined */
}

/* Header offset to prevent content being hidden by fixed header */
.page-news__hero-section {
    padding-top: var(--header-offset, 120px);
}

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

/* Section Titles */
.page-news__section-title {
    font-size: 2.5em;
    color: #017439; /* Brand primary color for titles */
    text-align: center;
    margin-bottom: 40px;
    font-weight: bold;
}

/* Hero Section */
.page-news__hero-section {
    position: relative;
    width: 100%;
    height: 600px; /* Adjust height as needed */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    background-color: #017439; /* Fallback background */
}

.page-news__hero-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.page-news__hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5); /* Dark overlay for text readability */
    z-index: 2;
}

.page-news__hero-content {
    position: relative;
    z-index: 3;
    color: #ffffff;
    max-width: 800px;
    padding: 20px;
}

.page-news__hero-title {
    font-size: 3.5em;
    margin-bottom: 20px;
    color: #ffffff;
    font-weight: bold;
}

.page-news__hero-description {
    font-size: 1.2em;
    margin-bottom: 30px;
}

/* Button Styles */
.page-news__btn-primary,
.page-news__btn-secondary {
    display: inline-block;
    padding: 15px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease, color 0.3s ease;
    cursor: pointer;
    box-sizing: border-box; /* Ensure padding is included in width */
    max-width: 100%; /* Ensure responsiveness */
    white-space: normal; /* Allow text wrap */
    word-wrap: break-word; /* Allow text wrap */
}

.page-news__btn-primary {
    background-color: #C30808; /* Register/Login color */
    color: #FFFF00; /* Register/Login font color */
    border: 2px solid #C30808;
    margin-right: 15px;
}

.page-news__btn-primary:hover {
    background-color: #e02020;
    border-color: #e02020;
}

.page-news__btn-secondary {
    background-color: #017439; /* Brand primary color */
    color: #ffffff;
    border: 2px solid #017439;
}

.page-news__btn-secondary:hover {
    background-color: #005a2e;
    border-color: #005a2e;
}

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

.page-news__article-card {
    background-color: #ffffff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.page-news__article-card:hover {
    transform: translateY(-5px);
}

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

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

.page-news__article-title {
    font-size: 1.5em;
    margin-bottom: 10px;
    font-weight: bold;
}

.page-news__article-title a {
    color: #017439; /* Brand primary color for article titles */
    text-decoration: none;
    transition: color 0.3s ease;
}

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

.page-news__article-excerpt {
    font-size: 0.95em;
    color: #555555;
    margin-bottom: 15px;
    flex-grow: 1;
}

.page-news__read-more {
    display: inline-block;
    color: #017439;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
    margin-top: auto; /* Push to bottom */
}

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

/* Dark themed article card */
.page-news__article-card--dark {
    background-color: #017439;
    color: #ffffff;
}

.page-news__article-card--dark .page-news__article-title a {
    color: #ffffff;
}

.page-news__article-card--dark .page-news__article-title a:hover {
    color: #f0f0f0;
}

.page-news__article-card--dark .page-news__article-excerpt {
    color: #f0f0f0;
}

.page-news__read-more--dark {
    color: #FFFF00; /* Yellow for contrast on dark background */
}
.page-news__read-more--dark:hover {
    color: #fff;
}


/* Categories Section */
.page-news__category-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 60px;
}

.page-news__category-item a {
    display: block;
    background-color: #f0f0f0;
    color: #017439;
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.page-news__category-item a:hover {
    background-color: #017439;
    color: #ffffff;
}

/* Promotions Section */
.page-news__promotions {
    text-align: center;
    padding: 60px 20px;
}

.page-news__promotions-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.page-news__promotions-description {
    font-size: 1.1em;
    margin-bottom: 30px;
    max-width: 800px;
    color: #f0f0f0;
}

.page-news__promotions-image {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin-bottom: 30px;
    display: block; /* Ensure image behaves as a block element */
    width: 100%; /* Make image fill container */
}

/* FAQ Section */
.page-news__faq-section {
    padding: 60px 20px;
}

.page-news__faq-list {
    max-width: 900px;
    margin: 0 auto;
}

.page-news__faq-item {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
}

.page-news__faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    cursor: pointer;
    background-color: #f9f9f9;
    color: #017439;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.page-news__faq-question:hover {
    background-color: #f0f0f0;
}

.page-news__faq-heading {
    margin: 0;
    font-size: 1.2em;
    color: #017439;
}

.page-news__faq-toggle {
    font-size: 1.5em;
    font-weight: bold;
    transition: transform 0.3s ease;
}

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

.page-news__faq-answer {
    max-height: 0;
    overflow: hidden;
    padding: 0 20px;
    transition: max-height 0.3s ease, padding 0.3s ease;
    color: #333333;
}

.page-news__faq-item.active .page-news__faq-answer {
    max-height: 1000px !important; /* Sufficiently large value */
    padding: 15px 20px;
}

.page-news__faq-answer p {
    margin: 0;
}

/* CTA Section */
.page-news__cta-section {
    padding: 60px 20px;
    text-align: center;
}

.page-news__cta-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.page-news__cta-description {
    font-size: 1.1em;
    margin-bottom: 30px;
    max-width: 800px;
    color: #f0f0f0;
}

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

/* Color Contrast Safeguards */
.page-news__dark-section {
    background-color: #017439;
    color: #ffffff;
}

.page-news__dark-section .page-news__section-title,
.page-news__dark-section .page-news__hero-title,
.page-news__dark-section .page-news__hero-description {
    color: #ffffff;
}

.page-news__light-bg {
    background-color: #ffffff;
    color: #333333;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .page-news {
        font-size: 16px;
        line-height: 1.6;
    }

    .page-news__container {
        padding-left: 15px;
        padding-right: 15px;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .page-news__hero-section {
        height: 450px;
        padding-top: var(--header-offset, 120px) !important; /* Ensure mobile header offset */
    }

    .page-news__hero-title {
        font-size: 2.5em;
    }

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

    .page-news__btn-primary,
    .page-news__btn-secondary {
        padding: 12px 20px;
        font-size: 0.9em;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        white-space: normal !important;
        word-wrap: break-word !important;
        margin-right: 0; /* Remove margin for stacked buttons */
    }

    .page-news__cta-buttons {
        flex-direction: column;
        gap: 15px;
        width: 100%;
        max-width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px;
        padding-right: 15px;
    }

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

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

    .page-news__article-card {
        padding-bottom: 0; /* Adjust if needed */
    }

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

    .page-news__promotions-image {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        display: block !important;
    }

    /* Images within content sections */
    .page-news img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        display: block !important;
    }

    /* Containers for images and other content */
    .page-news__section,
    .page-news__card,
    .page-news__container,
    .page-news__articles-grid,
    .page-news__promotions-content,
    .page-news__cta-content {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px;
        padding-right: 15px;
        overflow: hidden !important; /* Prevent horizontal scroll */
    }

    .page-news__category-list {
        flex-direction: column;
        align-items: center;
    }
    .page-news__category-item a {
        width: 100%;
        text-align: center;
    }
}