/* style/news.css */

:root {
  --primary-color: #11A84E;
  --secondary-color: #22C768;
  --button-gradient: linear-gradient(180deg, #2AD16F 0%, #13994A 100%);
  --card-bg: #11271B;
  --background-color: #08160F;
  --text-main: #F2FFF6;
  --text-secondary: #A7D9B8;
  --border-color: #2E7A4E;
  --glow-color: #57E38D;
  --gold-color: #F2C14E;
  --divider-color: #1E3A2A;
  --deep-green-color: #0A4B2C;
}

.page-news {
  background-color: var(--background-color);
  color: var(--text-main);
  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;
  width: 100%; /* Ensure width is 100% for desktop too */
}

.page-news__hero-section {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 10px; /* Small top padding */
  padding-bottom: 60px;
  text-align: center;
  overflow: hidden;
}

.page-news__hero-image-wrapper {
  width: 100%;
  max-height: 500px;
  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 contrast */
}

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

.page-news__hero-title {
  font-size: clamp(2em, 4vw, 3.5em);
  color: var(--text-main);
  margin-bottom: 15px;
  font-weight: 700;
  line-height: 1.2;
}

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

.page-news__cta-button {
  display: inline-block;
  background: var(--button-gradient);
  color: #ffffff; /* White text for contrast */
  padding: 15px 30px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: bold;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  border: none;
  cursor: pointer;
}

.page-news__cta-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

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

.page-news__section-description {
  font-size: 1.1em;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 40px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.page-news__latest-news-section,
.page-news__analysis-section,
.page-news__guide-section,
.page-news__community-section,
.page-news__cta-section {
  padding: 60px 0;
}

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

.page-news__news-card,
.page-news__guide-card,
.page-news__community-item {
  background-color: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.page-news__news-card:hover,
.page-news__guide-card:hover,
.page-news__community-item:hover {
  transform: translateY(-5px);
}

.page-news__card-image,
.page-news__guide-card-image,
.page-news__community-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

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

.page-news__card-title,
.page-news__guide-card-title,
.page-news__community-title {
  font-size: 1.4em;
  color: var(--text-main);
  margin-bottom: 10px;
  font-weight: 600;
}

.page-news__card-title a {
  color: var(--text-main);
  text-decoration: none;
}

.page-news__card-title a:hover {
  color: var(--secondary-color);
}

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

.page-news__card-excerpt {
  font-size: 1em;
  color: var(--text-secondary);
  margin-bottom: 20px;
  flex-grow: 1;
}

.page-news__read-more {
  display: inline-block;
  color: var(--secondary-color);
  text-decoration: none;
  font-weight: bold;
  position: relative;
  padding-bottom: 2px;
}

.page-news__read-more::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background-color: var(--secondary-color);
  transform: scaleX(0);
  transform-origin: bottom right;
  transition: transform 0.3s ease-out;
}

.page-news__read-more:hover::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}

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

.page-news__view-all-button {
  display: inline-block;
  background: var(--primary-color);
  color: #ffffff;
  padding: 12px 25px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

.page-news__view-all-button:hover {
  background-color: var(--secondary-color);
}

.page-news__analysis-section .page-news__content-grid {
  display: flex;
  gap: 30px;
  align-items: flex-start;
}

.page-news__text-block {
  flex: 2;
}

.page-news__image-block {
  flex: 1;
  min-width: 300px;
}

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

.page-news__sub-title {
  font-size: 1.8em;
  color: var(--text-main);
  margin-top: 30px;
  margin-bottom: 15px;
  font-weight: 600;
}

.page-news__analysis-section p {
  color: var(--text-secondary);
  margin-bottom: 15px;
}

.page-news__analysis-section p b {
  color: var(--text-main);
}

.page-news__cta-wrapper {
  text-align: center;
  margin-top: 60px;
}

.page-news__dark-bg {
  background-color: var(--deep-green-color);
  padding: 50px;
  border-radius: 12px;
  text-align: center;
}

.page-news__text-main {
  color: var(--text-main);
}

.page-news__text-secondary {
  color: var(--text-secondary);
}

/* Image and Video Responsiveness */
.page-news img,
.page-news video {
  max-width: 100%;
  height: auto;
  display: block;
}

.page-news__video-section,
.page-news__video-container,
.page-news__video-wrapper,
.page-news__news-grid,
.page-news__guide-grid,
.page-news__community-grid,
.page-news__analysis-section .page-news__content-grid,
.page-news__hero-section,
.page-news__latest-news-section,
.page-news__analysis-section,
.page-news__guide-section,
.page-news__community-section,
.page-news__cta-section {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .page-news__container {
    padding: 0 15px !important;
  }

  .page-news__hero-section {
    padding-bottom: 40px;
  }

  .page-news__hero-content-wrapper {
    position: static;
    transform: none;
    padding: 20px 15px;
    margin: 20px auto;
    background: rgba(0, 0, 0, 0.6); /* Adjust background for mobile */
  }

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

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

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

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

  .page-news__news-grid,
  .page-news__guide-grid,
  .page-news__community-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .page-news__analysis-section .page-news__content-grid {
    flex-direction: column;
  }

  .page-news__text-block,
  .page-news__image-block {
    flex: auto;
  }

  .page-news__sub-title {
    font-size: 1.5em;
  }

  /* Force full width for images and videos on mobile */
  .page-news img,
  .page-news video {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
  }

  /* Ensure all containers containing images/videos/buttons are responsive */
  .page-news__section,
  .page-news__card,
  .page-news__container,
  .page-news__hero-section,
  .page-news__latest-news-section,
  .page-news__analysis-section,
  .page-news__guide-section,
  .page-news__community-section,
  .page-news__cta-section,
  .page-news__video-section,
  .page-news__video-container,
  .page-news__video-wrapper,
  .page-news__cta-buttons,
  .page-news__button-group,
  .page-news__btn-container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important; /* Ensure no overflow */
  }

  /* Button specific mobile styles */
  .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-left: 15px;
    padding-right: 15px;
  }

  .page-news__cta-buttons,
  .page-news__button-group,
  .page-news__btn-container {
    flex-direction: column !important;
    gap: 10px;
    align-items: stretch; /* Stretch buttons to full width */
  }

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

  .page-news__hero-image {
    filter: brightness(0.5); /* More dim on mobile for better text contrast */
  }
}