/* --- LAYOUT GRID 3 CỘT --- */
.home-wrapper {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  display: grid;
  grid-template-columns: 1fr; /* Mobile first */
  gap: 30px;
  align-items: start;
}

@media (min-width: 1024px) {
  .home-wrapper {
    /* CŨ: grid-template-columns: 250px 1fr 300px; */
    
    /* MỚI: Tỷ lệ 1 - 3 - 1 tương ứng 20% - 60% - 20% */
    grid-template-columns: 1fr 3fr 1fr; 
  }
}
/* --- LEFT SIDEBAR (Sticky) --- */
.left-sidebar {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

@media (min-width: 1024px) {
  .left-sidebar {
   /* position: sticky;
    top: 20px;*/
  }
}

.sidebar-module {
  margin-bottom: 15px;
}

.sidebar-heading {
  font-size: 0.9rem;
  text-transform: uppercase;
  font-weight: 700;
  color: #999;
  margin-bottom: 15px;
  letter-spacing: 1px;
  border-bottom: 1px solid #eee;
  padding-bottom: 5px;
}

/* Share Buttons List */
.share-list, .rec-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.share-item, .rec-item {
  margin-bottom: 10px;
}

.share-link, .rec-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #555;
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.share-link:hover, .rec-link:hover {
  color: #0d6efd;
}

/* --- CENTER CONTENT (Web Apps) --- */
.center-content {
  min-width: 0; /* Prevent grid blowout */
}

.section-title {
  font-size: 1.6rem;
  margin-bottom: 1.5rem;
  color: #333;
  font-weight: 700;
  border-left: 4px solid #0d6efd;
  padding-left: 15px;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.app-card {
  background: white;
  border: 1px solid #e1e4e8; /* Viền mỏng nhẹ kiểu GitHub */
  border-radius: 8px;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
}

.app-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
  border-color: #0d6efd;
}

/* Tăng size ảnh icon lên 150% so với bản cũ */
.app-card-image {
  height: 280px; /* Cũ là ~180-200px -> Tăng lên */
  background: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  border-bottom: 1px solid #eee;
}

.app-card-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.3s;
  /* Nếu ảnh gốc nhỏ, ta scale lên */
  transform: scale(1.2); 
}

.app-card:hover .app-card-image img {
  transform: scale(1.3);
}

.app-card-body {
  padding: 1.25rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.app-card-title {
  margin: 0 0 0.5rem 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: #24292e;
}

.app-card-desc {
  font-size: 0.95rem;
  color: #586069;
  line-height: 1.5;
  margin-bottom: 1rem;
  flex-grow: 1;
}

.btn--app {
  display: block;
  text-align: center;
  background: #f6f8fa;
  color: #24292e;
  padding: 10px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  border: 1px solid rgba(27,31,35,0.15);
  transition: all 0.2s;
}

.btn--app:hover {
  background-color: #0d6efd;
  color: white;
  border-color: #0d6efd;
}

/* Tools Section (Compact) */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
}

.tool-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid #e1e4e8;
  padding: 12px;
  border-radius: 6px;
  text-decoration: none;
  color: #444;
  font-size: 0.9rem;
  font-weight: 600;
}

.tool-item:hover {
  background: #f1f8ff;
  border-color: #0d6efd;
  color: #0d6efd;
}

/* --- RIGHT SIDEBAR (Latest Posts) --- */
.right-sidebar {
  /* Có thể sticky nếu muốn */
}

.latest-posts-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.latest-post-item {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #f0f0f0;
}

.latest-post-item:last-child {
  border-bottom: none;
}

.lp-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 5px 0;
  line-height: 1.4;
}

.lp-title a {
  color: #24292e;
  text-decoration: none;
}

.lp-title a:hover {
  color: #0d6efd;
}

.lp-date {
  font-size: 0.8rem;
  color: #6a737d;
  display: block;
  margin-bottom: 5px;
}

.lp-excerpt {
  font-size: 0.85rem;
  color: #586069;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2; /* Giới hạn 2 dòng */
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Responsive Tablet */
@media (max-width: 1023px) {
  .home-wrapper {
    grid-template-columns: 1fr;
  }
  .left-sidebar {
    display: none; /* Hoặc đẩy xuống dưới cùng */
  }
}
/* --- STYLE MỚI: HEADER XANH ĐẬM --- */

/* 1. Định dạng thanh tiêu đề */
.sidebar-heading.header-highlight {
  background-color: #0b2e59; /* Xanh đậm */
  color: #ffffff !important; /* Chữ trắng (dùng !important để đè màu cũ) */
  padding: 12px 15px;        /* Tăng khoảng cách cho thoáng */
  margin-bottom: 0;          /* Bỏ margin dưới để dính liền với list */
  border-radius: 4px 4px 0 0; /* Bo tròn 2 góc trên */
  border: none;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* 2. Đóng khung cho khối chứa header này */
/* Lưu ý: :has() hỗ trợ tốt trên Chrome/Edge/Safari mới. 
   Nếu trình duyệt cũ không nhận, nó sẽ chỉ hiện header xanh mà không có khung bao quanh (vẫn ổn). */
.sidebar-module:has(.header-highlight) {
  background: #fff;
  border: 1px solid #e1e4e8;
  border-radius: 6px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* 3. Căn chỉnh lại danh sách bên trong để không dính sát viền */
.sidebar-module:has(.header-highlight) ul {
  padding: 15px;
  margin: 0;
}

/* Tinh chỉnh riêng cho link trong khung Share để đẹp hơn */
.sidebar-module:has(.header-highlight) .share-item {
  margin-bottom: 12px;
}