/* style/news.css */
/* body đã có padding-top: var(--header-offset)；tránh trùng lặp */
.page-news {
  color: #ffffff; /* Body background is dark, so text is light */
  background-color: #000000; /* Ensure main content area has a background to blend with body */
  font-family: Arial, sans-serif;
  line-height: 1.6;
}

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

/* Hero Section */
.page-news__hero-section {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 0;
  padding-top: 10px; /* Small top padding for visual spacing, body handles header offset */
  background-color: #017439; /* Use brand color for hero section background */
  overflow: hidden;
}

.page-news__hero-image-wrapper {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
  margin-bottom: 30px; /* Space between image and text */
}

.page-news__hero-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  min-height: 200px; /* Minimum size requirement */
}

.page-news__hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  padding: 0 20px;
  color: #ffffff;
}

.page-news__main-title {
  font-size: clamp(2em, 4vw, 3.2em); /* Responsive font size for H1 */
  font-weight: bold;
  margin-bottom: 20px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.page-news__hero-description {
  font-size: 1.1em;
  margin-bottom: 30px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

/* Section Titles and Descriptions */
.page-news__section-title {
  font-size: 2.5em;
  font-weight: bold;
  text-align: center;
  margin-bottom: 20px;
  color: #ffffff; /* Default for dark sections */
}

.page-news__section-description {
  font-size: 1.1em;
  text-align: center;
  margin-bottom: 40px;
  color: #f0f0f0; /* Default for dark sections */
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* Buttons */
.page-news__cta-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap; /* Allow buttons to wrap on smaller screens */
}

.page-news__btn-primary,
.page-news__btn-secondary {
  display: inline-block;
  padding: 15px 30px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  transition: all 0.3s ease;
  min-width: 150px;
  text-align: center;
  box-sizing: border-box;
  max-width: 100%; /* Ensure buttons adapt to container */
  white-space: normal; /* Allow text to wrap */
  word-wrap: break-word; /* Break long words */
}

.page-news__btn-primary {
  background-color: #C30808; /* Custom color for register/login */
  color: #FFFF00; /* Custom color for register/login font */
  border: 2px solid #C30808;
}

.page-news__btn-primary:hover {
  background-color: #a00606;
  border-color: #a00606;
  color: #ffffff;
}

.page-news__btn-secondary {
  background-color: transparent;
  color: #ffffff;
  border: 2px solid #ffffff;
}

.page-news__btn-secondary:hover {
  background-color: #ffffff;
  color: #017439;
}

/* Latest Articles Section */
.page-news__latest-articles {
  padding: 80px 0;
  background-color: #000000; /* Dark background for this section */
  color: #ffffff;
}

.page-news__latest-articles .page-news__section-title {
  color: #ffffff;
}

.page-news__latest-articles .page-news__section-description {
  color: #f0f0f0;
}

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

.page-news__article-card {
  background: rgba(255, 255, 255, 0.1); /* Semi-transparent white for cards on dark background */
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  color: #ffffff;
}

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

.page-news__card-image {
  width: 100%;
  height: 220px; /* Fixed height for consistent card appearance */
  object-fit: cover;
  display: block;
  min-width: 200px; /* Minimum size requirement */
  min-height: 200px;
}

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

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

.page-news__card-title a {
  color: #ffffff;
  text-decoration: none;
  transition: color 0.3s ease;
}

.page-news__card-title a:hover {
  color: #FFFF00; /* Highlight link on hover */
}

.page-news__card-meta {
  font-size: 0.9em;
  color: #cccccc;
  margin-bottom: 15px;
}

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

.page-news__read-more {
  display: inline-block;
  color: #FFFF00; /* Use highlight color for read more */
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s ease;
  margin-top: auto; /* Push to bottom */
}

.page-news__read-more:hover {
  text-decoration: underline;
}

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

/* Categories Section */
.page-news__categories {
  padding: 80px 0;
  background-color: #017439; /* Brand color background */
  color: #ffffff;
}

.page-news__categories .page-news__section-title {
  color: #ffffff;
}

.page-news__categories .page-news__section-description {
  color: #f0f0f0;
}

.page-news__category-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-top: 40px;
}

.page-news__category-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.15);
  padding: 20px 30px;
  border-radius: 10px;
  transition: background 0.3s ease, transform 0.3s ease;
  min-width: 150px;
  flex: 1 1 auto; /* Allow items to grow and shrink */
  max-width: 250px; /* Max width for category items */
  box-sizing: border-box;
}

.page-news__category-item:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-3px);
}

.page-news__category-icon {
  font-size: 2.5em;
  margin-bottom: 10px;
}

.page-news__category-name {
  font-size: 1.1em;
  font-weight: bold;
  text-align: center;
}

/* CTA Section */
.page-news__cta-section {
  padding: 80px 0;
  background-color: #000000; /* Dark background */
  color: #ffffff;
}

.page-news__cta-section .page-news__container {
  display: flex;
  align-items: center;
  gap: 50px;
  flex-wrap: wrap;
}

.page-news__cta-content {
  flex: 1;
  min-width: 300px;
}

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

.page-news__cta-description {
  font-size: 1.1em;
  margin-bottom: 30px;
  color: #f0f0f0;
}

.page-news__cta-image-wrapper {
  flex: 1;
  min-width: 300px;
  text-align: center;
  max-width: 500px; /* Limit image size */
}

.page-news__cta-image {
  width: 100%;
  height: auto;
  border-radius: 12px;
  display: block;
  min-width: 200px;
  min-height: 200px;
}

/* FAQ Section */
.page-news__faq-section {
  padding: 80px 0;
  background-color: #017439; /* Brand color background */
  color: #ffffff;
}

.page-news__faq-section .page-news__section-title {
  color: #ffffff;
}

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

.page-news__faq-item {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  margin-bottom: 15px;
  overflow: hidden;
  color: #ffffff;
}

.page-news__faq-item summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  font-size: 1.2em;
  font-weight: bold;
  cursor: pointer;
  list-style: none; /* Hide default marker */
  outline: none;
  color: #ffffff;
  transition: background-color 0.3s ease;
}

.page-news__faq-item summary::-webkit-details-marker {
  display: none; /* Hide default marker for webkit browsers */
}

.page-news__faq-item summary:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

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

.page-news__faq-toggle {
  font-size: 1.5em;
  line-height: 1;
  margin-left: 15px;
  color: #FFFF00; /* Highlight toggle icon */
}

.page-news__faq-answer {
  padding: 0 25px 20px;
  font-size: 1em;
  color: #f0f0f0;
  line-height: 1.6;
}

.page-news__faq-answer p {
  margin-bottom: 10px;
}

.page-news__faq-answer a {
  color: #FFFF00;
  text-decoration: underline;
}

.page-news__faq-answer a:hover {
  color: #ffffff;
}


/* Responsive Design */
@media (max-width: 1024px) {
  .page-news__hero-section {
    padding: 40px 0;
    padding-top: 10px;
  }

  .page-news__main-title {
    font-size: clamp(1.8em, 5vw, 2.8em);
  }

  .page-news__section-title {
    font-size: 2em;
  }

  .page-news__latest-articles,
  .page-news__categories,
  .page-news__cta-section,
  .page-news__faq-section {
    padding: 60px 0;
  }

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

  .page-news__cta-section .page-news__container {
    flex-direction: column;
    text-align: center;
  }

  .page-news__cta-buttons {
    margin-top: 20px;
  }
}

@media (max-width: 768px) {
  .page-news__container {
    padding: 0 15px;
  }

  .page-news__hero-section {
    padding: 30px 0;
    padding-top: 10px !important;
  }

  .page-news__main-title {
    font-size: clamp(1.6em, 6vw, 2.5em);
  }

  .page-news__hero-description {
    font-size: 1em;
  }

  .page-news__section-title {
    font-size: 1.8em;
  }

  .page-news__section-description {
    font-size: 1em;
  }

  /* Buttons responsive */
  .page-news__cta-buttons {
    flex-direction: column;
    gap: 15px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 15px; /* Add padding to button container */
  }

  .page-news__btn-primary,
  .page-news__btn-secondary {
    width: 100% !important;
    max-width: 100% !important;
    padding: 12px 20px;
    font-size: 1em;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
  }

  /* Image responsive */
  .page-news img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
    min-width: 200px !important;
    min-height: 200px !important;
  }

  .page-news__section,
  .page-news__card,
  .page-news__container,
  .page-news__hero-image-wrapper,
  .page-news__cta-image-wrapper {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }
  .page-news__latest-articles .page-news__container,
  .page-news__categories .page-news__container,
  .page-news__cta-section .page-news__container,
  .page-news__faq-section .page-news__container {
    padding-left: 15px !important;
    padding-right: 15px !important;
  }

  .page-news__article-card {
    margin-bottom: 20px;
  }

  .page-news__category-item {
    flex: 1 1 100%; /* Stack categories vertically */
    max-width: 100%;
  }

  .page-news__cta-content,
  .page-news__cta-image-wrapper {
    min-width: unset;
    width: 100%;
  }
  .page-news__faq-item summary {
    font-size: 1.1em;
    padding: 15px 20px;
  }
  .page-news__faq-answer {
    padding: 0 20px 15px;
  }
}

/* Ensure all links have proper contrast */
.page-news a {
  color: #FFFF00; /* Use a bright color for links on dark backgrounds */
  text-decoration: none;
}
.page-news a:hover {
  text-decoration: underline;
}

/* Specific contrast adjustments */
.page-news__dark-section {
  background-color: #017439;
  color: #ffffff;
}

.page-news__light-bg {
  background-color: #000000; /* This section is dark */
  color: #ffffff;
}

.page-news__card {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}