/* style/news.css */

/* Custom Colors */
:root {
    --color-primary: #11A84E;
    --color-secondary: #22C768;
    --color-button-gradient-start: #2AD16F;
    --color-button-gradient-end: #13994A;
    --color-card-bg: #11271B;
    --color-background: #08160F;
    --color-text-main: #F2FFF6;
    --color-text-secondary: #A7D9B8;
    --color-border: #2E7A4E;
    --color-glow: #57E38D;
    --color-gold: #F2C14E;
    --color-divider: #1E3A2A;
    --color-deep-green: #0A4B2C;
}

.page-news {
    font-family: Arial, sans-serif;
    color: var(--color-text-main); /* Default text color for the page content */
    background-color: var(--color-background); /* Default background for the page content */
}

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

/* Hero Section */
.page-news__hero-section {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    padding-top: 0; /* Handled by body padding-top */
    padding-bottom: 60px;
    background-color: var(--color-deep-green);
}

.page-news__hero-image-wrapper {
    width: 100%;
    max-height: 500px;
    overflow: hidden;
    margin-bottom: 30px;
}

.page-news__hero-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    object-position: center;
}

.page-news__hero-content {
    position: relative;
    z-index: 1;
    max-width: 900px;
    padding: 0 20px;
}

.page-news__main-title {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 700;
    color: var(--color-gold);
    margin-bottom: 20px;
    line-height: 1.2;
}

.page-news__hero-description {
    font-size: 1.15rem;
    color: var(--color-text-secondary);
    margin-bottom: 30px;
    line-height: 1.6;
}

/* Buttons */
.page-news__btn-primary,
.page-news__btn-secondary,
.page-news a[class*="btn"] {
    display: inline-block;
    padding: 14px 28px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.3s ease;
    white-space: normal;
    word-wrap: break-word;
    box-sizing: border-box;
    max-width: 100%;
}

.page-news__btn-primary {
    background: linear-gradient(180deg, var(--color-button-gradient-start) 0%, var(--color-button-gradient-end) 100%);
    color: var(--color-text-main);
    border: none;
    box-shadow: 0 4px 15px rgba(42, 209, 111, 0.4);
}

.page-news__btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(42, 209, 111, 0.6);
}

.page-news__btn-secondary {
    background: transparent;
    color: var(--color-button-gradient-start);
    border: 2px solid var(--color-button-gradient-start);
}

.page-news__btn-secondary:hover {
    background: var(--color-button-gradient-start);
    color: var(--color-text-main);
}

/* Latest News Section */
.page-news__latest-news-section {
    padding: 80px 0;
    background-color: var(--color-background);
}

.page-news__section-title {
    font-size: 2.5rem;
    color: var(--color-text-main);
    text-align: center;
    margin-bottom: 20px;
    font-weight: 700;
}

.page-news__section-description {
    font-size: 1.1rem;
    color: var(--color-text-secondary);
    text-align: center;
    margin-bottom: 50px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

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

.page-news__news-card {
    background-color: var(--color-card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

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

.page-news__news-card-image-wrapper {
    width: 100%;
    aspect-ratio: 16 / 9; /* Maintain aspect ratio */
    overflow: hidden;
}

.page-news__news-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

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

.page-news__news-date {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    margin-bottom: 10px;
    display: block;
}

.page-news__news-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    line-height: 1.4;
}

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

.page-news__news-title a:hover {
    color: var(--color-button-gradient-start);
}

.page-news__news-excerpt {
    font-size: 1rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
    flex-grow: 1;
}

.page-news__read-more-btn {
    display: inline-block;
    color: var(--color-button-gradient-start);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.page-news__read-more-btn:hover {
    color: var(--color-gold);
}

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

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

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

.page-news__cta-section .page-news__section-description {
    color: var(--color-text-secondary);
    margin-bottom: 40px;
}

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

.page-news__faq-list {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.page-news__faq-item {
    background-color: var(--color-card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--color-border);
}

.page-news__faq-item summary {
    list-style: none;
    cursor: pointer;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--color-text-main);
    position: relative;
}

.page-news__faq-item summary::-webkit-details-marker {
    display: none;
}

.page-news__faq-item summary::marker {
    display: none;
}

.page-news__faq-toggle {
    font-size: 1.8rem;
    line-height: 1;
    color: var(--color-button-gradient-start);
    margin-left: 15px;
    transition: transform 0.3s ease;
}

.page-news__faq-item[open] .page-news__faq-toggle {
    transform: rotate(45deg);
}

.page-news__faq-answer {
    padding: 0 25px 20px;
    font-size: 1rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
}

.page-news__faq-item[open] .page-news__faq-answer {
    opacity: 1;
    max-height: 500px; /* Arbitrary large value for smooth transition */
}

.page-news__faq-answer p {
    margin: 0;
    padding-top: 10px;
}

.page-news__faq-answer a {
    color: var(--color-button-gradient-start);
    text-decoration: none;
}

.page-news__faq-answer a:hover {
    text-decoration: underline;
}

/* General image rules */
.page-news img {
    max-width: 100%;
    height: auto;
    display: block;
}

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

    .page-news__section-title {
        font-size: 2rem;
    }

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

@media (max-width: 768px) {
    /* LOGO轮播区域 - Not explicitly in HTML, but must be covered if it were */
    /* Assuming shared handles body padding, so first content block has fixed top padding */
    .page-news__logo-carousel-section {
        padding: 50px 15px 20px; /* Fixed top padding, not var(--header-offset) */
    }

    /* HERO 主图区域 */
    .page-news__hero-section {
        padding-top: 0 !important; /* Ensure no double padding from body */
        padding-bottom: 40px;
    }
    .page-news__hero-image-wrapper {
        max-height: 300px;
    }
    .page-news__hero-content {
        padding: 0 15px;
    }
    .page-news__main-title {
        font-size: 2rem;
        margin-bottom: 15px;
    }
    .page-news__hero-description {
        font-size: 1rem;
        margin-bottom: 25px;
    }

    /* 游戏展示区域 (News cards are similar to game cards) */
    .page-news__latest-news-section,
    .page-news__cta-section,
    .page-news__faq-section {
        padding: 40px 0;
    }

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

    .page-news__section-title {
        font-size: 1.8rem;
        margin-bottom: 15px;
    }

    .page-news__section-description {
        font-size: 0.95rem;
        margin-bottom: 30px;
    }

    .page-news__news-grid {
        grid-template-columns: 1fr; /* Single column for mobile */
        gap: 20px;
    }

    .page-news__news-card-content {
        padding: 20px;
    }

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

    /* 通用图片与容器 */
    .page-news img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
    }
    /* 🚨 游戏大图/卡片缩略图：须覆盖上一段，禁止被 height:auto 破坏裁切（父级为 aspect-ratio 或固定高） */
    .page-news__news-card-image,
    .page-news__hero-image {
        width: 100% !important;
        height: 100% !important; /* Ensure these maintain height for object-fit */
        max-width: 100% !important;
        object-fit: cover !important;
        object-position: center !important;
    }

    /* LOGO轮播项必须单独设置，保持固定尺寸 */
    /* This is a placeholder, as no logo carousel is in current HTML for news page */
    .page-news__logo-item {
        width: 80px !important; 
        height: 80px !important;
        max-width: 80px !important;
        box-sizing: border-box;
    }

    /* 按钮与按钮容器 */
    .page-news__btn-primary,
    .page-news__btn-secondary,
    .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;
        text-align: center;
    }

    .page-news__view-all-wrapper {
        padding: 0 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;
        display: flex;
        flex-direction: column; /* Stack buttons vertically */
    }
    
    /* 其他内容模块 (FAQ) */
    .page-news__faq-item summary {
        font-size: 1rem;
        padding: 15px 20px;
    }
    .page-news__faq-toggle {
        font-size: 1.5rem;
    }
    .page-news__faq-answer {
        font-size: 0.95rem;
        padding: 0 20px 15px;
    }
}