/* style/news.css */

/* Base Styles for the page-news scope */
.page-news {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333333; /* Dark text for light body background */
    background-color: #ffffff; /* Explicitly set for consistency */
}

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

/* Color contrast enforcement */
.page-news__light-bg {
    background-color: #ffffff;
    color: #333333;
}

.page-news__dark-bg {
    background-color: #017439; /* Main brand color */
    color: #ffffff; /* White text for dark background */
}

/* Section titles and descriptions */
.page-news__section-title {
    font-size: 2.5em;
    color: #017439;
    text-align: center;
    margin-bottom: 20px;
    font-weight: bold;
}

.page-news__section-title--white {
    color: #ffffff;
}

.page-news__section-description {
    font-size: 1.1em;
    text-align: center;
    margin-bottom: 40px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.page-news__section-description--white {
    color: #f0f0f0;
}

/* Buttons */
.page-news__btn-primary,
.page-news__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;
    cursor: pointer;
    text-align: center;
    max-width: 100%; /* For mobile responsiveness */
    box-sizing: border-box; /* For mobile responsiveness */
    white-space: normal; /* Allow text wrapping */
    word-wrap: break-word; /* Allow text wrapping */
}

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

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

.page-news__btn-secondary {
    background-color: transparent;
    color: #017439;
    border: 2px solid #017439;
}

.page-news__btn-secondary:hover {
    background-color: #017439;
    color: #ffffff;
}

/* Hero Section */
.page-news__hero-section {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 600px;
    overflow: hidden;
    text-align: center;
    padding-top: var(--header-offset, 120px); /* Adjust for fixed header, default 120px */
}

.page-news__hero-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    display: block; /* Ensure image is block for proper sizing */
}

.page-news__hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: 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: 900px;
}

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

.page-news__hero-description {
    font-size: 1.3em;
    margin-bottom: 30px;
    color: #f0f0f0;
}

.page-news__hero-button {
    margin: 0 10px;
}

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

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

.page-news__article-card {
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease;
    color: #333333; /* Ensure dark text on light card background */
}

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

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

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

.page-news__article-title {
    font-size: 1.5em;
    margin-bottom: 10px;
    color: #017439;
}

.page-news__article-title a {
    color: inherit;
    text-decoration: none;
}

.page-news__article-title a:hover {
    text-decoration: underline;
}

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

.page-news__read-more {
    font-size: 0.9em;
    padding: 8px 15px;
}

/* Categories Section */
.page-news__categories {
    padding: 60px 0;
    text-align: center;
}

.page-news__category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.page-news__category-card {
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    text-decoration: none;
    color: #333333;
    transition: transform 0.3s ease;
}

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

.page-news__category-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.page-news__category-title {
    font-size: 1.3em;
    padding: 15px;
    color: #017439;
    font-weight: bold;
}

/* All Articles List Section */
.page-news__all-articles {
    padding: 60px 0;
}

.page-news__article-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.page-news__list-item {
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    padding: 25px;
    transition: transform 0.2s ease;
    color: #333333;
}

.page-news__list-item:hover {
    transform: translateX(5px);
}

.page-news__list-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.9em;
    color: #777777;
    margin-bottom: 10px;
}

.page-news__list-category {
    font-weight: bold;
    color: #017439;
}

.page-news__list-title {
    font-size: 1.6em;
    margin-bottom: 10px;
    color: #017439;
}

.page-news__list-title a {
    color: inherit;
    text-decoration: none;
}

.page-news__list-title a:hover {
    text-decoration: underline;
}

.page-news__list-excerpt {
    color: #555555;
}

.page-news__pagination {
    display: flex;
    justify-content: center;
    margin-top: 40px;
    gap: 10px;
}

.page-news__pagination-link {
    display: inline-block;
    padding: 10px 15px;
    border: 1px solid #017439;
    border-radius: 5px;
    text-decoration: none;
    color: #017439;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.page-news__pagination-link:hover,
.page-news__pagination-link--active {
    background-color: #017439;
    color: #ffffff;
}

/* CTA Section */
.page-news__cta-section {
    position: relative;
    padding: 80px 0;
    text-align: center;
    overflow: hidden;
    background-color: #017439; /* Fallback background */
    color: #ffffff;
}

.page-news__cta-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    opacity: 0.3; /* Subtle overlay */
    display: block;
}

.page-news__cta-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.page-news__cta-title {
    font-size: 2.8em;
    margin-bottom: 20px;
    color: #ffffff;
}

.page-news__cta-description {
    font-size: 1.2em;
    margin-bottom: 40px;
    color: #f0f0f0;
}

.page-news__cta-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap; /* Allow wrapping on small screens */
}

.page-news__cta-button {
    min-width: 180px; /* Ensure buttons are not too small */
}

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

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

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

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

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

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

.page-news__faq-item.active .page-news__faq-toggle {
    transform: rotate(45deg); /* Plus to X */
}

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

/* IMPORTANT: This ensures the FAQ answer expands */
.page-news__faq-item.active .page-news__faq-answer {
    max-height: 1000px !important; /* Use !important to ensure it overrides */
    padding: 15px 25px;
}

/* Image responsiveness and size constraints */
.page-news img {
    max-width: 100%;
    height: auto;
    display: block; /* Prevents extra space below images */
}

/* Ensure no CSS filter is used on images */
.page-news img {
    filter: none; /* Explicitly reset any potential filter */
}

/* Media Queries for Responsiveness */
@media (max-width: 1024px) {
    .page-news__hero-title {
        font-size: 3em;
    }
    .page-news__hero-description {
        font-size: 1.1em;
    }
    .page-news__section-title {
        font-size: 2em;
    }
    .page-news__cta-title {
        font-size: 2.2em;
    }
}

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

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

    .page-news__hero-content {
        padding: 0 15px;
    }

    .page-news__hero-title {
        font-size: 2.2em;
        margin-bottom: 15px;
    }

    .page-news__hero-description {
        font-size: 1em;
        margin-bottom: 25px;
    }

    .page-news__hero-button {
        margin: 5px 0;
        width: 100%;
    }

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

    .page-news__article-grid,
    .page-news__category-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .page-news__article-card,
    .page-news__category-card,
    .page-news__list-item {
        margin: 0 15px; /* Add horizontal padding to cards/list items */
        box-sizing: border-box;
    }

    .page-news__article-list {
        padding: 0 15px; /* Add horizontal padding to the list container */
    }

    .page-news__list-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .page-news__list-title {
        font-size: 1.4em;
    }

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

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

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

    .page-news__cta-buttons {
        flex-direction: column; /* Stack buttons vertically */
        gap: 15px;
        padding: 0 15px;
    }

    .page-news__cta-button {
        width: 100% !important; /* Force full width for buttons */
        max-width: 100% !important;
        box-sizing: border-box !important;
        white-space: normal !important;
        word-wrap: break-word !important;
    }

    .page-news__faq-list {
        padding: 0 15px;
    }

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

    .page-news__faq-answer {
        padding: 0 20px;
    }
    .page-news__faq-item.active .page-news__faq-answer {
        padding: 15px 20px !important;
    }

    /* Mobile image responsiveness (mandatory) */
    .page-news img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        display: block !important;
    }
    
    .page-news__section,
    .page-news__card,
    .page-news__container {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Ensure content containers have proper padding and max-width */
    .page-news__container {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    .page-news__latest-articles .page-news__container,
    .page-news__categories .page-news__container,
    .page-news__all-articles .page-news__container,
    .page-news__cta-section .page-news__container,
    .page-news__faq-section .page-news__container {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    
    /* Video responsiveness (if any, though none explicitly in HTML yet) */
    .page-news video,
    .page-news__video {
      max-width: 100% !important;
      width: 100% !important;
      height: auto !important;
      display: block !important;
    }
    
    .page-news__video-section,
    .page-news__video-container,
    .page-news__video-wrapper {
      max-width: 100% !important;
      width: 100% !important;
      box-sizing: border-box !important;
      padding-left: 15px !important;
      padding-right: 15px !important;
      overflow: hidden !important;
    }
}