/*
Theme Name: Flatsome Child
Description: This is a child theme for Flatsome Theme
Author: UX Themes
Template: flatsome
Version: 3.0
*/

/*************** ADD CUSTOM CSS HERE.   ***************/


@media only screen and (max-width: 48em) {
/*************** ADD MOBILE ONLY CSS HERE  ***************/


}
/* =================== HERO (Heading danh mục) =================== */
.tm-archive-hero{
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
}
.tm-archive-title{
  margin: 0 0 14px !important;
  line-height: 1.25;
  font-weight: 800;
  font-size: 28px;
  text-align: center;
  position: relative;
  padding-bottom: 12px;               /* chừa chỗ cho gạch */
}
.tm-archive-title::after{
  content: "";
  display: block;
  width: 52px;                        /* chiều dài gạch */
  height: 3px;                        /* độ dày gạch */
  background: #d9d9d9;                /* màu xám */
  border-radius: 2px;
  margin: 10px auto 0;                /* canh giữa dưới heading */
}
.tm-archive-desc{
  margin: 0 auto 12px;
  color: #555;
  max-width: 880px;
  text-align: center;
}
/* không để khoảng trống giữa heading và grid */
.tm-archive-hero + .container{
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* =================== CARD BÀI VIẾT =================== */
.tm-post-card{
  background: #fff;
  border: 0;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0,0,0,.06);
  overflow: hidden;
  padding: 0 0 16px;
  transition: transform .2s ease, box-shadow .2s ease;
}
.tm-post-card:hover{
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0,0,0,.09);
}

/* Ảnh đồng nhất 16:9 */
.tm-thumb{display:block; position:relative; overflow:hidden;}
.tm-thumb img{
  display:block; width:100%; height:100%;
  aspect-ratio: 16 / 9;
  object-fit: cover; object-position: center;
}
/* Fallback cho trình duyệt cũ */
@supports not (aspect-ratio: 16/9) {
  .tm-thumb{padding-top:56.25%;}
  .tm-thumb img{position:absolute; inset:0; width:100%; height:100%;}
}

/* Badge ngày/tháng */
.tm-badge{
  position:absolute; left:12px; top:12px;
  background:#a22126; color:#fff;
  border-radius:20px; padding:6px 10px; line-height:1.1;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
  z-index:2;
}
.tm-badge b{display:block; font-weight:800; font-size:14px}
.tm-badge i{display:block; font-style:normal; font-size:11px; opacity:.95}

/* Tiêu đề & trích dẫn (không gạch) */
.tm-title{
  font-size:20px; line-height:1.35; font-weight:800;
  margin:12px 16px 8px; text-align:center; padding-bottom:0;
}
.tm-title::after{ content:none !important; } /* đảm bảo không có gạch dưới tiêu đề */
.tm-title a{color:#111; text-decoration:none}
.tm-title a:hover{color:#a22126}
.tm-excerpt{margin:0 16px; color:#555; text-align:center}

/* =================== LƯỚI & PHÂN TRANG =================== */
.row.row-small{row-gap:28px;} /* khoảng cách dọc giữa các card */
.pagination-centered{ text-align:center; margin-top:18px; }
.pagination-centered .page-numbers{
  display:inline-block; padding:6px 10px; margin:0 3px;
  border-radius:6px; background:#f2f2f2; color:#333;
}
.pagination-centered .page-numbers.current{
  background:#a22126; color:#fff;
}
.pagination-centered .page-numbers:hover{
  background:#d9d9d9; color:#111;
}

/* =================== RESPONSIVE =================== */
@media (max-width: 849px){
  .tm-archive-title{font-size:24px;}
  .tm-title{font-size:18px;}
}
@media (max-width: 549px){
  .tm-archive-title{font-size:22px;}
  .tm-title{font-size:17px;}
  .row.row-small{row-gap:22px;}
}
/* Căn giữa nội dung trong card */
.post-item { display:flex; }
.post-item .tm-post-card{
  display:flex;
  flex-direction:column;
  align-items:center;          /* canh giữa theo trục ngang */
}

/* Tiêu đề & trích dẫn căn giữa + giới hạn bề rộng */
.tm-title,
.tm-excerpt{
  width:100%;
  max-width: 88%;              /* thu hẹp để nhìn gọn */
  margin-left:auto !important;
  margin-right:auto !important;
  text-align:center !important;
}

/* Khoảng cách tinh chỉnh */
.tm-title{ margin-top:12px; margin-bottom:8px; }
.tm-excerpt{ margin-top:0; margin-bottom:12px; }

/* Giữ clamp tránh tràn */
.tm-title a{
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical;
  overflow:hidden;
}
.tm-excerpt{
  display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical;
  overflow:hidden;
}
/* Đẩy heading danh mục (H1) xuống một khoảng dưới header */
.tm-archive-hero{
  padding-top: 28px !important;   /* chỉnh 20–40px theo ý */
}

/* Nếu đang đăng nhập có thanh admin bar, tăng thêm 1 chút trên desktop */
@media (min-width: 782px){
  body.admin-bar .tm-archive-hero{
    padding-top: 44px !important;
  }
}
/* =================== HEADING danh mục =================== */
.tm-archive-hero{padding-top:28px;margin:0;background:transparent;border:0}
.tm-archive-title{
  margin:0 0 14px; text-align:center; font-weight:800; font-size:28px;
  position:relative; padding-bottom:12px
}
.tm-archive-title::after{
  content:""; display:block; width:52px; height:3px; margin:10px auto 0;
  background:#d9d9d9; border-radius:2px
}
.tm-archive-desc{max-width:880px;margin:0 auto 12px;color:#555;text-align:center}

/* =================== CARD bài viết =================== */
/* Khung ngoài: bo tròn + bóng + nền trắng. Overflow hidden để con bám theo góc */
.post-item{display:flex}
.post-item .box{
  display:flex; flex-direction:column; height:100%;
  background:#fff !important;
  border-radius:16px !important;
  overflow:hidden !important;
  box-shadow:0 6px 18px rgba(0,0,0,.06);
  transition:transform .2s ease, box-shadow .2s ease;
}
.post-item .box:hover{transform:translateY(-2px); box-shadow:0 10px 24px rgba(0,0,0,.09)}

/* Ảnh 16:9, phủ kín; bỏ margin để không tạo vệt xám giữa ảnh & nền */
.post-item .box-image{position:relative; overflow:hidden; margin:0 !important}
.post-item .box-image img{width:100%; height:100%; aspect-ratio:16/9; object-fit:cover; display:block}
@supports not (aspect-ratio:16/9){
  .post-item .box-image{padding-top:56.25%}
  .post-item .box-image img{position:absolute; inset:0}
}

/* NỀN phần text: trắng, không thêm bo (đã bo bởi .box), không margin gây khe */
.post-item .box-text{
  background:#fff !important;
  margin:0 !important; padding:14px 16px 16px !important;
  border-radius:0 !important;
}

/* Badge ngày/tháng (nếu dùng) */
.badge-inner,.tm-badge{background:#a22126;color:#fff;border-radius:18px}

/* Tiêu đề & mô tả: căn giữa + chống tràn */
.post-item .post-title{margin:8px 0 6px; text-align:center}
.post-item .post-title a{
  color:#111; text-decoration:none;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden
}
.post-item .post-title a:hover{color:#a22126}
.post-item .from_the_blog_excerpt{
  color:#555; text-align:center; margin:0;
  display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden
}

/* Khoảng cách giữa các card */
.row.row-small{row-gap:28px}
/* === Bo tròn nền card đúng lớp ngoài cùng (Flatsome) === */
.post-item .col-inner{
  background:#fff !important;
  border-radius:16px !important;     /* chỉnh 12/16/20 tùy ý */
  overflow:hidden !important;
  box-shadow:0 6px 18px rgba(0,0,0,.06);
  display:flex;
  flex-direction:column;
  height:100%;
}

/* Bên trong không được đặt nền/bo riêng để khỏi phá góc tròn */
.post-item .box{
  background:transparent !important;
  border-radius:0 !important;
  overflow:visible !important;
  box-shadow:none !important;
}

/* Ảnh: không margin, phủ kín, không bo riêng */
.post-item .box-image{ margin:0 !important; position:relative; overflow:hidden; }
.post-item .box-image img{ width:100%; height:100%; aspect-ratio:16/9; object-fit:cover; display:block; }
@supports not (aspect-ratio:16/9){
  .post-item .box-image{ padding-top:56.25%; }
  .post-item .box-image img{ position:absolute; inset:0; }
}

/* Vùng nền text: cùng màu với nền ngoài, KHÔNG bo thêm */
.post-item .box-text{
  background:#fff !important;
  border-radius:0 !important;
  margin:0 !important;
  padding:14px 16px 16px !important;
}

/* (tuỳ chọn) hover nhẹ toàn card */
.post-item .col-inner:hover{
  transform:translateY(-2px);
  box-shadow:0 10px 24px rgba(0,0,0,.09);
}
