/* style/news.css */

/* Root variables for page-specific colors */
:root {
    --page-news-primary: #017439; /* Main brand green */
    --page-news-secondary: #FFFFFF; /* White, also body background */
    --page-news-text-dark: #333333;
    --page-news-text-light: #ffffff;
    --page-news-border-color: #e0e0e0;
    --page-news-bg-light: #f9f9f9;
    --page-news-button-register: #C30808; /* Register button color */
    --page-news-button-login: #C30808; /* Login button color */
    --page-news-button-font: #FFFF00; /* Font color for register/login buttons */
}

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

/* Fixed header offset - applied to the first main section */
.page-news__hero-section {
    padding-top: var(--header-offset, 120px); /* Ensures content is not hidden by fixed header */
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-bottom: 60px;
    background: linear-gradient(135deg, var(--page-news-primary), #004d26); /* Darker green gradient */
    color: var(--page-news-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;
    padding: 0 20px;
}

.page-news__hero-image {
    width: 100%;
    margin-bottom: 30px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

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

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

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

.page-news__hero-description {
    font-size: 1.2em;
    margin-bottom: 30px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    color: rgba(255, 255, 255, 0.9);
}

.page-news__cta-button {
    display: inline-block;
    padding: 15px 40px;
    background: var(--page-news-button-register); /* Specific color for register/login buttons */
    color: var(--page-news-button-font); /* Specific font color for register/login buttons */
    text-decoration: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: bold;
    margin-top: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
    border: none;
}

.page-news__cta-button:hover {
    background: #e02a2a; /* Slightly darker red on hover */
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* General Section Styles */
.page-news__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

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

/* Latest Articles Section */
.page-news__latest-articles {
    padding: 80px 0;
    background-color: var(--page-news-secondary); /* Light background */
}

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

.page-news__article-card {
    background: var(--page-news-text-light);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 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(-8px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.page-news__article-thumbnail {
    width: 100%;
    height: 220px; /* Fixed height for thumbnails */
    overflow: hidden;
}

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

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

.page-news__article-content {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.page-news__article-title {
    font-size: 1.4em;
    margin-top: 0;
    margin-bottom: 15px;
    font-weight: 600;
}

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

.page-news__article-title a:hover {
    color: #004d26; /* Darker green on hover */
    text-decoration: underline;
}

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

.page-news__read-more-btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--page-news-primary);
    color: var(--page-news-text-light);
    text-decoration: none;
    border-radius: 5px;
    font-size: 0.9em;
    font-weight: 500;
    transition: background-color 0.3s ease;
    align-self: flex-start;
}

.page-news__read-more-btn:hover {
    background: #004d26; /* Darker green on hover */
}

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

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

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

.page-news__pagination-link--active {
    background: var(--page-news-primary);
    color: var(--page-news-text-light);
    border-color: var(--page-news-primary);
    pointer-events: none; /* Disable click on active link */
}

/* Call to Action Section */
.page-news__cta-section {
    padding: 80px 0;
    background: linear-gradient(90deg, #004d26, var(--page-news-primary)); /* Dark green background */
    color: var(--page-news-text-light);
    text-align: center;
}

.page-news__cta-content {
    max-width: 900px;
}

.page-news__cta-title {
    font-size: 2.8em;
    margin-bottom: 25px;
    color: var(--page-news-text-light);
    font-weight: 700;
}

.page-news__cta-description {
    font-size: 1.1em;
    margin-bottom: 40px;
    color: rgba(255, 255, 255, 0.9);
}

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

.page-news__btn-primary,
.page-news__btn-secondary {
    display: inline-block;
    padding: 15px 35px;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    border: 2px solid transparent;
    max-width: 100%; /* Ensure responsiveness */
    box-sizing: border-box; /* Ensure padding is included in width */
    white-space: normal; /* Allow text to wrap */
    word-wrap: break-word; /* Allow long words to break */
}

.page-news__btn-primary {
    background: var(--page-news-button-register); /* Red for primary action */
    color: var(--page-news-button-font); /* Yellow for font */
    border-color: var(--page-news-button-register);
}

.page-news__btn-primary:hover {
    background: #e02a2a;
    border-color: #e02a2a;
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.page-news__btn-secondary {
    background: var(--page-news-text-light); /* White for secondary action */
    color: var(--page-news-primary); /* Green for font */
    border-color: var(--page-news-primary);
}

.page-news__btn-secondary:hover {
    background: var(--page-news-primary);
    color: var(--page-news-text-light);
    border-color: var(--page-news-primary);
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}


/* FAQ Section */
.page-news__faq-section {
    padding: 80px 0;
    background-color: var(--page-news-bg-light); /* Light grey background */
}

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

/* FAQ container style */
.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 25px;
    opacity: 0;
    color: #444;
    font-size: 0.95em;
}

/* FAQ expanded state - \u26a0\ufe0f Use!important and sufficiently large max-height */
.page-news__faq-item.active .page-news__faq-answer {
    max-height: 2000px !important; /* \u26a0\ufe0f Use!important to ensure priority, value large enough for any content */
    padding: 20px 25px !important;
    opacity: 1;
    background: var(--page-news-text-light); /* White background for answer */
    border-top: 1px solid var(--page-news-border-color);
    border-radius: 0 0 8px 8px;
}

/* Question style */
.page-news__faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: var(--page-news-text-light);
    border: 1px solid var(--page-news-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: var(--page-news-bg-light);
    border-color: #d0d0d0;
}

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

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

/* Toggle icon */
.page-news__faq-toggle {
    font-size: 28px;
    font-weight: bold;
    line-height: 1;
    color: var(--page-news-primary);
    transition: transform 0.3s ease, color 0.3s ease;
    flex-shrink: 0;
    margin-left: 15px;
    pointer-events: none; /* Prevent icon from blocking click event */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.page-news__faq-item.active .page-news__faq-toggle {
    color: #004d26; /* Darker green when active */
    transform: rotate(45deg); /* Rotate for 'x' effect, or change text to '−' via JS */
}

/* --- Responsive Design --- */
@media (max-width: 1024px) {
    .page-news__hero-title {
        font-size: 2.8em;
    }
    .page-news__section-title {
        font-size: 2em;
    }
    .page-news__cta-title {
        font-size: 2.4em;
    }
}

@media (max-width: 768px) {
    /* Mobile header offset and general padding */
    .page-news__hero-section {
        padding-top: var(--header-offset, 120px) !important; /* Ensure mobile header offset */
        padding-bottom: 40px;
        padding-left: 15px;
        padding-right: 15px;
    }

    .page-news__hero-title {
        font-size: 2em;
        margin-bottom: 15px;
    }

    .page-news__hero-description {
        font-size: 1em;
        margin-bottom: 20px;
    }

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

    .page-news__container {
        padding: 20px 15px;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

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

    .page-news__articles-grid {
        grid-template-columns: 1fr;
    }
    
    .page-news__article-thumbnail {
        height: 180px;
    }

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

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

    .page-news__article-summary {
        font-size: 0.9em;
        margin-bottom: 15px;
    }

    .page-news__read-more-btn {
        padding: 8px 15px;
        font-size: 0.85em;
    }

    .page-news__pagination {
        margin-top: 40px;
        gap: 8px;
    }

    .page-news__pagination-link {
        width: 36px;
        height: 36px;
        font-size: 0.9em;
    }

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

    .page-news__cta-title {
        font-size: 1.8em;
        margin-bottom: 20px;
    }

    .page-news__cta-description {
        font-size: 1em;
        margin-bottom: 30px;
    }

    .page-news__cta-buttons {
        flex-direction: column;
        gap: 15px;
        padding: 0 15px;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .page-news__btn-primary,
    .page-news__btn-secondary {
        width: 100% !important;
        max-width: 100% !important;
        padding: 12px 20px !important;
        font-size: 1em !important;
        box-sizing: border-box !important;
        white-space: normal !important;
        word-wrap: break-word !important;
    }

    /* FAQ Mobile Styles */
    .page-news__faq-section {
        padding: 50px 0;
    }

    .page-news__faq-question {
        padding: 15px 20px;
        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: 28px;
        height: 28px;
        font-size: 24px;
    }
    
    .page-news__faq-answer {
        padding: 0 20px;
    }
    
    .page-news__faq-item.active .page-news__faq-answer {
        padding: 15px 20px !important;
    }

    /* Ensure all images are responsive and do not overflow */
    .page-news img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        box-sizing: border-box !important;
    }
    
    .page-news__hero-image,
    .page-news__article-thumbnail,
    .page-news__container,
    .page-news__articles-grid,
    .page-news__article-card,
    .page-news__cta-section,
    .page-news__faq-section,
    .page-news__faq-item {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
}

@media (max-width: 480px) {
    .page-news__hero-title {
        font-size: 1.8em;
    }
    .page-news__section-title {
        font-size: 1.6em;
    }
    .page-news__cta-title {
        font-size: 1.6em;
    }
    .page-news__hero-image {
        border-radius: 8px;
    }
    .page-news__article-card {
        border-radius: 8px;
    }
    .page-news__article-thumbnail {
        height: 150px;
    }
}