/*
 * flatsome-compat.css — Lớp "cách ly" CSS của Flatsome khỏi thiết kế đã duyệt.
 * (MỚI 2026-09-29 — WordPress Developer. KHÔNG sửa tokens.css / theme.css gốc.)
 *
 * VẤN ĐỀ: flatsome.css (152KB) + <style id="custom-css"> của Flatsome định
 * nghĩa sẵn rất nhiều class TRÙNG TÊN với design system (.container, .row,
 * .col, .nav, .button, .section, .dark…) và style thẳng lên thẻ (h1–h6, p,
 * button, table, th, td, label, input, ul…): font Lato, chữ HOA ở nav/nút/th,
 * max-width 1080px, padding 30px cho .section, margin-bottom 1.3em cho p…
 * Những thuộc tính theme.css KHÔNG khai (vì prototype chạy trên nền trắng của
 * trình duyệt) thì bị Flatsome "rò" vào → web thật lệch prototype.
 *
 * CÁCH SỬA (3 lớp, theo thứ tự ưu tiên CSS Cascade Layers — Chrome/Edge 99+,
 * Safari 15.4+, Firefox 97+):
 *   1. functions.php đưa TOÀN BỘ flatsome.css + custom-css của Flatsome vào
 *      cascade layer `flatsome` (thấp nhất).
 *   2. File này khai layer `tal-reset` (cao hơn `flatsome`): trả mọi phần tử
 *      thuộc thiết kế 3A về style mặc định của trình duyệt (`all: revert`) —
 *      tức là ĐÚNG nền mà prototype đang chạy.
 *   3. tokens.css + theme.css KHÔNG nằm trong layer nào → luôn thắng cả 2
 *      layer trên, bất kể độ ưu tiên selector. Hiển thị = prototype.
 *
 * NGOẠI LỆ (Flatsome vẫn được style như cũ): mọi phần tử Flatsome gốc do UX
 * Builder sinh ra (Section/Row/Banner… — nằm trong `.section-content` hoặc
 * `.row`), popup `.mfp-*`, thanh admin, và vùng Owner tự bọc class `tal-fs`.
 * Ảnh/SVG/video/iframe cũng được loại trừ để giữ thuộc tính width/height gốc.
 *
 * Rollback: bỏ enqueue 'tal-flatsome-compat' + 2 filter layer trong
 * functions.php (xem README mục "Sửa lệch layout 2026-09-29").
 * Không có mã màu hex nào trong file này.
 */

@layer flatsome, tal-reset;

@layer tal-reset {
  :where(html, body),
  :where(body *:not(img, svg, svg *, video, iframe, canvas, picture, source, audio, #wpadminbar, #wpadminbar *, .tal-fs, .tal-fs *, .section-content, .section-content *, .row, .row *, .mfp-wrap, .mfp-wrap *, .mfp-bg)),
  :where(body *:not(img, svg, svg *, video, iframe, canvas, picture, source, audio, #wpadminbar, #wpadminbar *, .tal-fs, .tal-fs *, .section-content, .section-content *, .row, .row *, .mfp-wrap, .mfp-wrap *, .mfp-bg))::before,
  :where(body *:not(img, svg, svg *, video, iframe, canvas, picture, source, audio, #wpadminbar, #wpadminbar *, .tal-fs, .tal-fs *, .section-content, .section-content *, .row, .row *, .mfp-wrap, .mfp-wrap *, .mfp-bg))::after {
    all: revert;
  }
}

/*
 * Global styles (theme.json) của WordPress/Flatsome in `<style id="global-styles-inline-css">`
 * NGOÀI mọi layer, có rule `a:where(:not(.wp-element-button)) { text-decoration: none; }` →
 * link trong đoạn văn mất gạch chân so với prototype. Trả thuộc tính này về tầng dưới
 * (= gạch chân mặc định của trình duyệt); các class của theme.css (.btn, .nav__link,
 * .project-card__link…) có độ ưu tiên cao hơn nên vẫn tự bỏ gạch chân như thiết kế.
 */
a:where(:not(.wp-element-button)) {
  text-decoration: revert-layer;
}
