/* ==========================================================================
   Trang bài viết – template: single.php · logic: inc/single-post.php · script: assets/single-post.js
   ========================================================================== */

.ms-post { --post-line: #e5e5e5; --post-soft: #f5f5f5; padding-bottom: 80px; background: #f8f9fa; color: #000; }
.ms-post *, .ms-post *::before, .ms-post *::after { box-sizing: border-box; }
.ms-post-wrap { max-width: var(--ms-wrap, 1280px); margin: 0 auto; padding: 0 var(--ms-gutter, 32px); }
.ms-post .ms-ico { flex-shrink: 0; }
.ms-post .ms-ico.is-filled { fill: currentColor; }
.ms-post button { min-height: 0; margin: 0; font-family: inherit; letter-spacing: inherit; text-transform: none; line-height: inherit; box-shadow: none; }
.ms-post-card { border: 1px solid rgba(229, 229, 229, .9); border-radius: 16px; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .05); }

/* ---------- Thanh breadcrumb ---------- */
.ms-post-bar { border-bottom: 1px solid var(--post-line); background: #fff; }
.ms-post-bar-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; padding-bottom: 12px; font-size: 14px; }
.ms-post-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; color: var(--ms-text, #525252); font-weight: 500; }
.ms-post-crumbs a { color: var(--ms-text, #525252); transition: color .2s; }
.ms-post-crumbs a:hover { color: #000; }
.ms-post-crumb-sep { color: #a3a3a3; }
.ms-post-crumb-current { overflow: hidden; max-width: 448px; color: #000; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Khung tiêu đề ---------- */
.ms-post-body { padding-top: 32px; }
/* Nền tối: đen sâu + quầng cam góc phải, lưới chấm sáng mờ dần về bên phải, vạch nhấn cam ở mép trái (chỉ dùng CSS) */
.ms-post .ms-post-head { position: relative; isolation: isolate; overflow: hidden; margin-bottom: 32px; padding: 44px 48px 28px; border-color: #1f1f1f; background: radial-gradient(680px 300px at 100% 0%, rgb(var(--ms-accent-rgb, 245 74 0) / 0.28), transparent 70%), radial-gradient(520px 260px at 0% 100%, rgba(255, 255, 255, .05), transparent 70%), linear-gradient(135deg, #0b0b0c, #161618); color: #fff; box-shadow: 0 24px 48px -24px rgba(0, 0, 0, .45); }
.ms-post-head::before { content: ""; position: absolute; z-index: -1; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, .14) 1px, transparent 1.2px); background-size: 18px 18px; -webkit-mask-image: linear-gradient(110deg, transparent 45%, #000 100%); mask-image: linear-gradient(110deg, transparent 45%, #000 100%); pointer-events: none; }
.ms-post-head::after { content: ""; position: absolute; top: 44px; bottom: 44px; left: 0; width: 4px; border-radius: 0 4px 4px 0; background: linear-gradient(180deg, var(--ms-accent-soft, #fb923c), var(--ms-accent, #f54a00) 60%, rgb(var(--ms-accent-rgb, 245 74 0) / 0)); box-shadow: 0 0 18px rgb(var(--ms-accent-rgb, 245 74 0) / 0.6); }
.ms-post-cat { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 18px; padding: 6px 14px 6px 11px; border: 1px solid rgba(255, 255, 255, .14); border-radius: 999px; background: rgba(255, 255, 255, .08); color: #fff; font-size: 11px; font-weight: 800; line-height: 14px; letter-spacing: .08em; text-transform: uppercase; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); transition: background .2s, border-color .2s, transform .2s; }
.ms-post-cat .ms-ico { color: var(--ms-accent-soft, #fb923c); }
.ms-post-cat:hover { border-color: rgb(var(--ms-accent-soft-rgb, 251 146 60) / 0.6); background: rgb(var(--ms-accent-rgb, 245 74 0) / 0.18); color: #fff; transform: translateY(-1px); }
.ms-post .ms-post-title { max-width: 1000px; margin: 0 0 28px; color: #fff; font-size: 38px; font-weight: 900; line-height: 1.2; letter-spacing: -.03em; text-transform: uppercase; text-wrap: balance; }
.ms-post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; padding-top: 20px; background: linear-gradient(90deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0)) top left / 100% 1px no-repeat; color: #d4d4d4; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ms-post-meta > span { display: inline-flex; align-items: center; gap: 8px; }
.ms-post-meta > span .ms-ico { box-sizing: content-box; padding: 7px; border: 1px solid rgba(255, 255, 255, .12); border-radius: 50%; background: rgba(255, 255, 255, .06); color: var(--ms-accent-soft, #fb923c); }

/* ---------- Bố cục 2 cột ---------- */
.ms-post-grid { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); align-items: start; gap: 40px; }

/* ---------- Nội dung bài ---------- */
.ms-post-main { display: flex; flex-direction: column; gap: 32px; padding: 40px; }
.ms-post-cover { position: relative; overflow: hidden; aspect-ratio: 16 / 9; margin: 0; border: 1px solid var(--post-line); border-radius: 16px; background: var(--post-soft); }
.ms-post-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ms-post .ms-post-lead { margin: 0; padding: 20px; border: 0; border-left: 4px solid #000; border-radius: 12px; background: #fafafa; color: #262626; font-size: 16px; font-weight: 600; font-style: italic; line-height: 1.625; }


.ms-post .ms-post-content { padding: 0; color: #262626; font-size: 16px; line-height: 1.625; }
.ms-post-content > * { margin-top: 0; margin-bottom: 24px; }
.ms-post-content > :last-child { margin-bottom: 0; }
.ms-post-content p { color: #404040; }
.ms-post-content a { color: #000; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.ms-post-content a:hover { color: var(--ms-accent, #f54a00); }
.ms-post-content strong, .ms-post-content b { color: #000; font-weight: 700; }
.ms-post .ms-post-content h2 { display: flex; align-items: baseline; gap: 8px; padding-top: 16px; border-top: 1px solid var(--post-soft); color: #000; font-size: 20px; font-weight: 900; line-height: 1.4; }
.ms-post .ms-post-content h2::before { content: ""; flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%; background: #000; transform: translateY(-3px); }
.ms-post .ms-post-content h3 { color: #000; font-size: 18px; font-weight: 800; line-height: 1.4; }
.ms-post .ms-post-content h4 { color: #000; font-size: 16px; font-weight: 800; }
.ms-post-content ul, .ms-post-content ol { padding-left: 22px; }
.ms-post-content ul { list-style: disc; }
.ms-post-content li { margin-bottom: 6px; }
.ms-post-content li::marker { color: #000; }
.ms-post-content img { height: auto; border-radius: 12px; }
.ms-post-content figure { max-width: 100%; }
.ms-post-content figcaption { margin-top: 8px; color: #737373; font-size: 13px; text-align: center; }
.ms-post-content blockquote { margin-left: 0; margin-right: 0; padding: 16px 20px; border-left: 4px solid #000; border-radius: 12px; background: #fafafa; color: #262626; font-style: italic; }
.ms-post-content table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ms-post-content th, .ms-post-content td { padding: 10px 12px; border: 1px solid var(--post-line); text-align: left; }
.ms-post-content th { background: #fafafa; font-weight: 700; }
.ms-post-content iframe, .ms-post-content video { max-width: 100%; border-radius: 12px; }
.ms-post-pages { display: flex; gap: 8px; font-weight: 700; }

/* Sản phẩm đề xuất */
.ms-post-product { padding: 24px; border: 1px solid #262626; border-radius: 16px; background: linear-gradient(to bottom right, #111, #1c1c1c); color: #fff; box-shadow: 0 20px 25px -5px rgba(0, 0, 0, .1), 0 8px 10px -6px rgba(0, 0, 0, .1); }
.ms-post-product-h { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; color: #a3a3a3; font-size: 12px; font-weight: 500; }
.ms-post-product-badge { padding: 2px 10px; border-radius: 4px; background: #fff; color: #000; font-size: 10px; font-weight: 900; text-transform: uppercase; }
.ms-post-product-row { display: flex; align-items: center; gap: 24px; }
.ms-post-product-img { flex-shrink: 0; width: 112px; height: 112px; padding: 4px; overflow: hidden; border: 1px solid #404040; border-radius: 12px; background: #fff; }
.ms-post-product-img img { display: block; width: 100%; height: 100%; border-radius: 8px; object-fit: cover; }
.ms-post-product-info { display: flex; flex: 1; flex-direction: column; gap: 6px; min-width: 0; }
.ms-post .ms-post-product-info h4 { display: -webkit-box; margin: 0; overflow: hidden; font-size: 16px; font-weight: 700; line-height: 1.375; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.ms-post-product-info h4 a { color: #fff; }
.ms-post-product-info h4 a:hover { color: var(--ms-accent-300, #fdba74); }
.ms-post-product-rating { display: flex; align-items: center; gap: 6px; color: #d4d4d4; font-size: 12px; }
.ms-post-product-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; padding-top: 4px; }
.ms-post-product-price strong { color: var(--ms-accent-soft, #fb923c); font-size: 20px; font-weight: 900; font-variant-numeric: tabular-nums; }
.ms-post-product-price del { color: #a3a3a3; font-size: 12px; font-variant-numeric: tabular-nums; }
.ms-post-product-price .amount { color: inherit; }
.ms-post-product-btns { display: flex; flex-direction: column; flex-shrink: 0; gap: 8px; }
.ms-post-product-view, .ms-post .ms-post-product-add { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 132px; margin: 0; padding: 10px 16px; border-radius: 12px; font-size: 12px; font-weight: 800; line-height: 16px; letter-spacing: .05em; text-transform: uppercase; transition: background .2s, color .2s; }
.ms-post-product-view { background: #fff; color: #000; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, .1); }
.ms-post-product-view:hover { background: #e5e5e5; color: #000; }
.ms-post .ms-post-product-add { border: 1px solid #404040; background: #262626; color: #fff; }
.ms-post .ms-post-product-add:hover { background: #404040; color: #fff; }
.ms-post-product-add .is-done, .ms-post-product-add.added .is-idle { display: none; }
.ms-post-product-add.added .is-done { display: inline; }
.ms-post .ms-post-product-add.added { border-color: var(--ms-accent, #f54a00); background: var(--ms-accent, #f54a00); }
.ms-post-product-add.loading { opacity: .7; pointer-events: none; }
.ms-post-product-add.loading::after, .ms-post-product-add.is-loading::after { display: none; } /* bỏ icon xoay mặc định của theme */
.ms-post-product-btns .added_to_cart { display: none !important; } /* WooCommerce tự chèn link "Xem giỏ hàng" */
.ms-post .ms-pd-stars-ico { position: relative; display: inline-flex; line-height: 0; }
.ms-post .ms-pd-stars-bg { display: inline-flex; color: #525252; } /* nền tối cố định: không theo màu chữ website */
.ms-post .ms-pd-stars-fg { position: absolute; top: 0; left: 0; display: inline-flex; overflow: hidden; color: var(--ms-accent-500, #f97316); white-space: nowrap; }

/* Thẻ */
.ms-post-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-top: 16px; border-top: 1px solid var(--post-line); }
.ms-post-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: #737373; }
.ms-post-foot-label { margin-right: 4px; color: #737373; font-size: 12px; font-weight: 700; }
.ms-post-tags a { padding: 4px 10px; border-radius: 6px; background: var(--post-soft); color: #262626; font-size: 12px; font-weight: 600; transition: background .2s; }
.ms-post-tags a:hover { background: #e5e5e5; color: #000; }

/* ---------- Cột phải ---------- */
.ms-post-side { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 24px; }
.admin-bar .ms-post-side { top: 128px; }
.ms-post-box { padding: 20px; }
.ms-post .ms-post-box-h { display: flex; align-items: center; gap: 6px; margin: 0 0 16px; padding-bottom: 12px; border-bottom: 1px solid var(--post-soft); color: #000; font-size: 12px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; }
.ms-post .ms-post-mini, .ms-post .ms-post-sellers { margin: 0; padding: 0; list-style: none; }
.ms-post .ms-post-mini li { margin: 0; padding: 12px 0 0; border-top: 1px solid var(--post-soft); }
.ms-post .ms-post-mini li + li { margin-top: 12px; }
.ms-post .ms-post-mini li:first-child { padding-top: 0; border-top: 0; }
.ms-post-mini a { display: flex; gap: 12px; color: inherit; }
.ms-post-mini-img { flex-shrink: 0; width: 80px; height: 64px; overflow: hidden; border-radius: 8px; background: var(--post-soft); }
.ms-post-mini-img img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.ms-post-mini a:hover img { transform: scale(1.08); }
.ms-post-mini-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ms-post-kicker { display: block; color: #737373; font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.ms-post-mini-text strong { display: -webkit-box; overflow: hidden; color: var(--ms-ink, #171717); font-size: 12px; font-weight: 700; line-height: 1.375; -webkit-box-orient: vertical; -webkit-line-clamp: 2; transition: color .2s; }
.ms-post-mini a:hover strong { color: var(--ms-text, #525252); }
.ms-post-mini-text time { color: #a3a3a3; font-size: 10px; }

.ms-post .ms-post-sellers li { margin: 0 0 12px; }
.ms-post .ms-post-sellers li:last-child { margin-bottom: 0; }
.ms-post-sellers a { display: flex; align-items: center; gap: 12px; padding: 8px; border: 1px solid var(--post-soft); border-radius: 12px; color: inherit; transition: border-color .2s; }
.ms-post-sellers a:hover { border-color: #000; }
.ms-post-sellers-img { flex-shrink: 0; width: 56px; height: 56px; padding: 4px; overflow: hidden; border: 1px solid var(--post-line); border-radius: 8px; background: #fafafa; }
.ms-post-sellers-img img { display: block; width: 100%; height: 100%; border-radius: 4px; object-fit: cover; }
.ms-post-sellers-text { flex: 1; min-width: 0; }
.ms-post-sellers-text strong { display: block; overflow: hidden; color: var(--ms-ink, #171717); font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.ms-post-sellers-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin-top: 2px; }
.ms-post-sellers-price b { color: var(--ms-accent-600, #ea580c); font-size: 12px; font-weight: 900; font-variant-numeric: tabular-nums; }
.ms-post-sellers-price del { color: #a3a3a3; font-size: 10px; font-variant-numeric: tabular-nums; }
.ms-post-sellers-price .amount { color: inherit; }


/* Hộp tư vấn = UX Block "tu-van-truc-tiep" (style của hộp ở style.css): bỏ lề hàng/cột của Flatsome trong cột phải */
.ms-post-contact-block .row { width: auto; max-width: none; margin: 0; }
.ms-post-contact-block .row > .col { padding: 0; }

/* ---------- Bài viết liên quan ---------- */
.ms-post-related { margin-top: 64px; padding-top: 48px; border-top: 1px solid var(--post-line); }
.ms-post-related-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 32px; }
.ms-post-related-eyebrow { display: block; margin-bottom: 4px; color: #737373; font-size: 12px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.ms-post .ms-post-related-h h2 { margin: 0; color: #000; font-size: 24px; font-weight: 900; letter-spacing: -.025em; text-transform: uppercase; }
.ms-post-related-h > a { display: inline-flex; align-items: center; gap: 4px; color: #404040; font-size: 12px; font-weight: 700; white-space: nowrap; }
.ms-post-related-h > a:hover { color: #000; }
.ms-post-related-h > a .ms-ico { color: #000; transition: transform .2s; }
.ms-post-related-h > a:hover .ms-ico { transform: translateX(4px); }
.ms-post-related-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.ms-post-rcard { display: flex; flex-direction: column; overflow: hidden; border: 1px solid rgba(229, 229, 229, .9); border-radius: 16px; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .04); transition: transform .3s, box-shadow .3s; }
.ms-post-rcard:hover { box-shadow: 0 20px 25px -5px rgba(0, 0, 0, .1), 0 8px 10px -6px rgba(0, 0, 0, .1); transform: translateY(-4px); }
.ms-post-rcard-img { position: relative; display: block; overflow: hidden; aspect-ratio: 16 / 10; background: var(--post-soft); }
.ms-post-rcard-img img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.ms-post-rcard:hover .ms-post-rcard-img img { transform: scale(1.06); }
.ms-post-rcard-date { position: absolute; top: 12px; left: 12px; display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border: 1px solid rgba(255, 255, 255, .1); border-radius: 6px; background: rgba(0, 0, 0, .8); color: #fff; font-size: 10px; font-weight: 700; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.ms-post-rcard-body { display: flex; flex: 1; flex-direction: column; justify-content: space-between; gap: 12px; padding: 20px; }
.ms-post-rcard .ms-post-kicker { margin-bottom: 4px; }
.ms-post .ms-post-rcard h3 { display: -webkit-box; margin: 0; overflow: hidden; font-size: 14px; font-weight: 700; line-height: 1.375; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.ms-post-rcard h3 a { color: #000; transition: color .2s; }
.ms-post-rcard:hover h3 a { color: var(--ms-text, #525252); }
.ms-post .ms-post-rcard p { display: -webkit-box; margin: 8px 0 0; overflow: hidden; color: #737373; font-size: 12px; line-height: 1.625; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.ms-post-rcard-more { display: flex; align-items: center; justify-content: space-between; padding-top: 12px; border-top: 1px solid var(--post-soft); color: #000; font-size: 12px; font-weight: 700; }
.ms-post-rcard-more .ms-ico { transition: transform .2s; }
.ms-post-rcard:hover .ms-post-rcard-more { color: var(--ms-text, #525252); }
.ms-post-rcard:hover .ms-post-rcard-more .ms-ico { transform: translateX(4px); }

/* ---------- Máy tính bảng ---------- */
@media (max-width: 1023px) {
	.ms-post .ms-post-title { font-size: 30px; }
	.ms-post-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
	.ms-post-side { position: static; }
	.ms-post-main { padding: 32px; }
	.ms-post .ms-post-head { padding: 36px 36px 24px; }
	.ms-post-head::after { top: 36px; bottom: 36px; }
}
@media (max-width: 767px) {
	.ms-post-related-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
	.ms-post-product-row { flex-direction: column; gap: 16px; text-align: center; }
	.ms-post-product-rating, .ms-post-product-price { justify-content: center; }
	.ms-post-product-btns { flex-direction: row; width: 100%; }
	.ms-post-product-view, .ms-post .ms-post-product-add { flex: 1; min-width: 0; }
}

/* ---------- Điện thoại ---------- */
@media (max-width: 639px) {
	.ms-post { padding-bottom: 56px; }
	.ms-post-bar-in { flex-wrap: nowrap; gap: 8px; padding-top: 10px; padding-bottom: 10px; font-size: 12px; }
	.ms-post-crumbs { flex: 1; flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
	.ms-post-crumbs::-webkit-scrollbar { display: none; }
	.ms-post-crumb-current { max-width: 200px; }
	.ms-post-body { padding-top: 24px; }
	.ms-post .ms-post-head { margin-bottom: 24px; padding: 26px 22px 22px; }
	.ms-post-head::after { top: 26px; bottom: 26px; width: 3px; }
	.ms-post-head::before { -webkit-mask-image: linear-gradient(160deg, transparent 40%, #000 100%); mask-image: linear-gradient(160deg, transparent 40%, #000 100%); }
	.ms-post .ms-post-title { margin-bottom: 22px; font-size: 24px; }
	.ms-post-meta { gap: 10px 16px; padding-top: 16px; font-size: 12px; }
	.ms-post-meta > span .ms-ico { padding: 6px; }
	.ms-post-main { gap: 24px; padding: 24px 20px; }
	.ms-post .ms-post-lead { padding: 16px; font-size: 14px; }
	.ms-post .ms-post-content { font-size: 15px; }
	.ms-post .ms-post-content h2 { font-size: 18px; }
	.ms-post-product { padding: 20px; }
	.ms-post-product-img { width: 96px; height: 96px; }
	.ms-post-related { margin-top: 48px; padding-top: 40px; }
	.ms-post-related-h { margin-bottom: 24px; }
	.ms-post .ms-post-related-h h2 { font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
	.ms-post *, .ms-post *::before, .ms-post *::after { transition: none !important; }
}
