/* style/news.css */

/* Custom Colors */
:root {
  --page-news-bg: #08160F;
  --page-news-card-bg: #11271B;
  --page-news-text-main: #F2FFF6;
  --page-news-text-secondary: #A7D9B8;
  --page-news-border: #2E7A4E;
  --page-news-glow: #57E38D;
  --page-news-gold: #F2C14E;
  --page-news-divider: #1E3A2A;
  --page-news-deep-green: #0A4B2C;
  --page-news-btn-gradient: linear-gradient(180deg, #2AD16F 0%, #13994A 100%);
}

.page-news {
  background-color: var(--page-news-bg); /* Matches background color rule */
  color: var(--page-news-text-main); /* Ensures text contrast on dark background */
  font-family: Arial, sans-serif;
  line-height: 1.6;
}

.page-news h1, .page-news h2, .page-news h3, .page-news h4, .page-news h5, .page-news h6 {
  color: var(--page-news-text-main);
  margin-bottom: 15px;
  line-height: 1.2;
}

.page-news a {
  color: var(--page-news-glow);
  text-decoration: none;
}

.page-news a:hover {
  text-decoration: underline;
  color: var(--page-news-gold);
}

.page-news__section {
  padding: 40px 0;
  border-bottom: 1px solid var(--page-news-divider);
}

.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;
  text-align: center;
  padding: 10px 0 60px 0; /* Small top padding, body handles header offset */
  overflow: hidden;
}

.page-news__hero-image-wrapper {
  width: 100%;
  max-height: 600px; /* Limit height for hero image */
  overflow: hidden;
  position: relative;
}

.page-news__hero-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  filter: brightness(0.7); /* Slightly dim the image for text readability */
}

.page-news__hero-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  max-width: 900px;
  padding: 20px;
  background: rgba(0, 0, 0, 0.4); /* Semi-transparent overlay for text readability */
  border-radius: 8px;
  box-sizing: border-box;
}

.page-news__main-title {
  font-size: clamp(2em, 4vw, 3.5em); /* H1 font size with clamp */
  font-weight: bold;
  color: var(--page-news-text-main);
  margin-bottom: 20px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.page-news__hero-description {
  font-size: 1.1em;
  color: var(--page-news-text-secondary);
  margin-bottom: 30px;
}

.page-news__cta-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.page-news__btn-primary,
.page-news__btn-secondary {
  padding: 12px 25px;
  border-radius: 8px;
  font-weight: bold;
  font-size: 1em;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  display: inline-block;
  box-sizing: border-box;
  max-width: 100%; /* Ensures button fits container */
  white-space: normal; /* Allows text to wrap */
  word-wrap: break-word;
}

.page-news__btn-primary {
  background: var(--page-news-btn-gradient);
  color: var(--page-news-text-main);
  border: 2px solid transparent;
}

.page-news__btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(var(--page-news-glow), 0.4);
}

.page-news__btn-secondary {
  background: var(--page-news-bg);
  color: var(--page-news-glow);
  border: 2px solid var(--page-news-glow);
}

.page-news__btn-secondary:hover {
  background: var(--page-news-glow);
  color: var(--page-news-bg);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(var(--page-news-glow), 0.4);
}

/* Introduction Section */
.page-news__introduction .page-news__paragraph {
  color: var(--page-news-text-secondary);
}

/* Featured News Section */
.page-news__section-title {
  font-size: 2.2em;
  font-weight: bold;
  text-align: center;
  margin-bottom: 40px;
  color: var(--page-news-gold);
}

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

.page-news__news-card {
  background-color: var(--page-news-card-bg); /* Card BG color */
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  color: var(--page-news-text-secondary);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.page-news__news-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(var(--page-news-glow), 0.2);
}

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

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

.page-news__card-title {
  font-size: 1.4em;
  font-weight: bold;
  margin-bottom: 10px;
  color: var(--page-news-text-main);
  line-height: 1.3;
}

.page-news__card-title a {
  color: inherit;
  text-decoration: none;
}

.page-news__card-title a:hover {
  color: var(--page-news-glow);
  text-decoration: underline;
}

.page-news__card-meta {
  font-size: 0.9em;
  color: var(--page-news-text-secondary);
  margin-bottom: 15px;
}

.page-news__card-description {
  font-size: 1em;
  margin-bottom: 20px;
  flex-grow: 1;
}

.page-news__card-link {
  color: var(--page-news-glow);
  font-weight: bold;
  display: inline-block;
  margin-top: auto;
}

.page-news__card-link:hover {
  text-decoration: underline;
}

.page-news__view-all-button {
  text-align: center;
  margin-top: 30px;
}

/* Guides & Tips Section */
.page-news__guides-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.page-news__guide-item {
  background-color: var(--page-news-card-bg); /* Card BG color */
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  padding: 20px;
  text-align: center;
  color: var(--page-news-text-secondary);
}

.page-news__guide-image {
  width: 100%;
  max-width: 300px; /* Limit image width within guide card */
  height: auto;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 20px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.page-news__guide-title {
  font-size: 1.3em;
  font-weight: bold;
  color: var(--page-news-text-main);
  margin-bottom: 15px;
}

.page-news__guide-text {
  font-size: 0.95em;
}

/* System Updates Section */
.page-news__system-updates {
  background-color: var(--page-news-deep-green);
  padding: 60px 0;
}

.page-news__system-updates .page-news__section-title {
  color: var(--page-news-text-main);
}

.page-news__update-content {
  display: flex;
  gap: 40px;
  align-items: center;
}

.page-news__update-image {
  width: 100%;
  max-width: 500px;
  height: auto;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

.page-news__update-text {
  flex: 1;
}

.page-news__update-text .page-news__paragraph {
  color: var(--page-news-text-secondary);
  margin-bottom: 20px;
}

/* FAQ Section */
.page-news__faq-section {
  background-color: var(--page-news-bg);
}

.page-news__faq-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.page-news__faq-item {
  background-color: var(--page-news-card-bg); /* Card BG color */
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
  color: var(--page-news-text-main);
}

.page-news__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  cursor: pointer;
  font-weight: bold;
  font-size: 1.1em;
  color: var(--page-news-text-main);
  transition: background-color 0.3s ease;
  list-style: none; /* Remove default marker for details */
}

.page-news__faq-question::-webkit-details-marker {
  display: none; /* Remove default marker for details in webkit */
}

.page-news__faq-item[open] .page-news__faq-question {
  background-color: var(--page-news-deep-green);
}

.page-news__faq-question:hover {
  background-color: var(--page-news-deep-green);
}

.page-news__faq-toggle {
  font-size: 1.5em;
  line-height: 1;
  margin-left: 10px;
}

.page-news__faq-answer {
  padding: 0 20px 15px;
  color: var(--page-news-text-secondary);
  font-size: 0.95em;
}

.page-news__faq-item:not([open]) .page-news__faq-answer {
  display: none;
}

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

.page-news__cta-bottom .page-news__paragraph {
  color: var(--page-news-text-secondary);
  margin-bottom: 30px;
}

/* Responsive Design */
@media (max-width: 992px) {
  .page-news__hero-content {
    max-width: 700px;
  }

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

  .page-news__update-content {
    flex-direction: column;
    text-align: center;
  }

  .page-news__update-image {
    max-width: 80%;
  }
}

@media (max-width: 768px) {
  .page-news__hero-content {
    width: 90%;
    padding: 15px;
  }

  .page-news__main-title {
    font-size: clamp(1.5em, 6vw, 2.5em);
    margin-bottom: 15px;
  }

  .page-news__hero-description {
    font-size: 1em;
    margin-bottom: 20px;
  }

  .page-news__cta-buttons {
    flex-direction: column;
    gap: 10px;
  }

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

  .page-news__section-title {
    font-size: 1.8em;
    margin-bottom: 30px;
  }

  .page-news__news-grid,
  .page-news__guides-grid {
    grid-template-columns: 1fr;
  }

  .page-news__card-image,
  .page-news__guide-image {
    height: auto;
    max-width: 100% !important;
    width: 100% !important;
    display: block !important;
  }

  .page-news__update-image {
    max-width: 100%;
  }

  .page-news img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
  }

  .page-news__container,
  .page-news__section,
  .page-news__news-card,
  .page-news__guide-item,
  .page-news__faq-item,
  .page-news__cta-buttons {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
    overflow-x: hidden;
  }

  .page-news__hero-section,
  .page-news__introduction,
  .page-news__featured-news,
  .page-news__guides-tips,
  .page-news__system-updates,
  .page-news__faq-section,
  .page-news__cta-bottom {
    padding-left: 0;
    padding-right: 0;
  }

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

  .page-news__faq-question {
    font-size: 1em;
  }
}