/* style/news.css */

/* Base styles for the news page */
.page-news {
    font-family: 'Arial', sans-serif;
    color: #333333; /* Default text color for light background */
    line-height: 1.6;
    background-color: var(--background-color, #FFFFFF); /* Inherit body background */
}

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

/* Hero Section */
.page-news__hero-section {
    position: relative;
    padding: 80px 0;
    text-align: center;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 500px;
    background-color: #017439; /* Brand color as background */
    color: #ffffff; /* White text for dark background */
}

.page-news__hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4); /* Dark overlay for text readability */
    z-index: 1;
}

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

.page-news__hero-container {
    position: relative;
    z-index: 2;
    max-width: 900px;
    padding: 20px;
}

.page-news__hero-title {
    font-size: 3.2em;
    margin-bottom: 20px;
    line-height: 1.2;
    color: #FFFF00; /* Custom color for important titles */
}

.page-news__hero-description {
    font-size: 1.2em;
    margin-bottom: 40px;
    color: #ffffff;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

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

/* Section Titles & Descriptions */
.page-news__section-title {
    font-size: 2.5em;
    color: #017439;
    text-align: center;
    margin-bottom: 20px;
    margin-top: 60px;
}

.page-news__section-description {
    font-size: 1.1em;
    color: #555555;
    text-align: center;
    max-width: 800px;
    margin: 0 auto 40px auto;
}

/* Buttons */
.page-news__btn-primary,
.page-news__btn-secondary {
    display: inline-block;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
    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; /* Custom color for register/login */
    color: #FFFF00; /* Custom font color for register/login */
    border: 2px solid #C30808;
}

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

.page-news__btn-secondary {
    background-color: transparent;
    color: #FFFF00; /* Custom font color for register/login */
    border: 2px solid #FFFF00;
}

.page-news__btn-secondary:hover {
    background-color: #FFFF00;
    color: #C30808;
}

/* News Grid */
.page-news__latest-news-section {
    padding: 60px 0;
    background-color: #f9f9f9; /* Light background for contrast */
}

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

.page-news__news-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, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

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

.page-news__card-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    min-width: 200px;
    min-height: 200px;
}

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

.page-news__card-title {
    font-size: 1.4em;
    margin-bottom: 15px;
    line-height: 1.3;
}

.page-news__card-title a {
    color: #017439;
    text-decoration: none;
    transition: color 0.3s ease;
}

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

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

.page-news__read-more-link {
    color: #017439;
    text-decoration: none;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color 0.3s ease;
}

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

.page-news__arrow {
    font-size: 1.2em;
    line-height: 1;
    transition: transform 0.3s ease;
}

.page-news__read-more-link:hover .page-news__arrow {
    transform: translateX(5px);
}

/* Featured Article Section */
.page-news__featured-article-section {
    padding: 80px 0;
    background-color: #017439; /* Dark background */
    color: #ffffff; /* White text */
}

.page-news__featured-article-section .page-news__section-title {
    color: #FFFF00; /* Yellow title for dark background */
}

.page-news__article-content {
    max-width: 900px;
    margin: 0 auto;
}

.page-news__article-image {
    width: 100%;
    height: auto;
    border-radius: 10px;
    margin-bottom: 40px;
    display: block;
    min-width: 200px;
    min-height: 200px;
}

.page-news__article-content p {
    margin-bottom: 20px;
    font-size: 1.05em;
    color: #f0f0f0;
}

.page-news__article-subtitle {
    font-size: 1.8em;
    margin-top: 40px;
    margin-bottom: 15px;
    color: #FFFF00; /* Yellow subtitle for dark background */
}

.page-news__article-cta {
    text-align: center;
    margin-top: 40px;
}

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

.page-news__faq-list {
    max-width: 800px;
    margin: 0 auto;
    border-top: 1px solid #e0e0e0;
}

.page-news__faq-item {
    border-bottom: 1px solid #e0e0e0;
}

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

.page-news__faq-question:hover {
    background-color: #e6ffe6; /* Light green hover */
}

.page-news__faq-toggle {
    font-size: 1.5em;
    line-height: 1;
    width: 30px;
    text-align: center;
    transition: transform 0.3s ease;
}

.page-news__faq-item.active .page-news__faq-toggle {
    transform: rotate(45deg); /* Plus sign becomes a cross (minus) */
}

.page-news__faq-answer {
    max-height: 0;
    overflow: hidden;
    padding: 0 15px; /* Initial padding for collapsed state */
    transition: max-height 0.3s ease, padding 0.3s ease;
    color: #555555;
    font-size: 1em;
}

.page-news__faq-item.active .page-news__faq-answer {
    max-height: 1000px !important; /* Sufficiently large to reveal content */
    padding: 15px 15px 20px 15px; /* Padding for expanded state */
}

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

/* CTA Banner Section */
.page-news__cta-banner-section {
    position: relative;
    padding: 80px 0;
    text-align: center;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 350px;
    background-color: #017439; /* Brand color as background */
    color: #ffffff; /* White text for dark background */
}

.page-news__cta-banner-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4); /* Dark overlay for text readability */
    z-index: 1;
}

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

.page-news__cta-title {
    position: relative;
    z-index: 2;
    font-size: 2.8em;
    margin-bottom: 20px;
    line-height: 1.2;
    color: #FFFF00;
}

.page-news__cta-description {
    position: relative;
    z-index: 2;
    font-size: 1.2em;
    margin-bottom: 40px;
    color: #ffffff;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .page-news__hero-title {
        font-size: 2.8em;
    }
    .page-news__section-title {
        font-size: 2em;
    }
    .page-news__news-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
    .page-news__cta-title {
        font-size: 2.2em;
    }
}

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

    .page-news__hero-section {
        padding: 60px 0;
        min-height: 400px;
    }
    .page-news__hero-title {
        font-size: 2.2em;
    }
    .page-news__hero-description {
        font-size: 1em;
    }
    .page-news__hero-cta-buttons {
        flex-direction: column;
        gap: 15px;
    }
    .page-news__btn-primary,
    .page-news__btn-secondary {
        width: 100% !important;
        max-width: 100% !important;
        padding: 12px 20px;
        font-size: 1em;
        white-space: normal !important;
        word-wrap: break-word !important;
    }

    .page-news__section-title {
        font-size: 1.8em;
        margin-top: 40px;
        margin-bottom: 15px;
    }
    .page-news__section-description {
        font-size: 0.95em;
        margin-bottom: 30px;
    }

    .page-news__latest-news-section,
    .page-news__featured-article-section,
    .page-news__faq-section,
    .page-news__cta-banner-section {
        padding: 40px 0;
    }

    .page-news__news-grid {
        grid-template-columns: 1fr; /* Single column layout */
        gap: 20px;
    }
    .page-news__card-image {
        height: 180px;
    }
    .page-news__card-content {
        padding: 20px;
    }
    .page-news__card-title {
        font-size: 1.2em;
    }
    .page-news__card-excerpt {
        font-size: 0.9em;
    }

    .page-news__article-image {
        margin-bottom: 30px;
    }
    .page-news__article-subtitle {
        font-size: 1.5em;
        margin-top: 30px;
    }
    .page-news__article-content p {
        font-size: 1em;
    }

    .page-news__faq-question {
        font-size: 1em;
        padding: 15px 0;
    }
    .page-news__faq-toggle {
        font-size: 1.2em;
        width: 25px;
    }
    .page-news__faq-answer {
        padding: 0 10px;
    }
    .page-news__faq-item.active .page-news__faq-answer {
        padding: 10px 10px 15px 10px;
    }

    .page-news__cta-banner-section {
        min-height: 300px;
        padding: 60px 0;
    }
    .page-news__cta-title {
        font-size: 1.8em;
    }
    .page-news__cta-description {
        font-size: 1em;
    }

    /* Mobile image responsiveness */
    .page-news img {
      max-width: 100% !important;
      height: auto !important;
      display: block !important;
    }
    
    .page-news__hero-section,
    .page-news__latest-news-section,
    .page-news__featured-article-section,
    .page-news__faq-section,
    .page-news__cta-banner-section,
    .page-news__news-card,
    .page-news__article-content,
    .page-news__hero-cta-buttons,
    .page-news__article-cta {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important; /* Prevent horizontal scroll */
    }
    .page-news__hero-section {
        padding-top: var(--header-offset, 120px) !important; /* Ensure header offset on mobile */
    }
    .page-news__hero-container,
    .page-news__container {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
}

/* Ensure no filter on images */
.page-news img {
    filter: none !important;
}

/* Specific color contrast for sections */
.page-news__dark-bg {
    background-color: #017439;
    color: #ffffff;
}

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