/* style/news.css */
:root {
    --primary-color: #017439;
    --secondary-color: #FFFFFF;
    --text-color-dark: #333333;
    --text-color-light: #ffffff;
    --button-register: #C30808;
    --button-login: #C30808;
    --button-text-color: #FFFF00;
    --border-color: #e0e0e0;
    --card-bg: #f9f9f9;
}

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

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

/* 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 space for fixed header */
    background-color: var(--primary-color);
    color: var(--text-color-light);
    overflow: hidden;
}

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

.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;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

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

.page-news__hero-title {
    font-size: 2.8em;
    margin-bottom: 20px;
    color: var(--text-color-light);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

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

.page-news__cta-button {
    display: inline-block;
    padding: 15px 40px;
    background: var(--button-register);
    color: var(--button-text-color);
    text-decoration: none;
    border-radius: 5px;
    font-size: 18px;
    font-weight: bold;
    margin-top: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border: none;
}

.page-news__cta-button:hover {
    background: #FF4500; /* A slightly different red for hover */
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

/* Section Titles & Intros */
.page-news__section-title {
    font-size: 2.2em;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 20px;
    padding-top: 40px;
}

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

/* Articles Grid */
.page-news__articles-section {
    padding: 60px 0;
    background-color: var(--secondary-color);
}

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

.page-news__article-card {
    background: var(--card-bg);
    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-image {
    width: 100%;
    height: 220px; /* Fixed height for image consistency */
    overflow: hidden;
}

.page-news__article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.page-news__article-card:hover .page-news__article-image img {
    transform: scale(1.05);
}

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

.page-news__article-title {
    font-size: 1.4em;
    margin-bottom: 10px;
    line-height: 1.4;
}

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

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

.page-news__article-summary {
    font-size: 0.95em;
    color: #555;
    margin-bottom: 15px;
    flex-grow: 1;
}

.page-news__article-date {
    font-size: 0.85em;
    color: #777;
    margin-bottom: 15px;
}

.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;
    margin-top: auto;
}

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

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

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

/* Pagination */
.page-news__pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 50px;
    gap: 10px;
}

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

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

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

.page-news__page-link--next {
    width: auto;
    padding: 0 15px;
}

/* CTA Section (Bottom) */
.page-news__cta-section {
    background-color: var(--primary-color);
    color: var(--text-color-light);
    padding: 80px 20px;
    text-align: center;
}

.page-news__cta-title {
    font-size: 2.5em;
    margin-bottom: 20px;
    color: var(--text-color-light);
}

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

.page-news__cta-button--secondary {
    background: var(--button-register);
    color: var(--button-text-color);
    border: none;
}

.page-news__cta-button--secondary:hover {
    background: #FF4500;
}

/* FAQ Section */
.page-news__faq-section {
    padding: 60px 0;
    background-color: var(--secondary-color);
}

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

/* FAQ item styles */
.page-news__faq-item {
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

/* FAQ default state - answer 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, opacity 0.4s ease;
    padding: 0 20px;
    opacity: 0;
    color: var(--text-color-dark);
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
}

/* FAQ expanded state - 🚨 Use!important and sufficiently large max-height */
.page-news__faq-item.active .page-news__faq-answer {
    max-height: 2000px !important; /* 🚨 Use!important ensure priority, value large enough */
    padding: 20px !important;
    opacity: 1;
    border-radius: 0 0 8px 8px;
}

/* Question style */
.page-news__faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    background: var(--text-color-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    position: relative;
}

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

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

.page-news__faq-item.active .page-news__faq-question {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-color: #d0d0d0;
}

/* Question title style */
.page-news__faq-question h3 {
    margin: 0;
    padding: 0;
    flex: 1;
    font-size: 1.15em;
    font-weight: 600;
    line-height: 1.5;
    color: var(--primary-color);
    pointer-events: none; /* Prevent h3 from blocking click events */
}

/* Toggle icon */
.page-news__faq-toggle {
    font-size: 28px;
    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; /* Prevent icon from blocking click events */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.page-news__faq-item.active .page-news__faq-toggle {
    color: var(--primary-color);
    transform: rotate(45deg);
}

/* Responsive Design */
@media (max-width: 992px) {
    .page-news__hero-title {
        font-size: 2.2em;
    }
    .page-news__section-title {
        font-size: 1.8em;
    }
    .page-news__cta-title {
        font-size: 2em;
    }
    .page-news__article-title {
        font-size: 1.2em;
    }
    .page-news__article-image {
        height: 180px;
    }
}

@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: 1.8em;
        margin-bottom: 15px;
    }
    .page-news__hero-description {
        font-size: 1em;
        margin-bottom: 20px;
    }
    .page-news__cta-button {
        padding: 12px 30px;
        font-size: 16px;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        white-space: normal !important;
        word-wrap: break-word !important;
    }
    .page-news__section-title {
        font-size: 1.6em;
        padding-top: 20px;
    }
    .page-news__section-intro {
        font-size: 0.95em;
        margin-bottom: 30px;
    }
    .page-news__articles-section, .page-news__cta-section, .page-news__faq-section {
        padding: 40px 0;
    }
    .page-news__container {
        padding: 0 15px;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    .page-news__articles-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .page-news__article-image {
        height: 160px;
    }
    .page-news__article-title {
        font-size: 1.1em;
    }
    .page-news__article-summary {
        font-size: 0.9em;
    }
    .page-news__cta-title {
        font-size: 1.8em;
    }
    .page-news__cta-description {
        font-size: 1em;
    }
    .page-news__faq-question {
        padding: 15px;
    }
    .page-news__faq-question h3 {
        font-size: 1em;
    }
    .page-news__faq-toggle {
        font-size: 24px;
        width: 28px;
        height: 28px;
    }
    .page-news__faq-item.active .page-news__faq-answer {
        padding: 15px !important;
    }
    .page-news img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
    }
    .page-news__pagination {
        flex-wrap: wrap;
        gap: 8px;
    }
    .page-news__page-link {
        width: 36px;
        height: 36px;
        font-size: 0.9em;
    }
}

@media (max-width: 480px) {
    .page-news__hero-title {
        font-size: 1.5em;
    }
    .page-news__cta-title {
        font-size: 1.5em;
    }
    .page-news__article-content {
        padding: 15px;
    }
    .page-news__article-title {
        font-size: 1em;
    }
    .page-news__article-summary {
        font-size: 0.85em;
    }
    .page-news__article-date {
        font-size: 0.8em;
    }
}