/* style/news.css */

/* Custom properties for colors from the prompt */
:root {
  --primary-color: #017439;
  --secondary-color: #FFFFFF;
  --register-button-color: #C30808;
  --login-button-color: #C30808;
  --text-on-dark-bg: #FFFFFF;
  --text-on-light-bg: #333333;
  --register-login-font-color: #FFFF00; /* This is for font color, not background */
}

/* Base styles for the news page */
.page-news {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-on-light-bg); /* Default text color for light body background */
  background-color: var(--secondary-color); /* Explicitly set for clarity, though shared.css might set body */
}

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

.page-news a:hover {
  color: #005f2a; /* Darker green */
}

/* 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); /* Ensures content is not hidden by fixed header */
  background: linear-gradient(135deg, var(--primary-color), #00A65A); /* Gradient with brand color */
  overflow: hidden; /* Prevent image overflow */
}

.page-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-news__hero-image {
  width: 100%;
  margin-bottom: 30px;
  position: relative;
  z-index: 1; /* Ensure image is behind content if content is overlaid */
}

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

.page-news__hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  width: 100%;
  color: var(--text-on-dark-bg); /* White text on dark hero background */
}

.page-news__main-title {
  font-size: 3.2em;
  margin-bottom: 15px;
  color: var(--text-on-dark-bg);
  font-weight: bold;
}

.page-news__hero-description {
  font-size: 1.2em;
  margin-bottom: 30px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  color: var(--text-on-dark-bg);
}

.page-news__cta-button {
  display: inline-block;
  padding: 15px 40px;
  background: var(--register-button-color); /* Using register button color for CTA */
  color: var(--register-login-font-color); /* Using specific font color */
  text-decoration: none;
  border-radius: 5px;
  font-size: 18px;
  font-weight: bold;
  margin-top: 20px;
  transition: all 0.3s ease;
  border: none;
}

.page-news__cta-button:hover {
  background: #a40707; /* Darker red */
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* General Section Styles */
.page-news__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
  box-sizing: border-box;
}

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

.page-news__section-description {
  font-size: 1.1em;
  text-align: center;
  max-width: 900px;
  margin: 0 auto 40px auto;
  color: var(--text-on-light-bg);
}

.page-news__light-bg {
  background-color: var(--secondary-color); /* White background */
  color: var(--text-on-light-bg); /* Dark text */
}

.page-news__dark-bg {
  background-color: var(--primary-color); /* Green background */
  color: var(--text-on-dark-bg); /* White text */
}

.page-news__dark-bg .page-news__section-title,
.page-news__dark-bg .page-news__section-description {
  color: var(--text-on-dark-bg);
}

/* Introduction Section */
.page-news__introduction-section {
  padding: 60px 0;
}

/* Articles Section */
.page-news__articles-section {
  padding: 60px 0;
}

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

.page-news__article-card {
  background-color: var(--secondary-color);
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.page-news__article-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.page-news__article-link {
  display: block;
  color: inherit; /* Inherit color from parent */
}

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

.page-news__article-title {
  font-size: 1.4em;
  color: var(--primary-color);
  margin: 20px 20px 10px 20px;
  padding: 0;
  line-height: 1.3;
}

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

.page-news__read-more-button {
  display: inline-block;
  padding: 10px 20px;
  background: #f0f0f0;
  color: var(--primary-color);
  text-align: center;
  border-radius: 5px;
  font-size: 0.9em;
  font-weight: bold;
  margin: 0 20px 20px 20px;
  transition: background-color 0.3s ease, color 0.3s ease;
  align-self: flex-start; /* Align button to start */
}

.page-news__read-more-button:hover {
  background: var(--primary-color);
  color: var(--text-on-dark-bg);
}

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

.page-news__pagination-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--primary-color);
  border-radius: 50%;
  color: var(--primary-color);
  font-weight: bold;
  transition: all 0.3s ease;
}

.page-news__pagination-item:hover {
  background-color: var(--primary-color);
  color: var(--text-on-dark-bg);
}

.page-news__pagination-item--active {
  background-color: var(--primary-color);
  color: var(--text-on-dark-bg);
}

/* Why Follow Section */
.page-news__why-follow-section {
  padding: 60px 0;
}

.page-news__benefits-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
}

.page-news__benefit-item {
  background-color: rgba(255, 255, 255, 0.1); /* Slightly transparent white on dark green */
  border-radius: 8px;
  padding: 30px;
  text-align: left;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  color: var(--text-on-dark-bg);
  height: 100%;
}

.page-news__benefit-title {
  font-size: 1.6em;
  color: var(--text-on-dark-bg);
  margin-top: 0;
  margin-bottom: 15px;
}

.page-news__benefit-item p {
  font-size: 1em;
  color: rgba(255, 255, 255, 0.85);
}

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

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

.page-news__faq-item {
  margin-bottom: 15px;
  border-radius: 5px;
  overflow: hidden;
  background-color: var(--secondary-color); /* White background for FAQ item */
}

.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 15px;
  opacity: 0;
  color: var(--text-on-light-bg);
}

.page-news__faq-item.active .page-news__faq-answer {
  max-height: 2000px !important; /* Use !important and sufficiently large value */
  padding: 20px 15px !important;
  opacity: 1;
  background: #f9f9f9; /* Slightly off-white for expanded answer */
  border-radius: 0 0 5px 5px;
}

.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;
  color: var(--text-on-light-bg);
}

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

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

.page-news__faq-question h3 {
  margin: 0;
  padding: 0;
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  pointer-events: none;
  color: var(--primary-color); /* FAQ question title in brand color */
}

.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;
  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); /* Toggle icon in brand color when active */
  transform: rotate(45deg); /* Rotate for 'x' effect, or keep '-' */
}

.page-news__faq-answer p {
  margin-bottom: 10px;
  color: var(--text-on-light-bg);
}

.page-news__faq-answer ul {
  padding-left: 20px;
  margin-top: 10px;
}

.page-news__faq-answer li {
  margin-bottom: 5px;
  color: var(--text-on-light-bg);
}

.page-news__text-link {
  color: var(--primary-color);
  font-weight: bold;
}
.page-news__text-link:hover {
  text-decoration: underline;
}

/* CTA Section */
.page-news__cta-section {
  padding: 60px 0;
  text-align: center;
}

.page-news__cta-title {
  font-size: 2.8em;
  color: var(--text-on-dark-bg);
  margin-bottom: 20px;
}

.page-news__cta-description {
  font-size: 1.2em;
  color: var(--text-on-dark-bg);
  max-width: 800px;
  margin: 0 auto 40px auto;
}

.page-news__cta-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap; /* Allow wrapping on smaller screens */
  width: 100%;
  max-width: 600px; /* Limit width of button group */
  margin: 0 auto;
}

.page-news__btn-primary,
.page-news__btn-secondary {
  display: inline-block;
  padding: 15px 30px;
  text-decoration: none;
  border-radius: 5px;
  font-size: 1.1em;
  font-weight: bold;
  transition: all 0.3s ease;
  min-width: 180px; /* Ensure buttons have a decent minimum width */
  text-align: center;
  box-sizing: border-box; /* Include padding and border in element's total width and height */
  white-space: normal; /* Allow text to wrap */
  word-wrap: break-word; /* Break long words */
}

.page-news__btn-primary {
  background: var(--register-button-color); /* Red */
  color: var(--register-login-font-color); /* Yellow text */
  border: 2px solid var(--register-button-color);
}
.page-news__btn-secondary {
  background: transparent;
  color: var(--register-button-color);
  border: 2px solid var(--register-button-color);
}
.page-news__btn-primary:hover {
  background: #a40707;
  border-color: #a40707;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.page-news__btn-secondary:hover {
  background: var(--register-button-color);
  color: var(--register-login-font-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}