/* site.css — CSS của WEBSITE XUẤT BẢN (M33, publish/export.js chép vào file zip thành css/site.css; app không dùng file này).
   Chỉ gồm phần vẽ trang của tab xem trước: luật hình / rê chuột / trình chiếu / băng chạy / chờ cuộn tới chép từ
   components.css (mục hình, M31) + preview.css (trang, M29) — SỬA MỘT BÊN THÌ SỬA CẢ HAI. Không có khung máy, thanh nút,
   nhãn ID, thanh "Có bản mới". Trang rộng đúng bề ngang cửa sổ, cao theo tỉ lệ trang của khổ bố cục (M21/M22), cả trang cuộn. */

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: #ffffff; }
body { margin: 0; }
[hidden] { display: none !important; }

/* ---- Trang (preview.css .pv-page) ---- */
.pv-page { display: block; width: 100%; aspect-ratio: var(--page-w) / var(--page-h); }
.pv-page .canvas { display: block; width: 100%; height: 100%; }
.canvas__bg { fill: #ffffff; }

/* ---- Hình (components.css) ---- */
.shape { stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.shape__hit { fill: transparent; pointer-events: all; }
.ss__empty { display: none; } /* "Thêm ảnh" chỉ ở trang sửa */
.ss__counter, .ss-btn { user-select: none; -webkit-user-select: none; }

/* ---- Khi di chuột (M31, components.css) ---- */
.hv {
  transition: transform var(--hv-dur, .3s) ease-out, opacity var(--hv-dur, .3s) ease-out, filter var(--hv-dur, .3s) ease-out;
}
.hv-color > .shape:not(g), .hv-color > .shape > text { transition: fill var(--hv-dur, .3s) ease-out; }
@media (hover: hover) {
  .hv-live .hv .shape { pointer-events: all; }
  .hv-live .hv-zoom:hover { transform: var(--hv-zoom); }
  .hv-live .hv-fade:hover { opacity: var(--hv-op, .6); }
  .hv-live .hv-color:hover > .shape:not(g), .hv-live .hv-color:hover > .shape > text { fill: var(--hv-color); }
  .hv-live .hv-lift:hover { transform: translate(0px, -6px); filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .28)); }
}
.hv-live .is-pending .shape, .hv-live .is-pending .shape * { pointer-events: none; }
@media (prefers-reduced-motion: reduce) {
  .hv, .hv-color > .shape:not(g), .hv-color > .shape > text { transition: none; }
}

/* ---- Link, trình chiếu, băng chạy, chờ cuộn tới (preview.css) ---- */
.pv-link { cursor: pointer; }
.pv-link .shape { pointer-events: all; }
.pv-link:focus-visible { outline: 2px solid #3d6ff5; outline-offset: 2px; }
.ss-btn { cursor: pointer; outline: none; }
.ss-btn:focus-visible .ss-btn__bg { stroke: #3d6ff5; stroke-width: 3px; vector-effect: non-scaling-stroke; }
.mq__track[data-run="1"] { animation: mq-run var(--mq-dur, 0s) linear infinite; }
.mq__view:hover .mq__track { animation-play-state: paused; }
@keyframes mq-run {
  from { transform: translateX(var(--mq-from, 0px)); }
  to { transform: translateX(var(--mq-to, 0px)); }
}
@media (prefers-reduced-motion: reduce) {
  .mq__track[data-run="1"] { animation: none; }
}
.is-pending { visibility: hidden; }
.is-pending .shape { pointer-events: none; }

/* ---- Video (M32, preview.css + components.css): dấu ▶ chỉ ở trang sửa ---- */
.vid__badge { display: none; }
.vid__fo { overflow: hidden; }
.vid__box { position: relative; width: 100%; height: 100%; container-type: size; }
.vid__el { display: block; width: 100%; height: 100%; object-fit: cover; background: transparent; }
.vid__el--contain { object-fit: contain; background: #111827; } /* phần dư = nền đen (che ảnh bìa svg bên dưới) */
.vid__play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 64px; height: 64px; width: clamp(24px, 22cqmin, 160px); height: clamp(24px, 22cqmin, 160px);
  border: 0; border-radius: 50%; padding: 0; cursor: pointer;
  background: rgba(17, 24, 39, .6); color: #fff; font: 600 28px/1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: clamp(10px, 9cqmin, 64px);
}
.vid__play:focus-visible { outline: 3px solid #3d6ff5; outline-offset: 2px; }

/* ---- Dính trên đầu khi cuộn (M29 đợt 3, preview.css): khối sticky cao 0 ở đầu trang, cả trang cuộn ---- */
.pv-sticky { position: sticky; top: 0; z-index: 1; height: 0; }
.pv-sticky__svg { position: absolute; top: 0; left: 0; display: block; width: 100%; height: var(--sticky-h, 0px); pointer-events: none; }
#layer-sticky { pointer-events: visiblePainted; }

/* ---- Chữ dự phòng khi trình duyệt tắt JavaScript (<noscript>, publish/export.js) ---- */
.site-noscript { max-width: 720px; margin: 0 auto; padding: 24px 16px; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: #1d2a44; }
