/* style/news.css */
:root {
    --primary-color: #26A9E0;
    --secondary-color: #FFFFFF;
    --text-color-dark: #333333;
    --text-color-light: #ffffff;
    --bg-light: #f9f9f9;
    --bg-dark: #26A9E0;
    --login-button-color: #EA7C07;
}

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

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

/* 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, var(--primary-color), var(--secondary-color));
    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;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

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

.page-news__hero-content h1 {
    font-size: 48px;
    font-weight: bold;
    margin-bottom: 20px;
    color: var(--text-color-light);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.page-news__hero-description {
    font-size: 20px;
    margin-bottom: 30px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    color: var(--text-color-light);
}

.page-news__cta-button {
    display: inline-block;
    padding: 15px 40px;
    background: var(--login-button-color); /* Using login color for CTA */
    color: var(--text-color-light);
    text-decoration: none;
    border-radius: 5px;
    font-size: 18px;
    font-weight: bold;
    margin-top: 20px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.page-news__cta-button:hover {
    background: darken(var(--login-button-color), 10%); /* Placeholder for darken */
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

/* General Section Styles */
.page-news__section-title {
    font-size: 36px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 20px;
    color: var(--primary-color);
}

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

.page-news__dark-section .page-news__section-title,
.page-news__dark-section .page-news__section-description {
    color: var(--text-color-light);
}

/* Latest Articles Grid */
.page-news__latest-articles {
    padding: 80px 0;
    background-color: var(--bg-dark); /* Dark background for this section */
    color: var(--text-color-light);
}

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

.page-news__article-card {
    background: var(--secondary-color);
    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;
    display: flex;
    flex-direction: column;
}

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

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

.page-news__card-content {
    padding: 25px;
    color: var(--text-color-dark);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.page-news__card-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.3;
}

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

.page-news__card-title a:hover {
    color: darken(var(--primary-color), 10%); /* Placeholder for darken */
}

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

.page-news__card-excerpt {
    font-size: 16px;
    color: #555;
    margin-bottom: 20px;
    flex-grow: 1;
}

.page-news__read-more {
    display: inline-flex;
    align-items: center;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
    margin-top: auto;
}

.page-news__read-more:hover {
    color: darken(var(--primary-color), 10%); /* Placeholder for darken */
}

.page-news__arrow {
    margin-left: 8px;
    transition: transform 0.3s ease;
}

.page-news__read-more:hover .page-news__arrow {
    transform: translateX(5px);
}

/* Categories Section */
.page-news__categories {
    padding: 80px 0;
    background-color: var(--bg-light);
}

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

.page-news__category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    background: var(--secondary-color);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    color: var(--text-color-dark);
}

.page-news__category-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.page-news__category-item img {
    
    
    object-fit: contain;
    margin-bottom: 15px;
    border-radius: 5px;
}

.page-news__category-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-color);
}

/* All Articles List */
.page-news__all-articles {
    padding: 80px 0;
    background-color: var(--secondary-color);
}

.page-news__articles-list {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.page-news__list-item {
    display: flex;
    background: var(--secondary-color);
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.page-news__list-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.12);
}

.page-news__list-image {
    flex-shrink: 0;
    width: 300px;
    height: 200px;
}

.page-news__list-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.page-news__list-content {
    padding: 25px;
    flex-grow: 1;
    color: var(--text-color-dark);
}

.page-news__list-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.3;
}

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

.page-news__list-title a:hover {
    color: darken(var(--primary-color), 10%); /* Placeholder for darken */
}

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

.page-news__list-excerpt {
    font-size: 16px;
    color: #555;
    margin-bottom: 20px;
}

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

.page-news__pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 15px;
    background: var(--secondary-color);
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

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

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

/* FAQ Section */
.page-news__faq-section {
    padding: 80px 0;
    background-color: var(--bg-light);
}

.page-news__faq-list {
    max-width: 900px;
    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.4s 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: #f9f9f9;
  border-radius: 0 0 5px 5px;
}

/* 问题样式 */
.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;
}

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

/* 切换图标 */
.page-news__faq-toggle {
  font-size: 28px;
  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; /* 防止图标阻止点击事件 */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

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

/* CTA Section */
.page-news__cta-section {
    padding: 80px 0;
    text-align: center;
    background-color: var(--primary-color);
    color: var(--text-color-light);
}

.page-news__cta-section .page-news__section-title,
.page-news__cta-section .page-news__section-description {
    color: var(--text-color-light);
}

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

.page-news__btn-primary,
.page-news__btn-secondary {
    display: inline-block;
    padding: 15px 40px;
    text-decoration: none;
    border-radius: 5px;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    cursor: pointer;
}

.page-news__btn-primary {
    background: var(--login-button-color);
    color: var(--text-color-light);
    border-color: var(--login-button-color);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.page-news__btn-primary:hover {
    background: darken(var(--login-button-color), 10%); /* Placeholder for darken */
    border-color: darken(var(--login-button-color), 10%); /* Placeholder for darken */
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.page-news__btn-secondary {
    background: var(--secondary-color);
    color: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.page-news__btn-secondary:hover {
    background: var(--primary-color);
    color: var(--text-color-light);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

/* Images responsiveness */
.page-news img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Mobile Responsive */
@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-content h1 {
        font-size: 32px;
    }

    .page-news__hero-description {
        font-size: 16px;
    }

    .page-news__cta-button {
        padding: 12px 30px;
        font-size: 16px;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        white-space: normal !important;
        word-wrap: break-word !important;
    }

    .page-news__section-title {
        font-size: 28px;
    }

    .page-news__section-description {
        font-size: 16px;
    }

    .page-news__articles-grid {
        grid-template-columns: 1fr;
    }

    .page-news__article-card {
        margin-left: 15px;
        margin-right: 15px;
    }

    .page-news__category-list {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        padding-left: 15px;
        padding-right: 15px;
    }

    .page-news__list-item {
        flex-direction: column;
        margin-left: 15px;
        margin-right: 15px;
    }

    .page-news__list-image {
        width: 100%;
        height: 200px;
    }

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

    .page-news__list-title {
        font-size: 20px;
    }

    .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: 28px;
        height: 28px;
        font-size: 24px;
    }
    
    .page-news__faq-answer {
        padding: 0 15px;
    }
    
    .page-news__faq-item.active .page-news__faq-answer {
        padding: 15px !important;
    }

    .page-news__cta-buttons {
        flex-direction: column;
        gap: 15px;
        padding-left: 15px;
        padding-right: 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;
    }

    .page-news img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
    }
    
    .page-news__container,
    .page-news__section,
    .page-news__card,
    .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;
    }

    .page-news__latest-articles, .page-news__categories, .page-news__all-articles, .page-news__faq-section, .page-news__cta-section {
        padding: 40px 0;
    }
}