/* ═══════════════════════════════════════════════════════════
   HOME TOEIC — review-core.css (DÙNG CHUNG: trang Đánh giá danh-gia.html + mục đánh giá trang Khóa học)
   Thẻ đánh giá học viên viết trên web, huy hiệu, hồ sơ học tập, lưới ảnh Fanpage/Tin nhắn, thanh tab nguồn.
   Nạp SAU khoa-hoc.css (dùng .kh-review-*, .kh-lightbox-*, .kh-overlay/.kh-modal). Đi cùng review-core.js.
   ═══════════════════════════════════════════════════════════ */
/* ── Đánh giá học viên viết trên web ── */
/* Lưới 3 cột máy tính / 2 cột máy tính bảng / 1 cột điện thoại — dùng chung cho thẻ web + ảnh trang Đánh giá. */
.dg-grid, .dg-shots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.dg-grid { align-items: start; }
@media (max-width: 1000px) { .dg-grid, .dg-shots { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .dg-grid, .dg-shots { grid-template-columns: 1fr; gap: 14px; } }

.dg-card {
  display: flex; flex-direction: column; gap: 12px; padding: 18px 20px; border-radius: var(--radius);
  background: var(--bg-card); border: 1.5px solid var(--border); box-shadow: var(--shadow-sm);
}
.dg-card-head { display: flex; align-items: flex-start; gap: 12px; }
.dg-avatar {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; object-fit: cover;
  background: var(--bg-hover);
}
.dg-avatar--txt {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary-light); color: var(--primary); font-size: 17px; font-weight: 800;
}
.dg-card-who { flex: 1; min-width: 0; }
.dg-card-name { font-size: 14.5px; font-weight: 800; color: var(--text); overflow-wrap: anywhere; }
.dg-card-head .kh-review-score { margin-top: 2px; }
.dg-badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.dg-badge {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 800;
  padding: 2px 8px; border-radius: var(--radius-pill); white-space: nowrap;
}
.dg-badge svg { flex-shrink: 0; }
.dg-badge--promax { background: #fef3c7; color: #b45309; }
.dg-badge--pro    { background: var(--primary-light); color: var(--primary); }
.dg-badge--zoom   { background: #ede9fe; color: #6d28d9; }
:root[data-theme="dark"] .dg-badge--promax { background: rgba(255,192,0,.16); color: var(--gold); }
:root[data-theme="dark"] .dg-badge--pro    { color: #93c5fd; }
:root[data-theme="dark"] .dg-badge--zoom   { background: rgba(139,92,246,.18); color: #c4b5fd; }

/* Bài dài cắt ở 7 dòng, nút "Xem thêm" mở đủ (JS chỉ hiện nút khi bài thật sự bị cắt). */
.dg-card-text {
  margin: 0; font-size: 14px; line-height: 1.7; color: var(--text); overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 7; -webkit-box-orient: vertical; overflow: hidden;
}
.dg-card.is-open .dg-card-text { display: block; -webkit-line-clamp: unset; overflow: visible; }
.dg-card-more {
  align-self: flex-start; margin-top: -6px; padding: 0; border: 0; background: none;
  color: var(--primary); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
}
.dg-card-more[hidden] { display: none; }

.dg-card-img {
  position: relative; display: block; width: 100%; height: 180px; padding: 0; overflow: hidden;
  border: 1px solid var(--border); border-radius: 10px; background: var(--bg); cursor: zoom-in;
}
.dg-card-img img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.dg-card-img-hint {
  position: absolute; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: var(--radius-pill); background: rgba(15,23,42,.78); color: #fff;
  font-size: 12px; font-weight: 700; pointer-events: none;
}
.dg-card-img:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.dg-card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text-2);
}
.dg-card-stats { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.dg-card-stats span { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
.dg-card-stats svg { flex-shrink: 0; color: var(--success); }

/* ── Ảnh Fanpage / Tin nhắn trang Đánh giá (lưới cột ở khối .dg-grid, .dg-shots phía trên; điện thoại 1 cột dọc
   — trang riêng nên cuộn dọc tự nhiên hơn hàng vuốt ngang của trang Khóa học). ── */
.dg-shots { align-items: stretch; }
/* Thẻ không có dòng dưới ảnh (không điểm / link) vẫn cao bằng thẻ có: khung ảnh giãn lấp phần còn lại (nền trắng). */
.kh-review-card--img .kh-review-imgbox { flex: 1 0 auto; }
/* Mọi ô ảnh CAO BẰNG NHAU, tỉ lệ 4:3 (thẻ 3 cột hẹp nên cho cao hơn để thấy đủ đầu bài; điện thoại 3:2).
   Ảnh bám ĐỈNH khung, nền TRẮNG như bài Facebook (không nền xám, không canh giữa) nên ảnh ngắn hơn chỉ
   dư 1 dải trắng nhỏ phía dưới; ảnh dài bị cắt + mờ mép trắng + "Bấm để xem đủ". */
.dg-shots .kh-review-card--img .kh-review-imgbox { height: auto; aspect-ratio: 4 / 3; background: #fff; }
.dg-shots .kh-review-card--img .kh-review-img { margin: 0; }
.dg-shots .kh-review-imgbox.is-clipped::after { background: linear-gradient(to bottom, rgba(255,255,255,0), #fff); }
@media (max-width: 640px) {
  .dg-shots .kh-review-card--img .kh-review-imgbox { height: auto; aspect-ratio: 3 / 2; }
}
/* Nhãn "Bấm để xem đủ" trên máy tính chỉ hiện khi rê chuột vào thẻ (hiện sẵn ở mọi thẻ trông rối);
   điện thoại không rê chuột được → vẫn hiện sẵn. Áp dụng cả trang Khóa học. */
@media (hover: hover) and (pointer: fine) {
  .kh-review-imgbox.is-clipped .kh-review-more-hint { opacity: 0; transition: opacity .15s ease; }
  .kh-review-card--img:hover .kh-review-more-hint,
  .kh-review-card--img:focus-visible .kh-review-more-hint { opacity: 1; }
}
.dg-shots .kh-review-card:not(.kh-review-card--img) { padding: 20px; }

/* ── Khung hộp thoại (hồ sơ học tập + form viết đánh giá) ── */
.dg-form { max-width: 560px; }
.dg-form-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 18px 22px 0;
}
.dg-form-head h2 { margin: 0; font-size: 19px; font-weight: 800; color: var(--text); }
.dg-x {
  display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px;
  border: 0; border-radius: 50%; background: var(--bg-hover); color: var(--text-2); cursor: pointer;
}
.dg-x:hover { color: var(--text); }
.dg-form-body { display: flex; flex-direction: column; gap: 14px; padding: 16px 22px 22px; }
@media (max-width: 480px) {
  .dg-form-head { padding: 16px 16px 0; }
  .dg-form-body { padding: 14px 16px 18px; }
}

/* ── Mục "Đề xuất trên Facebook" ── */
.dg-title-fb { display: flex; align-items: center; justify-content: center; gap: 8px; }
/* Logo Facebook chuẩn: hình SVG đã là tròn xanh + chữ "f" khoét rỗng → tô XANH, lót 1 đĩa trắng nhỏ hơn
   một chút phía sau để chữ f luôn trắng (cả chế độ tối), không lộ viền trắng quanh mép. */
.dg-fb-ic {
  /* Cỡ ~ chiều cao chữ tiêu đề (21px) — 30px trông to tràn, lấn chữ. */
  display: inline-flex; width: 22px; height: 22px; flex-shrink: 0; color: #1877f2;
  background: radial-gradient(circle closest-side, #fff 94%, transparent 95%);
}
.dg-fb-ic svg { display: block; width: 100%; height: 100%; }
.dg-section .kh-reviews-more svg:first-child { color: #1877f2; }
.dg-shot-right { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.dg-fb-post {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700;
  color: #1877f2; text-decoration: none; white-space: nowrap;
}
.dg-fb-post:hover { text-decoration: underline; }
:root[data-theme="dark"] .dg-fb-post { color: #60a5fa; }

/* ── Nút "Xem hồ sơ" + hộp hồ sơ học tập ── */
.dg-card-stats time { color: var(--text-2); font-weight: 500; }
.dg-profile-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 6px 14px;
  border-radius: var(--radius-pill); border: 1.5px solid var(--border); background: var(--bg-card);
  color: var(--primary); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; white-space: nowrap;
  transition: border-color .15s ease;
}
.dg-profile-btn:hover { border-color: var(--primary); }
.dg-profile-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.dg-prof .dg-form-head { align-items: flex-start; }
.dg-prof .dg-form-head .dg-card-head { flex: 1; min-width: 0; }
.dg-prof-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 480px) { .dg-prof-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dg-prof-val { font-size: 16px; } }
.dg-prof-tile {
  padding: 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--border); min-width: 0;
}
.dg-prof-val { font-size: 18px; font-weight: 800; color: var(--text); line-height: 1.2; overflow-wrap: anywhere; }
.dg-prof-key { margin-top: 4px; font-size: 12px; color: var(--text-2); line-height: 1.35; }
.dg-prof-hero {
  padding: 16px; border-radius: 12px; text-align: center;
  background: var(--primary-light); border: 1px solid var(--border);
}
.dg-prof-hero-val { font-size: 32px; font-weight: 800; line-height: 1.1; color: var(--text); }
.dg-prof-hero .dg-prof-key { font-size: 13px; }
.dg-prof-note { margin: 0; font-size: 12px; line-height: 1.5; color: var(--text-2); }

/* ── 2 tab nguồn (chỉ khi cả 2 nguồn có bài) — kiểu nút bo tròn giống trang Xếp hạng ── */
/* Rộng theo nội dung (3 nhãn dài không bị tràn ra ngoài khung), không quá bề ngang màn hình. */
.dg-tabs {
  display: flex; gap: 6px; width: fit-content; max-width: 100%; margin: 0 auto 26px; padding: 4px;
  background: var(--bg-hover); border: 1.5px solid var(--border); border-radius: var(--radius-pill);
}
.dg-tab {
  flex: 1 1 auto; min-width: 0; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px;
  padding: 8px 16px; border: 0; border-radius: var(--radius-pill); background: transparent;
  color: var(--text-2); font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; white-space: nowrap;
  transition: background .2s ease, color .2s ease;
}
.dg-tab svg { flex-shrink: 0; width: 16px; height: 16px; }
.dg-tab-fb { display: inline-flex; color: #1877f2; }
.dg-tab.active { background: var(--primary); color: #fff; }
.dg-tab.active .dg-tab-fb { color: #fff; }
.dg-tab:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.dg-tab-short { display: none; }
@media (max-width: 700px) { .dg-tab-long { display: none; } .dg-tab-short { display: inline; } }
/* Có tab rồi thì tiêu đề từng mục thừa — tab đã nói nguồn. */
.dg-tabbed .dg-section > .kh-reviews-title { display: none; }
.dg-tabbed .dg-section { margin-top: 0; }

/* 3 tab trên điện thoại nhỏ: bỏ icon (trừ logo Facebook) cho đủ chỗ. */
@media (max-width: 400px) {
  .dg-tabs { width: 100%; }
  .dg-tab { flex: 1 1 0; padding: 8px 4px; gap: 4px; font-size: 12.5px; }
  .dg-tab > svg { display: none; }
}
