/* Latest News Section */
.latest-news {
  padding: 6rem 2rem;
  background: #f9fafb;
  overflow: hidden;
  position: relative;
}

.news-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

.news-title {
  flex: 1 1 50%;
}

.news-desc {
  flex: 1 1 45%;
  color: #555;
  line-height: 1.7;
  font-size: 1rem;
}

/* Tag Line */
.news-title .tag-line {
  display: flex;
  align-items: center;
  margin-bottom: 0.8rem;
}

.news-title .tag-line .line {
  width: 50px;
  height: 3px;
  background-color: var(--color-green);
  margin-right: 0.6rem;
  border-radius: 2px;
}

.news-title .tag-line .text {
  color: var(--color-green);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.9rem;
}

.news-title h2 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-slate);
}

/* Slider */
.news-slider {
  position: relative;
  overflow: hidden;
}

.news-track {
  display: flex;
  gap: 2rem;
  animation: slideNews 40s linear infinite;
  width: max-content;
}

/* Individual Card */
.news-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  width: 340px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.news-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.news-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.news-content {
  padding: 1.5rem;
}

.news-content .date {
  font-size: 0.9rem;
  color: #888;
  margin-bottom: 0.5rem;
  display: block;
}

.news-content h3 {
  font-size: 1.1rem;
  color: var(--color-slate);
  margin-bottom: 0.6rem;
  line-height: 1.4;
}

.news-content p {
  color: #555;
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.read-more {
  display: inline-flex;
  align-items: center;
  color: var(--color-green);
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
}

.read-more i {
  margin-left: 6px;
  transition: transform 0.3s ease;
}

.read-more:hover i {
  transform: translateX(5px);
}

/* Animation */
@keyframes slideNews {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Responsive */
@media (max-width: 900px) {
  .news-header {
    flex-direction: column;
    text-align: center;
  }

  .news-desc {
    margin-top: 1rem;
  }

  .news-card {
    width: 280px;
  }
}
/* Responsive */
@media (max-width: 900px) {
    /* Adjust overall padding for mobile layout */
    .latest-news {
        padding: 4rem 0; 
    }

    /* 1. Alignment Fixes: Force all header content to align left */
    .news-header {
        flex-direction: column;
        margin-bottom: 2rem;
        /* Add horizontal padding back to the header elements */
        padding: 0 1.5rem; 
    }

    .news-title,
    .news-desc {
        flex: 1 1 100%;
        text-align: left; /* Critical: forces h2 and p left */
    }
    
    /* Ensures the flex-aligned tagline stays left */
    .news-title .tag-line {
        justify-content: flex-start;
    }

    .news-title h2 {
        font-size: 1.8rem;
    }

    /* 2. Slider Behavior: User-controlled horizontal scroll */
    .news-slider {
        /* Enable horizontal scrolling, hide vertical overflow */
        overflow-x: scroll; 
        overflow-y: hidden;
        /* Enable scroll snapping for clean card-by-card view */
        scroll-snap-type: x mandatory; 
        -webkit-overflow-scrolling: touch; /* Smoother scrolling on iOS */
        
        /* Add padding at the start so the first card doesn't touch the edge */
        padding-left: 1.5rem; 
        padding-bottom: 1rem; /* Space for the scrollbar */
    }

    .news-track {
        /* Disable automatic sliding animation */
        animation: none; 
        /* Keep content inline */
        width: max-content; 
        gap: 1.5rem; /* Tighter gap between cards */
    }

    .news-card {
        /* Set card width to show one main card plus a peek of the next */
        width: 80vw; 
        /* Ensure cards snap to the start of the viewport */
        scroll-snap-align: start;
        flex-shrink: 0; /* Important: prevents cards from collapsing */
    }
    
    /* Optional: Hide scrollbar in a subtle way (Webkit browsers only) */
    .news-slider::-webkit-scrollbar {
        height: 4px;
    }
    .news-slider::-webkit-scrollbar-thumb {
        background: rgba(0, 0, 0, 0.2);
        border-radius: 10px;
    }
}
