/* Service Posts Element Styles */

/* Main container with background image */
.service-posts-wrapper {
  width: 100%;
  max-width: 100%;
  position: relative;
  margin-bottom: 40px;
  background-color: #1976D2; /* Màu xanh đậm mặc định */
  background-image: url('../images/service-bg.jpg'); /* Thêm background image */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  padding: 40px 20px;
  border-radius: 8px;
  color: #fff;
  overflow: hidden; /* Ngăn nội dung tràn ra ngoài */
}

/* Thêm overlay để làm nền tối hơn */
.service-posts-wrapper::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(25, 118, 210, 0.85); /* Overlay xanh với độ mờ */
  z-index: 1;
}

/* Header */
.service-posts-header {
  margin-bottom: 30px;
  text-align: center;
  position: relative;
  z-index: 2; /* Đặt trên overlay */
}

.service-posts-heading {
  font-size: 32px;
  font-weight: 700;
  color: #ffffff;
  text-align: center;
  position: relative;
  display: inline-block;
  margin-bottom: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); /* Thêm shadow cho text */
}

/* Posts grid - Chuyển thành scroll ngang */
.service-posts-grid {
  display: flex;
  overflow-x: auto; /* Cho phép cuộn ngang */
  padding: 15px 0;
  position: relative;
  z-index: 2; /* Đặt trên overlay */
  scroll-behavior: smooth; /* Cuộn mượt */
  scrollbar-width: none; /* Ẩn scrollbar trên Firefox */
  -ms-overflow-style: none; /* Ẩn scrollbar trên IE/Edge */
  gap: 20px; /* Khoảng cách giữa các items */
  scroll-snap-type: x mandatory; /* Cuộn snap vào item */
  margin: 0 40px; /* Tạo khoảng trống cho navigation buttons */
}

/* Ẩn scrollbar */
.service-posts-grid::-webkit-scrollbar {
  display: none;
}

/* Không còn sử dụng grid-template-columns vì đã chuyển sang flex */
.service-posts-wrapper[data-columns="1"] .service-posts-grid,
.service-posts-wrapper[data-columns="2"] .service-posts-grid,
.service-posts-wrapper[data-columns="3"] .service-posts-grid,
.service-posts-wrapper[data-columns="4"] .service-posts-grid {
  display: flex;
}

/* Post item */
.service-post-item {
  display: flex;
  flex-direction: column;
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: all 0.3s ease;
  height: 100%;
  min-width: 300px; /* Chiều rộng tối thiểu cho mỗi item */
  max-width: 350px; /* Chiều rộng tối đa */
  flex: 0 0 auto; /* Không cho phép co giãn */
  scroll-snap-align: start; /* Snap vào đầu item */
}

.service-post-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Post image */
.service-post-image {
  position: relative;
  overflow: hidden;
  height: 220px;
}

.service-post-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.service-post-item:hover .service-post-image img {
  transform: scale(1.05);
}

/* Post content */
.service-post-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  background-color: #ffffff;
  color: #333333;
}

.service-post-title {
  font-size: 20px;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 15px;
  line-height: 1.3;
}

.service-post-title a {
  color: #000000;
  text-decoration: none;
  transition: color 0.3s ease;
}

.service-post-title a:hover {
  color: #1976D2;
}

.service-post-excerpt {
  font-size: 15px;
  line-height: 1.6;
  color: #666666;
  margin-bottom: 20px;
  flex-grow: 1;
}

/* Post footer */
.service-post-footer {
  margin-top: auto;
}

.service-post-button {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  background-color: #1976D2;
  color: white;
  text-decoration: none;
  border-radius: 50px;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(25, 118, 210, 0.3);
}

.service-post-button .button-text {
  position: relative;
  z-index: 2;
}

.service-post-button .button-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  width: 24px;
  height: 24px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transition: transform 0.3s ease;
}

.service-post-button:hover {
  background-color: #1565C0;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(25, 118, 210, 0.5);
}

.service-post-button:hover .button-icon {
  transform: translateX(3px);
}

/* Thêm navigation buttons */
.service-posts-navigation {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  z-index: 3;
  display: flex;
  justify-content: space-between;
  padding: 0 10px;
  pointer-events: none; /* Chỉ buttons có thể click */
}

.service-scroll-button {
  width: 44px;
  height: 44px;
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  border: none;
  outline: none;
  pointer-events: auto; /* Cho phép click */
  opacity: 0.85;
  color: #1976D2;
  font-size: 20px;
}

.service-scroll-button:hover {
  background-color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  opacity: 1;
}

.service-scroll-prev {
  left: 10px;
  position: absolute;
}

.service-scroll-next {
  right: 10px;
  position: absolute;
}

/* Thêm dots navigation */
.service-posts-dots {
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: center;
  margin-top: 20px;
  gap: 8px;
}

.service-posts-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  padding: 0;
}

.service-posts-dot.active {
  background-color: #ffffff;
  transform: scale(1.2);
}

/* Responsive */
@media (max-width: 991px) {
  .service-posts-heading {
    font-size: 28px;
  }
  
  .service-post-item {
    min-width: 280px;
    max-width: 320px;
  }
}

@media (max-width: 767px) {
  .service-posts-heading {
    font-size: 24px;
  }
  
  .service-post-item {
    min-width: 260px;
    max-width: 300px;
  }
  
  .service-post-image {
    height: 180px;
  }
  
  .service-scroll-button {
    width: 38px;
    height: 38px;
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  .service-posts-wrapper {
    padding: 30px 15px;
  }
  
  .service-posts-heading {
    font-size: 22px;
  }
  
  .service-post-item {
    min-width: 240px;
    max-width: 280px;
  }
  
  .service-post-image {
    height: 160px;
  }
  
  .service-scroll-button {
    width: 34px;
    height: 34px;
    font-size: 16px;
  }
} 