/* News Section Styles */
.news-section {
  margin-top: 2rem;
  padding: 2rem 0;
}

.news-section h2 {
  font-size: 2.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.news-section p {
  font-size: 1.1rem;
  opacity: 0.9;
  margin-bottom: 2rem;
}

.news-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 15px;
  overflow: hidden;
  transition: all 0.3s ease;
  height: 100%;
  position: relative;
}

.news-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.15);
}

.news-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.news-card:hover img {
  transform: scale(1.05);
}

.news-card-body {
  padding: 1.5rem;
  color: white;
  display: flex;
  flex-direction: column;
  height: calc(100% - 200px);
}

.news-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.4;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card-date {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 1rem;
  font-style: italic;
}

.news-card-link {
  color: #007bff;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
  margin-top: auto;
  display: inline-block;
  padding: 0.5rem 0;
}

.news-card-link:hover {
  color: #0056b3;
  text-decoration: underline;
}

.news-loading {
  text-align: center;
  color: white;
  padding: 2rem;
  font-size: 1.1rem;
}

/* "เพิ่มเติม" — link out to the full news archive on the NARIT website */
.news-more-btn {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.75rem 2.5rem;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50px;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: all 0.3s ease;
}

.news-more-btn:hover,
.news-more-btn:focus-visible {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.6);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255, 255, 255, 0.15);
}

.news-error {
  text-align: center;
  color: #ff6b6b;
  padding: 2rem;
  font-size: 1.1rem;
}

/* News Slider Styles */
.news-slider-section {
  margin-top: 3rem;
  padding: 2rem 0;
  /* background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%); */
  background:  rgba(0, 0, 0, 0.0);
  position: relative;
  overflow: hidden;
}

.news-slider-section h3 {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  text-align: center;
  color: white;
}

.news-slider-container {
  position: relative;
  overflow: hidden;
  padding: 0 50px;
}

.news-slider-track {
  display: flex;
  transition: transform 0.5s ease;
  gap: 20px;
}

.news-slider-item {
  flex: 0 0 300px;
  min-width: 300px;
}

.news-slider-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 15px;
  overflow: hidden;
  transition: all 0.3s ease;
  height: 400px;
  position: relative;
}

.news-slider-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.15);
}

.news-slider-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.news-slider-card:hover img {
  transform: scale(1.05);
}

.news-slider-card-body {
  padding: 1.5rem;
  color: white;
  display: flex;
  flex-direction: column;
  height: calc(100% - 200px);
}

.news-slider-card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.4;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-slider-card-date {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 1rem;
  font-style: italic;
}

.news-slider-card-link {
  color: #007bff;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
  margin-top: auto;
  display: inline-block;
  padding: 0.5rem 0;
  font-size: 0.9rem;
}

.news-slider-card-link:hover {
  color: #0056b3;
  text-decoration: underline;
}

/* Slider Navigation Buttons */
.slider-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
}

.slider-nav-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-50%) scale(1.1);
}

.slider-nav-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.slider-nav-btn.prev {
  left: 10px;
}

.slider-nav-btn.next {
  right: 10px;
}

/* Slider Dots */
.slider-dots {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
  gap: 10px;
}

.slider-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: all 0.3s ease;
}

.slider-dot.active {
  background: rgba(255, 255, 255, 0.8);
  transform: scale(1.2);
}

/* Responsive Design */
@media (max-width: 768px) {
  .news-section h2 {
    font-size: 2rem;
  }
  
  .news-section p {
    font-size: 1rem;
  }
  
  .news-card-title {
    font-size: 1rem;
  }
  
  .news-card-body {
    padding: 1rem;
  }

  .news-slider-section h3 {
    font-size: 1.5rem;
  }

  .news-slider-container {
    padding: 0 40px;
  }

  .news-slider-item {
    flex: 0 0 250px;
    min-width: 250px;
  }

  .slider-nav-btn {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }
}

@media (max-width: 576px) {
  .news-section {
    padding: 1rem 0;
  }
  
  .news-section h2 {
    font-size: 1.8rem;
  }
  
  .news-card img {
    height: 150px;
  }
  
  .news-card-body {
    height: calc(100% - 150px);
  }

  .news-slider-section {
    margin-top: 2rem;
    padding: 1rem 0;
  }

  .news-slider-container {
    padding: 0 30px;
  }

  .news-slider-item {
    flex: 0 0 200px;
    min-width: 200px;
  }

  .news-slider-card {
    height: 350px;
  }

  .news-slider-card img {
    height: 150px;
  }

  .news-slider-card-body {
    height: calc(100% - 150px);
    padding: 1rem;
  }
}

/* Animation for loading */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.news-card {
  animation: fadeInUp 0.6s ease-out;
}

.news-card:nth-child(1) { animation-delay: 0.1s; }
.news-card:nth-child(2) { animation-delay: 0.2s; }
.news-card:nth-child(3) { animation-delay: 0.3s; }
.news-card:nth-child(4) { animation-delay: 0.4s; }
.news-card:nth-child(5) { animation-delay: 0.5s; }
.news-card:nth-child(6) { animation-delay: 0.6s; }

/* Loading spinner */
.news-loading::before {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
  margin-right: 10px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
} 