/* style/news.css */

/* Base styles for the news page, ensuring light text on a dark body background */
.page-news {
    color: #ffffff; /* Light text for dark body background */
    font-family: Arial, sans-serif;
    line-height: 1.6;
    background-color: transparent; /* Inherit from body, which is var(--black-color) */
}

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

/* Hero Section */
.page-news__hero-section {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column; /* Image first, then content */
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: 10px; /* Small top padding, body handles header offset */
    padding-bottom: 60px;
    overflow: hidden; /* Ensure no overflow */
    box-sizing: border-box;
}

.page-news__hero-image {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
    margin-bottom: 30px; /* Space between image and content */
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    min-width: 200px; /* Enforce min size */
    min-height: 200px; /* Enforce min size */
}

.page-news__hero-content {
    max-width: 800px;
    padding: 0 20px;
    z-index: 1; /* Ensure content is above any potential background elements */
}

.page-news__main-title {
    font-size: clamp(2.5rem, 5vw, 3.5rem); /* Responsive H1 font size */
    color: #26A9E0; /* Brand color for title */
    margin-bottom: 20px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.page-news__description {
    font-size: 1.2rem;
    color: #f0f0f0; /* Slightly off-white for body text */
    margin-bottom: 30px;
}

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

.page-news__btn-primary,
.page-news__btn-secondary {
    display: inline-block;
    padding: 15px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    text-align: center;
    min-width: 200px; /* Enforce min size for buttons */
    box-sizing: border-box; /* Include padding in width calculation */
    white-space: normal; /* Allow text to wrap */
    word-wrap: break-word; /* Break long words */
}

.page-news__btn-primary {
    background-color: #26A9E0; /* Main brand color */
    color: #ffffff;
    border: 2px solid #26A9E0;
}

.page-news__btn-primary:hover {
    background-color: #1e87c0;
    border-color: #1e87c0;
    transform: translateY(-2px);
}

.page-news__btn-secondary {
    background-color: #ffffff;
    color: #26A9E0;
    border: 2px solid #26A9E0;
}

.page-news__btn-secondary:hover {
    background-color: #e0e0e0;
    color: #1e87c0;
    border-color: #1e87c0;
    transform: translateY(-2px);
}

/* Login button specific color */
.page-news__btn-login {
    background-color: #EA7C07; /* Specific login color */
    color: #ffffff;
    border: 2px solid #EA7C07;
}

.page-news__btn-login:hover {
    background-color: #c46406;
    border-color: #c46406;
    transform: translateY(-2px);
}

/* Latest News Section */
.page-news__latest-news-section {
    padding: 60px 0;
    background-color: rgba(255, 255, 255, 0.05); /* Slightly lighter dark background */
}

.page-news__section-title {
    font-size: 2.5rem;
    color: #26A9E0;
    text-align: center;
    margin-bottom: 20px;
    font-weight: 700;
}

.page-news__section-description {
    font-size: 1.1rem;
    color: #cccccc;
    text-align: center;
    max-width: 800px;
    margin: 0 auto 40px auto;
}

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

.page-news__news-card {
    background-color: rgba(255, 255, 255, 0.1); /* Dark card background */
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    min-width: 200px; /* Enforce min size */
    min-height: 200px; /* Enforce min size */
}

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

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

.page-news__news-card-content {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.page-news__news-card-title {
    font-size: 1.4rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.page-news__news-card-title a {
    color: #ffffff; /* White text for titles on dark cards */
    text-decoration: none;
    transition: color 0.3s ease;
}

.page-news__news-card-title a:hover {
    color: #26A9E0; /* Brand color on hover */
}

.page-news__news-card-meta {
    font-size: 0.9rem;
    color: #aaaaaa;
    margin-bottom: 15px;
}

.page-news__news-card-summary {
    font-size: 1rem;
    color: #cccccc;
    margin-bottom: 20px;
    flex-grow: 1;
}

.page-news__read-more-btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #26A9E0;
    color: #ffffff;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.3s ease;
    align-self: flex-start;
    min-width: 150px; /* Ensure button is not too small */
    text-align: center;
    box-sizing: border-box;
    white-space: normal;
    word-wrap: break-word;
}

.page-news__read-more-btn:hover {
    background-color: #1e87c0;
}

.page-news__view-all {
    text-align: center;
    margin-top: 50px;
}

/* FAQ Section */
.page-news__faq-section {
    padding: 60px 0;
    background-color: rgba(255, 255, 255, 0.08); /* Slightly different dark background */
}

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

.page-news__faq-item {
    background-color: rgba(255, 255, 255, 0.15); /* Darker card background for FAQ */
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.page-news__faq-item summary {
    list-style: none; /* Hide default marker */
    padding: 20px 25px;
    font-size: 1.2rem;
    font-weight: 600;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease;
}

.page-news__faq-item summary::-webkit-details-marker {
    display: none; /* Hide default marker for webkit */
}

.page-news__faq-item summary:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.page-news__faq-qtext {
    flex-grow: 1;
    color: #ffffff; /* White text for FAQ questions */
}

.page-news__faq-toggle {
    font-size: 1.8rem;
    line-height: 1;
    margin-left: 15px;
    color: #26A9E0; /* Brand color for toggle icon */
}

.page-news__faq-answer {
    padding: 0 25px 20px 25px;
    font-size: 1rem;
    color: #cccccc;
    line-height: 1.7;
}

/* Call to Action Section */
.page-news__call-to-action-section {
    padding: 60px 0;
    text-align: center;
    background-color: #26A9E0; /* Brand color background for CTA */
    color: #ffffff;
}

.page-news__call-to-action-section .page-news__section-title {
    color: #ffffff;
}

.page-news__call-to-action-section .page-news__section-description {
    color: #f0f0f0;
}

/* --- Responsive Design --- */
@media (max-width: 1024px) {
    .page-news__main-title {
        font-size: clamp(2rem, 6vw, 3rem);
    }
    .page-news__section-title {
        font-size: 2.2rem;
    }
}

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

    .page-news__hero-section {
        padding-bottom: 40px;
    }

    .page-news__hero-content {
        padding: 0 15px;
    }

    .page-news__main-title {
        font-size: clamp(1.8rem, 8vw, 2.5rem);
    }

    .page-news__description {
        font-size: 1rem;
    }

    .page-news__cta-buttons {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }

    /* Mobile specific button adaptations */
    .page-news__btn-primary,
    .page-news__btn-secondary,
    .page-news__btn-login,
    .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;
        padding-right: 15px;
    }

    .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;
        flex-wrap: wrap !important;
        gap: 10px;
    }

    .page-news__latest-news-section {
        padding: 40px 0;
    }

    .page-news__section-title {
        font-size: 2rem;
        padding: 0 15px;
    }

    .page-news__section-description {
        font-size: 1rem;
        padding: 0 15px;
        margin-bottom: 30px;
    }

    .page-news__news-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Mobile specific image adaptations */
    .page-news img {
        max-width: 100% !important;
        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__hero-section {
      padding-top: 10px !important; /* body 已承担 --header-offset，此处禁止 var(--header-offset) */
    }

    .page-news__news-card-image {
        height: 180px; /* Adjust height for smaller screens */
    }

    .page-news__news-card-title {
        font-size: 1.2rem;
    }

    .page-news__faq-section {
        padding: 40px 0;
    }

    .page-news__faq-item summary {
        font-size: 1.1rem;
        padding: 15px 20px;
    }

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

    .page-news__call-to-action-section {
        padding: 40px 0;
    }
}