/* style/news.css */
.page-news {
    color: #333333;
    font-family: Arial, sans-serif;
    line-height: 1.6;
}

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

/* Hero Section */
.page-news__hero-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 10px; /* Small top padding, relying on body padding-top from shared */
    background-color: #017439;
    color: #ffffff;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-news__hero-image-wrapper {
    width: 100%;
    max-height: 600px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.page-news__hero-image {
    width: 100%;
    height: auto;
    object-fit: cover; /* Desktop: cover to fill space */
    display: block;
}

.page-news__hero-content {
    padding: 40px 20px;
    max-width: 800px;
    z-index: 1;
}

.page-news__hero-title {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
    color: #ffffff;
}

.page-news__hero-description {
    font-size: 1.1rem;
    margin-bottom: 30px;
}

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

/* Buttons */
.page-news__btn-primary,
.page-news__btn-secondary {
    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;
    white-space: normal; /* Allow text wrapping */
    word-wrap: break-word; /* Allow text wrapping */
    box-sizing: border-box;
    max-width: 100%;
}

.page-news__btn-primary {
    background-color: #C30808; /* Register/Login 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: #ffffff;
    border: 2px solid #ffffff;
}

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

.page-news__read-more-btn {
    display: inline-block;
    margin-top: 15px;
    padding: 8px 15px;
    background-color: #017439;
    color: #ffffff;
    border-radius: 5px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
    white-space: normal;
    word-wrap: break-word;
    box-sizing: border-box;
    max-width: 100%;
}

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

/* Section Titles */
.page-news__section-title {
    font-size: 2.2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 40px;
    color: inherit; /* Inherit from parent section (dark/light) */
}

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

/* Latest News Section */
.page-news__latest-news-section,
.page-news__featured-articles,
.page-news__cta-section {
    background-color: #017439;
    color: #ffffff;
    padding: 60px 0;
}

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

.page-news__news-card,
.page-news__article-card {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.page-news__news-image-wrapper,
.page-news__article-image-wrapper {
    width: 100%;
    height: 225px; /* Fixed height for consistency */
    overflow: hidden;
}

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

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

.page-news__news-card-title,
.page-news__article-card-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #ffffff;
}

.page-news__news-card-title a,
.page-news__article-card-title a {
    color: #ffffff;
    text-decoration: none;
}

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

.page-news__news-meta,
.page-news__article-meta {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 15px;
}

.page-news__news-excerpt,
.page-news__article-excerpt {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
    flex-grow: 1;
    margin-bottom: 15px;
}

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

/* Categories Section */
.page-news__categories-section {
    background-color: #ffffff;
    color: #333333;
    padding: 60px 0;
}

.page-news__categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.page-news__category-card {
    background-color: #f8f8f8;
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: #333333;
    text-align: center;
    padding-bottom: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.page-news__category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.page-news__category-image {
    width: 100%;
    height: 150px; /* Fixed height for category images */
    object-fit: cover;
    margin-bottom: 15px;
}

.page-news__category-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #017439;
}

.page-news__category-text {
    font-size: 0.9rem;
    padding: 0 15px;
}

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

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

.page-news__faq-item {
    background-color: #ffffff;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.page-news__faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 25px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #017439;
    cursor: pointer;
    list-style: none;
    position: relative;
}

.page-news__faq-question::-webkit-details-marker {
    display: none;
}

.page-news__faq-item[open] .page-news__faq-question {
    background-color: #e0f0e0;
}

.page-news__faq-toggle {
    font-size: 1.5rem;
    line-height: 1;
    color: #017439;
    margin-left: 15px;
}

.page-news__faq-item[open] .page-news__faq-toggle {
    content: "−";
}

.page-news__faq-answer {
    padding: 0 25px 20px 25px;
    font-size: 1rem;
    color: #555555;
}

/* CTA Section */
.page-news__cta-section .page-news__section-title,
.page-news__cta-section .page-news__cta-description {
    color: #ffffff;
}

.page-news__cta-description {
    max-width: 700px;
    margin: 0 auto 30px auto;
    font-size: 1.1rem;
}

.page-news__cta-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

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

/* Media Queries */
@media (max-width: 1024px) {
    .page-news__container {
        padding: 20px 30px;
    }

    .page-news__hero-title {
        font-size: 3rem;
    }

    .page-news__news-grid,
    .page-news__article-grid,
    .page-news__categories-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }

    .page-news__section-title {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .page-news__container {
        padding: 15px;
    }

    /* Hero Section */
    .page-news__hero-section {
        padding-top: 10px !important; /* Small top padding for mobile */
    }

    .page-news__hero-image-wrapper {
        max-height: 400px;
    }

    .page-news__hero-image {
        object-fit: contain !important; /* Mobile: contain to prevent cropping */
        aspect-ratio: unset !important;
        max-height: none !important;
    }

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

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

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

    .page-news__hero-cta {
        flex-direction: column;
        gap: 10px;
    }

    /* Buttons */
    .page-news__btn-primary,
    .page-news__btn-secondary,
    .page-news__read-more-btn,
    .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 !important;
        padding-right: 15px !important;
        text-align: center;
    }

    .page-news__cta-buttons,
    .page-news__button-group,
    .page-news__btn-container {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
        flex-wrap: wrap !important;
        gap: 10px !important;
        flex-direction: column; /* Ensure vertical stacking for buttons */
    }

    /* Section Titles */
    .page-news__section-title {
        font-size: 1.8rem;
        margin-bottom: 30px;
    }

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

    /* News/Article Cards */
    .page-news__news-grid,
    .page-news__article-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .page-news__news-image-wrapper,
    .page-news__article-image-wrapper {
        height: 200px; /* Adjust height for smaller screens */
    }

    .page-news__news-card-title,
    .page-news__article-card-title {
        font-size: 1.1rem;
    }

    .page-news__news-excerpt,
    .page-news__article-excerpt {
        font-size: 0.9rem;
    }

    /* Categories Grid */
    .page-news__categories-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .page-news__category-image {
        height: 120px;
    }

    .page-news__category-title {
        font-size: 1.1rem;
    }

    .page-news__category-text {
        font-size: 0.85rem;
    }

    /* FAQ Section */
    .page-news__faq-question {
        padding: 15px 20px;
        font-size: 1rem;
    }

    .page-news__faq-answer {
        padding: 0 20px 15px 20px;
        font-size: 0.95rem;
    }

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

    .page-news__section,
    .page-news__card,
    .page-news__container,
    .page-news__hero-section,
    .page-news__latest-news-section,
    .page-news__categories-section,
    .page-news__featured-articles,
    .page-news__faq-section,
    .page-news__cta-section {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
        overflow-x: hidden;
    }

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