/* style/news.css */

/* Variables from custom palette */
:root {
    --page-news-bg: #08160F; /* Background */
    --page-news-card-bg: #11271B; /* Card BG */
    --page-news-text-main: #F2FFF6; /* Text Main */
    --page-news-text-secondary: #A7D9B8; /* Text Secondary */
    --page-news-border: #2E7A4E; /* Border */
    --page-news-glow: #57E38D; /* Glow */
    --page-news-gold: #F2C14E; /* Gold */
    --page-news-divider: #1E3A2A; /* Divider */
    --page-news-deep-green: #0A4B2C; /* Deep Green */
    /* Button gradient */
    --page-news-btn-gradient: linear-gradient(180deg, #2AD16F 0%, #13994A 100%);
}

.page-news {
    background-color: var(--page-news-bg);
    color: var(--page-news-text-main); /* Light text on dark background */
    font-family: Arial, sans-serif;
    line-height: 1.6;
    font-size: 1rem;
}

/* Ensure content is not hidden by fixed header */
/* padding-top is handled by body in shared.css, so page sections use minimal top padding */
.page-news__hero-section,
.page-news__latest-articles,
.page-news__featured-news,
.page-news__faq-section,
.page-news__cta-section {
    padding: 40px 20px; /* Default padding for sections */
    position: relative;
    z-index: 1; /* Ensure content is above any potential background elements */
}

.page-news__hero-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-top: 10px; /* Small top padding, body handles --header-offset */
    padding-bottom: 60px;
}

.page-news__hero-image-wrapper {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
    margin-bottom: 30px;
}

.page-news__hero-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    object-fit: cover;
    min-width: 200px; /* Min size requirement */
    min-height: 200px; /* Min size requirement */
}

.page-news__hero-content {
    max-width: 900px;
    margin: 0 auto;
}

.page-news__main-title {
    color: var(--page-news-text-main);
    font-size: clamp(2.2rem, 4vw, 3rem); /* H1 font size with clamp */
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.page-news__description {
    color: var(--page-news-text-secondary);
    font-size: 1.1rem;
    margin-bottom: 30px;
}

.page-news__cta-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap; /* Allow buttons to wrap on smaller screens */
}

.page-news__btn-primary,
.page-news__btn-secondary,
.page-news__read-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 25px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
    max-width: 100%; /* Ensure button responsiveness */
    white-space: normal; /* Allow text to wrap */
    word-wrap: break-word; /* Allow text to wrap */
    text-align: center;
}

.page-news__btn-primary {
    background: var(--page-news-btn-gradient);
    color: #ffffff; /* White text on green gradient button */
    border: none;
    box-shadow: 0 4px 15px rgba(42, 209, 111, 0.4);
}

.page-news__btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(42, 209, 111, 0.6);
}

.page-news__btn-secondary {
    background: transparent;
    color: var(--page-news-glow); /* Light green text */
    border: 2px solid var(--page-news-glow);
}

.page-news__btn-secondary:hover {
    background: var(--page-news-glow);
    color: var(--page-news-bg); /* Dark text on light green hover */
    transform: translateY(-2px);
}

.page-news__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px; /* Add padding for mobile content */
    box-sizing: border-box;
}

.page-news__section-title {
    color: var(--page-news-gold); /* Gold color for section titles */
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    font-weight: 700;
    text-align: center;
    margin-bottom: 40px;
    position: relative;
    padding-bottom: 15px;
}

.page-news__section-title::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--page-news-glow);
    border-radius: 2px;
}

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

.page-news__article-card,
.page-news__featured-item {
    background-color: var(--page-news-card-bg); /* Darker green background for cards */
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%; /* Ensure cards have equal height in a row */
}

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

.page-news__article-image,
.page-news__featured-image {
    width: 100%;
    height: 220px; /* Fixed height for consistency */
    object-fit: cover;
    display: block;
    min-width: 200px; /* Min size requirement */
    min-height: 200px; /* Min size requirement */
}

.page-news__article-content,
.page-news__featured-content {
    padding: 20px;
    flex-grow: 1; /* Allow content to grow and push read-more to bottom */
    display: flex;
    flex-direction: column;
}

.page-news__article-title,
.page-news__featured-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.4;
}

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

.page-news__article-title a:hover,
.page-news__featured-title a:hover {
    color: var(--page-news-gold);
}

.page-news__article-meta,
.page-news__featured-meta {
    color: var(--page-news-text-secondary);
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.page-news__article-excerpt,
.page-news__featured-excerpt {
    color: var(--page-news-text-secondary);
    font-size: 1rem;
    margin-bottom: 20px;
    flex-grow: 1; /* Allow excerpt to take available space */
}

.page-news__read-more {
    color: var(--page-news-glow);
    text-decoration: none;
    font-weight: 600;
    align-self: flex-start; /* Align to the start of the flex container */
}

.page-news__read-more:hover {
    text-decoration: underline;
    color: var(--page-news-gold);
}

.page-news__view-all-button {
    text-align: center;
}

.page-news__faq-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.page-news__faq-item {
    background-color: var(--page-news-card-bg);
    border-radius: 8px;
    border: 1px solid var(--page-news-border);
    overflow: hidden;
    transition: all 0.3s ease;
}

.page-news__faq-item[open] {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
}

.page-news__faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 25px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--page-news-text-main);
    position: relative;
    list-style: none; /* For details/summary */
}

.page-news__faq-question::-webkit-details-marker {
    display: none;
}

.page-news__faq-qtext {
    flex-grow: 1;
}

.page-news__faq-toggle {
    font-size: 1.5rem;
    line-height: 1;
    margin-left: 15px;
    color: var(--page-news-glow);
}

.page-news__faq-answer {
    padding: 0 25px 20px;
    color: var(--page-news-text-secondary);
    font-size: 1rem;
    max-height: 0; /* For JS-controlled collapse */
    overflow: hidden; /* For JS-controlled collapse */
    transition: max-height 0.4s ease-out, padding 0.4s ease-out;
}

.page-news__faq-item[open] .page-news__faq-answer {
    max-height: 500px; /* Arbitrary large value for smooth expansion */
    padding: 0 25px 20px;
}
.page-news__faq-item.active .page-news__faq-answer {
    max-height: 500px; /* Arbitrary large value for smooth expansion */
    padding: 0 25px 20px;
}

.page-news__cta-section {
    text-align: center;
    background-color: var(--page-news-deep-green); /* Darker green for CTA background */
    border-radius: 12px;
    padding: 50px 20px;
    margin-top: 60px;
}

.page-news__cta-section .page-news__section-title {
    color: var(--page-news-gold);
    margin-bottom: 20px;
}

.page-news__cta-section .page-news__description {
    max-width: 800px;
    margin: 0 auto 30px;
    color: var(--page-news-text-secondary);
}

/* --- Responsive Design --- */
@media (max-width: 1024px) {
    .page-news__main-title {
        font-size: clamp(2rem, 5vw, 2.8rem);
    }
    .page-news__section-title {
        font-size: clamp(1.6rem, 4vw, 2.2rem);
    }
    .page-news__hero-image {
        height: 500px;
    }
    .page-news__article-image,
    .page-news__featured-image {
        height: 180px;
    }
}

@media (max-width: 768px) {
    .page-news__hero-section {
        padding: 40px 15px 50px;
        padding-top: 10px !important; /* body handles --header-offset, this is for visual separation */
    }
    .page-news__hero-image {
        height: 300px;
    }
    .page-news__cta-buttons {
        flex-direction: column;
        gap: 10px;
    }
    .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;
      box-sizing: border-box !important;
      white-space: normal !important;
      word-wrap: break-word !important;
      padding-left: 15px;
      padding-right: 15px;
    }
    .page-news__cta-buttons,
    .page-news__button-group,
    .page-news__btn-container {
      max-width: 100% !important;
      width: 100% !important;
      box-sizing: border-box !important;
      padding-left: 15px;
      padding-right: 15px;
      flex-wrap: wrap !important;
      gap: 10px;
    }

    .page-news__container {
        padding: 0 15px;
    }

    /* Mobile image responsiveness */
    .page-news img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        display: block !important;
        min-width: 200px !important;
        min-height: 200px !important;
    }
    
    .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;
    }
    
    .page-news__latest-articles,
    .page-news__featured-news,
    .page-news__faq-section,
    .page-news__cta-section {
        padding-left: 15px;
        padding-right: 15px;
    }

    .page-news__article-card,
    .page-news__featured-item {
        grid-template-columns: 1fr;
    }

    .page-news__article-image,
    .page-news__featured-image {
        height: auto;
        max-height: 250px;
    }

    .page-news p,
    .page-news li {
      font-size: 16px;
      line-height: 1.6;
    }
}

/* Content area images CSS size check (min 200px) */
.page-news__articles-grid img,
.page-news__featured-grid img {
    min-width: 200px;
    min-height: 200px;
}