/* style/news.css */

/* Base styles for the news page content */
.page-news {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333333; /* Dark text for light background */
    background-color: var(--secondary-color, #FFFFFF); /* Body background is light */
    padding-top: var(--header-offset, 120px); /* Ensure content is not hidden by fixed header */
}

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

.page-news__section-title {
    font-size: 2.2em;
    color: var(--primary-color, #017439);
    text-align: center;
    margin-bottom: 40px;
    font-weight: bold;
}

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

/* Hero Banner Section */
.page-news__hero-banner {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    background-color: var(--primary-color, #017439); /* Dark background for contrast with text */
    padding: 60px 20px;
}

.page-news__hero-image {
    width: 100%;
    height: auto;
    max-width: 100%;
    display: block;
    border-radius: 8px;
    object-fit: cover;
    margin-top: 30px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.page-news__hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    color: #FFFFFF; /* White text for dark background */
}

.page-news__main-title {
    font-size: 3em;
    margin-bottom: 20px;
    line-height: 1.2;
    color: #FFFF00; /* Yellow for main title as per brand color */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.page-news__intro-text {
    font-size: 1.2em;
    margin-bottom: 30px;
    color: #FFFFFF;
}

.page-news__cta-button {
    display: inline-block;
    padding: 15px 40px;
    background: #C30808; /* Register/Login button color */
    color: #FFFFFF; /* Ensuring contrast, overriding #FFFF00 */
    text-decoration: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border: none;
    cursor: pointer;
}

.page-news__cta-button:hover {
    background: #a30707; /* Slightly darker red on hover */
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

/* Latest Articles Section */
.page-news__latest-articles {
    padding: 60px 0;
    background-color: var(--secondary-color, #FFFFFF);
}

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

.page-news__article-card {
    background: #ffffff;
    border-radius: 10px;
    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;
    color: #333333;
}

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

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

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

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

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

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

.page-news__article-meta {
    font-size: 0.9em;
    color: #666666;
    margin-bottom: 15px;
}

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

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

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

/* Categories Section */
.page-news__categories {
    padding: 60px 0;
    background-color: var(--primary-color, #017439); /* Dark background */
}

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

.page-news__category-item {
    display: inline-block;
    padding: 12px 25px;
    background: rgba(255, 255, 255, 0.2);
    color: #FFFFFF;
    text-decoration: none;
    border-radius: 25px;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.3s ease;
    white-space: nowrap; /* Prevent category names from breaking */
}

.page-news__category-item:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

/* Featured News Section */
.page-news__featured-news {
    padding: 60px 0;
    background-color: var(--secondary-color, #FFFFFF);
}

.page-news__featured-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
}

.page-news__featured-card {
    display: flex;
    background: #ffffff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    color: #333333;
}

.page-news__featured-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.page-news__featured-thumbnail {
    width: 50%;
    height: auto;
    object-fit: cover;
    display: block;
    min-width: 200px; /* Ensure minimum size */
}

.page-news__featured-content {
    padding: 30px;
    width: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.page-news__featured-title {
    font-size: 1.8em;
    margin-bottom: 15px;
    font-weight: bold;
}

.page-news__featured-title a {
    color: var(--primary-color, #017439);
    text-decoration: none;
    transition: color 0.3s ease;
}

.page-news__featured-title a:hover {
    color: #005a2e;
}

.page-news__featured-excerpt {
    font-size: 1.1em;
    color: #555555;
    margin-bottom: 20px;
}

/* FAQ Section */
.page-news__faq-section {
    padding: 60px 0;
    background-color: var(--primary-color, #017439); /* Dark background */
}

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

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

.page-news__faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s ease;
    padding: 0 15px;
    opacity: 0;
    color: #333333;
}

.page-news__faq-item.active .page-news__faq-answer {
    max-height: 2000px !important; /* Sufficiently large value */
    padding: 20px 15px !important;
    opacity: 1;
    background: #f9f9f9;
    border-radius: 0 0 5px 5px;
}

.page-news__faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    position: relative;
    color: var(--primary-color, #017439);
}

.page-news__faq-item.active .page-news__faq-question {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-color: var(--primary-color, #017439);
}

.page-news__faq-question:hover {
    background: #f5f5f5;
    border-color: #d0d0d0;
}

.page-news__faq-question:active {
    background: #eeeeee;
}

.page-news__faq-question h3 {
    margin: 0;
    padding: 0;
    flex: 1;
    font-size: 1.1em;
    font-weight: 600;
    line-height: 1.5;
    pointer-events: none;
    color: var(--primary-color, #017439);
}

.page-news__faq-toggle {
    font-size: 24px;
    font-weight: bold;
    line-height: 1;
    color: #666;
    transition: transform 0.3s ease, color 0.3s ease;
    flex-shrink: 0;
    margin-left: 15px;
    pointer-events: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

.page-news__faq-item.active .page-news__faq-toggle {
    color: var(--primary-color, #017439);
    transform: rotate(45deg); /* Rotate for 'x' effect */
}


/* CTA Banner Section */
.page-news__cta-banner {
    padding: 80px 0;
    background: linear-gradient(90deg, var(--primary-color, #017439) 0%, #005a2e 100%); /* Darker green for gradient */
    text-align: center;
    color: #FFFFFF;
}

.page-news__cta-container {
    max-width: 800px;
}

.page-news__cta-title {
    font-size: 2.5em;
    margin-bottom: 20px;
    color: #FFFF00; /* Yellow for CTA title */
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

.page-news__cta-description {
    font-size: 1.1em;
    margin-bottom: 40px;
}

.page-news__cta-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap; /* For mobile responsiveness */
}

.page-news__btn-primary,
.page-news__btn-secondary {
    display: inline-block;
    padding: 15px 40px;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border: none;
    cursor: pointer;
    max-width: 100%; /* Important for mobile buttons */
    box-sizing: border-box; /* Important for mobile buttons */
    white-space: normal; /* Allow text wrap */
    word-wrap: break-word; /* Allow text wrap */
}

.page-news__btn-primary {
    background: #C30808; /* Register/Login button color */
    color: #FFFFFF; /* Ensuring contrast, overriding #FFFF00 */
}

.page-news__btn-primary:hover {
    background: #a30707;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.page-news__btn-secondary {
    background: #FFFFFF;
    color: var(--primary-color, #017439);
    border: 2px solid #FFFFFF;
}

.page-news__btn-secondary:hover {
    background: #f0f0f0;
    color: var(--primary-color, #017439);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}


/* Responsive Design */
@media (max-width: 1024px) {
    .page-news__main-title {
        font-size: 2.5em;
    }

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

    .page-news__featured-card {
        flex-direction: column;
    }

    .page-news__featured-thumbnail,
    .page-news__featured-content {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .page-news {
        padding-top: var(--header-offset, 120px) !important; /* Mobile padding-top */
        font-size: 16px;
        line-height: 1.6;
    }

    .page-news__container {
        padding: 15px;
    }

    .page-news__hero-banner {
        padding: 40px 15px;
    }

    .page-news__main-title {
        font-size: 2em;
    }

    .page-news__intro-text {
        font-size: 1em;
    }

    .page-news__cta-button {
        padding: 12px 30px;
        font-size: 1em;
    }

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

    .page-news__article-grid {
        grid-template-columns: 1fr;
    }

    .page-news__article-thumbnail {
        height: 180px;
    }

    .page-news__article-title {
        font-size: 1.1em;
    }

    .page-news__card-content {
        padding: 15px;
    }

    .page-news__categories {
        padding: 40px 0;
    }

    .page-news__category-item {
        padding: 10px 20px;
        font-size: 0.9em;
    }

    .page-news__featured-news {
        padding: 40px 0;
    }

    .page-news__featured-content {
        padding: 20px;
    }

    .page-news__featured-title {
        font-size: 1.4em;
    }

    .page-news__featured-excerpt {
        font-size: 0.95em;
    }

    /* FAQ Mobile */
    .page-news__faq-question {
        padding: 15px;
        flex-wrap: wrap;
    }
    
    .page-news__faq-question h3 {
        font-size: 1em;
        margin-bottom: 0;
        width: calc(100% - 40px);
    }
    
    .page-news__faq-toggle {
        margin-left: 10px;
        width: 24px;
        height: 24px;
        font-size: 20px;
    }
    
    .page-news__faq-answer {
        padding: 0 15px;
    }
    
    .page-news__faq-item.active .page-news__faq-answer {
        padding: 15px !important;
    }

    /* CTA Banner Mobile */
    .page-news__cta-banner {
        padding: 50px 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;
    }

    .page-news__btn-primary,
    .page-news__btn-secondary {
        max-width: 100% !important;
        width: 100% !important;
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* Ensure all images are responsive in mobile */
    .page-news img {
        max-width: 100% !important;
        height: auto !important;
        width: 100% !important; /* Added for strict compliance */
    }
    
    .page-news__section,
    .page-news__card,
    .page-news__container {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px;
        padding-right: 15px;
    }
}