/* style/news.css */

/* --- General Styles for .page-news scope --- */
.page-news {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333333; /* Dark text for light body background */
    background-color: #ffffff; /* Default body background */
}

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

.page-news__section-title {
    font-size: 2.5em;
    color: #017439; /* Brand green for titles */
    text-align: center;
    margin-bottom: 20px;
    font-weight: bold;
}

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

.page-news__btn-primary {
    display: inline-block;
    background-color: #017439; /* Brand green */
    color: #ffffff; /* White text */
    padding: 15px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.3s ease;
    border: none;
    cursor: pointer;
    text-align: center;
}

.page-news__btn-primary:hover {
    background-color: #005a2e; /* Darker green on hover */
    transform: translateY(-2px);
}

/* --- Hero Section --- */
.page-news__hero-section {
    position: relative;
    width: 100%;
    height: 600px; /* Fixed height for desktop */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    padding-top: var(--header-offset, 120px); /* Fixed header spacing */
}

.page-news__hero-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.page-news__hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2;
}

.page-news__hero-content {
    position: relative;
    z-index: 3;
    color: #ffffff;
    max-width: 800px;
    padding: 20px;
}

.page-news__hero-title {
    font-size: 3.5em;
    margin-bottom: 20px;
    font-weight: bold;
    color: #ffffff;
}

.page-news__hero-description {
    font-size: 1.3em;
    margin-bottom: 30px;
    line-height: 1.5;
    color: #f0f0f0;
}

/* --- Latest Articles Section --- */
.page-news__latest-articles {
    padding: 80px 0;
    background-color: #f9f9f9;
}

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

.page-news__article-card {
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    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 6px 20px rgba(0, 0, 0, 0.15);
}

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

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

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

.page-news__article-title a {
    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: #777777;
    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: #017439;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
    margin-top: auto; /* Push to bottom */
}

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

/* --- Categories Section --- */
.page-news__categories {
    padding: 80px 0;
    background-color: #017439; /* Brand green background */
    color: #ffffff; /* White text */
}

.page-news__categories .page-news__section-title,
.page-news__categories .page-news__section-description {
    color: #ffffff; /* White text for titles/descriptions */
}

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

.page-news__category-card {
    background-color: rgba(255, 255, 255, 0.1); /* Semi-transparent white */
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    transition: background-color 0.3s ease, transform 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

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

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

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

.page-news__category-title a:hover {
    color: #f0f0f0;
}

.page-news__category-text {
    font-size: 1em;
    color: #f0f0f0;
}

/* --- Featured Video Section --- */
.page-news__featured-video {
    padding: 80px 0;
    background-color: #ffffff;
}

.page-news__video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    background: #000;
    border-radius: 10px;
    margin-bottom: 20px;
}

.page-news__video-link {
    display: block; /* Make the entire wrapper clickable */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10; /* Ensure link is above video controls */
}

.page-news__video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer; /* Indicate clickable video */
}

.page-news__video-caption {
    text-align: center;
    font-size: 0.95em;
    color: #666666;
}

/* --- In-depth Article Section --- */
.page-news__in-depth-article {
    padding: 80px 0;
    background-color: #f9f9f9;
}

.page-news__article-detail {
    max-width: 900px;
    margin: 0 auto;
}

.page-news__detail-image {
    width: 100%;
    height: auto;
    border-radius: 10px;
    margin-bottom: 30px;
    display: block;
}

.page-news__detail-intro,
.page-news__detail-text,
.page-news__detail-conclusion {
    font-size: 1.1em;
    line-height: 1.8;
    margin-bottom: 20px;
    color: #333333;
}

.page-news__detail-subtitle {
    font-size: 2em;
    color: #017439;
    margin-top: 40px;
    margin-bottom: 15px;
    font-weight: bold;
}

/* --- FAQ Section --- */
.page-news__faq-section {
    padding: 80px 0;
    background-color: #ffffff;
}

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

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

.page-news__faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    font-size: 1.2em;
    font-weight: bold;
    color: #333333;
    cursor: pointer;
    background-color: #e8e8e8;
    border-bottom: 1px solid #d0d0d0;
    transition: background-color 0.3s ease;
}

.page-news__faq-question:hover {
    background-color: #e0e0e0;
}

.page-news__faq-toggle {
    font-size: 1.5em;
    font-weight: bold;
    color: #017439;
    transition: transform 0.3s ease;
}

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

.page-news__faq-answer {
    max-height: 0;
    overflow: hidden;
    padding: 0 25px;
    transition: max-height 0.3s ease, padding 0.3s ease;
    background-color: #fdfdfd;
}

.page-news__faq-item.active .page-news__faq-answer {
    max-height: 1000px !important; /* Sufficiently large */
    padding: 20px 25px;
}

.page-news__faq-answer p {
    margin: 0;
    color: #555555;
    font-size: 1em;
    line-height: 1.6;
}

/* --- CTA Section --- */
.page-news__cta-section {
    padding: 60px 0;
    background-color: #017439; /* Brand green background */
    color: #ffffff;
    text-align: center;
}

.page-news__cta-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

.page-news__cta-text-content {
    flex: 1;
    min-width: 300px;
    text-align: left;
}

.page-news__cta-title {
    font-size: 2.8em;
    color: #ffffff;
    margin-bottom: 15px;
    font-weight: bold;
}

.page-news__cta-description {
    font-size: 1.1em;
    color: #f0f0f0;
    margin-bottom: 30px;
    line-height: 1.6;
}

.page-news__cta-image {
    width: 400px; /* Fixed width for desktop */
    height: auto;
    border-radius: 10px;
    flex-shrink: 0;
    display: block;
}

/* --- Responsive Adjustments --- */
@media (max-width: 1024px) {
    .page-news__hero-title {
        font-size: 3em;
    }
    .page-news__section-title {
        font-size: 2em;
    }
    .page-news__cta-title {
        font-size: 2.2em;
    }
    .page-news__cta-image {
        width: 300px;
    }
}

@media (max-width: 768px) {
    /* Mobile header spacing is handled by shared.css on body, or by the explicit padding-top on hero section */
    .page-news__hero-section {
        height: 450px; /* Adjust height for mobile */
        padding-top: var(--header-offset, 120px) !important; /* Ensure spacing on mobile */
    }
    .page-news__hero-title {
        font-size: 2.2em;
    }
    .page-news__hero-description {
        font-size: 1em;
    }

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

    .page-news__article-grid {
        grid-template-columns: 1fr; /* Single column on mobile */
    }

    .page-news__category-grid {
        grid-template-columns: 1fr; /* Single column on mobile */
    }

    .page-news__cta-flex {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .page-news__cta-text-content {
        text-align: center;
        width: 100%;
    }
    .page-news__cta-image {
        width: 100%; /* Full width on mobile */
        max-width: 300px; /* Max width for smaller screens */
        margin-top: 30px;
    }
    .page-news__cta-button {
        width: 100%; /* Full width button */
        max-width: 300px; /* Max width for smaller buttons */
    }

    /* --- Image, Video, Button Responsive Adaptations (CRITICAL) --- */
    .page-news img {
        max-width: 100% !important;
        height: auto !important;
        display: block !important;
    }

    .page-news video,
    .page-news__video {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        display: block !important;
    }

    .page-news__video-section,
    .page-news__video-container,
    .page-news__video-wrapper {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px;
        padding-right: 15px;
        overflow: hidden !important;
    }
    
    .page-news__section,
    .page-news__card,
    .page-news__container,
    .page-news__article-card,
    .page-news__category-card,
    .page-news__article-detail,
    .page-news__faq-section,
    .page-news__cta-section {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px;
        padding-right: 15px;
    }

    .page-news__cta-button,
    .page-news__btn-primary,
    .page-news__btn-secondary,
    .page-news a[class*="button"],
    .page-news a[class*="btn"] {
        max-width: 100% !important;
        width: 100% !important; /* Ensure full width for buttons */
        box-sizing: border-box !important;
        white-space: normal !important;
        word-wrap: break-word !important;
        margin: 10px 0; /* Add vertical margin for stacked buttons */
    }

    /* If multiple buttons were in a flex row, ensure they wrap or stack */
    .page-news__cta-buttons, /* if such a class exists */
    .page-news__button-group,
    .page-news__btn-container {
        display: flex !important;
        flex-direction: column !important; /* Stack buttons vertically */
        gap: 10px !important;
    }

    /* Ensure content area images are not smaller than 200px (this is a general rule, but important for mobile) */
    .page-news__latest-articles img,
    .page-news__in-depth-article img {
        min-width: 200px !important; /* Explicitly ensure min-width */
        min-height: 200px !important; /* Explicitly ensure min-height */
    }
}

@media (max-width: 480px) {
    .page-news__hero-section {
        height: 350px;
    }
    .page-news__hero-title {
        font-size: 1.8em;
    }
    .page-news__hero-description {
        font-size: 0.9em;
    }
    .page-news__section-title {
        font-size: 1.5em;
    }
    .page-news__cta-title {
        font-size: 1.8em;
    }
}

/* Ensure color contrast for dark background areas */
.page-news__dark-bg {
    background-color: #017439;
    color: #ffffff;
}

.page-news__dark-bg .page-news__section-title,
.page-news__dark-bg .page-news__section-description {
    color: #ffffff;
}

/* Ensure color contrast for light background areas */
.page-news__light-bg {
    background-color: #f9f9f9;
    color: #333333;
}

.page-news__light-bg .page-news__section-title {
    color: #017439;
}

/* Specific button colors from custom palette */
.page-news__register-button { /* Example if there was a register button with specific color */
    background-color: #C30808; /* Red for register */
    color: #FFFF00; /* Yellow text for register */
}

.page-news__login-button { /* Example if there was a login button with specific color */
    background-color: #C30808; /* Red for login */
    color: #FFFF00; /* Yellow text for login */
}

/* Ensure no filter is applied to images */
.page-news img {
    filter: none !important; /* Absolutely no filters */
}