/* style/news.css */

/* Base styles for the news page, assuming body has a light background (default white) */
.page-news {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333333; /* Dark text for light background */
    background-color: #ffffff; /* Default background, though body is handled by shared */
}

/* Hero Section */
.page-news__hero-section {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column; /* Image on top, content below */
    align-items: center;
    text-align: center;
    padding: 60px 20px;
    padding-top: 10px; /* Small top padding, body handles --header-offset */
    background-color: #f8f8f8; /* Light background for the section */
}

.page-news__hero-image {
    width: 100%;
    max-width: 1920px; /* Max width for large screens */
    height: auto;
    display: block;
    object-fit: cover;
    margin-bottom: 30px; /* Space between image and content */
    border-radius: 8px;
    min-width: 200px; /* Enforce min size */
    min-height: 200px; /* Enforce min size */
}

.page-news__hero-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 15px;
}

.page-news__main-title {
    font-size: clamp(2.5rem, 4vw, 3.5rem); /* Responsive H1 font size */
    color: #017439; /* Brand color for main title */
    margin-bottom: 20px;
    font-weight: bold;
    line-height: 1.2;
}

.page-news__hero-description {
    font-size: 1.15rem;
    color: #555555;
    margin-bottom: 30px;
}

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

/* Buttons */
.page-news__btn-primary,
.page-news__btn-secondary {
    display: inline-block;
    padding: 14px 30px;
    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 long words to break */
    box-sizing: border-box;
    max-width: 100%; /* Ensure button doesn't overflow */
}

.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: #017439; /* Brand color */
    color: #ffffff;
    border: 2px solid #017439;
}

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

/* Latest News Section */
.page-news__latest-news-section {
    padding: 60px 20px;
    background-color: #ffffff;
}

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

.page-news__section-title {
    font-size: 2.2rem;
    color: #017439;
    text-align: center;
    margin-bottom: 20px;
    font-weight: bold;
}

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

.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: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.page-news__news-card:hover {
    transform: translateY(-5px);
}

.page-news__news-image {
    width: 100%;
    height: 200px; /* Fixed height for consistency */
    object-fit: cover;
    display: block;
    min-width: 200px; /* Enforce min size */
    min-height: 200px; /* Enforce min size */
}

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

.page-news__news-title {
    font-size: 1.3rem;
    margin-bottom: 10px;
    font-weight: bold;
    line-height: 1.3;
}

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

.page-news__news-title a:hover {
    color: #005a2d;
}

.page-news__news-meta {
    font-size: 0.9rem;
    color: #888888;
    margin-bottom: 15px;
}

.page-news__news-excerpt {
    font-size: 1rem;
    color: #666666;
    margin-bottom: 20px;
    flex-grow: 1; /* Push read more button to bottom */
}

.page-news__read-more-btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: transparent;
    color: #017439;
    border: 1px solid #017439;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    align-self: flex-start; /* Align to the start of the flex item */
}

.page-news__read-more-btn:hover {
    background-color: #017439;
    color: #ffffff;
}

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

/* CTA Section */
.page-news__cta-section {
    padding: 80px 20px;
    background-color: #017439; /* Brand primary color for dark section */
    color: #ffffff; /* White text for dark background */
    text-align: center;
}

.page-news__cta-title {
    font-size: 2.5rem;
    margin-bottom: 20px;
    font-weight: bold;
    color: #ffffff;
}

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

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

/* Responsive Design */
@media (max-width: 1024px) {
    .page-news__main-title {
        font-size: clamp(2rem, 5vw, 3rem);
    }
    .page-news__section-title {
        font-size: 2rem;
    }
    .page-news__cta-title {
        font-size: 2.2rem;
    }
}

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

    .page-news__hero-section {
        padding: 40px 15px;
        padding-top: 10px !important; /* Small top padding, body handles --header-offset */
    }
    
    .page-news__hero-image {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
    }

    .page-news__main-title {
        font-size: clamp(1.8rem, 6vw, 2.5rem);
    }

    .page-news__hero-description {
        font-size: 1rem;
    }

    .page-news__cta-group {
        flex-direction: column;
        gap: 15px;
        padding: 0 15px; /* Add horizontal padding for buttons */
    }
    .page-news__cta-group .page-news__btn-primary,
    .page-news__cta-group .page-news__btn-secondary {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 15px;
        padding-right: 15px;
    }

    .page-news__latest-news-section {
        padding: 40px 15px;
    }

    .page-news__container {
        padding: 0; /* Remove container padding as sections have it */
    }

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

    .page-news__news-grid {
        grid-template-columns: 1fr; /* Single column layout */
        gap: 20px;
    }

    .page-news__news-image {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        min-width: 200px !important;
        min-height: 200px !important;
    }
    
    /* Ensure all images are responsive */
    .page-news img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        display: block !important;
    }
    
    /* Image containers for responsiveness */
    .page-news__hero-section,
    .page-news__latest-news-section,
    .page-news__news-card,
    .page-news__cta-section,
    .page-news__container {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        /* Padding handled by specific sections */
    }
    
    /* Add horizontal padding to main content areas if not already covered */
    .page-news__latest-news-section,
    .page-news__cta-section {
        padding-left: 15px;
        padding-right: 15px;
    }


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

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

    .page-news__cta-title {
        font-size: 1.8rem;
    }

    .page-news__cta-description {
        font-size: 1rem;
    }

    .page-news__cta-buttons {
        flex-direction: column;
        gap: 15px;
        padding: 0 15px; /* Add horizontal padding for buttons */
    }
    .page-news__cta-buttons .page-news__btn-primary,
    .page-news__cta-buttons .page-news__btn-secondary {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 15px;
        padding-right: 15px;
    }
}

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