/* style/news.css */

/* --- General Styling & Reset (scoped to .page-news) --- */
.page-news {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333333; /* Default text color for light background */
    background-color: var(--page-bg); /* Use shared body background */
}

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

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

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

/* --- Buttons --- */
.page-news__btn-primary,
.page-news__btn-secondary {
    display: inline-block;
    padding: 12px 25px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1em;
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: center;
    max-width: 100%;
    box-sizing: border-box;
    white-space: normal; /* Allow text wrapping */
    word-wrap: break-word; /* Allow text wrapping */
}

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

.page-news__btn-primary:hover {
    background: #a30606;
    border-color: #a30606;
    transform: translateY(-2px);
}

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

.page-news__btn-secondary:hover {
    background: #017439;
    color: #FFFFFF;
    transform: translateY(-2px);
}

/* --- 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;
    padding-top: var(--header-offset, 120px); /* Fixed header offset */
}

.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.6); /* Dark overlay for text readability */
    z-index: 2;
}

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

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

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

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

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

.page-news__article-card {
    background: #ffffff;
    border-radius: 12px;
    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 25px rgba(0, 0, 0, 0.15);
}

.page-news__article-image {
    width: 100%;
    height: 250px;
    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: 1.6em;
    margin-bottom: 15px;
    font-weight: bold;
}

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

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

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

.page-news__read-more {
    display: inline-block;
    color: #017439;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.page-news__read-more:hover {
    color: #005f2e;
    text-decoration: underline;
}

/* --- Announcement List --- */
.page-news__announcement-list {
    margin-top: 40px;
    display: grid;
    gap: 20px;
}

.page-news__announcement-item {
    background: rgba(255, 255, 255, 0.1); /* Semi-transparent white on dark background */
    padding: 25px;
    border-radius: 12px;
    border-left: 5px solid #017439;
    color: #FFFFFF; /* Light text for dark background */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

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

.page-news__announcement-title a {
    color: #FFFF00; /* Custom font color for important links */
    text-decoration: none;
    transition: color 0.3s ease;
}

.page-news__announcement-title a:hover {
    color: #ffffff;
}

.page-news__announcement-date {
    display: block;
    font-size: 0.9em;
    color: #cccccc;
    margin-bottom: 15px;
}

.page-news__announcement-summary {
    font-size: 1em;
    color: #f0f0f0;
}

/* --- FAQ Section --- */
.page-news__faq-list {
    margin-top: 40px;
    display: grid;
    gap: 15px;
}

.page-news__faq-item {
    background: rgba(255, 255, 255, 0.1); /* Semi-transparent white on dark background */
    border-radius: 12px;
    overflow: hidden;
    color: #FFFFFF; /* Light text for dark background */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.page-news__faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.05);
    transition: background 0.3s ease;
}

.page-news__faq-question:hover {
    background: rgba(255, 255, 255, 0.1);
}

.page-news__faq-heading {
    font-size: 1.3em;
    margin: 0;
    font-weight: bold;
    color: #FFFF00; /* Custom font color for important links */
}

.page-news__faq-toggle {
    font-size: 1.8em;
    font-weight: bold;
    line-height: 1;
    transition: transform 0.3s ease;
    color: #FFFF00; /* Custom font color for important links */
}

.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: #f0f0f0;
}

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

.page-news__faq-answer p {
    margin: 0;
    padding-bottom: 10px; /* Add some spacing at the end of the answer */
    color: #f0f0f0;
}

/* --- CTA Section --- */
.page-news__cta-section {
    text-align: center;
    padding: 60px 20px;
    background: #017439; /* Use primary brand color for CTA background */
    color: #FFFFFF; /* White text on dark background */
}

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

.page-news__cta-description {
    font-size: 1.2em;
    max-width: 800px;
    margin: 0 auto 40px auto;
    color: #f0f0f0;
}

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

/* --- Background Colors for Sections (Smart Contrast) --- */
.page-news__dark-bg {
    background: #017439; /* Primary brand color */
    color: #ffffff; /* Light text for dark background */
}

.page-news__light-bg {
    background: #ffffff; /* Auxiliary brand color / default white */
    color: #333333; /* Dark text for light background */
}

/* --- Responsive Design --- */
@media (max-width: 1024px) {
    .page-news__hero-title {
        font-size: 3em;
    }
    .page-news__hero-description {
        font-size: 1.2em;
    }
    .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;
    }

    .page-news__container {
        padding-left: 15px;
        padding-right: 15px;
    }

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

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

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

    .page-news__hero-buttons {
        flex-direction: column;
        gap: 15px;
    }

    .page-news__btn-primary,
    .page-news__btn-secondary {
        width: 100% !important;
        max-width: 100% !important;
        padding: 12px 15px; /* Adjust padding for full width buttons */
        box-sizing: border-box !important;
    }

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

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

    .page-news__article-card {
        padding-bottom: 0; /* Remove extra padding if any */
    }

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

    .page-news__article-title {
        font-size: 1.4em;
    }
    .page-news__article-excerpt {
        font-size: 0.95em;
    }

    .page-news__announcement-item {
        padding: 20px;
    }
    .page-news__announcement-title {
        font-size: 1.3em;
    }

    .page-news__faq-question {
        padding: 15px 20px;
    }
    .page-news__faq-heading {
        font-size: 1.1em;
    }
    .page-news__faq-answer {
        padding: 0 20px;
    }
    .page-news__faq-item.active .page-news__faq-answer {
        padding: 15px 20px 20px 20px;
    }

    .page-news__cta-section {
        padding: 40px 15px;
    }
    .page-news__cta-title {
        font-size: 1.8em;
    }
    .page-news__cta-description {
        font-size: 1em;
        margin-bottom: 30px;
    }
    .page-news__cta-buttons {
        flex-direction: column;
        gap: 15px;
    }

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

    /* All containers containing images or buttons must be responsive */
    .page-news__section,
    .page-news__card,
    .page-news__container,
    .page-news__hero-section,
    .page-news__articles-grid,
    .page-news__announcement-list,
    .page-news__faq-list,
    .page-news__cta-buttons {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important; /* Prevent horizontal scroll */
    }

    /* Ensure padding for content within full-width containers */
    .page-news__featured-news .page-news__container,
    .page-news__announcements .page-news__container,
    .page-news__guides-strategies .page-news__container,
    .page-news__faq .page-news__container,
    .page-news__cta-section .page-news__container {
        padding-left: 15px;
        padding-right: 15px;
    }
}

@media (max-width: 480px) {
    .page-news__hero-section {
        height: 400px;
    }
    .page-news__hero-title {
        font-size: 1.8em;
    }
    .page-news__hero-description {
        font-size: 0.9em;
    }
    .page-news__section-title {
        font-size: 1.6em;
    }
    .page-news__cta-title {
        font-size: 1.6em;
    }
}