/* style/news.css */

/* Base styles for the news page */
.page-news {
    font-family: Arial, sans-serif;
    color: #333333; /* Default text color for light background */
    line-height: 1.6;
    background-color: #FFFFFF; /* Default body background */
}

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

.page-news__section {
    padding: 60px 0;
    text-align: center;
}

.page-news__section-title {
    font-size: 32px;
    color: #017439; /* Primary brand color for titles */
    margin-bottom: 40px;
    font-weight: bold;
}

/* 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 spacing below fixed header */
    background: linear-gradient(135deg, #e0ffe0, #ffffff); /* Light gradient to match green theme */
}

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

.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;
    min-width: 200px;
    min-height: 200px;
}

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

.page-news__hero-title {
    font-size: 42px;
    color: #017439;
    margin-bottom: 20px;
    line-height: 1.2;
}

.page-news__hero-description {
    font-size: 18px;
    color: #333333;
    margin-bottom: 30px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.page-news__cta-button {
    display: inline-block;
    padding: 15px 40px;
    background: #017439; /* Primary brand color */
    color: #ffffff;
    text-decoration: none;
    border-radius: 5px;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-sizing: border-box; /* Ensure padding doesn't cause overflow */
    white-space: normal;
    word-wrap: break-word;
}

.page-news__cta-button:hover {
    background: #005a2e; /* Darker shade for hover */
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Latest News Section */
.page-news__latest-news {
    background-color: #f9f9f9;
}

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

.page-news__news-card {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.page-news__news-card-image {
    width: 100%;
    height: 220px; /* Fixed height for consistency */
    object-fit: cover;
    display: block;
    min-width: 200px;
    min-height: 200px;
}

.page-news__news-card-content {
    padding: 25px;
}

.page-news__news-card-title {
    font-size: 22px;
    margin-bottom: 10px;
    line-height: 1.4;
}

.page-news__news-card-title a {
    color: #017439; /* Primary brand color */
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.page-news__news-card-title a:hover {
    color: #005a2e;
}

.page-news__news-card-excerpt {
    font-size: 15px;
    color: #555555;
    margin-bottom: 20px;
}

.page-news__read-more {
    display: inline-block;
    color: #017439;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

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

/* Categories Section */
.page-news__categories {
    background-color: #ffffff;
}

.page-news__category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    text-align: center;
}

.page-news__category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 25px;
    background: #f0fff0; /* Lighter shade of primary color */
    border-radius: 8px;
    text-decoration: none;
    color: #333333;
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.page-news__category-item:hover {
    background-color: #e0ffe0;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.page-news__category-icon {
    font-size: 40px;
    margin-bottom: 15px;
    line-height: 1;
}

.page-news__category-title {
    font-size: 18px;
    font-weight: bold;
    color: #017439;
    margin: 0;
}

/* In-depth Articles Section */
.page-news__in-depth-articles {
    background-color: #f9f9f9;
    text-align: left;
}

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

.page-news__article-content p {
    margin-bottom: 20px;
    font-size: 16px;
    color: #333333;
}

.page-news__article-subtitle {
    font-size: 28px;
    color: #017439;
    margin-top: 40px;
    margin-bottom: 20px;
    font-weight: bold;
}

.page-news__article-image {
    width: 100%;
    height: auto;
    max-width: 100%;
    border-radius: 8px;
    margin-bottom: 30px;
    object-fit: cover;
    min-width: 200px;
    min-height: 200px;
}

/* FAQ Section */
.page-news__faq {
    background-color: #ffffff;
}

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

/* FAQ container styles */
.page-news__faq-item {
    margin-bottom: 15px;
    border-radius: 5px;
    overflow: hidden;
}

/* 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 15px;
    opacity: 0;
}

/* FAQ expanded state - ⚠️ Using !important and sufficiently large max-height to ensure expansion */
.page-news__faq-item.active .page-news__faq-answer {
    max-height: 2000px !important; /* ⚠️ Use !important for priority, value large enough to contain any content */
    padding: 20px 15px !important;
    opacity: 1;
    background: #f9f9f9;
    border-radius: 0 0 5px 5px;
    color: #333333; /* Ensure text is readable */
}

/* Question styles */
.page-news__faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    background: #fff;
    border: 1px solid #e0e0e0;
    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: #f5f5f5;
    border-color: #d0d0d0;
}

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

/* Question title styles */
.page-news__faq-question h3 {
    margin: 0;
    padding: 0;
    flex: 1;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5;
    pointer-events: none; /* Prevent h3 tag from blocking click event */
    color: #333333; /* Ensure readability */
}

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

.page-news__faq-item.active .page-news__faq-toggle {
    color: #017439; /* Primary color when active */
    transform: rotate(45deg); /* Rotate for 'x' effect, or just change text to '-' */
}

/* Call to Action Bottom Section */
.page-news__cta-bottom {
    background-color: #017439; /* Primary brand color */
    color: #ffffff;
    padding: 80px 20px;
}

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

.page-news__cta-bottom .page-news__section-title {
    color: #ffffff;
    margin-bottom: 25px;
}

.page-news__cta-bottom p {
    font-size: 18px;
    margin-bottom: 40px;
}

.page-news__button-group {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap; /* Allow buttons to wrap on smaller screens */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.page-news__cta-button--download {
    background: #C30808; /* Custom color for download/register */
    color: #FFFF00; /* Custom font color */
    border: 2px solid #FFFF00;
}

.page-news__cta-button--download:hover {
    background: #a30606;
    color: #ffffff;
    border-color: #ffffff;
}

.page-news__cta-button--register {
    background: #C30808; /* Custom color for download/register */
    color: #FFFF00; /* Custom font color */
    border: 2px solid #FFFF00;
}

.page-news__cta-button--register:hover {
    background: #a30606;
    color: #ffffff;
    border-color: #ffffff;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .page-news__hero-title {
        font-size: 36px;
    }
    .page-news__hero-description {
        font-size: 16px;
    }
    .page-news__section-title {
        font-size: 28px;
    }
    .page-news__news-card-title {
        font-size: 20px;
    }
    .page-news__article-subtitle {
        font-size: 24px;
    }
}

@media (max-width: 768px) {
    .page-news__hero-section {
        padding-top: var(--header-offset, 120px) !important; /* Mobile specific padding top */
        padding-bottom: 40px;
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .page-news__hero-title {
        font-size: 30px;
    }
    .page-news__hero-description {
        font-size: 15px;
    }
    .page-news__cta-button {
        padding: 12px 30px;
        font-size: 16px;
    }

    .page-news__section {
        padding: 40px 0;
    }
    .page-news__section-title {
        font-size: 24px;
        margin-bottom: 30px;
    }

    .page-news__news-grid {
        grid-template-columns: 1fr; /* Stack cards vertically */
        gap: 20px;
    }
    .page-news__news-card-content {
        padding: 20px;
    }
    .page-news__news-card-title {
        font-size: 18px;
    }
    .page-news__news-card-excerpt {
        font-size: 14px;
    }

    .page-news__category-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 15px;
    }
    .page-news__category-item {
        padding: 20px 15px;
    }
    .page-news__category-icon {
        font-size: 32px;
        margin-bottom: 10px;
    }
    .page-news__category-title {
        font-size: 16px;
    }

    .page-news__article-subtitle {
        font-size: 22px;
        margin-top: 30px;
        margin-bottom: 15px;
    }
    .page-news__article-content p {
        font-size: 15px;
    }

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

    .page-news__cta-bottom {
        padding: 60px 15px;
    }
    .page-news__cta-bottom p {
        font-size: 16px;
    }

    .page-news__button-group {
        flex-direction: column; /* Stack buttons vertically on mobile */
        gap: 15px;
    }
    .page-news__cta-button,
    .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; /* Add padding to buttons themselves */
      padding-right: 15px;
    }
    
    .page-news__button-group,
    .page-news__container {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px;
        padding-right: 15px;
    }

    /* Enforce all images responsive on mobile */
    .page-news img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        min-width: unset; /* Allow images to shrink below 200px on mobile if needed, but still be content images */
        min-height: unset;
    }
    .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;
    }
}