/* Base */
.tpl-body{
  background:#fff8f1;
  margin:0;
  font-family: Arial, Helvetica, sans-serif;
  color:#333;
}
.container{
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Top bar */
.topbar{
  background:#e9e5e1;
  border-radius: 999px;
  margin: 16px auto 12px;
  max-width: 1100px;
}
.topmenu, .topmenu-fallback{
  display:flex;
  justify-content: center;
  gap: 28px;
  padding: 14px 10px;
  margin:0;
  list-style:none;
}
.topmenu a, .topmenu-fallback a{
  text-decoration:none;
  color:#333;
  font-weight:600;
}
.topmenu a:hover, .topmenu-fallback a:hover{
  text-decoration:underline;
}

/* Brand logos (optional row) */
.brandlogos{
  padding: 8px 0 2px;
}

/* Hero area */
.hero{
  display:flex;
  gap: 20px;
  align-items: stretch;
  margin-top: 8px;
}
.hero-left{
  flex: 1.2;
  background: transparent;
  padding: 8px 0;
}
.hero-title{
  margin: 0;
  font-size: 44px;
  line-height: 1.1;
  font-weight: 800;
  color: #b04b7d; /* gần giống ảnh mẫu */
}
.hero-right{
  flex: 1;
  background: #f5d6cf;
  border-radius: 10px;
  padding: 18px;
  display:flex;
  align-items:center;
  justify-content:center;
}
.hero-buttons{
  display:flex;
  gap: 14px;
  width: 100%;
  justify-content: center;
}
.btn-hero{
  display:flex;
  align-items:center;
  justify-content:center;
  width: 220px;
  min-height: 110px;
  border-radius: 22px;
  background:#9a5a79;
  color:#fff;
  text-decoration:none;
  font-size: 26px;
  font-weight: 700;
  text-align:center;
  padding: 16px;
}
.btn-hero:hover{ opacity:.92; }

/* Hero image */
.hero-image{
  margin: 14px 0 16px;
}
.hero-image img{
  width:100%;
  height:auto;
  border-radius: 4px;
  display:block;
}
.hero-image-placeholder{
  background:#fff;
  border:1px dashed #bbb;
  border-radius: 6px;
  padding: 18px;
}

/* Latest posts section */
.latest{
  padding-bottom: 26px;
}
.section-title{
  margin: 10px 0 12px;
  font-size: 22px;
}
.post-card{
  display:flex;
  gap: 14px;
  background:#fff;
  border-radius: 10px;
  padding: 12px;
  margin: 10px 0;
  box-shadow: 0 1px 6px rgba(0,0,0,.06);
}
.post-thumb{
  width: 220px;
  height: 130px;
  background: #e9e9e9;
  border-radius: 8px;
  flex: 0 0 auto;
}
.post-text{ flex: 1; }
.post-title{
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
}
.post-desc{
  font-size: 14px;
  color:#666;
  line-height: 1.5;
}

/* Footer */
.footer{
  padding: 18px 0;
  color:#666;
  font-size: 13px;
  text-align:center;
}

/* Responsive */
@media (max-width: 900px){
  .hero{ flex-direction: column; }
  .btn-hero{ width: 100%; min-height: 80px; font-size: 20px; }
  .hero-title{ font-size: 34px; }
}
@media (max-width: 640px){
  .post-card{ flex-direction: column; }
  .post-thumb{ width:100%; height: 180px; }
}

.latest-wrap .post-card{
  display:flex;
  gap:14px;
  background:#fff;
  border-radius:10px;
  padding:12px;
  margin:12px 0;
  box-shadow:0 1px 6px rgba(0,0,0,.06);
}

.latest-wrap .post-thumb{
  width:220px;
  height:130px;
  flex:0 0 auto;
  border-radius:8px;
  overflow:hidden;
  background:#e9e9e9;
  display:block;
}

.latest-wrap .post-thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.latest-wrap .post-text{ flex:1; }
.latest-wrap .post-title{ margin:0 0 6px; font-size:18px; font-weight:700; }
.latest-wrap .post-title a{ text-decoration:none; }
.latest-wrap .post-desc{ color:#666; line-height:1.6; }

.pagination-wrap{ margin:16px 0 0; }
.pagination-results{ margin-top:6px; color:#777; font-size:12px; }

@media (max-width: 640px){
  .latest-wrap .post-card{ flex-direction:column; }
  .latest-wrap .post-thumb{ width:100%; height:180px; }
}

/* =========================
   Pagination FINAL (Joomla 3)
   HTML: nav.pagination-wrap > nav > ul.pagination-list > li > a/span
   ========================= */

.pagination-wrap{
  margin: 18px 0 0;
  text-align: center;
}

/* Flex để không bị lệch hàng + canh giữa */
.pagination-wrap ul.pagination-list{
  list-style: none !important;
  margin: 0 auto !important;
  padding: 0 !important;

  display: flex !important;
  justify-content: center;
  align-items: center;
  gap: 10px;

  flex-wrap: wrap;           /* nếu màn hình nhỏ sẽ xuống dòng đẹp */
  max-width: 100%;
}

/* mỗi item không tự tạo margin lạ */
.pagination-wrap ul.pagination-list > li{
  margin: 0 !important;
  padding: 0 !important;
}

/* nút */
.pagination-wrap ul.pagination-list > li > a,
.pagination-wrap ul.pagination-list > li > span{
  display: inline-flex !important;
  align-items: center;
  justify-content: center;

  height: 40px;
  min-width: 48px;
  padding: 0 14px;

  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(0,0,0,.14);

  text-decoration: none !important;
  color: #222;
  font-weight: 700;
  line-height: 1;
  box-sizing: border-box;

  white-space: nowrap;       /* không cho chữ/icon bị xuống dòng trong nút */
}

/* hover */
.pagination-wrap ul.pagination-list > li > a:hover{
  background: #f4f4f4;
}

/* active: li.active > a (HTML của bạn) */
.pagination-wrap ul.pagination-list > li.active > a{
  background: #9a5a79;
  border-color: #9a5a79;
  color: #fff;
  cursor: default;
}

/* hidden-phone: vẫn giữ, nhưng nếu template bạn không có bootstrap2 thì class này vô dụng.
   Không cần sửa. */

/* Icon spans: ép hiển thị rõ ràng */
.pagination-wrap .icon-first,
.pagination-wrap .icon-previous,
.pagination-wrap .icon-next,
.pagination-wrap .icon-last{
  width: 1.2em;
  height: 1.2em;
  display: inline-block;
  position: relative;
}

/* đè icon font mặc định (tránh bị trống/khác) */
.pagination-wrap .icon-first::before,
.pagination-wrap .icon-previous::before,
.pagination-wrap .icon-next::before,
.pagination-wrap .icon-last::before{
  content: "";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;

  font-family: inherit !important;
  font-weight: 900;
  color: inherit;
}

.pagination-wrap .icon-first::before    { content: "«"; }
.pagination-wrap .icon-previous::before { content: "‹"; }
.pagination-wrap .icon-next::before     { content: "›"; }
.pagination-wrap .icon-last::before     { content: "»"; }

/* Dòng Page x of y */
.pagination-wrap .pagination-results{
  margin-top: 10px;
  color: #666;
  font-size: 13px;
}

/* Mobile tối ưu */
@media (max-width: 640px){
  .pagination-wrap ul.pagination-list{
    gap: 8px;
  }
  .pagination-wrap ul.pagination-list > li > a,
  .pagination-wrap ul.pagination-list > li > span{
    height: 36px;
    min-width: 42px;
    padding: 0 12px;
    border-radius: 11px;
  }
}


/* =========================
   Latest layout: Main + Sidebar (responsive)
   ========================= */
.latest-layout{
  display: grid;
  grid-template-columns: 1fr 320px; /* trái co giãn, phải cố định */
  gap: 18px;
  align-items: start;
}

.latest-main{
  min-width: 0; /* tránh vỡ layout khi có phần tử dài */
}

.latest-sidebar{
  position: relative;
}

.sidebar-placeholder{
  background: #fff;
  border: 1px dashed rgba(0,0,0,.2);
  border-radius: 10px;
  padding: 12px;
  color: #666;
  font-size: 13px;
}

/* Sidebar module card style (đẹp, đồng bộ) */
.latest-sidebar .moduletable,
.latest-sidebar .moduletable_menu,
.latest-sidebar .moduletable_text{
  background: #fff;
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 1px 6px rgba(0,0,0,.06);
  margin-bottom: 12px;
}

.latest-sidebar .moduletable h3,
.latest-sidebar .moduletable_menu h3,
.latest-sidebar .moduletable_text h3{
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 800;
}

/* Responsive: tablet/mobile -> 1 cột */
@media (max-width: 980px){
  .latest-layout{
    grid-template-columns: 1fr;
  }
  .latest-sidebar{
    margin-top: 8px;
  }
}

/* =========================
   Sidebar-b: module cards đẹp + title rõ
   ========================= */
.latest-sidebar{
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Wrapper module khi dùng style="xhtml" */
.latest-sidebar .moduletable,
.latest-sidebar .moduletable_menu,
.latest-sidebar .moduletable_text{
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 16px;
  padding: 14px 14px 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,.06);
  overflow: hidden;
}

/* Thanh nhấn nhẹ phía trên card */
.latest-sidebar .moduletable::before,
.latest-sidebar .moduletable_menu::before,
.latest-sidebar .moduletable_text::before{
  content:"";
  display:block;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #9a5a79, #f5d6cf);
  margin: -14px -14px 12px; /* kéo full ngang theo padding */
}

/* Title module */
.latest-sidebar .moduletable > h3,
.latest-sidebar .moduletable_menu > h3,
.latest-sidebar .moduletable_text > h3{
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 900;
  color: #2b2b2b;
  letter-spacing: .2px;
}

/* Nội dung text module */
.latest-sidebar p{
  margin: 8px 0;
  color:#444;
  line-height: 1.6;
}

/* Menu/link trong module */
.latest-sidebar ul{
  margin: 8px 0 0;
  padding-left: 18px;
}

.latest-sidebar a{
  color: #2b2b2b;
  text-decoration: none;
  font-weight: 700;
}

.latest-sidebar a:hover{
  text-decoration: underline;
  color: #9a5a79;
}

/* Nút "Xem thêm" nếu là link trong module custom */
.latest-sidebar a[href*="xem-them"],
.latest-sidebar a.readmore,
.latest-sidebar .readmore a{
  display: inline-block;
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(0,0,0,.12);
  font-weight: 800;
}

.latest-sidebar a[href*="xem-them"]:hover,
.latest-sidebar a.readmore:hover,
.latest-sidebar .readmore a:hover{
  background: #f4f4f4;
}

/* =========================
   Brand strip + Hero modern
   ========================= */
.brand-strip{
  display:flex;
  gap:22px;
  align-items:center;
  padding: 10px 0 6px;
  flex-wrap:wrap;
  animation: fadeUp .6s ease both;
}

.brand-logo{
  height: 34px;
  width:auto;
  display:block;
  opacity:.95;
  transition: transform .18s ease, opacity .18s ease, filter .18s ease;
}

.brand-logo:hover{
  transform: translateY(-2px);
  opacity: 1;
  filter: saturate(1.15);
}

.hero2{
  display:grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 18px;
  align-items: stretch;
  margin: 8px 0 10px;
  animation: fadeUp .75s ease .05s both;
}

.hero2-title{
  margin: 0;
  font-size: 40px;
  line-height: 1.4;
  font-weight: 600;
  color: #b04b7d;
}

.hero2-right{
  background: #f5d6cf;
  border-radius: 12px;
  padding: 18px;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow: 0 10px 26px rgba(0,0,0,.06);
  border: 1px solid rgba(0,0,0,.06);
}

.hero2-panel{
  width:100%;
  display:flex;
  gap:14px;
  justify-content:center;
}

.btn-hero2{
  flex:1;
  min-height: 118px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius: 26px;
  background:#9a5a79;
  color:#fff;
  text-decoration:none !important;
  font-size: 26px;
  font-weight: 600;
  text-align:center;
  padding: 18px;
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
  box-shadow: 0 12px 24px rgba(154, 90, 121, .20);
}

.btn-hero2:hover{
  transform: translateY(-2px);
  opacity: .96;
  box-shadow: 0 16px 30px rgba(154, 90, 121, .26);
}

.btn-hero2:focus{
  outline: 3px solid rgba(154, 90, 121, .35);
  outline-offset: 3px;
}

@keyframes fadeUp{
  from{ opacity:0; transform: translateY(8px); }
  to{ opacity:1; transform: translateY(0); }
}

@media (max-width: 980px){
  .hero2{ grid-template-columns: 1fr; }
  .hero2-title{ font-size: 36px; }
}

@media (max-width: 640px){
  .brand-logo{ height: 28px; }
  .hero2-panel{ flex-direction: column; }
  .btn-hero2{
    min-height: 84px;
    font-size: 20px;
    border-radius: 18px;
  }
}

/* =========================
   Brand strip – 4 logos (even layout)
   ========================= */

.brand-strip-4{
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 4 logo chia đều */
  gap: 24px;
  align-items: center;
  justify-items: center;
  padding: 12px 0 8px;
  margin-bottom: 6px;
}

/* Logo */
.brand-strip-4 .brand-logo{
  max-height: 38px;
  max-width: 140px;
  width: auto;
  height: auto;
  opacity: .95;
  transition: transform .18s ease, opacity .18s ease, filter .18s ease;
}

.brand-strip-4 .brand-logo:hover{
  transform: translateY(-2px);
  opacity: 1;
  filter: saturate(1.15);
}

/* Tablet */
@media (max-width: 980px){
  .brand-strip-4{
    grid-template-columns: repeat(2, 1fr); /* 2 x 2 */
    gap: 18px 24px;
  }
}

/* Mobile */
@media (max-width: 640px){
  .brand-strip-4{
    grid-template-columns: repeat(2, 1fr);
    gap: 14px 18px;
  }
  .brand-strip-4 .brand-logo{
    max-height: 30px;
    max-width: 120px;
  }
}

/* =========================
   Brand logos: grayscale → color on hover
   ========================= */

.brand-strip-4 .brand-logo{
  max-height: 38px;
  max-width: 140px;
  width: auto;
  height: auto;

  /* xám nhẹ */
  filter: grayscale(100%) brightness(0.9);
  opacity: .85;

  transition:
    filter .22s ease,
    opacity .22s ease,
    transform .22s ease;
}

/* hover: hiện màu */
.brand-strip-4 .brand-logo:hover{
  filter: grayscale(0%) brightness(1);
  opacity: 1;
  transform: translateY(-2px);
}

/* mobile: hover không cần nhấc cao quá */
@media (max-width: 640px){
  .brand-strip-4 .brand-logo:hover{
    transform: none;
  }
}

.tpl-body{
  background:#fff8f1;
  margin:0;
  font-family: "Be Vietnam Pro", Arial, Helvetica, sans-serif;
  color:#333;
}
.btn-hero2{
  white-space: normal;   /* cho phép xuống dòng */
  line-height: 1.15;
}
.btn-hero2{
  padding: 18px 14px;    /* giảm ngang nhẹ */
}

/* =========================
   Scroll reveal (education-modern, subtle)
   ========================= */
.reveal{
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .7s ease, transform .7s ease;
  will-change: opacity, transform;
}

.reveal.is-visible{
  opacity: 1;
  transform: translateY(0);
}

/* stagger nhẹ cho item logo */
.brand-strip.reveal.is-visible .brand-logo{
  animation: logoPop .6s ease both;
}
.brand-strip.reveal.is-visible .brand-logo:nth-child(2){ animation-delay: .05s; }
.brand-strip.reveal.is-visible .brand-logo:nth-child(3){ animation-delay: .10s; }
.brand-strip.reveal.is-visible .brand-logo:nth-child(4){ animation-delay: .15s; }

@keyframes logoPop{
  from{ opacity:0; transform: translateY(8px); }
  to{ opacity:1; transform: translateY(0); }
}

/* Người dùng chọn giảm chuyển động (accessibility) */
@media (prefers-reduced-motion: reduce){
  .reveal{
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .brand-strip.reveal.is-visible .brand-logo{
    animation: none !important;
  }
}

/* =========================
   Latest posts – Title tuning (Education style)
   ========================= */

/* Title link */
.latest-wrap .post-title a{
  color: #7a3e6a;                 /* tím hồng trầm – dễ đọc */
  font-size: 20px;                /* desktop */
  line-height: 1.35;
  font-weight: 600;
  letter-spacing: .2px;
  text-decoration: none;
  transition: color .2s ease;
}

/* Hover */
.latest-wrap .post-title a:hover{
  color: #9a5a79;                 /* đồng bộ màu button */
  text-decoration: underline;
}

/* Mô tả */
.latest-wrap .post-desc{
  font-size: 15px;
  line-height: 1.65;
  color: #555;
}

/* Card spacing tinh gọn hơn */
.latest-wrap .post-card{
  padding: 14px 16px;
}

/* Responsive */
@media (max-width: 900px){
  .latest-wrap .post-title a{
    font-size: 18px;
  }
}

@media (max-width: 640px){
  .latest-wrap .post-title a{
    font-size: 17px;
    line-height: 1.4;
  }
}

/* =========================
   Article detail page
   ========================= */

.article-page{
  padding: 8px 0 18px;
}

.article-layout{
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 18px;
  align-items: start;
}

.article-main{ min-width: 0; }

.article-card{
  background: rgba(255,255,255,.95);
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 16px;
  box-shadow: 0 10px 26px rgba(0,0,0,.06);
  overflow: hidden;
  padding: 16px 18px 18px;
}

.article-hero{
  margin: -16px -18px 14px;
  border-bottom: 1px solid rgba(0,0,0,.06);
}
.article-hero img{
  width: 100%;
  height: auto;
  display: block;
}

.article-title{
  margin: 0 0 8px;
  color: #7a3e6a;
  font-size: 28px;
  line-height: 1.25;
  font-weight: 900;
  letter-spacing: .2px;
}

.article-meta{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: #666;
  font-size: 13px;
  margin-bottom: 14px;
}
.article-meta .meta-item{
  background: #fff;
  border: 1px solid rgba(0,0,0,.10);
  padding: 6px 10px;
  border-radius: 999px;
}

.article-content{
  color: #333;
  font-size: 16px;
  line-height: 1.75;
}

/* Nội dung editor */
.article-content h2, .article-content h3{
  color: #2b2b2b;
  margin: 18px 0 10px;
}
.article-content a{
  color: #9a5a79;
  font-weight: 800;
  text-decoration: none;
}
.article-content a:hover{
  text-decoration: underline;
}
.article-content img{
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,.08);
}

/* Sidebar giữ style card bạn đã dùng */
.article-sidebar .moduletable,
.article-sidebar .moduletable_menu,
.article-sidebar .moduletable_text{
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.06);
  margin-bottom: 12px;
}

.article-sidebar .moduletable > h3,
.article-sidebar .moduletable_menu > h3,
.article-sidebar .moduletable_text > h3{
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 900;
}

@media (max-width: 980px){
  .article-layout{
    grid-template-columns: 1fr;
  }
  .article-title{
    font-size: 24px;
  }
}

