/* style/news.css */

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

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

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

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

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

/* --- 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); /* Ensures content is not hidden by fixed header */
    background: linear-gradient(135deg, #017439, #FFFFFF); /* Green to white gradient */
    color: #ffffff; /* White text for dark gradient start */
}

.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; /* Ensure content is above potential background elements */
}

.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%;
    padding: 0 20px;
}

.page-news__hero-content h1 {
    font-size: 3.2em;
    margin-bottom: 20px;
    color: #FFFF00; /* Yellow for prominence */
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    line-height: 1.2;
}

.page-news__hero-content p {
    font-size: 1.3em;
    margin-bottom: 30px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    color: #f0f0f0;
}

.page-news__cta-button {
    display: inline-block;
    padding: 18px 45px;
    background: #C30808; /* Register/Login color */
    color: #FFFF00; /* Register/Login font color */
    text-decoration: none;
    border-radius: 8px;
    font-size: 1.2em;
    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: #e01010;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* --- Latest Articles Section --- */
.page-news__latest-articles {
    background-color: #FFFFFF; /* Light background */
    color: #333333;
}

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

.page-news__article-card {
    background: #f9f9f9;
    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;
    text-align: left;
}

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

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

.page-news__card-content {
    padding: 25px;
}

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

.page-news__article-title a {
    color: #017439; /* Brand color for link */
    text-decoration: none;
    transition: color 0.3s ease;
}

.page-news__article-title a:hover {
    color: #005f2e;
    text-decoration: underline;
}

.page-news__article-excerpt {
    font-size: 0.95em;
    color: #666666;
    margin-bottom: 15px;
    min-height: 70px; /* Ensure consistent height */
}

.page-news__article-date {
    font-size: 0.85em;
    color: #999999;
    display: block;
}

.page-news__view-more-container {
    margin-top: 50px;
}

/* --- Featured Section --- */
.page-news__featured-section {
    background-color: #017439; /* Dark brand color background */
    color: #FFFFFF;
}

.page-news__featured-section .page-news__section-title,
.page-news__featured-section .page-news__section-description {
    color: #FFFFFF;
}

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

.page-news__featured-card {
    background: rgba(255, 255, 255, 0.1); /* Semi-transparent white background */
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: left;
}

.page-news__featured-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.page-news__featured-card img {
    width: 100%;
    height: 300px; /* Larger fixed height for featured */
    object-fit: cover;
    display: block;
}

.page-news__featured-card .page-news__article-title a {
    color: #FFFF00; /* Yellow for featured titles */
}

.page-news__featured-card .page-news__article-title a:hover {
    color: #f0f000;
    text-decoration: underline;
}

.page-news__featured-card .page-news__article-excerpt {
    color: #e0e0e0;
}

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

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

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

.page-news__category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); /* Card min-width to ensure image fits 200px + padding */
    gap: 25px;
    margin-top: 40px;
}

.page-news__category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    border-radius: 10px;
    padding: 20px 15px;
    text-decoration: none;
    color: #333333;
    transition: transform 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.page-news__category-card:hover {
    transform: translateY(-5px);
    background-color: #e8e8e8;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.12);
}

.page-news__category-card img {
    width: 100%; /* Image takes full width of card content area */
    min-width: 200px; /* Ensure minimum width for image */
    height: 200px; /* Fixed height, ensures min 200px */
    object-fit: cover; /* Cover ensures no distortion */
    margin-bottom: 15px;
    border-radius: 8px; /* Slightly rounded corners for images */
}

.page-news__category-name {
    font-size: 1.1em;
    font-weight: 600;
    text-align: center;
}

/* --- Promotions News Section --- */
.page-news__promotions-news {
    background-color: #017439; /* Dark brand color background */
    color: #FFFFFF;
}

.page-news__promotions-news .page-news__section-title,
.page-news__promotions-news .page-news__section-description {
    color: #FFFFFF;
}

.page-news__promo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.page-news__promo-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: left;
}

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

.page-news__promo-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

.page-news__promo-card .page-news__article-title a {
    color: #FFFF00;
}

.page-news__promo-card .page-news__article-title a:hover {
    color: #f0f000;
    text-decoration: underline;
}

.page-news__promo-card .page-news__article-excerpt {
    color: #e0e0e0;
}

/* --- FAQ Section --- */
.page-news__faq-section {
    background-color: #FFFFFF;
    color: #333333;
}

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

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

/* FAQ默认状态 - 答案隐藏 */
.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; /* Adjusted padding for desktop */
  opacity: 0;
}

/* FAQ展开状态 - 🚨 使用!important和足够大的max-height确保一定能展开 */
.page-news__faq-item.active .page-news__faq-answer {
  max-height: 2000px !important; /* 🚨 Use !important and a large value */
  padding: 20px 20px !important; /* Adjusted padding for desktop */
  opacity: 1;
  background: #f9f9f9;
  border-radius: 0 0 5px 5px;
}

/* Question style */
.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 style */
.page-news__faq-question h3 {
  margin: 0;
  padding: 0;
  flex: 1;
  font-size: 1.15em;
  font-weight: 600;
  line-height: 1.5;
  pointer-events: none; /* Prevent h3 from blocking click event */
  color: #017439; /* Brand color for FAQ questions */
}

/* 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: #333;
  transform: rotate(45deg); /* Rotate for 'x' effect, or simply change content to '-' */
}

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

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

.page-news__cta-bottom .page-news__section-title,
.page-news__cta-bottom .page-news__section-description {
    color: #FFFFFF;
}

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

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

.page-news__btn-primary {
    background: #C30808; /* Register/Login color */
    color: #FFFF00; /* Register/Login font color */
}

.page-news__btn-primary:hover {
    background: #e01010;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.page-news__btn-secondary {
    background: #FFFFFF;
    color: #017439; /* Brand color for text */
    border: 2px solid #017439;
}

.page-news__btn-secondary:hover {
    background: #f0f0f0;
    color: #005f2e;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

/* --- Utility Classes --- */
.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;
}

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


/* --- Responsive Design --- */
@media (max-width: 1024px) {
    .page-news__hero-content h1 {
        font-size: 2.8em;
    }
    .page-news__hero-content p {
        font-size: 1.2em;
    }
    .page-news__section-title {
        font-size: 2em;
    }
    .page-news__article-card img {
        height: 200px;
    }
    .page-news__featured-card img {
        height: 250px;
    }
    .page-news__category-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    .page-news__promo-card img {
        height: 200px;
    }
}

@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-image {
        margin-bottom: 20px;
        border-radius: 8px;
    }
    .page-news__hero-content h1 {
        font-size: 2em;
        margin-bottom: 15px;
    }
    .page-news__hero-content p {
        font-size: 1em;
        margin-bottom: 20px;
    }
    .page-news__cta-button {
        padding: 12px 30px;
        font-size: 1em;
        width: 100%; /* Full width button */
        max-width: 300px; /* Max width for button */
        margin-left: auto;
        margin-right: auto;
    }

    .page-news__section {
        padding: 40px 0;
    }
    .page-news__section-title {
        font-size: 1.8em;
    }
    .page-news__section-description {
        font-size: 0.95em;
        margin-bottom: 30px;
    }

    .page-news__container {
        padding: 0 15px; /* Adjust container padding for mobile */
    }

    .page-news__articles-grid,
    .page-news__featured-grid,
    .page-news__promo-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .page-news__article-card img {
        
    }
    .page-news__article-title {
        font-size: 1.2em;
    }
    .page-news__article-excerpt {
        font-size: 0.9em;
        min-height: auto;
    }

    .page-news__featured-card img {
        height: 220px;
    }

    .page-news__category-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); /* Minimum card width is 200px on mobile */
        gap: 15px;
    }
    .page-news__category-card img {
        height: 200px; /* Maintain 200px height for images on mobile */
    }

    .page-news__promo-card img {
        
    }

    /* FAQ Mobile */
    .page-news__faq-question {
        padding: 15px;
        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: 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;
    }

    /* CTA Bottom Mobile */
    .page-news__cta-bottom {
        padding: 50px 0;
    }
    .page-news__cta-buttons {
        flex-direction: column;
        gap: 15px;
    }
    .page-news__btn-primary,
    .page-news__btn-secondary {
        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;
    }

    /* Universal image responsiveness for mobile */
    .page-news img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
    }
    .page-news__section,
    .page-news__card,
    .page-news__container,
    .page-news__articles-grid,
    .page-news__featured-grid,
    .page-news__category-grid,
    .page-news__promo-grid,
    .page-news__faq-list,
    .page-news__cta-buttons {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px;
        padding-right: 15px;
    }
    .page-news__hero-image {
        padding-left: 0;
        padding-right: 0;
    }
}