/* style/news.css */

:root {
    --primary-color: #017439;
    --secondary-color: #FFFFFF;
    --text-dark: #333333;
    --text-light: #ffffff;
    --button-register: #C30808;
    --button-login: #C30808;
    --button-text-highlight: #FFFF00;
    --border-color: #e0e0e0;
}

.page-news {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark); /* Default text color for light body background */
    background-color: var(--secondary-color);
}

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

.page-news__section-title {
    font-size: 2.5em;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 20px;
    font-weight: bold;
}

.page-news__section-description {
    font-size: 1.1em;
    text-align: center;
    max-width: 800px;
    margin: 0 auto 40px auto;
    color: var(--text-dark);
}

/* Hero Section */
.page-news__hero-section {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    padding-top: var(--header-offset, 120px); /* Ensure header offset */
    background: linear-gradient(135deg, var(--primary-color) 0%, #015c2e 100%); /* Darker green gradient */
    color: var(--text-light);
}

.page-news__hero-container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.page-news__hero-image {
    width: 100%;
    margin-bottom: 30px;
}

.page-news__hero-image img {
    width: 100%;
    height: auto;
    max-width: 100%;
    display: block;
    border-radius: 8px;
    object-fit: cover;
}

.page-news__hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    width: 100%;
}

.page-news__hero-title {
    font-size: 3.5em;
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--text-light);
    font-weight: bold;
}

.page-news__hero-description {
    font-size: 1.3em;
    margin-bottom: 30px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    color: var(--text-light);
}

.page-news__cta-button {
    display: inline-block;
    padding: 15px 40px;
    background: var(--button-register); /* Using #C30808 for CTA */
    color: var(--button-text-highlight); /* Using #FFFF00 for text */
    text-decoration: none;
    border-radius: 5px;
    font-size: 1.2em;
    font-weight: bold;
    margin-top: 30px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.page-news__cta-button:hover {
    background: #e62e2e; /* Slightly darker red on hover */
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

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

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

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

.page-news__article-card img {
    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__card-title {
    font-size: 1.5em;
    margin-top: 0;
    margin-bottom: 10px;
    line-height: 1.3;
}

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

.page-news__card-title a:hover {
    color: #005527; /* Darker green on hover */
}

.page-news__card-excerpt {
    font-size: 1em;
    color: #666;
    margin-bottom: 15px;
    flex-grow: 1;
}

.page-news__read-more {
    display: inline-flex;
    align-items: center;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.page-news__read-more:hover {
    color: #005527;
}

.page-news__arrow {
    margin-left: 8px;
    transition: transform 0.3s ease;
}

.page-news__read-more:hover .page-news__arrow {
    transform: translateX(5px);
}

/* Categories Section */
.page-news__categories {
    padding: 80px 0;
    background-color: var(--primary-color);
    color: var(--text-light);
}

.page-news__categories .page-news__section-title {
    color: var(--text-light);
}

.page-news__categories .page-news__section-description {
    color: var(--text-light);
}

.page-news__category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.page-news__category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 20px 10px;
    text-decoration: none;
    color: var(--text-light);
    transition: background-color 0.3s ease, transform 0.3s ease;
}

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

.page-news__category-item img {
    
    
    object-fit: contain;
    margin-bottom: 15px;
    filter: invert(1); /* Invert for dark background to make icons white */
    transition: filter 0.3s ease;
}

.page-news__category-item:hover img {
    filter: invert(0.8);
}

.page-news__category-title {
    font-size: 1.2em;
    margin: 0;
    font-weight: bold;
    color: var(--text-light);
}

/* All News Section */
.page-news__all-news {
    padding: 80px 0;
    background-color: var(--secondary-color);
}

.page-news__news-list {
    margin-top: 40px;
}

.page-news__list-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
}

.page-news__list-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.page-news__list-item img {
    width: 250px;
    
    object-fit: cover;
    border-radius: 8px;
    margin-right: 25px;
    flex-shrink: 0;
}

.page-news__list-content {
    flex-grow: 1;
}

.page-news__list-title {
    font-size: 1.6em;
    margin-top: 0;
    margin-bottom: 8px;
    line-height: 1.3;
}

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

.page-news__list-title a:hover {
    color: #005527;
}

.page-news__list-date {
    font-size: 0.9em;
    color: #888;
    margin-bottom: 10px;
}

.page-news__list-excerpt {
    font-size: 1em;
    color: #666;
    margin-bottom: 15px;
}

.page-news__pagination {
    display: flex;
    justify-content: center;
    margin-top: 50px;
    gap: 10px;
}

.page-news__pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 5px;
    background-color: #f0f0f0;
    color: var(--text-dark);
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.page-news__pagination-link:hover:not(.page-news__pagination-link--disabled):not(.page-news__pagination-link--active) {
    background-color: var(--primary-color);
    color: var(--text-light);
}

.page-news__pagination-link--active {
    background-color: var(--primary-color);
    color: var(--text-light);
}

.page-news__pagination-link--disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* FAQ Section */
.page-news__faq-section {
    padding: 80px 0;
    background-color: var(--primary-color);
    color: var(--text-light);
}

.page-news__faq-section .page-news__section-title {
    color: var(--text-light);
}

.page-news__faq-section .page-news__section-description {
    color: var(--text-light);
}

.page-news__faq-list {
    margin-top: 40px;
}

.page-news__faq-item {
    margin-bottom: 15px;
    border-radius: 5px;
    overflow: hidden;
}

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

.page-news__faq-item.active .page-news__faq-answer {
    max-height: 2000px !important;
    padding: 20px 15px !important;
    opacity: 1;
    background: rgba(255, 255, 255, 0.95); /* Slightly transparent white for contrast */
    color: var(--text-dark);
    border-radius: 0 0 5px 5px;
}

.page-news__faq-answer p {
    margin: 0;
}

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

.page-news__faq-question:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

.page-news__faq-question:active {
    background: rgba(255, 255, 255, 0.35);
}

.page-news__faq-question h3 {
    margin: 0;
    padding: 0;
    flex: 1;
    font-size: 1.2em;
    font-weight: 600;
    line-height: 1.5;
    color: var(--text-light);
    pointer-events: none;
}

.page-news__faq-toggle {
    font-size: 24px;
    font-weight: bold;
    line-height: 1;
    color: var(--text-light);
    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(--text-light);
    transform: rotate(45deg); /* Rotate to form 'X' or '−' */
}

/* Final CTA Section */
.page-news__cta-section {
    padding: 80px 0;
    background-color: var(--secondary-color);
}

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

.page-news__cta-content .page-news__section-title {
    color: var(--primary-color);
}

.page-news__cta-content .page-news__section-description {
    color: var(--text-dark);
    margin-bottom: 30px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .page-news__hero-title {
        font-size: 3em;
    }
    .page-news__hero-description {
        font-size: 1.2em;
    }
    .page-news__section-title {
        font-size: 2em;
    }
    .page-news__article-card img {
        
    }
    .page-news__list-item img {
        width: 200px;
        
    }
}

@media (max-width: 768px) {
    .page-news__hero-section {
        padding-top: var(--header-offset, 120px) !important;
        padding-bottom: 40px;
        padding-left: 15px;
        padding-right: 15px;
    }
    .page-news__hero-title {
        font-size: 2.5em;
    }
    .page-news__hero-description {
        font-size: 1em;
    }
    .page-news__cta-button {
        padding: 12px 30px;
        font-size: 1.1em;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        white-space: normal !important;
        word-wrap: break-word !important;
    }
    .page-news__articles-grid {
        grid-template-columns: 1fr;
    }
    .page-news__section-title {
        font-size: 1.8em;
    }
    .page-news__section-description {
        font-size: 1em;
        margin-bottom: 30px;
    }
    .page-news__category-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 15px;
    }
    .page-news__category-item {
        padding: 15px 5px;
    }
    .page-news__category-item img {
        
        
    }
    .page-news__category-title {
        font-size: 1em;
    }
    .page-news__list-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .page-news__list-item img {
        width: 100% !important;
        height: auto !important;
        max-width: 100% !important;
        margin-right: 0;
        margin-bottom: 20px;
    }
    .page-news__list-title {
        font-size: 1.3em;
    }
    .page-news__list-date, .page-news__list-excerpt {
        font-size: 0.95em;
    }

    /* Mobile image 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__articles-grid,
    .page-news__category-grid,
    .page-news__news-list,
    .page-news__faq-list {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px;
        padding-right: 15px;
    }

    .page-news__faq-question {
        padding: 15px;
        flex-wrap: wrap;
    }
    .page-news__faq-question h3 {
        font-size: 1.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;
    }
}

@media (max-width: 480px) {
    .page-news__hero-title {
        font-size: 2em;
    }
    .page-news__hero-description {
        font-size: 0.9em;
    }
    .page-news__cta-button {
        font-size: 1em;
    }
    .page-news__section-title {
        font-size: 1.6em;
    }
    .page-news__card-title {
        font-size: 1.3em;
    }
    .page-news__list-title {
        font-size: 1.1em;
    }
    .page-news__category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}