/* style/news.css */

/* Global styles for .page-news within main */
.page-news {
    background-color: #0d0d0d; /* Matching shared.css body background */
    color: #ffffff; /* Light text for dark background */
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    padding-bottom: 60px; /* Add some padding at the bottom before footer */
}

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

.page-news__section-title {
    font-size: 36px;
    font-weight: bold;
    color: #FFD700; /* Use secondary color for main titles */
    text-align: center;
    margin-bottom: 20px;
    margin-top: 60px;
    line-height: 1.2;
}

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

/* Hero Section */
.page-news__hero-section {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 100px 20px 60px;
    padding-top: var(--header-offset, 120px); /* Fixed header offset */
    text-align: center;
    overflow: hidden;
    background-color: #0A246A; /* Primary brand color for hero background */
}

.page-news__hero-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.3; /* Subtle background image */
    z-index: 0;
}

.page-news__hero-section .page-news__container {
    position: relative;
    z-index: 1;
}

.page-news__main-title {
    font-size: 52px;
    font-weight: 900;
    color: #FFD700;
    margin-bottom: 25px;
    line-height: 1.2;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.page-news__hero-description {
    font-size: 20px;
    color: #f0f0f0;
    margin-bottom: 40px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* CTA Buttons */
.page-news__cta-button {
    display: inline-block;
    padding: 15px 40px;
    background: #FFD700; /* Secondary color for CTA */
    color: #0A246A; /* Primary color for text on secondary background */
    text-decoration: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border: none;
    cursor: pointer;
    margin: 10px;
    max-width: 100%; /* Ensure responsiveness */
    box-sizing: border-box;
    white-space: normal;
    word-wrap: break-word;
}

.page-news__cta-button:hover {
    background: #e6c200; /* Darker secondary on hover */
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.page-news__cta-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 30px;
    flex-wrap: wrap; /* Allow buttons to wrap on smaller screens */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

/* Latest News Section */
.page-news__latest-news-section {
    padding: 60px 0;
    background-color: #0d0d0d;
}

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

.page-news__news-card {
    background-color: #1a1a1a; /* Slightly lighter dark for cards */
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

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

.page-news__card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.page-news__card-title {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 10px;
    line-height: 1.3;
}

.page-news__card-title a {
    color: #FFD700; /* Secondary color for article titles */
    text-decoration: none;
    transition: color 0.3s ease;
}

.page-news__card-title a:hover {
    color: #ffffff;
}

.page-news__card-excerpt {
    font-size: 16px;
    color: #cccccc;
    margin-bottom: 15px;
    flex-grow: 1;
}

.page-news__card-date {
    font-size: 14px;
    color: #888888;
    margin-top: auto; /* Push date and read more to bottom */
    margin-bottom: 10px;
}

.page-news__read-more {
    display: inline-block;
    color: #0A246A; /* Primary color */
    background-color: #FFD700; /* Secondary color background */
    padding: 8px 15px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease, color 0.3s ease;
    align-self: flex-start;
}

.page-news__read-more:hover {
    background-color: #e6c200;
    color: #0A246A;
}

.page-news__pagination {
    display: flex;
    justify-content: center;
    margin-top: 50px;
    gap: 10px;
}

.page-news__pagination-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #1a1a1a;
    color: #FFD700;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease, color 0.3s ease;
    border: 1px solid #FFD700;
}

.page-news__pagination-link:hover {
    background-color: #FFD700;
    color: #0A246A;
}

.page-news__pagination-link--active {
    background-color: #FFD700;
    color: #0A246A;
    pointer-events: none;
    border-color: #FFD700;
}

/* Call to Action Section */
.page-news__cta-section {
    padding: 80px 20px;
    background-color: #0A246A; /* Primary color background */
    text-align: center;
    color: #ffffff;
    margin-top: 60px;
}

.page-news__cta-title {
    font-size: 40px;
    font-weight: bold;
    color: #FFD700;
    margin-bottom: 20px;
    line-height: 1.2;
}

.page-news__cta-description {
    font-size: 20px;
    color: #f0f0f0;
    margin-bottom: 40px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.page-news__btn-primary {
    background: #FFD700;
    color: #0A246A;
    border: none;
}

.page-news__btn-primary:hover {
    background: #e6c200;
}

.page-news__btn-secondary {
    background: transparent;
    color: #FFD700;
    border: 2px solid #FFD700;
    box-shadow: none;
}

.page-news__btn-secondary:hover {
    background: #FFD700;
    color: #0A246A;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

/* FAQ Section */
.page-news__faq-section {
    padding: 60px 0;
    background-color: #0d0d0d;
}

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

/* FAQ容器样式 */
.page-news__faq-item {
  margin-bottom: 15px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  background-color: #1a1a1a; /* Darker background for FAQ item */
}

/* 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;
  padding: 0 25px; /* Adjust padding for dark background */
  opacity: 0;
  color: #cccccc; /* Lighter text for answer */
  font-size: 16px;
  line-height: 1.6;
}

/* 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 25px !important; /* Adjust padding for dark background */
  opacity: 1;
  background: #2a2a2a; /* Slightly different background for expanded answer */
  border-radius: 0 0 8px 8px;
}

/* Question style */
.page-news__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  background: #0A246A; /* Primary color for question background */
  border: 1px solid #0A246A;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  position: relative;
}

.page-news__faq-item.active .page-news__faq-question {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.page-news__faq-question:hover {
  background: #1a3a8a; /* Slightly darker primary on hover */
  border-color: #1a3a8a;
}

.page-news__faq-question:active {
  background: #081e5a;
}

/* Question title style */
.page-news__faq-question h3 {
  margin: 0;
  padding: 0;
  flex: 1;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
  pointer-events: none; /* Prevent h3 tag from blocking click event */
  color: #FFD700; /* Secondary color for question text */
}

/* Toggle icon */
.page-news__faq-toggle {
  font-size: 28px; /* Larger icon */
  font-weight: bold;
  line-height: 1;
  color: #FFD700; /* Secondary color for toggle */
  transition: transform 0.3s ease, color 0.3s ease;
  flex-shrink: 0;
  margin-left: 15px;
  pointer-events: none; /* Prevent icon from blocking click event */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.page-news__faq-item.active .page-news__faq-toggle {
  color: #ffffff;
  transform: rotate(45deg); /* Rotate for minus sign */
}

/* About Section */
.page-news__about-section {
    padding: 80px 0;
    background-color: #0A246A; /* Primary color background */
    color: #ffffff;
    margin-top: 60px;
}

.page-news__about-content {
    display: flex;
    align-items: center;
    gap: 40px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.page-news__about-image {
    flex: 1;
    min-width: 300px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    max-width: 100%; /* Ensure responsiveness */
    height: auto;
    display: block;
}

.page-news__about-text {
    flex: 2;
    font-size: 17px;
    line-height: 1.7;
}

.page-news__about-text p {
    margin-bottom: 15px;
    color: #f0f0f0;
}

.page-news__read-more-button {
    display: inline-block;
    margin-top: 20px;
    padding: 12px 30px;
    background: #FFD700;
    color: #0A246A;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    max-width: 100%; /* Ensure responsiveness */
    box-sizing: border-box;
    white-space: normal;
    word-wrap: break-word;
}

.page-news__read-more-button:hover {
    background: #e6c200;
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3);
}


/* --- Responsive Styles --- */
@media (max-width: 1024px) {
    .page-news__main-title {
        font-size: 44px;
    }
    .page-news__section-title {
        font-size: 32px;
    }
    .page-news__cta-title {
        font-size: 36px;
    }
}

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

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

    .page-news__hero-section {
        padding: 80px 15px 40px;
        padding-top: var(--header-offset, 120px) !important;
    }

    .page-news__main-title {
        font-size: 36px;
        margin-bottom: 15px;
    }

    .page-news__hero-description {
        font-size: 18px;
        margin-bottom: 30px;
    }

    .page-news__cta-button {
        padding: 12px 25px;
        font-size: 16px;
        margin: 8px;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        white-space: normal !important;
        word-wrap: break-word !important;
    }

    .page-news__cta-buttons {
        flex-direction: column; /* Stack buttons vertically on mobile */
        gap: 15px;
        margin-top: 20px;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px;
        padding-right: 15px;
    }

    .page-news__section-title {
        font-size: 28px;
        margin-top: 40px;
        margin-bottom: 15px;
    }

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

    .page-news__news-grid {
        grid-template-columns: 1fr;
        gap: 25px;
        margin-top: 30px;
    }

    .page-news__card-title {
        font-size: 20px;
    }

    .page-news__card-excerpt {
        font-size: 15px;
    }

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

    .page-news__pagination-link {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .page-news__cta-section {
        padding: 60px 15px;
        margin-top: 40px;
    }

    .page-news__cta-title {
        font-size: 30px;
        margin-bottom: 15px;
    }

    .page-news__cta-description {
        font-size: 17px;
        margin-bottom: 30px;
    }

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

    .page-news__about-content {
        flex-direction: column;
        gap: 30px;
    }

    .page-news__about-image {
        width: 100%;
        min-width: unset;
    }

    .page-news__about-text {
        font-size: 16px;
    }

    .page-news__read-more-button {
        width: 100%;
        max-width: 100% !important;
        padding: 12px 20px;
        font-size: 16px;
        white-space: normal !important;
        word-wrap: break-word !important;
    }
    
    /* Ensure all images are responsive */
    .page-news img {
      max-width: 100% !important;
      width: 100% !important;
      height: auto !important;
      display: block !important;
    }
    
    /* Ensure all image containers are responsive */
    .page-news__hero-section,
    .page-news__latest-news-section,
    .page-news__news-grid,
    .page-news__news-card,
    .page-news__cta-section,
    .page-news__faq-section,
    .page-news__faq-list,
    .page-news__faq-item,
    .page-news__about-section,
    .page-news__about-content,
    .page-news__about-text {
      max-width: 100% !important;
      width: 100% !important;
      box-sizing: border-box !important;
      overflow: hidden !important; /* Prevent content overflow */
    }
}

/* Ensure padding-left/right for containers on mobile */
@media (max-width: 768px) {
  .page-news__container {
    padding-left: 15px !important;
    padding-right: 15px !important;
  }
}