/* ==========================================================================
   1. Global Styles & Typography
   ========================================================================== */

/* Import font từ Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');

body {
  font-family: 'Roboto', sans-serif; /* Font chữ hiện đại, dễ đọc */
  line-height: 1.6; /* Tăng khoảng cách dòng giúp dễ đọc hơn */
  margin: 0;
  background-color: #f4f4f9; /* Màu nền xám rất nhạt cho toàn trang */
  color: #333; /* Màu chữ chính */
}

.container {
  max-width: 1200px; /* Giới hạn chiều rộng nội dung */
  margin: 0 auto; /* Căn giữa nội dung */
  padding: 20px;
}

/* ==========================================================================
   2. Header & Footer
   ========================================================================== */

.site-header {
  background-color: #2c3e50; /* Màu xanh đậm hải quân */
  color: white;
  padding: 30px 20px;
  text-align: center;
  border-bottom: 5px solid #3498db; /* Màu xanh dương làm điểm nhấn */
}

.site-header h1 {
  margin: 0;
  font-size: 2.8rem;
}

.site-header p {
  margin: 5px 0 0;
  font-size: 1.1rem;
  opacity: 0.9;
}

.site-header a {
  color: #3498db; /* Màu link nổi bật */
  text-decoration: none;
  font-weight: bold;
}

.site-header a:hover {
  text-decoration: underline;
}

.site-footer {
  text-align: center;
  padding: 20px;
  margin-top: 40px;
  background-color: #ffffff;
  border-top: 1px solid #e7e7e7;
  font-size: 0.9rem;
  color: #6c757d;
}

/* ==========================================================================
   3. Post List & Post Items (Card Design)
   ========================================================================== */

.post-list {
  display: grid;
  /* Tự động chia cột, mỗi cột tối thiểu 350px */
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 25px; /* Khoảng cách giữa các bài viết */
}

.post-item {
  background-color: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 8px; /* Bo góc mềm mại */
  padding: 25px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.05); /* Đổ bóng nhẹ nhàng */
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
  display: flex;
  flex-direction: column; /* Sắp xếp nội dung theo chiều dọc */
}

.post-item:hover {
  transform: translateY(-5px); /* Hiệu ứng nâng thẻ lên khi di chuột */
  box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.post-item h2 {
  font-size: 1.6rem;
  color: #1a1a1a;
  margin: 0 0 10px 0;
}

.post-meta {
  color: #6c757d;
  font-size: 0.9rem;
  margin-bottom: 15px;
}

.post-excerpt {
  margin-bottom: 20px;
  flex-grow: 1; /* Đẩy nút "Đọc tiếp" xuống dưới cùng */
}

.read-more {
  display: inline-block;
  align-self: flex-start; /* Căn nút về bên trái */
  padding: 10px 20px;
  background-color: #3498db; /* Màu xanh dương */
  color: white;
  text-decoration: none;
  border-radius: 5px;
  font-weight: bold;
  transition: background-color 0.2s;
}

.read-more:hover {
  background-color: #2980b9; /* Màu đậm hơn khi di chuột */
}


/* ==========================================================================
   4. Pagination
   ========================================================================== */

.pagination {
  margin-top: 40px;
}

.pagination ul {
  display: flex;
  justify-content: center;
  list-style: none;
  padding: 0;
}

.pagination li a {
  color: #3498db;
  padding: 10px 18px;
  margin: 0 5px;
  border: 1px solid #ddd;
  border-radius: 5px;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
  font-weight: bold;
}

.pagination li a:hover,
.pagination li a.active {
  background-color: #3498db;
  color: white;
  border-color: #3498db;
}

.pagination li a.disabled {
  color: #aaaaaa;
  pointer-events: none; /* Vô hiệu hóa click */
  background-color: #f8f9fa;
}


/* ==========================================================================
   5. Mobile Responsiveness
   ========================================================================== */

@media (max-width: 768px) {
  .post-list {
    grid-template-columns: 1fr; /* Chỉ hiển thị 1 cột trên màn hình nhỏ */
  }

  .site-header h1 {
    font-size: 2.2rem; /* Giảm kích thước tiêu đề trên mobile */
  }

  .pagination li a {
    padding: 8px 12px; /* Giảm kích thước nút phân trang */
    margin: 0 3px;
  }
}