/* Hallmark · bài tin DND (giữ khung 1 cột căn giữa) · design-system: DESIGN.md DND (bmw + vàng đồng) · tone: corporate-measured
 * Hallmark · pre-emit critique: P4 H4 E4 S5 R5 V5 — khác NTH (cột phụ phải + thanh tiến độ đọc kéo ngang, ảnh phóng 1.08) và angia (cột trái có form, ảnh mở từ dưới lên, gạch H2 vẽ dần):
 * DND = thẻ dự án dính lề phải chỉ hiện khi đọc giữa bài, ảnh xám nhạt → màu khi cuộn tới + vạch vàng đồng chạy dưới ảnh, bộ đếm "Mục x/y" góc trái dưới. body.dnd-bmw.single-post */

/* ---------- 1. Thẻ dự án ---------- */
body.dnd-bmw .dbt-card { background: var(--k-card); border: 1px solid var(--k-line); }
body.dnd-bmw .dbt-card__img { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--k-strong); }
body.dnd-bmw .dbt-card__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
body.dnd-bmw .dbt-card__body { display: grid; gap: 6px; padding: 16px 18px 18px; }
body.dnd-bmw .dbt-card__nhan { font-size: 12px; font-weight: 700; color: var(--k-gold-ink); }
body.dnd-bmw .dbt-card__ten { font-size: 20px; line-height: 1.2; }
body.dnd-bmw .dbt-card__ten a { color: var(--k-ink) !important; text-decoration: none !important; }
body.dnd-bmw .dbt-card__ten a:hover { color: var(--k-gold-ink) !important; }
body.dnd-bmw .dbt-card__vt { font-size: 13px; color: var(--k-mute); line-height: 1.4; }
body.dnd-bmw .dbt-card__spec { margin: 6px 0 4px; border-top: 1px solid var(--k-line); }
body.dnd-bmw .dbt-card__spec > div { padding: 7px 0; border-bottom: 1px solid var(--k-line); }
body.dnd-bmw .dbt-card__spec dt { margin: 0; font-size: 12px; color: var(--k-mute); }
body.dnd-bmw .dbt-card__spec dd { margin: 2px 0 0; font-size: 14px; font-weight: 700; color: var(--k-ink); line-height: 1.35; }
body.dnd-bmw .dbt-card a.dbt-card__btn { display: flex; align-items: center; justify-content: center; height: 44px; margin-top: 8px; background: var(--k-gold); color: var(--k-navy) !important; font-size: 15px; font-weight: 700; text-decoration: none !important; transition: background-color 200ms var(--k-ease); }
body.dnd-bmw .dbt-card a.dbt-card__btn:hover { background: var(--k-gold2); }
body.dnd-bmw .dbt-card a.dbt-card__link { justify-self: center; font-size: 14px; font-weight: 700; color: var(--k-ink) !important; text-decoration: underline !important; text-underline-offset: 4px; text-decoration-thickness: 1px !important; }
body.dnd-bmw .dbt-card a:focus-visible { outline: 2px solid var(--k-gold-ink); outline-offset: 2px; }
/* Mặc định (hẹp): nằm trong bài trước khối chuyên gia, xếp ngang */
body.dnd-bmw .dbt-card { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); margin: 40px 0; }
body.dnd-bmw .dbt-card .dbt-card__img { aspect-ratio: auto; height: 100%; }
@media (max-width: 600px) { body.dnd-bmw .dbt-card { grid-template-columns: minmax(0, 1fr); } body.dnd-bmw .dbt-card .dbt-card__img { aspect-ratio: 16 / 10; height: auto; } }
/* Màn hình rộng: dính lề phải (fixed, không chiếm chỗ trong bài), trượt vào khi đọc thân bài, lui khi tới cuối bài */
@media (min-width: 1360px) {
  body.dnd-bmw .dbt-card { display: block; position: fixed; z-index: 40; top: 120px; left: calc(50% + 416px + 24px); width: 248px; margin: 0; opacity: 0; transform: translateX(16px); pointer-events: none; transition: opacity 260ms var(--k-ease), transform 260ms var(--k-ease); }
  body.dnd-bmw .dbt-card .dbt-card__img { aspect-ratio: 16 / 10; height: auto; }
  body.dnd-bmw .dbt-card.is-hien { opacity: 1; transform: none; pointer-events: auto; }
}
@media (min-width: 1360px) and (max-height: 700px) { body.dnd-bmw .dbt-card .dbt-card__img { display: none; } }

/* ---------- 2. Ảnh trong bài: xám nhạt → màu khi cuộn tới + vạch vàng đồng chạy dưới ảnh ---------- */
body.dnd-bmw.dbt-fx .prose figure { position: relative; }
body.dnd-bmw.dbt-fx .prose figure img { filter: saturate(.45); transition: filter 700ms var(--k-ease); }
body.dnd-bmw.dbt-fx .prose figure.is-in img { filter: none; }
body.dnd-bmw.dbt-fx .prose figure .dbt-vach { display: block; height: 3px; margin-top: -3px; position: relative; z-index: 1; background: var(--k-gold); transform: scaleX(0); transform-origin: left; transition: transform 800ms var(--k-ease) 150ms; }
body.dnd-bmw.dbt-fx .prose figure.is-in .dbt-vach { transform: scaleX(1); }
/* Bảng giỏ hàng: hàng đang trỏ tô nền kem để dò */
@media (hover: hover) { body.dnd-bmw .prose table tbody tr:hover td { background-color: var(--k-strong) !important; } }

/* ---------- 3. Bộ đếm "Mục x/y" ---------- */
body.dnd-bmw .dbt-muc { position: fixed; z-index: 45; left: 24px; bottom: 24px; display: flex; align-items: center; gap: 10px; max-width: min(420px, calc(100vw - 140px)); height: 46px; padding: 0 16px 0 0; background: var(--k-navy); color: #fff; border: 0; cursor: pointer; opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity 240ms var(--k-ease), transform 240ms var(--k-ease); }
body.dnd-bmw .dbt-muc.is-hien { opacity: 1; transform: none; pointer-events: auto; }
body.dnd-bmw .dbt-muc__so { display: grid; place-items: center; height: 100%; min-width: 64px; padding: 0 12px; background: var(--k-gold); color: var(--k-navy); font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
body.dnd-bmw .dbt-muc__ten { font-size: 14px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
body.dnd-bmw .dbt-muc:hover .dbt-muc__ten { color: var(--k-gold); }
body.dnd-bmw .dbt-muc:focus-visible { outline: 2px solid var(--k-gold); outline-offset: 3px; }
@media (max-width: 767px) { body.dnd-bmw .dbt-muc { left: 12px; bottom: 12px; height: 42px; max-width: calc(100vw - 110px); } body.dnd-bmw .dbt-muc__so { min-width: 56px; } }

@media (prefers-reduced-motion: reduce) {
  body.dnd-bmw .dbt-card, body.dnd-bmw .dbt-muc { transition: none; transform: none; }
  body.dnd-bmw.dbt-fx .prose figure img, body.dnd-bmw.dbt-fx .prose figure .dbt-vach { transition: none; }
}
