/* ==========================================================================
   Tin tức: trang /tin-tuc, chuyên mục, thẻ bài viết (dùng lại được ở trang chủ),
   nhãn chuyên mục trên trang bài viết. Dùng biến màu của site.css và studio.css.
   ========================================================================== */
:root {
  --tt-chip-nen: #eff6df;
  --tt-chip-chu: #2f3a1f;
  --tt-hinh-nen: #e8eddf;
  --tt-khung-dt: #272924;
}
@media (prefers-color-scheme: dark) {
  :root { --tt-chip-nen: #313c25; --tt-chip-chu: #e3f2b8; --tt-hinh-nen: #2a3121; --tt-khung-dt: #11130f; }
}

.an-di { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Mục "Tin tức" đang mở trên thanh điều hướng */
.dieu-huong a[aria-current] { text-decoration: underline; text-decoration-color: var(--nhan); text-decoration-thickness: 3px; text-underline-offset: 6px; }

/* ---------- Đầu trang Tin tức ---------- */
.tin-tuc-dau { padding-top: clamp(28px, 4vw, 48px); padding-bottom: 28px; }
.tin-tuc-dau__luoi { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px 64px; align-items: end; }
.tin-tuc-dau h1 { margin-top: 18px; font-size: clamp(2.6rem, 6.2vw, 5.4rem); font-weight: 800; letter-spacing: -.065em; line-height: 1; }
.tin-tuc-dau .collection-count { margin-left: 2px; }
.tin-tuc-dau__phu { display: grid; justify-items: start; gap: 18px; padding-bottom: 6px; }
.tin-tuc-dau__phu p { max-width: 40ch; color: var(--chu-phu); font-size: .95rem; line-height: 1.75; }
.tin-tuc-rss { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border: 1px solid var(--vien); border-radius: 999px; font-size: .74rem; font-weight: 600; text-decoration: none; transition: border-color .2s, background-color .2s; }
.tin-tuc-rss:hover { border-color: var(--muc); background: var(--be-mat); }
.tin-tuc-rss .ic { width: 14px; height: 14px; }

/* ---------- Lọc chuyên mục ---------- */
.loc-chuyen-muc { padding-bottom: 36px; }
.loc-chuyen-muc ul { list-style: none; margin: 0; padding: 22px 0 0; display: flex; flex-wrap: wrap; gap: 8px; border-top: 1px solid var(--vien); }
.loc-chuyen-muc a { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 16px; border: 1px solid var(--vien); border-radius: 999px; color: var(--chu-phu); font-size: .78rem; font-weight: 500; text-decoration: none; transition: background-color .15s, color .15s, border-color .15s; }
.loc-chuyen-muc a span { font-size: .66rem; min-width: 20px; padding: 1px 6px; border-radius: 999px; background: var(--nen-2); color: var(--chu-phu); text-align: center; }
.loc-chuyen-muc a:hover { border-color: var(--muc); color: var(--muc); }
.loc-chuyen-muc a[aria-current] { background: var(--muc); border-color: var(--muc); color: var(--nen); }
.loc-chuyen-muc a[aria-current] span { background: color-mix(in srgb, var(--nen) 18%, transparent); color: var(--nen); }

/* ---------- Lưới bài viết ---------- */
.luoi-bv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 52px 28px; padding-bottom: clamp(56px, 7vw, 96px); }
.luoi-bv__trong { grid-column: 1 / -1; display: grid; justify-items: start; gap: 18px; padding: 40px; border: 1px dashed var(--vien); border-radius: 18px; color: var(--chu-phu); }

/* ---------- Thẻ bài viết ---------- */
.the-bv { position: relative; display: flex; flex-direction: column; min-width: 0; }
/* Tỉ lệ 1200×630 như ảnh bìa bài viết, ảnh chia sẻ không bị cắt mép */
.the-bv__hinh { position: relative; aspect-ratio: 40 / 21; border-radius: 18px; overflow: hidden; background: var(--tt-hinh-nen); isolation: isolate; }
.the-bv__hinh img { width: 100%; height: 100%; object-fit: cover; object-position: center top; transition: transform .6s var(--em-diu); }
/* Ảnh dọc (chụp màn hình điện thoại): đặt trong khung máy, nghiêng nhẹ như thẻ dự án ở trang chủ */
.the-bv__hinh--doc img { position: absolute; width: 32%; height: auto; top: 11%; left: 50%; object-fit: initial; border: 5px solid var(--tt-khung-dt); border-radius: 22px; box-shadow: 0 22px 35px -13px #232b2655; transform: translateX(-50%) rotate(-4deg); }
.the-bv__hinh--doc::before { content: ''; position: absolute; z-index: -1; width: 70%; aspect-ratio: 1; left: 15%; top: 14%; border: 1px solid color-mix(in srgb, var(--muc) 10%, transparent); border-radius: 50%; }
.the-bv__cho { position: absolute; inset: 0; display: grid; place-items: center; font: 800 clamp(3rem, 6vw, 4.6rem)/1 var(--chu-hien-thi); letter-spacing: -.06em; color: color-mix(in srgb, var(--muc) 30%, transparent); }
.the-bv__chu { display: flex; flex-direction: column; flex: 1; padding-top: 18px; }
.the-bv__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; color: var(--chu-phu); font-size: .7rem; }
.the-bv__muc { position: relative; z-index: 2; display: inline-flex; align-items: center; min-height: 26px; padding: 2px 11px; border-radius: 999px; background: var(--tt-chip-nen); color: var(--tt-chip-chu); font-weight: 600; letter-spacing: .02em; text-decoration: none; }
.the-bv__muc:hover { background: var(--nhan); color: #222520; }
.the-bv__ngon-ngu { font-size: .64rem; text-transform: uppercase; letter-spacing: .1em; }
.the-bv__tieu-de { margin-top: 12px; font-size: clamp(1.18rem, 1.55vw, 1.42rem); font-weight: 700; letter-spacing: -.035em; line-height: 1.2; }
.the-bv__tieu-de a { text-decoration: none; }
/* Liên kết tiêu đề phủ cả thẻ: bấm ảnh hay mô tả đều mở bài */
.the-bv__tieu-de a::after { content: ''; position: absolute; inset: 0; z-index: 1; border-radius: 18px; }
.the-bv__tieu-de a:focus-visible { outline: none; }
.the-bv__tieu-de a:focus-visible::after { outline: 3px solid var(--muc); outline-offset: 6px; }
.the-bv__mo-ta { margin-top: 10px; color: var(--chu-phu); font-size: .84rem; line-height: 1.7; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.the-bv__doc { margin-top: auto; padding-top: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--chu-phu); font-size: .68rem; }
.the-bv__doc .ic { width: 34px; height: 34px; padding: 9px; border: 1px solid var(--vien); border-radius: 50%; color: var(--muc); transition: background-color .2s, transform .3s var(--em-diu); }
.the-bv:hover .the-bv__tieu-de a { text-decoration: underline; text-decoration-thickness: 2px; text-decoration-color: var(--nhan); text-underline-offset: 4px; }
.the-bv:hover .the-bv__doc .ic { background: var(--nhan); color: #222520; border-color: var(--nhan); }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .the-bv:hover .the-bv__hinh img { transform: scale(1.035); }
  .the-bv:hover .the-bv__hinh--doc img { transform: translateX(-50%) translateY(-8px) rotate(-2deg); }
  .the-bv:hover .the-bv__doc .ic { transform: rotate(45deg); }
}

/* Bài nổi bật: bài mới nhất ở trang đầu, chiếm cả hàng */
.the-bv--noi-bat { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 28px 48px; align-items: center; padding-bottom: 52px; border-bottom: 1px solid var(--vien); }
.the-bv--noi-bat .the-bv__hinh--doc img { width: 26%; top: 9%; }
.the-bv--noi-bat .the-bv__chu { padding-top: 0; }
.the-bv--noi-bat .the-bv__tieu-de { font-size: clamp(1.7rem, 3vw, 2.6rem); letter-spacing: -.05em; line-height: 1.08; margin-top: 16px; }
.the-bv--noi-bat .the-bv__mo-ta { font-size: .95rem; -webkit-line-clamp: 4; line-clamp: 4; margin-top: 14px; }
.the-bv--noi-bat .the-bv__doc { margin-top: 0; padding-top: 24px; }
.the-bv--noi-bat .the-bv__tieu-de a::after { inset: -8px; }

/* ---------- Phân trang ---------- */
.phan-trang { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 24px; padding-bottom: clamp(64px, 8vw, 110px); margin-top: calc(-1 * clamp(24px, 4vw, 48px)); }
.phan-trang ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.phan-trang ol a, .phan-trang ol [aria-current] { display: grid; place-items: center; min-width: 40px; height: 40px; padding: 0 6px; border-radius: 999px; font-size: .8rem; font-weight: 600; text-decoration: none; }
.phan-trang ol a { border: 1px solid var(--vien); }
.phan-trang ol a:hover { border-color: var(--muc); }
.phan-trang ol [aria-current] { background: var(--muc); color: var(--nen); }
.phan-trang__chuyen { display: inline-flex; align-items: center; gap: 8px; min-width: 96px; font-size: .78rem; font-weight: 600; text-decoration: none; }
.phan-trang__chuyen:last-child { justify-content: flex-end; }
.phan-trang__chuyen:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Trang bài viết: nhãn chuyên mục trên tiêu đề ---------- */
.nhan-chuyen-muc { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 16px; min-height: 30px; padding: 3px 13px; border-radius: 999px; background: var(--tt-chip-nen); color: var(--tt-chip-chu); font-size: .74rem; font-weight: 600; letter-spacing: .02em; text-decoration: none; }
.nhan-chuyen-muc::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #7b9848; }
/* Đường dẫn trên bài: các bước trước không xuống dòng giữa chừng, chỉ tiêu đề bài được cắt bớt */
.bai-viet__dau .duong-dan li:not([aria-current]) { flex: none; white-space: nowrap; }
.nhan-chuyen-muc:hover { background: var(--nhan); color: #222520; }

/* ---------- Kích thước màn hình ---------- */
@media (max-width: 1000px) {
  .luoi-bv { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 44px 22px; }
}
@media (max-width: 760px) {
  .tin-tuc-dau__luoi { grid-template-columns: 1fr; }
  .tin-tuc-dau__phu p { font-size: .88rem; }
  .the-bv--noi-bat { grid-template-columns: 1fr; padding-bottom: 40px; }
  .the-bv--noi-bat .the-bv__hinh--doc img { width: 32%; top: 11%; }
  .phan-trang__chuyen { min-width: 0; }
}
@media (max-width: 600px) {
  .luoi-bv { grid-template-columns: 1fr; gap: 40px; }
  .loc-chuyen-muc { padding-bottom: 28px; }
  .loc-chuyen-muc a { min-height: 36px; padding: 6px 12px; font-size: .74rem; }
  .phan-trang { flex-wrap: wrap; justify-content: center; }
  .phan-trang ol { order: -1; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .the-bv__hinh img, .the-bv__doc .ic { transition: none; }
}
