/* style/news.css */

/* --- Base Styles --- */
.page-news {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333333; /* Default text color for light background */
    background-color: #FFFFFF; /* Default body background is white */
}

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

.page-news__section {
    padding: 60px 0;
}

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

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

.page-news__cta-button {
    display: inline-block;
    padding: 15px 40px;
    background: #26A9E0; /* Primary color */
    color: #ffffff;
    text-decoration: none;
    border-radius: 5px;
    font-size: 18px;
    font-weight: bold;
    margin-top: 30px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-sizing: border-box;
    white-space: normal;
    word-wrap: break-word;
}

.page-news__cta-button:hover {
    background: #1e87c0; /* Slightly darker primary */
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.page-news__card-link,
.page-news__read-more-link {
    display: inline-block;
    color: #26A9E0;
    text-decoration: none;
    font-weight: bold;
    margin-top: 15px;
    transition: color 0.3s ease;
}

.page-news__card-link:hover,
.page-news__read-more-link:hover {
    color: #1e87c0;
    text-decoration: underline;
}

/* --- 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); /* Fixed header spacing */
    background-color: #f0f8ff; /* Light background for hero */
}

.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;
}

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

.page-news__main-title {
    font-size: 48px;
    color: #26A9E0;
    margin-bottom: 15px;
    font-weight: bold;
}

.page-news__hero-description {
    font-size: 20px;
    color: #333333;
    max-width: 900px;
    margin: 0 auto 30px auto;
}

/* --- Featured Categories Section --- */
.page-news__featured-categories {
    background-color: #f9f9f9;
}

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

.page-news__category-card {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    text-align: center;
    padding-bottom: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.page-news__category-card img {
    width: 100%;
    height: 200px; /* Fixed height for consistency */
    object-fit: cover;
    display: block;
    margin-bottom: 15px;
}

.page-news__category-card .page-news__card-title {
    font-size: 24px;
    color: #26A9E0;
    margin-bottom: 10px;
    padding: 0 15px;
}

.page-news__category-card .page-news__card-title a {
    color: #26A9E0;
    text-decoration: none;
}

.page-news__category-card .page-news__card-title a:hover {
    text-decoration: underline;
}

.page-news__category-card .page-news__card-text {
    font-size: 15px;
    color: #666666;
    padding: 0 15px;
    margin-bottom: 15px;
}

/* --- Featured Articles Section --- */
.page-news__featured-articles {
    background-color: #ffffff;
}

.page-news__article-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
}

.page-news__article-item {
    display: flex;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.page-news__article-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.page-news__article-item img {
    width: 40%;
    height: auto;
    object-fit: cover;
    display: block;
}

.page-news__article-content {
    padding: 25px;
    width: 60%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.page-news__article-title {
    font-size: 28px;
    color: #26A9E0;
    margin-bottom: 10px;
    line-height: 1.3;
}

.page-news__article-title a {
    color: #26A9E0;
    text-decoration: none;
}

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

.page-news__article-excerpt {
    font-size: 16px;
    color: #555555;
    margin-bottom: 15px;
}

/* --- Expert Guides Section (Dark Background) --- */
.page-news__expert-guides {
    background-color: #26A9E0; /* Primary brand color as background */
    color: #ffffff; /* White text for dark background */
}

.page-news__expert-guides .page-news__section-title,
.page-news__expert-guides .page-news__section-description {
    color: #ffffff; /* Ensure titles and descriptions are white */
}

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

.page-news__guide-card {
    background: rgba(255, 255, 255, 0.15); /* Semi-transparent white background */
    border-radius: 10px;
    padding: 30px;
    text-align: left;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.page-news__guide-card:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-5px);
}

.page-news__guide-card .page-news__card-title {
    font-size: 24px;
    color: #ffffff;
    margin-bottom: 15px;
}

.page-news__guide-card .page-news__card-title a {
    color: #ffffff;
    text-decoration: none;
}

.page-news__guide-card .page-news__card-title a:hover {
    text-decoration: underline;
}

.page-news__guide-card .page-news__card-text {
    font-size: 16px;
    color: #e0e0e0;
    margin-bottom: 20px;
}

.page-news__guide-card .page-news__card-link {
    color: #ffffff;
    border: 1px solid #ffffff;
    padding: 8px 15px;
    border-radius: 5px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.page-news__guide-card .page-news__card-link:hover {
    background-color: #ffffff;
    color: #26A9E0;
    text-decoration: none;
}

/* --- FAQ Section --- */
.page-news__faq-section {
    background-color: #f0f8ff; /* Light background for FAQ */
}

.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; /* 🚨 Sử dụng!important để đảm bảo độ ưu tiên, giá trị đủ lớn để chứa mọi nội dung */
    padding: 20px 15px !important;
    opacity: 1;
    background: #f9f9f9;
    border-radius: 0 0 5px 5px;
}

/* Vấn đề phong cách */
.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;
}

/* Tiêu đề câu hỏi */
.page-news__faq-question h3 {
    margin: 0;
    padding: 0;
    flex: 1;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5;
    pointer-events: none; /* Ngăn thẻ h3 chặn sự kiện click */
    color: #333333;
}

/* Biểu tượng chuyển đổi */
.page-news__faq-toggle {
    font-size: 24px;
    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; /* Ngăn biểu tượng chặn sự kiện click */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

.page-news__faq-item.active .page-news__faq-toggle {
    color: #333;
}

/* --- Bottom CTA Section --- */
.page-news__cta-bottom {
    background-color: #26A9E0; /* Primary brand color */
    padding: 80px 0;
    text-align: center;
}

.page-news__cta-content {
    max-width: 800px;
}

.page-news__cta-title {
    font-size: 38px;
    color: #ffffff;
    margin-bottom: 20px;
    font-weight: bold;
}

.page-news__cta-description {
    font-size: 20px;
    color: #ffffff;
    margin-bottom: 40px;
}

.page-news__cta-bottom .page-news__cta-button {
    background: #EA7C07; /* Login color for prominent CTA */
    padding: 18px 50px;
    font-size: 20px;
}

.page-news__cta-bottom .page-news__cta-button:hover {
    background: #d66f06;
}

/* --- Responsive Design --- */
@media (max-width: 1024px) {
    .page-news__hero-section {
        padding: 40px 15px;
        padding-top: var(--header-offset, 120px) !important;
    }
    .page-news__main-title {
        font-size: 40px;
    }
    .page-news__hero-description {
        font-size: 18px;
    }
    .page-news__section-title {
        font-size: 30px;
    }
    .page-news__article-item {
        flex-direction: column;
    }
    .page-news__article-item img {
        width: 100%;
        height: 250px;
    }
    .page-news__article-content {
        width: 100%;
        padding: 20px;
    }
    .page-news__article-title {
        font-size: 24px;
    }
    .page-news__category-grid,
    .page-news__guide-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

@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-image img {
        border-radius: 4px;
    }
    .page-news__main-title {
        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 {
        padding: 40px 0;
    }
    .page-news__section-title {
        font-size: 28px;
        margin-bottom: 15px;
    }
    .page-news__section-description {
        font-size: 16px;
        margin-bottom: 30px;
    }

    .page-news__category-card img {
        
    }
    .page-news__category-card .page-news__card-title {
        font-size: 20px;
    }
    .page-news__category-card .page-news__card-text {
        font-size: 14px;
    }

    .page-news__article-item {
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    }
    .page-news__article-item img {
        height: 200px;
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
    }
    .page-news__article-content {
        padding: 15px;
    }
    .page-news__article-title {
        font-size: 20px;
    }
    .page-news__article-excerpt {
        font-size: 14px;
    }
    .page-news__read-more-link {
        font-size: 14px;
    }

    .page-news__guide-card {
        padding: 20px;
    }
    .page-news__guide-card .page-news__card-title {
        font-size: 20px;
    }
    .page-news__guide-card .page-news__card-text {
        font-size: 14px;
    }
    .page-news__guide-card .page-news__card-link {
        padding: 6px 12px;
        font-size: 14px;
    }

    /* FAQ Mobile */
    .page-news__faq-question {
        padding: 15px;
        flex-wrap: wrap;
    }
    .page-news__faq-question h3 {
        font-size: 15px;
        margin-bottom: 0;
        width: calc(100% - 40px);
    }
    .page-news__faq-toggle {
        margin-left: 10px;
        width: 24px;
        height: 24px;
        font-size: 20px;
    }
    .page-news__faq-answer {
        padding: 0 15px;
    }
    .page-news__faq-item.active .page-news__faq-answer {
        padding: 15px !important;
    }

    .page-news__cta-bottom {
        padding: 60px 0;
    }
    .page-news__cta-title {
        font-size: 30px;
    }
    .page-news__cta-description {
        font-size: 16px;
    }
    .page-news__cta-bottom .page-news__cta-button {
        padding: 15px 35px;
        font-size: 18px;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        white-space: normal !important;
        word-wrap: break-word !important;
    }

    /* General image and container responsive rules */
    .page-news img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
    }
    .page-news__section,
    .page-news__card,
    .page-news__container,
    .page-news__category-card,
    .page-news__article-item,
    .page-news__guide-card,
    .page-news__faq-item {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px; /* Add padding for content within containers */
        padding-right: 15px;
    }
    .page-news__category-grid,
    .page-news__guide-grid {
        gap: 20px;
    }
    /* Ensure flex containers wrap */
    .page-news__cta-buttons,
    .page-news__button-group,
    .page-news__btn-container {
        display: flex;
        flex-direction: column; /* Stack buttons vertically */
        gap: 15px; /* Space between stacked buttons */
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px;
        padding-right: 15px;
    }
}