/* style/news.css */
:root {
  --primary-color: #26A9E0;
  --secondary-color: #FFFFFF;
  --text-dark: #333333;
  --text-light: #ffffff;
  --background-light: #f9f9f9;
  --background-dark: #26A9E0;
  --button-login: #EA7C07;
}

.page-news {
  font-family: 'Arial', sans-serif;
  color: var(--text-dark);
  line-height: 1.6;
  background-color: var(--background-light);
}

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

/* 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); /* Ensure content is not hidden by fixed header */
  color: var(--text-light);
  background: linear-gradient(135deg, var(--primary-color), #4CAF50); /* A bit darker for text contrast */
}

.page-news__hero-container {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.page-news__hero-image {
  width: 100%;
  margin-bottom: 30px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.page-news__hero-image img {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
  object-fit: cover;
  filter: none; /* Ensure no filter changes image color */
}

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

.page-news__main-title {
  font-size: 2.8em;
  margin-bottom: 15px;
  color: var(--text-light);
  text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}

.page-news__intro-description {
  font-size: 1.2em;
  max-width: 800px;
  margin: 0 auto 30px auto;
  color: var(--text-light);
  text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.page-news__cta-button {
  display: inline-block;
  padding: 15px 40px;
  background: var(--button-login); /* Using login button color for primary CTA */
  color: var(--text-light);
  text-decoration: none;
  border-radius: 5px;
  font-size: 1.1em;
  font-weight: bold;
  margin-top: 20px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.page-news__cta-button:hover {
  background: #E06C00;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

/* Section Titles */
.page-news__section-title {
  font-size: 2.2em;
  color: var(--primary-color);
  text-align: center;
  margin-bottom: 40px;
  position: relative;
  padding-bottom: 10px;
}

.page-news__section-title::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background-color: var(--primary-color);
  border-radius: 2px;
}

.page-news__section-description {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 50px auto;
  font-size: 1.1em;
  color: var(--text-dark);
}

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

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

.page-news__article-card {
  background: var(--secondary-color);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  color: var(--text-dark);
}

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

.page-news__article-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
}

.page-news__article-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: none; /* Ensure no filter changes image color */
}

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

.page-news__article-title {
  font-size: 1.4em;
  margin-top: 0;
  margin-bottom: 10px;
  line-height: 1.3;
}

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

.page-news__article-title a:hover {
  color: #1a7bbd;
}

.page-news__article-date {
  font-size: 0.9em;
  color: #777;
  margin-bottom: 15px;
}

.page-news__article-excerpt {
  font-size: 1em;
  color: #555;
  margin-bottom: 20px;
  flex-grow: 1;
}

.page-news__read-more-button {
  display: inline-block;
  padding: 10px 20px;
  background: var(--primary-color);
  color: var(--text-light);
  text-decoration: none;
  border-radius: 5px;
  font-weight: bold;
  transition: background-color 0.3s ease;
  align-self: flex-start;
}

.page-news__read-more-button:hover {
  background: #1a7bbd;
}

/* Game Focus Section */
.page-news__game-focus-section {
  padding: 80px 0;
  background-color: var(--background-dark);
  color: var(--text-light);
}

.page-news__game-focus-section .page-news__section-title {
  color: var(--text-light);
}

.page-news__game-focus-section .page-news__section-title::after {
  background-color: var(--text-light);
}

.page-news__game-focus-section .page-news__section-description {
  color: rgba(255, 255, 255, 0.9);
}

.page-news__content-grid {
  display: flex;
  align-items: center;
  gap: 50px;
  margin-bottom: 60px;
}

.page-news__content-grid--reverse {
  flex-direction: row-reverse;
}

.page-news__text-block {
  flex: 1;
}

.page-news__content-heading {
  font-size: 1.8em;
  margin-bottom: 20px;
  color: var(--text-light);
}

.page-news__text-block p {
  margin-bottom: 15px;
  color: rgba(255, 255, 255, 0.85);
}

.page-news__image-block {
  flex: 1;
}

.page-news__image-block img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  filter: none; /* Ensure no filter changes image color */
}

/* Industry Updates Section */
.page-news__industry-updates-section {
  padding: 80px 0;
  background-color: var(--background-light);
}

/* CTA Section */
.page-news__cta-section {
  padding: 80px 0;
  background: linear-gradient(90deg, #1a7bbd, var(--primary-color));
  text-align: center;
  color: var(--text-light);
}

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

.page-news__cta-title {
  font-size: 2.5em;
  margin-bottom: 20px;
  color: var(--text-light);
}

.page-news__cta-description {
  font-size: 1.2em;
  margin-bottom: 40px;
  color: rgba(255, 255, 255, 0.9);
}

.page-news__cta-button--large {
  padding: 18px 50px;
  font-size: 1.3em;
  background: var(--button-login);
}

.page-news__cta-button--large:hover {
  background: #E06C00;
}

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

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

/* FAQ容器样式 */
.page-news__faq-item {
  margin-bottom: 15px;
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* 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 15px;
  opacity: 0;
}

/* FAQ展开状态 - 🚨 使用!important và đủ lớn max-height để đảm bảo có thể mở rộng */
.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;
  color: var(--text-dark);
}

/* Question Style */
.page-news__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  background: var(--secondary-color);
  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;
}

/* Question Title Style */
.page-news__faq-question h3 {
  margin: 0;
  padding: 0;
  flex: 1;
  font-size: 1.1em;
  font-weight: 600;
  line-height: 1.5;
  pointer-events: none; /* Prevent h3 from blocking click events */
  color: var(--text-dark);
}

/* Toggle Icon */
.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; /* Prevent icon from blocking click events */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

.page-news__faq-item.active .page-news__faq-toggle {
  color: var(--primary-color);
  transform: rotate(45deg); /* Change to X when active */
}

/* Responsive Design */
@media (max-width: 992px) {
  .page-news__main-title {
    font-size: 2.2em;
  }
  .page-news__intro-description {
    font-size: 1.1em;
  }
  .page-news__section-title {
    font-size: 1.8em;
  }
  .page-news__content-grid {
    flex-direction: column;
    gap: 30px;
  }
  .page-news__content-grid--reverse {
    flex-direction: column;
  }
  .page-news__cta-title {
    font-size: 2em;
  }
}

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

  .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,
  .page-news__article-image img,
  .page-news__image-block img,
  .page-news img { /* All images */
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    filter: none; /* Ensure no filter changes image color */
  }

  .page-news__hero-image,
  .page-news__article-card,
  .page-news__content-grid,
  .page-news__articles-grid,
  .page-news__container,
  .page-news__cta-content,
  .page-news__faq-list,
  .page-news__faq-item,
  .page-news__faq-question,
  .page-news__faq-answer {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }
  
  .page-news__cta-button,
  .page-news__read-more-button,
  .page-news__cta-button--large,
  .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;
    margin-bottom: 10px; /* Add space between stacked buttons */
  }

  .page-news__main-title {
    font-size: 1.8em;
  }
  .page-news__intro-description {
    font-size: 1em;
  }
  .page-news__section-title {
    font-size: 1.6em;
  }
  .page-news__cta-title {
    font-size: 1.8em;
  }
  .page-news__cta-button--large {
    font-size: 1.1em;
    padding: 15px 30px;
  }
  .page-news__article-content {
    padding: 15px;
  }
  .page-news__article-title {
    font-size: 1.2em;
  }
  .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__articles-grid {
    gap: 20px;
  }
  .page-news__content-heading {
    font-size: 1.5em;
  }
}

@media (max-width: 480px) {
  .page-news__main-title {
    font-size: 1.5em;
  }
  .page-news__intro-description {
    font-size: 0.9em;
  }
  .page-news__cta-title {
    font-size: 1.5em;
  }
  .page-news__cta-button--large {
    font-size: 1em;
    padding: 12px 25px;
  }
}