/* =========================================
   TÀI LIỆU CPT — Stylesheet v1.0
   ========================================= */

/* ========== WRAPPER ========== */
.tl-wrap {
  max-width: 1200px;
  margin: 0 auto;
}

/* Layout: small → grid nhiều cột */
.tl-layout-small,
.tl-layout-both {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

/* Card large chiếm full width trong grid */
.tl-layout-both .tl-card-large {
  grid-column: 1 / -1;
}

/* Layout: large → stack dọc */
.tl-layout-large {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

@media (max-width: 900px) {

  .tl-layout-small,
  .tl-layout-both {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {

  .tl-layout-small,
  .tl-layout-both {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   CARD LARGE (nằm ngang — như ảnh 1)
   ======================================== */
.tl-card-large {
  display: flex;
  align-items: flex-start;
  gap: 30px;
  overflow: hidden;
  background: #fff;
  transition: box-shadow 0.22s ease, transform 0.22s ease;
}

/* Cột trái: ảnh bìa / placeholder */
.tl-card-left {
  width: 30%;
  align-self: stretch;
  border-left: 6px solid #C8521A;
}

.tl-thumb-large {
  width: 100%;
  height: 100%;
}

.tl-thumb-large img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 0 20px 20px 0;
}

/* Khi có ảnh thumbnail: ảnh làm nền, text overlay nổi lên trên */
.tl-thumb-has-img {
  position: relative;
  overflow: hidden;
  border-radius: 0 20px 20px 0;
}

.tl-thumb-has-img img {
  border-radius: 0;
}

.tl-thumb-overlay {
  position: absolute;
  inset: 0;
  /* background: linear-gradient(160deg, rgba(17, 17, 16, 0.85) 40%, rgba(17, 17, 16, 0.65)); */
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px 30px;
  z-index: 2;
}

.tl-thumb-overlay span {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 24px;
  margin-bottom: 28px;
}

.tl-thumb-overlay h3 {
  margin-bottom: 0;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: normal;
  color: white;
}

.tl-thumb-overlay em {
  color: #E0DBD2;
  font-style: normal;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: 0;
  margin-top: auto;
}

/* Placeholder khi không có ảnh */
.tl-thumb-placeholder {
  background: linear-gradient(160deg, #111110 60%, #2a2a28);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 32px 28px;
  gap: 12px;
  border-right: 3px solid #C8521A;
  border-radius: 0 20px 20px 0;
}

.tl-thumb-placeholder span {
  font-size: 11px;
  font-weight: 600;
  color: #999;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tl-thumb-placeholder strong {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  line-height: 1.35;
  flex: 1;
  display: flex;
  align-items: center;
}

.tl-thumb-placeholder em {
  font-style: normal;
  font-size: 12px;
  color: #777;
  margin-top: auto;
}

/* Cột phải: nội dung */
.tl-card-right {
  width: 67.5%;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.tl-card-right-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.tl-loai {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #888;
  margin-bottom: 10px;
}

.tl-title {
  font-size: 34px;
  font-weight: 600;
  line-height: normal;
  color: #111110;
  margin-bottom: 12px !important;
  font-family: "Playfair Display", serif;
}

.tl-title a {
  color: inherit;
  text-decoration: none;
}

.tl-title a:hover {
  color: #C8521A;
}

.tl-excerpt {
  font-size: 16px;
  color: #555;
  line-height: 24px;
  margin-bottom: 34px !important;
}


.tl-noi-dung-label {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 24px;
  color: #111110;
  margin-bottom: 0 !important;
  padding-bottom: 10px;
  border-bottom: 1px solid #E0DBD2;
}

.tl-bullets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  list-style: none;
  margin-top: 20px !important;
  margin-bottom: 24px !important;
  padding-left: 0 !important;
}

.tl-bullets li {
  padding-top: 2px;
  padding-bottom: 2px;
  font-size: 16px;
  color: #6B6257;
  font-weight: 500;
  padding-left: 26px;
  position: relative;
  line-height: 24px;
}

.tl-bullets li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: #C8521A;
  font-weight: 700;
}

/* Footer card large */
.tl-card-footer {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

/* Button tải PDF (card large) */
.tl-btn-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #111110;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
  padding: 12px 32px;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.18s, transform 0.15s;
  white-space: nowrap;
}

.tl-btn-download:hover {
  background: #333;
  color: #fff;
  transform: scale(1.02);
}

.tl-btn-download:active {
  transform: scale(0.98);
}

.tl-meta-str {
  font-size: 16px;
  color: #6B6257;
  line-height: 16px;
  white-space: nowrap;
}

/* ========================================
   CARD SMALL (dọc — như ảnh 2)
   ======================================== */
.tl-card-small {
  background: #fff;
  border: 1.5px solid #e8e5de;
  border-radius: 0 16px 16px 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.22s ease, transform 0.22s ease;
}

.tl-card-small:hover {
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.09);
  transform: translateY(-3px);
}

/* Header: nền tối, có ảnh hoặc text */
.tl-card-header {
  padding: 20px 20px 24px;
  position: relative;
  border-left: 6px solid #C8521A;

}

.tl-card-header img {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 14px;
  object-fit: cover;
  max-height: 160px;
}

.tl-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.tl-loai-badge {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: normal;
  line-height: 24px;
  color: #FFFFFF;
}

.tl-gia-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
}

.tl-free {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #a5d6a7;
}

.tl-paid {
  background: #fff3e0;
  color: #e65100;
  border: 1px solid #ffcc80;
}

.tl-title-small {
  font-size: 21px;
  font-weight: 500;
  line-height: normal;
  color: #fff !important;
  margin: 0;
  letter-spacing: 0;
	color: inherit;
}

/* Body card small */
.tl-card-body {
  padding: 30px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tl-excerpt-small {
  font-size: 16px;
  color: #6B6257;
  line-height: 24px;
  margin-bottom: 0 !important;
  letter-spacing: 0;
}

/* Tags */
.tl-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tl-tag {
  font-size: 11px;
  font-weight: 400;
  color: #111110;
  background: #f2f1ed;
  border: 1px solid #e4e2da;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.tl-tag-cat {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #3730a3;
}

/* Row meta + button nhỏ */
.tl-card-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid #f0eee9;
  margin-top: auto;
}

.tl-meta-str-small {
  font-size: 14px;
  color: #6B6257;
}

/* Button tải nhỏ */
.tl-btn-small {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 16px;
  font-weight: 600;
  color: #C8521A;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: opacity 0.15s;
  box-shadow: none;
}

.tl-btn-small:hover {
  opacity: 0.75;
  color: #C8521A;
}

/* Header dùng ảnh bài viết làm background */
.tl-card-header-bg {
  background-size: cover !important;
  background-position: center !important;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Khi có ảnh nền, loại badge và title cần nổi rõ hơn */
.tl-card-header-bg .tl-loai-badge {
  color: #FFFFFF;
}

.tl-card-header-bg .tl-title-small {
  margin-top: auto;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

/* =============================================
   Card small bên trong [tai_lieu_list] (.tl-wrap)
   → Header sáng, khác hoàn toàn với [tai_lieu_grid]
   ============================================= */
.tl-wrap .tl-card-small .tl-card-header {
  background: #f8f7f4;
  border-bottom: 1.5px solid #e8e5de;
  padding: 16px 16px 0;
}

.tl-wrap .tl-card-small .tl-card-header img {
  border-radius: 8px;
  margin-bottom: 0;
  max-height: 180px;
  width: 100%;
  object-fit: cover;
  display: block;
}

.tl-wrap .tl-card-small .tl-loai-badge {
  color: #888;
  text-shadow: none;
}

.tl-wrap .tl-card-small .tl-title-small {
  color: #111110;
  text-shadow: none;
  padding: 12px 0 14px;
  font-size: 15px;
}

.tl-wrap .tl-card-small .tl-title-small a {
  color: #111110;
}

.tl-wrap .tl-card-small .tl-title-small a:hover {
  color: #C8521A;
}

/* Placeholder khi không có ảnh trong card small của [tai_lieu_list] */
.tl-wrap .tl-card-small .tl-card-header:not(:has(img)) {
  background: #f8f7f4;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* ========================================
   SHORTCODE [tai_lieu_grid] — Lưới card nhỏ
   ======================================== */
.tl-grid-wrap .tl-grid {
  display: grid;
  gap: 30px;
}

.tl-grid-wrap .tl-grid.tl-grid-cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.tl-grid-wrap .tl-grid.tl-grid-cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.tl-grid-wrap .tl-grid.tl-grid-cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* ========== EMPTY ========== */
.tl-empty {
  text-align: center;
  color: #999;
  padding: 48px;
  font-size: 15px;
}

/* Tag: Chủ đề */
.tl-tag-chu-de {
  background: #fdf4ff;
  border-color: #e9d5ff;
  color: #7e22ce;
}

/* ========== FILTER TABS ========== */
.tl-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 44px;
}

.tl-filter-btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 20px;
  border-radius: 999px;
  border: 1.5px solid #e0dbd2;
  background: #fff;
  color: #444;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
  font-family: inherit;
  white-space: nowrap;
}

.tl-filter-btn:hover {
  background:#3A3A3A;
  color: #fff;
}

.tl-filter-btn.active {
  background: #111110;
  border-color: #111110;
  color: #fff;
}

/* Khi filter ẩn card large → xoá grid-column full width */
.tl-wrap.tl-layout-both .tl-card-large[style*="none"] {
  display: none !important;
}

/* ========================================
   MODAL — Thu thập email trước khi tải PDF
   ======================================== */
.tl-modal-overlay {
  position: fixed;
  inset: 0;
  background: #000000CC;
  backdrop-filter: blur(3px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: tl-fade-in 0.2s ease;
}

@keyframes tl-fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.tl-modal-box {
  background: #fff;
  border-radius: 20px;
  padding: 48px 44px 40px;
  width: 100%;
  max-width: 520px;
  position: relative;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.18);
  animation: tl-slide-up 0.25s ease;
}

@keyframes tl-slide-up {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tl-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: none;
  border: none;
  cursor: pointer;
  color: #888;
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  transition: color 0.15s, background 0.15s;
}

.tl-modal-close:hover {
  color: #111;
  background: #f2f0eb;
}

.tl-modal-label {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 24px;
  color: #C8521A;
  margin: 0 0 30px;
}

.tl-modal-title {
  font-size: 28px;
  font-weight: 800;
  color: #111110;
  line-height: 1.25;
  letter-spacing: -0.025em;
  margin: 0 0 12px;
}

.tl-modal-meta {
  font-size: 16px;
  color: #111110;
  margin: 0 0 30px;
  line-height: 24px;
}

.tl-modal-msg {
  font-size: 13.5px;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.tl-modal-msg-error {
  background: #fff2f2;
  color: #c0392b;
  border: 1px solid #f5c6c6;
}

.tl-modal-msg-success {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.tl-modal-field {
  margin-bottom: 12px;
}

.tl-modal-field input {
  width: 100%;
  padding: 10px 20px;
  border: 1px solid #00000033;
  border-radius: 8px;
  font-size: 15px;
  color: #111;
  background: #faf9f7;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
  box-sizing: border-box;
  font-family: inherit;
}

.tl-modal-field input:focus {
  border-color: #111110;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(17, 17, 16, 0.07);
}

.tl-modal-field input::placeholder {
  color: #aaa;
}

.tl-modal-btn {
  display: block;
  width: 100%;
  padding: 16px 32px;
  background: #000000;
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 18px;
  transition: background 0.18s, transform 0.15s;
  font-family: inherit;
  letter-spacing: -0.01em;
}

.tl-modal-btn:hover {
  background: #333;
  transform: translateY(-1px);
  color: #fff;
}

.tl-modal-btn:active {
  transform: translateY(0);
}

.tl-modal-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.tl-modal-btn-outline {
  background: transparent;
  color: #111110;
  border: 1.5px solid #e4e2da;
  margin-top: 16px;
}

.tl-modal-btn-outline:hover {
  background: #f5f4f0;
  transform: none;
}

.tl-modal-note {
  font-size: 11px;
  color: #A89F93;
  text-align: center;
  margin: 12px 0 0;
}

/* Success state */
.tl-modal-success-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
  margin-top: 8px;
}

/* button[type=button] override — đảm bảo style đúng */
button.tl-btn-download {
  cursor: pointer;
  border: none;
  font-family: inherit;
}

button.tl-btn-small {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  line-height: 1;
  padding: 0;
}

/* Mobile */
@media (max-width: 560px) {
  .tl-modal-box {
    padding: 36px 24px 32px;
    border-radius: 16px;
  }

  .tl-modal-title {
    font-size: 22px;
  }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
  .tl-filter-tabs {
    margin-bottom: 20px;
  }

  .tl-card-large {
    flex-direction: column;
  }

  .tl-card-left {
    width: 100%;
  }

  .tl-thumb-large {
    min-height: 180px;
    max-height: 220px;
  }

  .tl-thumb-overlay {
    padding: 20px 15px;
  }

  .tl-thumb-overlay span {
    margin-bottom: 10px;
  }

  .tl-card-right {
    width: 100%;
    padding: 20px 0;
    border-left: none;
    border-top: 1.5px solid #e8e5de;
  }

  .tl-title {
    font-size: 20px;
  }

  .tl-bullets {
    grid-template-columns: 1fr;
  }

  .tl-excerpt {
    margin-bottom: 20px !important;
  }
}

@media (max-width: 1024px) {

  .tl-grid-wrap .tl-grid.tl-grid-cols-3,
  .tl-grid-wrap .tl-grid.tl-grid-cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {

  .tl-grid-wrap .tl-grid.tl-grid-cols-2,
  .tl-grid-wrap .tl-grid.tl-grid-cols-3,
  .tl-grid-wrap .tl-grid.tl-grid-cols-4 {
    grid-template-columns: 1fr;
  }

  .tl-card-body {
    padding: 20px;
  }
}