/* style/news.css */

/* Base styles for the news page content */
.page-news {
  font-family: 'Arial', sans-serif;
  line-height: 1.6;
  color: #333333; /* Dark text for light body background */
  background-color: var(--secondary-color); /* Matches body background */
}

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

.page-news__section {
  padding: 60px 0;
  border-bottom: 1px solid #e0e0e0;
}

.page-news__section:last-of-type {
  border-bottom: none;
}

.page-news__section-title {
  font-size: 32px;
  color: var(--primary-color);
  text-align: center;
  margin-bottom: 40px;
  font-weight: bold;
}

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

.page-news__text-block {
  font-size: 16px;
  margin-bottom: 20px;
  text-align: justify;
}

.page-news__text-block--light {
  color: #f0f0f0;
}

/* 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: linear-gradient(135deg, var(--primary-color) 0%, #000000 100%); /* Dark gradient for hero */
  color: #ffffff;
  overflow: hidden; /* Ensure image doesn't overflow */
}

.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; /* Ensure content is above any background effects */
}

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

.page-news__hero-image img {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
  object-fit: cover;
}

.page-news__hero-content {
  text-align: center;
  width: 100%;
}

.page-news__main-title {
  font-size: 48px;
  margin-bottom: 20px;
  line-height: 1.2;
  color: #FFFF00; /* Bright yellow for main title on dark background */
}

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

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

.page-news__cta-button {
  display: inline-block;
  padding: 15px 40px;
  text-decoration: none;
  border-radius: 8px;
  font-size: 18px;
  font-weight: bold;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  min-width: 180px; /* Ensure buttons have a minimum width */
  text-align: center;
}

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

.page-news__btn-primary:hover {
  background: darken(var(--primary-color), 10%);
  border-color: darken(var(--primary-color), 10%);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

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

.page-news__btn-secondary:hover {
  background: darken(#C30808, 10%);
  border-color: darken(#C30808, 10%);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

/* Introduction Section */
.page-news__introduction .page-news__text-block {
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

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

.page-news__article-card {
  background: #ffffff;
  border-radius: 12px;
  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;
}

.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: 225px; /* Fixed height for consistency */
  object-fit: cover;
  display: block;
}

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

.page-news__article-title {
  font-size: 22px;
  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: darken(var(--primary-color), 10%);
}

.page-news__article-meta {
  font-size: 14px;
  color: #666;
  margin-bottom: 15px;
}

.page-news__article-summary {
  font-size: 15px;
  color: #555;
  margin-bottom: 20px;
  flex-grow: 1; /* Allow summary to take available space */
}

.page-news__read-more {
  display: inline-flex;
  align-items: center;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s ease;
  margin-top: auto; /* Push to bottom */
}

.page-news__read-more:hover {
  color: darken(var(--primary-color), 10%);
}

.page-news__arrow {
  margin-left: 8px;
  transition: transform 0.3s ease;
}

.page-news__read-more:hover .page-news__arrow {
  transform: translateX(5px);
}

/* Industry Updates, Betting Tips, Promotions, Guides */
.page-news__content-wrapper {
  display: flex;
  align-items: center;
  gap: 40px;
  margin-bottom: 40px;
}

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

.page-news__main-image {
  flex: 1;
  min-width: 400px; /* Minimum width for image in desktop */
  border-radius: 12px;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
  width: 100%; /* Ensure img fills its flex container */
  height: auto;
  object-fit: cover;
}

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

.page-news__sub-title {
  font-size: 28px;
  color: var(--primary-color);
  margin-bottom: 20px;
}

/* Latest Articles List */
.page-news__articles-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 40px;
}

.page-news__article-item {
  background: #ffffff;
  padding: 20px 25px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.page-news__article-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.page-news__article-list-title {
  font-size: 20px;
  margin-top: 0;
  margin-bottom: 8px;
}

.page-news__article-list-title a {
  color: #333333;
  text-decoration: none;
  transition: color 0.3s ease;
}

.page-news__article-list-title a:hover {
  color: var(--primary-color);
}

.page-news__article-meta {
  font-size: 14px;
  color: #666;
}

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

.page-news__pagination-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border: 1px solid var(--primary-color);
  border-radius: 5px;
  color: var(--primary-color);
  text-decoration: none;
  transition: all 0.3s ease;
  font-weight: bold;
}

.page-news__pagination-link:hover {
  background: var(--primary-color);
  color: #ffffff;
}

.page-news__pagination-link--active {
  background: var(--primary-color);
  color: #ffffff;
}

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

/* FAQ container styles */
.page-news__faq-item {
  margin-bottom: 15px;
  border-radius: 8px; /* Slightly larger radius */
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08); /* Add shadow for depth */
}

/* FAQ default state - answer hidden */
.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 20px; /* Adjusted padding */
  opacity: 0;
  color: #555; /* Darker text for answer */
}

/* FAQ expanded state - 🚨 Use!important and sufficiently large max-height */
.page-news__faq-item.active .page-news__faq-answer {
  max-height: 2000px !important; /* 🚨 Use!important ensure priority, value large enough to contain any content */
  padding: 20px !important; /* Adjusted padding */
  opacity: 1;
  background: #ffffff; /* Lighter background for answer */
  border-radius: 0 0 8px 8px; /* Match item border-radius */
}

/* Question styles */
.page-news__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px; /* Match item border-radius */
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  color: #333; /* Dark text for question */
}

.page-news__faq-item.active .page-news__faq-question {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-color: var(--primary-color); /* Highlight active question */
}

.page-news__faq-question:hover {
  background: #f5f5f5;
  border-color: #d0d0d0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

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

/* Question title style */
.page-news__faq-question h3 {
  margin: 0;
  padding: 0;
  flex: 1;
  font-size: 18px; /* Slightly larger font */
  font-weight: 600;
  line-height: 1.5;
  pointer-events: none; /* Prevent h3 from blocking click event */
  color: var(--primary-color);
}

/* Toggle icon */
.page-news__faq-toggle {
  font-size: 28px; /* Larger icon */
  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 event */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; /* Larger toggle area */
  height: 32px;
}

.page-news__faq-item.active .page-news__faq-toggle {
  color: var(--primary-color); /* Highlight active toggle */
  transform: rotate(45deg); /* Rotate for 'x' effect */
}

/* Bottom CTA Section */
.page-news__cta-bottom .page-news__container {
  background: var(--primary-color);
  padding: 40px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.page-news__cta-bottom .page-news__section-title {
  color: #ffffff;
  margin-bottom: 20px;
}

.page-news__cta-bottom .page-news__text-block {
  color: #f0f0f0;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 30px;
}

/* --- Responsive Design --- */
@media (max-width: 1024px) {
  .page-news__hero-image {
    margin-bottom: 20px;
  }
  .page-news__main-title {
    font-size: 40px;
  }
  .page-news__hero-description {
    font-size: 17px;
  }
  .page-news__section-title {
    font-size: 28px;
  }
  .page-news__article-title {
    font-size: 20px;
  }
  .page-news__sub-title {
    font-size: 24px;
  }
  .page-news__content-wrapper {
    flex-direction: column;
    gap: 30px;
  }
  .page-news__content-wrapper--reverse {
    flex-direction: column; /* Also column for reverse */
  }
  .page-news__main-image {
    min-width: unset; /* Remove min-width on smaller screens */
    width: 100%;
  }
}

@media (max-width: 768px) {
  /* Mobile header spacing */
  .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: 8px;
  }

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

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

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

  /* Buttons responsive */
  .page-news__cta-button,
  .page-news__btn-primary,
  .page-news__btn-secondary,
  .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: 12px 20px;
    font-size: 16px;
  }

  /* Images responsive */
  .page-news img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }

  .page-news__section,
  .page-news__card,
  .page-news__container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }
  
  .page-news__section-title {
    font-size: 24px;
    margin-bottom: 30px;
  }

  .page-news__text-block {
    font-size: 15px;
  }
}