/* 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: #ffffff; /* Explicitly set for clarity, assuming body is white */
}

/* Hero Section */
.page-news__hero-section {
    position: relative;
    width: 100%;
    padding-top: 10px; /* Small top padding, body handles header offset */
    margin-bottom: 40px;
    background-color: #f5f5f5;
}

.page-news__hero-image {
    width: 100%;
    overflow: hidden;
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
}

.page-news__hero-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Default cover */
    display: block;
}

.page-news__hero-content {
    max-width: 960px;
    margin: 0 auto;
    padding: 30px 20px 50px;
    text-align: center;
}

.page-news__main-title {
    font-size: clamp(28px, 4vw, 48px); /* Responsive font size */
    color: #017439;
    margin-bottom: 20px;
    line-height: 1.2;
    font-weight: 700;
}

.page-news__description {
    font-size: 18px;
    max-width: 800px;
    margin: 0 auto 30px;
    color: #555555;
}

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

/* General Section Styling */
.page-news__section {
    padding: 60px 20px;
    max-width: 1200px;
    margin: 0 auto;
    margin-bottom: 40px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.page-news__dark-section {
    background-color: #017439;
    color: #ffffff;
}

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

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

.page-news__section-title {
    font-size: clamp(24px, 3vw, 38px);
    color: #017439;
    text-align: center;
    margin-bottom: 20px;
    font-weight: 600;
}

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

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

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

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

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

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

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

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

.page-news__btn-login {
    background-color: #C30808; /* Custom login color */
    color: #FFFF00; /* Custom login font color */
    border-color: #C30808;
}

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

.page-news__btn-text {
    background: none;
    border: none;
    color: #017439;
    padding: 8px 15px;
    text-decoration: underline;
}

.page-news__dark-section .page-news__btn-text {
    color: #FFFF00;
}

.page-news__btn-text:hover {
    color: #005f2e;
}

.page-news__dark-section .page-news__btn-text:hover {
    color: #ffcc00;
}

/* Article Grid */
.page-news__articles-grid,
.page-news__promotions-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 40px;
}

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

.page-news__dark-section .page-news__article-card {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

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

.page-news__article-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

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

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

.page-news__article-title,
.page-news__promo-title {
    font-size: 20px;
    font-weight: 600;
    color: #017439;
    margin-bottom: 10px;
    line-height: 1.4;
}

.page-news__dark-section .page-news__article-title {
    color: #ffffff;
}

.page-news__article-meta,
.page-news__promo-meta {
    font-size: 14px;
    color: #888888;
    margin-bottom: 15px;
}

.page-news__dark-section .page-news__article-meta {
    color: #cccccc;
}

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

.page-news__dark-section .page-news__article-excerpt {
    color: #f0f0f0;
}

.page-news__view-all-button {
    text-align: center;
}

/* In-depth Analysis Section */
.page-news__content-wrapper {
    max-width: 960px;
    margin: 0 auto;
}

.page-news__article-body {
    font-size: 17px;
    line-height: 1.8;
    color: #333333;
}

.page-news__dark-section .page-news__article-body {
    color: #f0f0f0;
}

.page-news__article-body p {
    margin-bottom: 20px;
}

.page-news__article-body img.page-news__article-figure {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 30px auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* FAQ Section */
.page-news__faq-list {
    max-width: 960px;
    margin: 0 auto;
}

details.page-news__faq-item {
    margin-bottom: 15px;
    border-radius: 5px;
    border: 1px solid #e0e0e0;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
}
details.page-news__faq-item summary.page-news__faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    cursor: pointer;
    user-select: none;
    list-style: none;
    transition: background-color 0.3s ease;
}
details.page-news__faq-item summary.page-news__faq-question::-webkit-details-marker {
    display: none;
}
details.page-news__faq-item summary.page-news__faq-question:hover {
    background: #f5f5f5;
}
.page-news__faq-qtext {
    flex: 1;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.5;
    text-align: left;
    color: #017439;
}
.page-news__faq-toggle {
    font-size: 24px;
    font-weight: bold;
    color: #666;
    flex-shrink: 0;
    margin-left: 15px;
    width: 28px;
    text-align: center;
}
details.page-news__faq-item .page-news__faq-answer {
    padding: 0 20px 20px;
    background: #f9f9f9;
    border-radius: 0 0 5px 5px;
    color: #555555;
}
.page-news__faq-answer p {
    margin-bottom: 0;
}

/* CTA Section */
.page-news__cta-section {
    text-align: center;
    background-color: #017439;
    color: #ffffff;
    padding: 80px 20px;
    margin-bottom: 0; /* Last section */
    box-shadow: none;
}

.page-news__cta-section .page-news__section-title {
    color: #ffffff;
    margin-bottom: 25px;
}

.page-news__cta-section .page-news__section-description {
    color: #f0f0f0;
    margin-bottom: 40px;
}

/* --- Responsive Styles --- */

/* For smaller desktops and tablets (max-width: 1024px) */
@media (max-width: 1024px) {
    .page-news__articles-grid,
    .page-news__promotions-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }

    .page-news__hero-content {
        padding: 25px 20px 40px;
    }

    .page-news__section {
        padding: 50px 20px;
    }
}

/* For tablets and mobile devices (max-width: 849px) */
@media (max-width: 849px) {
    .page-news__hero-image img {
        object-fit: contain !important; /* Ensure image is fully visible */
        aspect-ratio: unset !important; /* Remove fixed aspect ratio if any */
        position: relative;
        height: auto;
        max-height: 400px; /* Limit height for contain mode */
    }
    .page-news__hero-image {
        padding-bottom: 0;
        height: auto;
    }
}

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

    .page-news__hero-section {
        padding-top: 10px;
        margin-bottom: 30px;
    }

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

    .page-news__main-title {
        font-size: clamp(24px, 7vw, 36px) !important;
        margin-bottom: 15px;
    }

    .page-news__description {
        font-size: 16px;
        margin-bottom: 20px;
    }

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

    .page-news__btn-primary,
    .page-news__btn-secondary,
    .page-news__btn-text {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        white-space: normal !important;
        word-wrap: break-word !important;
        padding: 12px 15px;
    }

    .page-news__section {
        padding: 40px 15px;
        margin-bottom: 30px;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .page-news__section-title {
        font-size: clamp(22px, 6vw, 30px) !important;
        margin-bottom: 15px;
    }

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

    .page-news__articles-grid,
    .page-news__promotions-grid {
        grid-template-columns: 1fr; /* Single column on mobile */
        gap: 20px;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding: 0;
    }

    .page-news__article-card,
    .page-news__promo-card {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .page-news__article-image,
    .page-news__promo-image {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        min-height: 180px;
        object-fit: cover;
    }

    .page-news__article-title,
    .page-news__promo-title {
        font-size: 18px;
    }

    .page-news__article-body {
        font-size: 16px;
    }

    .page-news__article-body p {
        margin-bottom: 15px;
    }

    .page-news__article-body img.page-news__article-figure {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        margin: 20px auto;
    }

    details.page-news__faq-item summary.page-news__faq-question {
        padding: 15px;
    }
    .page-news__faq-qtext {
        font-size: 16px;
    }
    details.page-news__faq-item .page-news__faq-answer {
        padding: 0 15px 15px;
    }

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

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

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