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

.page-company-news {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-dark); /* Default text color for light body background */
  background-color: var(--background-color); /* Default body background is white */
}

/* --- Fixed Header Offset --- */
/* Ensure the main content starts below the fixed header */
.page-company-news__hero-section {
  padding-top: var(--header-offset, 120px); /* Apply header offset */
}

/* --- General Container --- */
.page-company-news__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* --- Section Titles --- */
.page-company-news__section-title {
  font-size: 36px;
  font-weight: bold;
  color: var(--primary-color);
  text-align: center;
  margin-bottom: 40px;
  position: relative;
  padding-bottom: 15px;
}

.page-company-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-company-news__section-title--white {
  color: var(--text-light);
}

.page-company-news__section-title--white::after {
  background-color: var(--text-light);
}

/* --- Hero Section --- */
.page-company-news__hero-section {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(135deg, var(--primary-color) 0%, #4FAEE7 100%); /* Adjusted gradient for a better visual */
  padding-bottom: 60px; /* Added padding-bottom for hero section */
  overflow: hidden; /* Prevent content overflow */
}

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

.page-company-news__hero-image {
  width: 100%;
  margin-bottom: 30px;
  max-width: 100%;
  box-sizing: border-box;
}

.page-company-news__hero-image img {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.page-company-news__hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  width: 100%;
  color: var(--text-light);
  padding: 0 20px;
}

.page-company-news__main-title {
  font-size: 52px;
  font-weight: 800;
  margin-bottom: 20px;
  line-height: 1.2;
  color: var(--text-light);
}

.page-company-news__description-text {
  font-size: 20px;
  margin-bottom: 30px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  color: var(--text-light);
  opacity: 0.9;
}

.page-company-news__cta-button {
  display: inline-block;
  padding: 18px 45px;
  background: var(--login-button-color); /* Use login button color for CTA */
  color: var(--text-light);
  text-decoration: none;
  border-radius: 50px;
  font-size: 20px;
  font-weight: bold;
  margin-top: 30px;
  transition: all 0.3s ease;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  border: none;
  cursor: pointer;
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

.page-company-news__cta-button:hover {
  background: #C46600; /* Slightly darker orange on hover */
  transform: translateY(-3px);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.3);
}

/* --- Latest Updates Section --- */
.page-company-news__latest-updates {
  padding: 60px 0;
  background-color: var(--background-color);
}

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

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

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

.page-company-news__news-image {
  width: 100%;
  height: 220px; /* Fixed height for consistency */
  object-fit: cover;
  display: block;
}

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

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

.page-company-news__card-title .page-company-news__card-link {
  color: var(--text-dark);
  text-decoration: none;
  transition: color 0.3s ease;
}

.page-company-news__card-title .page-company-news__card-link:hover {
  color: var(--primary-color);
}

.page-company-news__card-date {
  font-size: 14px;
  color: #888;
  margin-bottom: 15px;
}

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

.page-company-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-size: 15px;
  font-weight: 600;
  transition: background-color 0.3s ease;
  align-self: flex-start;
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

.page-company-news__read-more-button:hover {
  background-color: #1a88c7;
}

/* --- Featured Story Section --- */
.page-company-news__featured-story {
  padding: 80px 0;
  background-color: var(--primary-color); /* Dark background */
  color: var(--text-light); /* Light text */
}

.page-company-news__story-content {
  display: flex;
  gap: 40px;
  align-items: flex-start;
  margin-top: 40px;
}

.page-company-news__story-image {
  flex: 0 0 500px; /* Fixed width for desktop */
  max-width: 500px;
  height: auto;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  display: block;
}

.page-company-news__story-text {
  flex: 1;
}

.page-company-news__story-subtitle {
  font-size: 30px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text-light);
}

.page-company-news__story-text p {
  margin-bottom: 15px;
  font-size: 17px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.9);
}

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

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

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

/* FAQ默认状态 - 答案隐藏 */
.page-company-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 20px;
  opacity: 0;
  background: #f9f9f9;
}

/* FAQ展开状态 - 🚨 使用!important và đủ lớn max-height để đảm bảo có thể mở rộng */
.page-company-news__faq-item.active .page-company-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 !important;
  opacity: 1;
  background: #f9f9f9;
  border-radius: 0 0 8px 8px;
}

/* Vấn đề phong cách */
.page-company-news__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: var(--secondary-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  position: relative;
}

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

.page-company-news__faq-question:hover {
  background: #f5f5f5;
  border-color: #d0d0d0;
}

.page-company-news__faq-question:active {
  background: #eeeeee;
}

/* Vấn đề tiêu đề phong cách */
.page-company-news__faq-question h3 {
  margin: 0;
  padding: 0;
  flex: 1;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text-dark);
  pointer-events: none; /* Ngăn thẻ h3 chặn sự kiện click */
}

/* Chuyển đổi biểu tượng */
.page-company-news__faq-toggle {
  font-size: 28px;
  font-weight: bold;
  line-height: 1;
  color: var(--primary-color);
  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: 32px;
  height: 32px;
}

.page-company-news__faq-item.active .page-company-news__faq-toggle {
  color: var(--primary-color);
  transform: rotate(45deg); /* Sử dụng xoay để tạo hiệu ứng '+' thành 'x' */
}


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

.page-company-news__cta-container {
  max-width: 900px;
  padding: 0 20px; /* Ensure padding for mobile */
}

.page-company-news__cta-text {
  font-size: 20px;
  margin-bottom: 40px;
  color: rgba(255, 255, 255, 0.9);
}

.page-company-news__cta-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap; /* Allow wrapping on small screens */
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.page-company-news__btn-primary,
.page-company-news__btn-secondary {
  display: inline-block;
  padding: 18px 40px;
  text-decoration: none;
  border-radius: 50px;
  font-size: 18px;
  font-weight: bold;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

.page-company-news__btn-primary {
  background: var(--login-button-color);
  color: var(--text-light);
  border: 2px solid var(--login-button-color);
}

.page-company-news__btn-primary:hover {
  background: #C46600;
  border-color: #C46600;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.page-company-news__btn-secondary {
  background: var(--secondary-color);
  color: var(--primary-color);
  border: 2px solid var(--secondary-color);
}

.page-company-news__btn-secondary:hover {
  background: #f0f0f0;
  color: #1a88c7;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* --- Responsive Design (Mobile) --- */
@media (max-width: 768px) {
  .page-company-news {
    font-size: 16px;
    line-height: 1.6;
  }

  /* --- Fixed Header Offset (Mobile) --- */
  .page-company-news__hero-section {
    padding-top: var(--header-offset, 120px) !important; /* Mobile specific header offset */
    padding-bottom: 40px;
  }

  .page-company-news__container {
    padding: 30px 15px;
  }

  .page-company-news__section-title {
    font-size: 28px;
    margin-bottom: 30px;
  }

  /* --- Hero Section Mobile --- */
  .page-company-news__main-title {
    font-size: 36px;
    margin-bottom: 15px;
  }

  .page-company-news__description-text {
    font-size: 17px;
    margin-bottom: 20px;
  }

  .page-company-news__cta-button {
    padding: 15px 30px;
    font-size: 17px;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    margin-top: 20px;
  }

  /* --- Latest Updates Section Mobile --- */
  .page-company-news__news-grid {
    grid-template-columns: 1fr; /* Single column for mobile */
    gap: 25px;
  }

  .page-company-news__news-card {
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
  }

  .page-company-news__news-image {
    height: 180px; /* Adjust height for mobile */
  }

  .page-company-news__card-content {
    padding: 20px;
  }

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

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

  .page-company-news__read-more-button {
    padding: 10px 18px;
    font-size: 14px;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
  }

  /* --- Featured Story Section Mobile --- */
  .page-company-news__featured-story {
    padding: 50px 0;
  }

  .page-company-news__story-content {
    flex-direction: column; /* Stack image and text */
    gap: 30px;
  }

  .page-company-news__story-image {
    flex: 1 1 auto; /* Allow image to take full width */
    max-width: 100%;
  }

  .page-company-news__story-subtitle {
    font-size: 24px;
  }

  .page-company-news__story-text p {
    font-size: 16px;
  }

  /* --- FAQ Section Mobile --- */
  .page-company-news__faq-section {
    padding: 40px 0;
  }
  
  .page-company-news__faq-list {
    margin-top: 30px;
  }

  .page-company-news__faq-question {
    padding: 15px;
  }
  
  .page-company-news__faq-question h3 {
    font-size: 16px;
  }
  
  .page-company-news__faq-toggle {
    font-size: 24px;
    width: 28px;
    height: 28px;
  }

  .page-company-news__faq-item.active .page-company-news__faq-answer {
    padding: 15px !important;
  }

  /* --- CTA Section Mobile --- */
  .page-company-news__cta-section {
    padding: 50px 0;
  }

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

  .page-company-news__cta-buttons {
    flex-direction: column; /* Stack buttons vertically */
    gap: 15px;
    padding: 0 15px; /* Add padding to button container */
  }

  .page-company-news__btn-primary,
  .page-company-news__btn-secondary {
    padding: 15px 30px;
    font-size: 17px;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
  }
  
  /* Global Image Responsive (Mobile) */
  .page-company-news img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    box-sizing: border-box !important;
  }
  
  .page-company-news__section, /* generic section class not in use, but for safety */
  .page-company-news__card, /* generic card class not in use, but for safety */
  .page-company-news__container, /* generic container class not in use, but for safety */
  .page-company-news__hero-section,
  .page-company-news__latest-updates,
  .page-company-news__featured-story,
  .page-company-news__faq-section,
  .page-company-news__cta-section {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 0;
    padding-right: 0;
  }
  /* Specific padding for containers within sections */
  .page-company-news__latest-updates .page-company-news__container,
  .page-company-news__featured-story .page-company-news__container,
  .page-company-news__faq-section .page-company-news__container,
  .page-company-news__cta-section .page-company-news__container {
    padding-left: 15px;
    padding-right: 15px;
  }
}