/* style/news.css */

:root {
    --primary-color: #017439;
    --secondary-color: #FFFFFF;
    --text-color-dark: #333333;
    --text-color-light: #ffffff;
    --button-register-bg: #C30808;
    --button-login-bg: #C30808;
    --button-text-color: #FFFF00;
    --background-color: #FFFFFF;
    --border-color: #e0e0e0;
}

.page-news {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color-dark);
    background-color: var(--background-color);
}

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

.page-news__section-title {
    font-size: 36px;
    font-weight: bold;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 20px;
    padding-top: 20px;
}

.page-news__section-title--white {
    color: var(--text-color-light);
}

.page-news__section-description {
    font-size: 18px;
    text-align: center;
    margin-bottom: 40px;
    color: var(--text-color-dark);
}

.page-news__section-description--white {
    color: rgba(255, 255, 255, 0.9);
}

/* 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 content is below fixed header */
    background: linear-gradient(135deg, var(--primary-color), #00A650);
    color: var(--text-color-light);
}

.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;
}

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

.page-news__hero-title {
    font-size: 48px;
    margin-bottom: 20px;
    color: var(--text-color-light);
    line-height: 1.2;
}

.page-news__hero-description {
    font-size: 20px;
    margin-bottom: 30px;
    color: rgba(255, 255, 255, 0.9);
}

.page-news__cta-button {
    display: inline-block;
    padding: 15px 40px;
    text-decoration: none;
    border-radius: 5px;
    font-size: 18px;
    font-weight: bold;
    margin-top: 20px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.page-news__btn-primary {
    background: var(--primary-color);
    color: var(--text-color-light);
}

.page-news__btn-primary:hover {
    background: #005f2c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Latest Articles Section */
.page-news__latest-articles-section {
    padding: 60px 0;
    background-color: var(--background-color);
}

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

.page-news__article-card {
    background: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

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

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

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

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

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

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

.page-news__article-title a:hover {
    color: #005f2c;
}

.page-news__article-meta {
    font-size: 14px;
    color: #777;
    margin-bottom: 15px;
}

.page-news__article-summary {
    font-size: 16px;
    color: var(--text-color-dark);
    margin-bottom: 20px;
}

.page-news__read-more-button {
    display: inline-block;
    padding: 10px 20px;
    background: var(--primary-color);
    color: var(--text-color-light);
    text-decoration: none;
    border-radius: 5px;
    font-size: 15px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.page-news__read-more-button:hover {
    background: #005f2c;
}

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

.page-news__pagination-link {
    display: block;
    padding: 12px 18px;
    border: 1px solid var(--primary-color);
    border-radius: 5px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
}

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

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

/* Categories Section */
.page-news__categories-section {
    padding: 60px 0;
    background: var(--primary-color);
    color: var(--text-color-light);
}

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

.page-news__category-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    text-decoration: none;
    color: var(--text-color-light);
    transition: background-color 0.3s ease, transform 0.3s ease;
}

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

.page-news__category-title {
    font-size: 24px;
    margin-bottom: 10px;
    color: var(--text-color-light);
}

.page-news__category-count {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.7);
}

/* CTA Bottom Section */
.page-news__cta-bottom-section {
    padding: 80px 0;
    background-color: var(--background-color);
}

.page-news__cta-bottom-content {
    text-align: center;
}

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

.page-news__btn-register {
    background: var(--button-register-bg);
    color: var(--button-text-color);
}

.page-news__btn-register:hover {
    background: #a30606;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.page-news__btn-login {
    background: var(--button-login-bg);
    color: var(--button-text-color);
}

.page-news__btn-login:hover {
    background: #a30606;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

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

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

/* FAQ容器样式 */
.page-news__faq-item {
  margin-bottom: 15px;
  border-radius: 5px;
  overflow: hidden;
}

/* 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.3s ease;
  padding: 0 15px;
  opacity: 0;
}

/* FAQ展开状态 - 🚨 使用!important和足够大的max-height确保一定能展开 */
.page-news__faq-item.active .page-news__faq-answer {
  max-height: 2000px !important; /* 🚨 使用!important确保优先级，值足够大以容纳任何内容 */
  padding: 20px 15px !important;
  opacity: 1;
  background: var(--secondary-color);
  border-radius: 0 0 5px 5px;
}

/* 问题样式 */
.page-news__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  background: var(--secondary-color);
  border: 1px solid var(--border-color);
  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;
}

/* 问题标题样式 */
.page-news__faq-question h3 {
  margin: 0;
  padding: 0;
  flex: 1;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text-color-dark);
  pointer-events: none; /* 防止h3标签阻止点击事件 */
}

/* 切换图标 */
.page-news__faq-toggle {
  font-size: 24px;
  font-weight: bold;
  line-height: 1;
  color: var(--primary-color);
  transition: transform 0.3s ease, color 0.3s ease;
  flex-shrink: 0;
  margin-left: 15px;
  pointer-events: none; /* 防止图标阻止点击事件 */
  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);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .page-news__hero-title {
        font-size: 40px;
    }
    .page-news__hero-description {
        font-size: 18px;
    }
    .page-news__section-title {
        font-size: 32px;
    }
    .page-news__article-title {
        font-size: 20px;
    }
}

@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-title {
        font-size: 32px;
    }
    .page-news__hero-description {
        font-size: 16px;
    }
    .page-news__cta-button {
        padding: 12px 30px;
        font-size: 16px;
    }
    .page-news__section-title {
        font-size: 28px;
        margin-bottom: 15px;
    }
    .page-news__section-description {
        font-size: 16px;
        margin-bottom: 30px;
    }
    .page-news__article-grid {
        grid-template-columns: 1fr;
    }
    .page-news__article-image-wrapper {
        height: 180px;
    }
    .page-news__article-title {
        font-size: 18px;
    }
    .page-news__article-summary {
        font-size: 15px;
    }
    .page-news__category-grid {
        grid-template-columns: 1fr;
    }
    .page-news__category-card {
        padding: 25px;
    }
    .page-news__category-title {
        font-size: 20px;
    }
    .page-news__cta-buttons {
        flex-direction: column;
        gap: 15px;
    }
    .page-news__cta-button, 
    .page-news__btn-primary, 
    .page-news__btn-register, 
    .page-news__btn-login {
        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 {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px;
        padding-right: 15px;
    }

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

    /* Ensure all images are responsive */
    .page-news img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !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;
    }
}