/**
 * 溙鼎環境科技 - 新聞頁面樣式
 */

/* News Hero */
.news-hero {
  padding: 60px 0 40px;
  text-align: center;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

/* News Carousel */
.news-carousel-section {
  padding: 40px 0;
  background: #fff;
}

.news-carousel {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.carousel-track {
  display: flex;
  transition: transform 0.5s ease;
}

.carousel-item {
  min-width: 100%;
  position: relative;
  aspect-ratio: 16/9;
  background: #1a1a2e;
}

.carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 60px 40px 40px;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  color: white;
}

.carousel-category {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 12px;
}

.carousel-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.3;
}

.carousel-title a {
  color: white;
  text-decoration: none;
  transition: opacity 0.2s;
}

.carousel-title a:hover {
  opacity: 0.9;
}

.carousel-summary {
  font-size: 16px;
  opacity: 0.9;
  max-width: 600px;
  line-height: 1.6;
  margin-bottom: 16px;
}

.carousel-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 14px;
  opacity: 0.8;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  color: #333;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 10;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.carousel-btn:hover {
  background: white;
  transform: translateY(-50%) scale(1.1);
}

.carousel-btn.prev { left: 20px; }
.carousel-btn.next { right: 20px; }

.carousel-dots {
  position: absolute;
  bottom: 20px;
  right: 40px;
  display: flex;
  gap: 8px;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  border: none;
  cursor: pointer;
  transition: all 0.3s;
}

.carousel-dot.active {
  background: white;
  transform: scale(1.2);
}

.carousel-dot:hover {
  background: rgba(255,255,255,0.8);
}

/* Filter Tabs */
.news-filter {
  padding: 30px 0;
  background: #fff;
  border-bottom: 1px solid #eee;
}

.filter-tabs {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.filter-tab {
  padding: 10px 20px;
  border: 1px solid #e0e0e0;
  border-radius: 25px;
  background: white;
  color: #666;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-tab:hover {
  border-color: #4CAF50;
  color: #4CAF50;
}

.filter-tab.active {
  background: #4CAF50;
  border-color: #4CAF50;
  color: white;
}

/* News List */
.news-list-section {
  padding: 50px 0;
  min-height: 400px;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.news-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  transition: all 0.3s;
}

.news-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.news-card-image {
  aspect-ratio: 16/9;
  overflow: hidden;
  position: relative;
}

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

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

.news-card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  color: white;
}

.news-card-content {
  padding: 20px;
}

.news-card-category {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 15px;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 10px;
}

.news-card-title {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 10px;
  color: #1a1a2e;
}

.news-card-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

.news-card-title a:hover {
  color: #4CAF50;
}

.news-card-summary {
  font-size: 14px;
  color: #666;
  line-height: 1.6;
  margin-bottom: 15px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 15px;
  border-top: 1px solid #f0f0f0;
  font-size: 13px;
  color: #999;
}

.news-card-date {
  display: flex;
  align-items: center;
  gap: 6px;
}

.news-card-views {
  display: flex;
  align-items: center;
  gap: 6px;
}

.news-card-link {
  color: #4CAF50;
  font-weight: 500;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: gap 0.2s;
}

.news-card:hover .news-card-link {
  gap: 8px;
}

/* Pagination */
.news-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 40px;
}

.pagination-btn {
  min-width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: white;
  color: #666;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.pagination-btn:hover:not(:disabled) {
  border-color: #4CAF50;
  color: #4CAF50;
}

.pagination-btn.active {
  background: #4CAF50;
  border-color: #4CAF50;
  color: white;
}

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

/* Empty State */
.news-empty {
  text-align: center;
  padding: 80px 20px;
  color: #999;
}

.news-empty i {
  font-size: 64px;
  margin-bottom: 20px;
  color: #ddd;
}

.news-empty h3 {
  font-size: 20px;
  color: #666;
  margin-bottom: 10px;
}

/* Loading */
.news-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 60px;
  color: #999;
}

.news-loading i {
  font-size: 32px;
  animation: spin 1s linear infinite;
}

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

/* Responsive */
@media (max-width: 992px) {
  .news-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  
  .carousel-title {
    font-size: 24px;
  }
  
  .carousel-overlay {
    padding: 40px 30px 30px;
  }
}

@media (max-width: 768px) {
  .news-grid {
    grid-template-columns: 1fr;
  }
  
  .carousel-btn {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
  
  .carousel-btn.prev { left: 10px; }
  .carousel-btn.next { right: 10px; }
  
  .carousel-title {
    font-size: 20px;
  }
  
  .carousel-summary {
    font-size: 14px;
  }
  
  .filter-tabs {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 10px;
  }
  
  .filter-tab {
    white-space: nowrap;
  }
}

@media (max-width: 480px) {
  .news-hero {
    padding: 40px 0 30px;
  }
  
  .carousel-overlay {
    padding: 30px 20px 25px;
  }
  
  .carousel-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}
