/* style/news.css */

/* Variables and Base Styles */
:root {
    --primary-color: #26A9E0; /* 淡蓝色 */
    --secondary-color: #FFFFFF; /* 白色 */
    --text-dark: #333333; /* 深色文字 */
    --text-light: #FFFFFF; /* 浅色文字 */
    --background-dark: #1a1a2e; /* 页面主背景色 (来自 shared.css) */
    --login-color: #EA7C07; /* 登录按钮颜色 */
    --card-background-light: #FFFFFF;
    --card-background-dark: rgba(255, 255, 255, 0.1); /* 半透明白色用于深色背景上的卡片 */
}

.page-news {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: var(--text-light); /* Default text color for dark body background */
    background-color: var(--background-dark); /* Ensure main content area matches body background */
}

/* Fixed header offset */
.page-news__hero-section {
    padding-top: var(--header-offset, 120px); /* Ensure content is not hidden by fixed header */
}

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

/* Section Titles and Descriptions */
.page-news__section-title {
    font-size: 2.5em;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 20px;
    font-weight: bold;
}

.page-news__section-description {
    font-size: 1.1em;
    color: var(--text-light);
    text-align: center;
    max-width: 800px;
    margin: 0 auto 40px auto;
}

/* Hero Section */
.page-news__hero-section {
    position: relative;
    width: 100%;
    height: 600px; /* Adjusted for better visual balance */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
}

.page-news__hero-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.page-news__hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2;
}

.page-news__hero-content {
    position: relative;
    z-index: 3;
    color: var(--text-light);
    max-width: 900px;
    padding: 20px;
}

.page-news__hero-title {
    font-size: 3.5em;
    margin-bottom: 20px;
    color: var(--secondary-color);
    line-height: 1.2;
}

.page-news__hero-description {
    font-size: 1.3em;
    margin-bottom: 30px;
    opacity: 0.9;
}

/* Buttons */
.page-news__btn-primary,
.page-news__btn-secondary {
    display: inline-block;
    padding: 15px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: center;
    box-sizing: border-box; /* Crucial for responsive buttons */
    white-space: normal; /* Allow text wrapping */
    word-wrap: break-word; /* Allow text wrapping */
}

.page-news__btn-primary {
    background: var(--primary-color);
    color: var(--text-light);
    border: 2px solid var(--primary-color);
    margin: 10px;
}

.page-news__btn-primary:hover {
    background: #1e87b7; /* Darken primary color */
    border-color: #1e87b7; /* Darken primary color */
}

.page-news__btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    margin: 10px;
}

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

/* Light Background Section (for contrast) */
.page-news__light-bg {
    background-color: var(--secondary-color); /* White background */
    color: var(--text-dark); /* Dark text on white background */
    padding: 60px 0;
}

.page-news__light-bg .page-news__section-title {
    color: var(--primary-color); /* Primary color for titles on light background */
}

.page-news__light-bg .page-news__section-description {
    color: var(--text-dark); /* Dark text for description on light background */
}

/* Dark Background Section */
.page-news__dark-section {
    background-color: var(--background-dark); /* Dark background */
    color: var(--text-light); /* Light text on dark background */
    padding: 60px 0;
}

.page-news__dark-section .page-news__section-title {
    color: var(--primary-color); /* Primary color for titles on dark background */
}

.page-news__dark-section .page-news__section-description {
    color: var(--text-light); /* Light text for description on dark background */
}

/* Articles Grid */
.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: var(--card-background-light); /* White background for cards on light sections */
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    color: var(--text-dark); /* Dark text for card content */
}

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

.page-news__article-image {
    width: 100%;
    height: 250px; /* Fixed height for consistency */
    object-fit: cover;
    display: block;
    /* No filter allowed */
}

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

.page-news__article-title {
    font-size: 1.5em;
    margin-bottom: 15px;
    line-height: 1.3;
    color: var(--primary-color); /* Primary color for article titles */
}

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

.page-news__article-title a:hover {
    text-decoration: underline;
}

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

.page-news__read-more {
    display: inline-block;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.page-news__read-more:hover {
    color: #1e87b7; /* Darken primary color */
}

/* Video Section */
.page-news__video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    background: #000;
    margin: 40px auto;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.page-news__video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    cursor: pointer;
}

.page-news__video-link {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10; /* Ensure link is clickable over video */
}

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

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

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

.page-news__faq-item {
    background: var(--card-background-dark); /* Semi-transparent white for FAQ items */
    border-radius: 10px;
    margin-bottom: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.page-news__faq-item.active {
    background: rgba(255, 255, 255, 0.15);
}

.page-news__faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    color: var(--text-light);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.page-news__faq-item.active .page-news__faq-question {
    border-bottom: 1px solid var(--primary-color);
}

.page-news__faq-qtext {
    flex-grow: 1;
    margin-right: 15px;
}

.page-news__faq-toggle {
    font-size: 1.5em;
    width: 25px;
    text-align: center;
    color: var(--primary-color);
}

.page-news__faq-answer {
    max-height: 0;
    overflow: hidden;
    padding: 0 25px;
    transition: max-height 0.5s ease-out, padding 0.5s ease-out;
    color: var(--text-light);
}

.page-news__faq-item.active .page-news__faq-answer {
    max-height: 500px; /* Sufficiently large to show content */
    padding: 20px 25px;
}

.page-news__faq-answer p {
    margin: 0;
    font-size: 1em;
    color: var(--text-light);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .page-news__hero-title {
        font-size: 2.8em;
    }
    .page-news__hero-description {
        font-size: 1.1em;
    }
    .page-news__section-title {
        font-size: 2em;
    }
}

@media (max-width: 768px) {
    .page-news {
        font-size: 16px;
        line-height: 1.6;
    }

    .page-news__hero-section {
        height: 500px;
    }

    .page-news__hero-title {
        font-size: 2.2em;
    }

    .page-news__hero-description {
        font-size: 1em;
    }

    .page-news__section-title {
        font-size: 1.8em;
    }

    .page-news__section-description {
        font-size: 0.9em;
        margin-bottom: 30px;
    }

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

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

    .page-news__article-card {
        margin-bottom: 20px;
    }

    .page-news__article-image {
        height: 200px; /* Adjusted height for mobile */
    }

    .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;
        margin: 5px 0 !important; /* Adjust margins for stacked buttons */
        padding: 12px 20px;
    }
    
    .page-news__cta-buttons {
        flex-direction: column; /* Stack buttons vertically on mobile */
        gap: 10px;
        padding: 0 15px; /* Add padding to button container */
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    /* Mobile image and video responsive rules */
    .page-news img {
        max-width: 100% !important;
        height: auto !important;
        display: block !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 video,
    .page-news__video {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        display: block !important;
    }
    
    .page-news__video-section,
    .page-news__video-container,
    .page-news__video-wrapper {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px;
        padding-right: 15px;
        overflow: hidden !important;
    }

    .page-news__video-section {
        padding-top: var(--header-offset, 120px) !important; /* Ensure video section has correct padding-top on mobile */
    }

    .page-news__faq-question {
        font-size: 1.1em;
        padding: 15px 20px;
    }

    .page-news__faq-answer {
        padding: 15px 20px;
    }
}

@media (max-width: 480px) {
    .page-news__hero-section {
        height: 400px;
    }
    .page-news__hero-title {
        font-size: 1.8em;
    }
    .page-news__hero-description {
        font-size: 0.9em;
    }
    .page-news__section-title {
        font-size: 1.5em;
    }
}