/* style/news.css */

/* Custom Colors */
:root {
    --d88-primary-color: #11A84E; /* Chủ đạo */
    --d88-secondary-color: #22C768; /* Phụ trợ */
    --d88-button-gradient: linear-gradient(180deg, #2AD16F 0%, #13994A 100%); /* Nút */
    --d88-card-bg: #11271B; /* Nền thẻ */
    --d88-background: #08160F; /* Nền chung */
    --d88-text-main: #F2FFF6; /* Văn bản chính */
    --d88-text-secondary: #A7D9B8; /* Văn bản phụ */
    --d88-border-color: #2E7A4E; /* Viền */
    --d88-glow-color: #57E38D; /* Hiệu ứng phát sáng */
    --d88-gold-color: #F2C14E; /* Màu vàng */
    --d88-divider-color: #1E3A2A; /* Đường phân cách */
    --d88-deep-green: #0A4B2C; /* Xanh lá đậm */
}

/* Base styles for the page content */
.page-news {
    background-color: var(--d88-background); /* Nền tối */
    color: var(--d88-text-main); /* Chữ sáng cho nền tối */
    font-family: Arial, sans-serif;
    line-height: 1.6;
    padding-bottom: 40px; /* Đảm bảo khoảng trống phía trên footer */
}

.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; /* Xếp ảnh và nội dung dọc */
    align-items: center;
    padding: 60px 0; /* Điều chỉnh khi cần */
    padding-top: 10px; /* Khoảng đệm nhỏ phía trên, body xử lý offset header */
    overflow: hidden; /* Đảm bảo nội dung không tràn */
}

.page-news__hero-image {
    width: 100%;
    max-height: 500px; /* Giới hạn chiều cao ảnh hero */
    object-fit: cover;
    display: block;
    margin-bottom: 30px; /* Khoảng cách giữa ảnh và nội dung văn bản */
    border-radius: 12px;
}

.page-news__hero-content {
    text-align: center;
    max-width: 900px;
    padding: 0 20px;
}

.page-news__main-title {
    font-size: clamp(2.2rem, 4vw, 3.5rem); /* Kích thước H1 phản hồi */
    color: var(--d88-gold-color); /* Màu vàng cho tiêu đề chính */
    margin-bottom: 20px;
    font-weight: 700;
    line-height: 1.2;
    text-shadow: 0 0 8px rgba(242, 193, 78, 0.5);
}

.page-news__description {
    font-size: 1.1rem;
    color: var(--d88-text-secondary);
    margin-bottom: 30px;
}

/* Section Titles */
.page-news__section-title {
    font-size: clamp(1.8rem, 3vw, 2.8rem);
    color: var(--d88-text-main);
    text-align: center;
    margin-bottom: 20px;
    font-weight: 600;
}

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

/* Buttons */
.page-news__cta-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
    flex-wrap: wrap; /* Cho phép các nút xuống dòng trên màn hình nhỏ hơn */
    width: 100%; /* Đảm bảo container chiếm toàn bộ chiều rộng để xuống dòng */
    box-sizing: border-box;
    padding: 0 15px; /* Thêm padding để tránh tràn trên màn hình rất nhỏ */
}

.page-news__btn-primary,
.page-news__btn-secondary,
.page-news__read-more-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    box-sizing: border-box; /* Bao gồm padding và border trong tổng chiều rộng và chiều cao của phần tử */
    white-space: normal; /* Cho phép văn bản xuống dòng */
    word-wrap: break-word; /* Ngắt từ dài */
    max-width: 100%; /* Đảm bảo các nút không vượt quá chiều rộng container */
}

.page-news__btn-primary {
    background: var(--d88-button-gradient);
    color: var(--d88-text-main); /* Chữ trắng trên nền nút tối */
    border: 2px solid transparent;
    box-shadow: 0 4px 15px rgba(42, 209, 111, 0.3);
}

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

.page-news__btn-secondary {
    background: transparent;
    color: var(--d88-secondary-color); /* Chữ xanh lá */
    border: 2px solid var(--d88-secondary-color);
}

.page-news__btn-secondary:hover {
    background: rgba(34, 199, 104, 0.1);
    transform: translateY(-2px);
}

.page-news__read-more-btn {
    background: var(--d88-deep-green);
    color: var(--d88-text-main);
    border: none;
    padding: 8px 15px;
    font-size: 0.9rem;
    border-radius: 5px;
}

.page-news__read-more-btn:hover {
    background: var(--d88-primary-color);
}

/* Latest News Section */
.page-news__latest-news-section {
    padding: 60px 0;
    background-color: var(--d88-card-bg); /* Nền tối hơn cho phần này */
}

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

.page-news__news-card {
    background-color: var(--d88-background); /* Nền tối cho thẻ */
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--d88-divider-color);
    display: flex;
    flex-direction: column;
}

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

.page-news__card-image {
    width: 100%;
    height: 220px; /* Chiều cao cố định để thẻ hiển thị nhất quán */
    object-fit: cover;
    display: block;
}

.page-news__card-content {
    padding: 20px;
    flex-grow: 1; /* Cho phép nội dung đẩy footer xuống dưới */
    display: flex;
    flex-direction: column;
}

.page-news__card-title {
    font-size: 1.3rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.page-news__card-title a {
    color: var(--d88-text-main); /* Chữ sáng cho tiêu đề */
    text-decoration: none;
    transition: color 0.3s ease;
}

.page-news__card-title a:hover {
    color: var(--d88-gold-color); /* Màu vàng khi hover */
}

.page-news__card-meta {
    font-size: 0.85rem;
    color: var(--d88-text-secondary); /* Màu chữ phụ cho meta */
    margin-bottom: 15px;
}

.page-news__card-excerpt {
    font-size: 0.95rem;
    color: var(--d88-text-secondary);
    margin-bottom: 20px;
    flex-grow: 1; /* Cho phép đoạn trích chiếm không gian có sẵn */
}

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

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

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

.page-news__faq-item {
    background-color: var(--d88-card-bg);
    border: 1px solid var(--d88-divider-color);
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
    color: var(--d88-text-main);
}

.page-news__faq-item summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none; /* Xóa dấu mặc định */
    color: var(--d88-text-main);
    transition: background-color 0.3s ease;
}

.page-news__faq-item summary:hover {
    background-color: var(--d88-deep-green);
}

.page-news__faq-item summary::-webkit-details-marker {
    display: none; /* Ẩn dấu mặc định cho trình duyệt Webkit */
}

.page-news__faq-qtext {
    flex-grow: 1;
}

.page-news__faq-toggle {
    font-size: 1.5rem;
    line-height: 1;
    margin-left: 15px;
    color: var(--d88-gold-color);
}

.page-news__faq-answer {
    padding: 0 25px 20px;
    font-size: 1rem;
    color: var(--d88-text-secondary);
}

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

/* Responsive Styles */
@media (max-width: 1024px) {
    .page-news__hero-image {
        max-height: 400px;
    }
    .page-news__news-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .page-news__hero-section {
        padding: 40px 0;
        padding-top: 10px !important; /* body xử lý --header-offset, đây là trang trí */
    }

    .page-news__hero-image {
        max-height: 300px;
        margin-bottom: 20px;
    }

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

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

    .page-news__section-title {
        font-size: clamp(1.6rem, 7vw, 2.2rem);
    }

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

    .page-news__btn-primary,
    .page-news__btn-secondary {
        width: 100% !important;
        max-width: 300px !important; /* Giới hạn chiều rộng nút trên di động */
        padding: 15px 20px;
        font-size: 1.1rem;
        white-space: normal !important;
        word-wrap: break-word !important;
    }

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

    .page-news__card-image {
        height: 200px;
    }

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

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

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

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

    /* All containers that might hold images or other content */
    .page-news__section,
    .page-news__card,
    .page-news__container,
    .page-news__hero-section,
    .page-news__latest-news-section,
    .page-news__faq-section,
    .page-news__cta-bottom-section {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px;
        padding-right: 15px;
        overflow-x: hidden !important; /* Ngăn chặn cuộn ngang */
    }

    /* Specific padding adjustments for sections that should stretch full width but have inner content padding */
    .page-news__latest-news-section .page-news__container,
    .page-news__faq-section .page-news__container,
    .page-news__cta-bottom-section .page-news__container {
        padding-left: 0;
        padding-right: 0;
    }

    .page-news__news-grid {
        padding: 0 15px; /* Áp dụng padding cho chính lưới */
    }
}

@media (max-width: 480px) {
    .page-news__hero-section {
        padding: 30px 0;
        padding-top: 10px !important;
    }
    .page-news__hero-image {
        max-height: 200px;
    }
    .page-news__main-title {
        font-size: clamp(1.8rem, 9vw, 2.2rem);
    }
    .page-news__description {
        font-size: 0.95rem;
    }
    .page-news__section-title {
        font-size: clamp(1.4rem, 8vw, 1.8rem);
    }
    .page-news__card-title {
        font-size: 1.1rem;
    }
    .page-news__card-meta, .page-news__card-excerpt {
        font-size: 0.85rem;
    }
}