/* Basic Reset & Layout */
.page-news {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333333; /* Default text color for light background */
    background-color: #FFFFFF; /* Default body background */
}

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

.page-news__section {
    padding: 60px 0;
}

.page-news__section-title {
    font-size: 36px;
    font-weight: 700;
    color: #017439;
    text-align: center;
    margin-bottom: 20px;
    line-height: 1.2;
}

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

/* Hero Section */
.page-news__hero-section {
    background: linear-gradient(135deg, #017439, #005f2e);
    padding-top: 10px; /* Small top padding, body handles header offset */
    padding-bottom: 60px;
    color: #FFFFFF;
}

.page-news__hero-container {
    display: flex;
    align-items: center;
    gap: 40px;
}

.page-news__hero-content {
    flex: 1;
    text-align: left;
}

.page-news__hero-title {
    font-size: clamp(2.5rem, 4vw, 3.5rem); /* Responsive H1 font size */
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 20px;
    color: #FFFFFF;
}

.page-news__hero-description {
    font-size: 18px;
    margin-bottom: 30px;
    max-width: 600px;
}

.page-news__hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 400px; /* Ensure image has some width */
}

.page-news__hero-image img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    object-fit: cover; /* Default for desktop */
}

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

.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: #e01b1b;
    border-color: #e01b1b;
}

.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;
}

/* Latest Articles Section */
.page-news__latest-articles {
    background-color: #f9f9f9;
}

.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-color: #FFFFFF;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    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 6px 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 {
    width: 100%;
    height: 225px; /* 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: 20px;
    font-weight: 600;
    color: #017439;
    margin-top: 0;
    margin-bottom: 10px;
    line-height: 1.3;
}

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

.page-news__article-summary {
    font-size: 15px;
    color: #555555;
    flex-grow: 1;
}

.page-news__view-all-button-wrapper {
    text-align: center;
    margin-top: 50px;
}

/* Featured News Section */
.page-news__featured-news {
    background-color: #017439; /* Dark background from brand color */
    color: #FFFFFF; /* Light text for dark background */
}

.page-news__section-title--light {
    color: #FFFFFF;
}

.page-news__article-body {
    max-width: 900px;
    margin: 0 auto;
    font-size: 17px;
    line-height: 1.8;
}

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

.page-news__article-body h3 {
    font-size: 28px;
    font-weight: 700;
    margin-top: 40px;
    margin-bottom: 20px;
    color: #FFFF00; /* Custom color for headings in dark section */
}

.page-news__article-figure {
    width: 100%;
    height: auto;
    display: block;
    margin: 30px 0;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    max-width: 100%; /* Ensure responsiveness */
}

/* CTA Section */
.page-news__cta-container {
    text-align: center;
}

.page-news__cta-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
    width: 100%; /* Ensure container responsiveness */
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

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

details.page-news__faq-item {
    margin-bottom: 15px;
    border-radius: 5px;
    border: 1px solid #e0e0e0;
    overflow: hidden;
    background: #fff;
}
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: 16px;
    font-weight: 600;
    line-height: 1.5;
    text-align: left;
    color: #333333;
}
.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;
}

/* --- Responsive Design --- */
/* Tablet & Smaller Desktops (max-width: 1024px) */
@media (max-width: 1024px) {
    .page-news__hero-container {
        flex-direction: column;
        text-align: center;
    }

    .page-news__hero-content {
        text-align: center;
    }

    .page-news__hero-description {
        max-width: 100%;
    }

    .page-news__hero-image {
        min-width: unset;
        width: 100%;
    }

    .page-news__section-title {
        font-size: 32px;
    }

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

/* Mobile (max-width: 768px) */
@media (max-width: 768px) {
    /* General */
    .page-news__section {
        padding: 40px 0;
    }

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

    .page-news__section-title {
        font-size: 28px;
        margin-bottom: 15px;
    }

    .page-news__section-description {
        font-size: 16px;
        margin-bottom: 30px;
    }
    
    /* Hero Section */
    .page-news__hero-section {
        padding-top: 10px; /* Small top padding, body handles header offset */
        padding-bottom: 40px;
    }

    .page-news__hero-title {
        font-size: clamp(2rem, 8vw, 2.5rem); /* Smaller H1 for mobile */
        margin-bottom: 15px;
    }

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

    .page-news__hero-image img {
        object-fit: contain !important; /* Force contain for mobile */
        aspect-ratio: unset !important; /* Remove aspect ratio if any */
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
    }

    /* Buttons */
    .page-news__btn-primary,
    .page-news__btn-secondary,
    .page-news a[class*="button"],
    .page-news a[class*="btn"] {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        white-space: normal !important;
        word-wrap: break-word !important;
        padding-left: 15px; /* Add padding to buttons */
        padding-right: 15px;
        font-size: 16px;
    }
    
    .page-news__cta-buttons {
        flex-direction: column; /* Stack buttons vertically on mobile */
        gap: 15px;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding: 0 15px; /* Add padding to button container */
        overflow: hidden !important;
    }

    /* Latest Articles Grid */
    .page-news__articles-grid {
        grid-template-columns: 1fr; /* Single column on mobile */
        gap: 20px;
        margin-top: 30px;
        overflow-x: hidden !important; /* Prevent horizontal scroll */
    }

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

    .page-news__article-image {
        height: 180px; /* Adjust image height for mobile cards */
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
    }

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

    .page-news__article-summary {
        font-size: 14px;
    }
    
    .page-news__view-all-button-wrapper {
        margin-top: 40px;
    }

    /* Featured News */
    .page-news__article-body {
        font-size: 15px;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding: 0 15px; /* Add padding to article body */
    }

    .page-news__article-body h3 {
        font-size: 22px;
        margin-top: 30px;
        margin-bottom: 15px;
    }

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

    /* FAQ */
    details.page-news__faq-item summary.page-news__faq-question { padding: 15px; }
    .page-news__faq-qtext { font-size: 15px; }
    details.page-news__faq-item .page-news__faq-answer { padding: 0 15px 15px; }
    
    /* Ensure all images are responsive */
    .page-news img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
    }
}