/*
Theme Name: PhimMoiHot
Theme URI: https://phimmoihot.local
Author: PhimMoiHot
Description: Theme phim thế hệ 3 — Neon Violet: hero slider + sidebar BXH, Video.js v10, Speculation Rules, View Transitions, REST cache-safe.
Version: 1.0.0
Requires PHP: 8.0
Text Domain: phimmoihot
*/

/* ============ TOKENS + BASE ============ */
:root {
	--bg: #0b0a14;
	--bg2: #131120;
	--card: #171528;
	--line: #262340;
	--tx: #f1f0f7;
	--mut: #a3a0ba;
	--acc: #8b5cf6;
	--acc2: #22d3ee;
	--hot: #f43f5e;
	--grad: linear-gradient(120deg, #8b5cf6 0%, #22d3ee 100%);
	--r: 12px;
	--head-h: 64px;
	--shadow: 0 10px 30px rgba(0, 0, 0, .45);
	--glow: 0 8px 28px rgba(139, 92, 246, .35);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--tx);
	font: 15px/1.6 "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
	overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--acc2); }
button { font: inherit; cursor: pointer; }
h1, h2, h3, h4 { line-height: 1.3; margin: 0 0 .6em; }
.wrap { max-width: 1320px; margin: 0 auto; padding: 0 22px; }
main#main { padding-top: var(--head-h); min-height: 60vh; }
body.pmh-hero-page main#main { padding-top: 0; }
.page-pad { padding-top: 26px; padding-bottom: 40px; }
.hidden-h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mut { color: var(--mut); }

/* View Transitions (MPA) — fade nhanh, tôn trọng reduced-motion */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: pmh-vt-out .14s ease both; }
::view-transition-new(root) { animation: pmh-vt-in .16s ease both; }
@keyframes pmh-vt-out { to { opacity: 0; } }
@keyframes pmh-vt-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
	::view-transition-old(root), ::view-transition-new(root) { animation: none; }
	html { scroll-behavior: auto; }
	.movie-poster, .lc-thumb, .rank-thumb, .mv-poster, .hs-bg, .facade, .facade .play { animation: none !important; }
}

/* Skeleton shimmer nền ảnh đang tải — tắt khi ảnh load xong (app.js thêm .img-ok) */
@keyframes pmh-skel { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
.movie-poster, .lc-thumb, .rank-thumb, .mv-poster, .hs-bg, .facade {
	background: linear-gradient(100deg, #1a1830 40%, #232043 50%, #1a1830 60%);
	background-size: 200% 100%;
	animation: pmh-skel 1.4s linear infinite;
}
.img-ok { animation: none; background: var(--card); }

/* ============ HEADER ============ */
.site-head {
	position: fixed; inset: 0 0 auto 0; z-index: 90;
	height: var(--head-h);
	background: transparent;
	transition: background .25s, box-shadow .25s, backdrop-filter .25s;
}
.site-head .wrap { display: flex; align-items: center; gap: 20px; height: 100%; }
.site-head.is-scrolled {
	background: rgba(11, 10, 20, .84);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	box-shadow: 0 6px 24px rgba(0, 0, 0, .35);
}
body:not(.pmh-hero-page) .site-head { background: rgba(11, 10, 20, .92); }

.brand-tx {
	font-weight: 800; font-size: 22px; letter-spacing: -.5px; white-space: nowrap;
	color: #fff;
}
.brand-tx em {
	font-style: normal;
	background: var(--grad);
	-webkit-background-clip: text; background-clip: text;
	-webkit-text-fill-color: transparent; color: transparent;
}
.site-nav { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; }
.site-nav > a, .nav-drop-t {
	padding: 8px 12px; border-radius: 8px; color: var(--tx);
	background: none; border: 0; font-weight: 600; font-size: 14px; white-space: nowrap;
	display: inline-flex; align-items: center; gap: 5px;
}
.site-nav > a:hover, .nav-drop:hover .nav-drop-t, .nav-drop-t:focus { background: rgba(139, 92, 246, .16); color: #fff; }
.nav-drop { position: relative; }
.nav-drop .chev { width: 13px; height: 13px; opacity: .7; }
.nav-drop-panel {
	position: absolute; top: 100%; left: 0; z-index: 95;
	min-width: 200px; padding: 12px; border-radius: 12px;
	background: rgba(19, 17, 32, .97); border: 1px solid var(--line);
	box-shadow: var(--shadow);
	display: none; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px;
}
.nav-drop-panel.mega { grid-template-columns: repeat(4, minmax(0, 1fr)); min-width: 560px; }
.nav-drop-panel::before { content: ""; position: absolute; top: -10px; left: 0; right: 0; height: 10px; }
.nav-drop:hover .nav-drop-panel, .nav-drop:focus-within .nav-drop-panel { display: grid; }
.nav-drop-panel a { padding: 7px 10px; border-radius: 7px; font-size: 13.5px; color: var(--mut); white-space: nowrap; }
.nav-drop-panel a:hover { background: rgba(139, 92, 246, .18); color: #fff; }
.nav-random { font-size: 16px; }

.search-btn { display: none; background: none; border: 0; color: var(--tx); padding: 8px; }
.search-btn svg { width: 21px; height: 21px; }
.search-mini { position: relative; display: flex; align-items: center; }
.search-mini .sicon { position: absolute; left: 11px; width: 16px; height: 16px; color: var(--mut); pointer-events: none; }
.search-mini input {
	width: 210px; padding: 9px 12px 9px 34px; border-radius: 999px;
	border: 1px solid var(--line); background: rgba(23, 21, 40, .8); color: var(--tx);
	font: inherit; font-size: 13.5px; outline: none; transition: width .25s, border-color .2s;
}
.search-mini input:focus { width: 270px; border-color: var(--acc); }
.search-drop {
	position: absolute; top: calc(100% + 8px); right: 0; width: 340px; max-width: 92vw;
	background: var(--bg2); border: 1px solid var(--line); border-radius: 12px;
	box-shadow: var(--shadow); overflow: hidden; z-index: 96;
}
.sd-item { display: flex; gap: 10px; padding: 9px 12px; align-items: center; }
.sd-item:hover { background: rgba(139, 92, 246, .14); }
.sd-item img, .sd-noimg { width: 38px; height: 54px; object-fit: cover; border-radius: 6px; background: var(--card); flex: 0 0 38px; }
.sd-tx { min-width: 0; flex: 1; }
.sd-tx b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-tx i { display: block; font-style: normal; color: var(--mut); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-ep { font-size: 11px; background: rgba(139, 92, 246, .25); color: #cabdfd; padding: 3px 7px; border-radius: 6px; white-space: nowrap; }
.sd-all { display: block; text-align: center; padding: 9px; font-size: 13px; color: var(--acc2); border-top: 1px solid var(--line); }
.sd-empty { padding: 14px; color: var(--mut); font-size: 13.5px; }

/* Burger + drawer (mobile) */
.nav-burger { display: none; background: none; border: 0; padding: 8px; flex-direction: column; gap: 4px; }
.nav-burger span { width: 20px; height: 2px; background: var(--tx); border-radius: 2px; display: block; }
.drawer-overlay {
	position: fixed; inset: 0; z-index: 97; background: rgba(0, 0, 0, .6);
	opacity: 0; pointer-events: none; transition: opacity .25s;
}
body.drawer-open .drawer-overlay { opacity: 1; pointer-events: auto; }
.mobile-drawer {
	position: fixed; top: 0; bottom: 0; left: -300px; width: 296px; z-index: 98;
	background: var(--bg2); border-right: 1px solid var(--line);
	visibility: hidden; /* đóng = bỏ khỏi tab order/screen reader, không chỉ đẩy ra ngoài màn */
	transition: left .28s ease, visibility .28s;
	overflow-y: auto; padding: 14px;
}
body.drawer-open .mobile-drawer { left: 0; visibility: visible; }
.md-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.md-close { background: none; border: 0; color: var(--tx); font-size: 26px; padding: 4px 10px; }
.md-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 8px; border-radius: 8px; font-weight: 600; font-size: 14.5px; }
.md-nav a:hover { background: rgba(139, 92, 246, .14); }
.md-nav svg { width: 18px; height: 18px; color: var(--acc); }
.md-sec { margin-top: 16px; }
.md-sec h4 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--mut); margin: 0 0 8px 8px; }
.md-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.md-tags a { font-size: 12.5px; padding: 6px 11px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--mut); }
.md-tags a:hover { border-color: var(--acc); color: #fff; }

/* ============ HERO SLIDER ============ */
.hero-slider { position: relative; height: min(74vh, 620px); min-height: 420px; overflow: hidden; }
.hslide { position: absolute; inset: 0; opacity: 0; transition: opacity .6s ease; pointer-events: none; }
.hslide.active { opacity: 1; pointer-events: auto; }
.hs-bg { position: absolute; inset: 0; }
.hs-bg img { width: 100%; height: 100%; object-fit: cover; }
.hs-scrim {
	position: absolute; inset: 0;
	background:
		linear-gradient(to top, var(--bg) 2%, rgba(11, 10, 20, .55) 34%, rgba(11, 10, 20, .18) 60%),
		linear-gradient(100deg, rgba(11, 10, 20, .88) 8%, rgba(11, 10, 20, .25) 55%, rgba(139, 92, 246, .12) 100%);
}
.hs-inner {
	position: relative; z-index: 2; height: 100%;
	display: flex; align-items: center; justify-content: space-between; gap: 40px;
	padding-top: var(--head-h);
}
.hs-info { max-width: 620px; min-width: 0; }
.hs-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.q-badge { background: var(--grad); color: #08060f; font-weight: 700; font-size: 12.5px; padding: 5px 11px; border-radius: 999px; }
.pill {
	display: inline-block; font-size: 12.5px; padding: 4px 11px; border-radius: 999px;
	background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .14); color: #e8e6f5;
}
.pill.rate { color: #ffd76a; border-color: rgba(255, 215, 106, .35); }
a.pill:hover { border-color: var(--acc2); color: #fff; }
.hs-title { font-size: clamp(26px, 4vw, 44px); font-weight: 800; margin: 0 0 6px; text-shadow: 0 2px 18px rgba(0, 0, 0, .5); }
.hs-oname { color: var(--acc2); font-size: 15px; margin-bottom: 10px; }
.hs-desc { color: #d5d2e6; font-size: 14.5px; max-width: 560px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hs-actions { margin-top: 18px; display: flex; gap: 12px; }
.hs-poster { flex: 0 0 240px; }
.hs-poster img { width: 240px; height: 360px; object-fit: cover; border-radius: 16px; box-shadow: var(--glow); }
.hs-nav {
	position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
	width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .2);
	background: rgba(11, 10, 20, .5); color: #fff; font-size: 24px; line-height: 1;
	backdrop-filter: blur(6px); transition: background .2s;
}
.hs-nav:hover { background: rgba(139, 92, 246, .6); }
.hs-prev { left: 18px; }
.hs-next { right: 18px; }
.hs-dots { position: absolute; bottom: 18px; left: 0; right: 0; z-index: 3; display: flex; justify-content: center; gap: 8px; }
.hs-dot { width: 22px; height: 4px; border-radius: 4px; border: 0; background: rgba(255, 255, 255, .28); padding: 0; transition: background .2s, width .2s; }
.hs-dot.active { background: var(--grad); width: 34px; }

/* ============ BUTTONS ============ */
.btn {
	display: inline-flex; align-items: center; gap: 9px;
	padding: 11px 22px; border-radius: 999px; border: 0;
	font-weight: 700; font-size: 14.5px; transition: transform .15s, box-shadow .2s, background .2s;
}
.btn-play { background: var(--grad); color: #0a0812; box-shadow: var(--glow); }
.btn-play:hover { transform: translateY(-2px); color: #000; box-shadow: 0 12px 34px rgba(34, 211, 238, .4); }
.btn-play .tri { width: 0; height: 0; border-style: solid; border-width: 6px 0 6px 10px; border-color: transparent transparent transparent #0a0812; }
.btn-ghost { background: rgba(255, 255, 255, .08); color: #fff; border: 1px solid rgba(255, 255, 255, .18); }
.btn-ghost:hover { border-color: var(--acc2); color: var(--acc2); }
.btn-sm { padding: 8px 15px; font-size: 13px; }

/* ============ SECTIONS / GRID / CARDS ============ */
.mv-sec { margin: 30px 0; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.sec-head h2 {
	font-size: 19px; font-weight: 800; margin: 0; padding-left: 12px; position: relative;
}
.sec-head h2::before {
	content: ""; position: absolute; left: 0; top: 3px; bottom: 3px; width: 4px; border-radius: 4px;
	background: var(--grad);
}
.sec-head .more { color: var(--mut); font-size: 13px; background: none; border: 0; }
.sec-head .more:hover { color: var(--acc2); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(152px, 1fr)); gap: 16px; }
.grid > * { min-width: 0; }

.mcard { min-width: 0; }
.movie-poster {
	position: relative; aspect-ratio: 2 / 3; border-radius: var(--r); overflow: hidden;
	transition: transform .22s ease, box-shadow .22s ease;
}
.movie-poster img { width: 100%; height: 100%; object-fit: cover; }
.mcard:hover .movie-poster { transform: translateY(-4px); box-shadow: var(--glow); }
.stretched-link { position: absolute; inset: 0; z-index: 4; text-indent: -9999px; overflow: hidden; }
.play-ic {
	position: absolute; inset: 0; z-index: 2; margin: auto; width: 52px; height: 52px;
	border-radius: 50%; background: rgba(11, 10, 20, .65) center / 40% no-repeat;
	opacity: 0; transition: opacity .2s; backdrop-filter: blur(4px);
}
.play-ic::after {
	content: ""; position: absolute; inset: 0; margin: auto; width: 0; height: 0;
	border-style: solid; border-width: 9px 0 9px 15px;
	border-color: transparent transparent transparent var(--acc2); translate: 3px 0;
}
.mcard:hover .play-ic, .lcard:hover .play-ic { opacity: 1; }
.badge { position: absolute; z-index: 3; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 7px; }
.rating-badge { top: 8px; left: 8px; background: rgba(11, 10, 20, .78); color: #ffd76a; }
.rating-badge .star { color: #ffd76a; }
.episode-badge { top: 8px; right: 8px; background: var(--grad); color: #0a0812; }
.hot-badge { top: 34px; left: 8px; background: var(--hot); color: #fff; }
.quality-badge { bottom: 8px; left: 8px; background: rgba(34, 211, 238, .2); color: var(--acc2); border: 1px solid rgba(34, 211, 238, .4); }
.view-count { bottom: 8px; right: 8px; background: rgba(11, 10, 20, .78); color: #d8d5ea; display: inline-flex; align-items: center; gap: 4px; }
.view-count svg { width: 12px; height: 12px; }
.movie-meta { padding: 9px 2px 0; }
.movie-title { font-size: 14px; font-weight: 600; margin: 0; }
.movie-title a { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.movie-original-title { color: var(--mut); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Carousel row */
.row-wrap { position: relative; }
.row {
	display: flex; gap: 15px; overflow-x: auto; scroll-snap-type: x proximity;
	padding-bottom: 6px; scrollbar-width: none;
}
.row::-webkit-scrollbar { display: none; }
.row > * { flex: 0 0 168px; min-width: 0; scroll-snap-align: start; }
.row.dragging { cursor: grabbing; user-select: none; }
.row.dragging a { pointer-events: none; }
.row-fill > * { flex: 1 1 168px; max-width: 220px; }
.mv-land .row > * { flex: 0 0 300px; }
.row-wrap .nav {
	position: absolute; top: 50%; transform: translateY(-50%); z-index: 5;
	width: 38px; height: 38px; border-radius: 50%;
	background: rgba(19, 17, 32, .9); border: 1px solid var(--line); color: #fff; font-size: 20px;
	opacity: 0; transition: opacity .2s;
}
.row-wrap:hover .nav { opacity: 1; }
.row-wrap .nav:disabled { opacity: 0 !important; pointer-events: none; }
.nav-prev { left: -12px; }
.nav-next { right: -12px; }

/* Thẻ ngang */
.lcard { min-width: 0; display: block; }
.lc-thumb { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r); overflow: hidden; transition: transform .22s, box-shadow .22s; }
.lc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.lcard:hover .lc-thumb { transform: translateY(-4px); box-shadow: var(--glow); }
.qb { position: absolute; top: 8px; left: 8px; z-index: 2; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 7px; background: rgba(34, 211, 238, .22); color: var(--acc2); }
.epb { position: absolute; top: 8px; right: 8px; z-index: 2; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 7px; background: var(--grad); color: #0a0812; }
.lc-cap {
	position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 24px 11px 9px;
	background: linear-gradient(to top, rgba(5, 4, 10, .92), transparent);
}
.lc-ti { font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lc-oi { color: var(--mut); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ============ HOME 2 CỘT + SIDEBAR BXH ============ */
.home-row { display: grid; grid-template-columns: minmax(0, 1fr) 336px; gap: 28px; align-items: start; }
.home-main { min-width: 0; }
.home-side { min-width: 0; position: sticky; top: calc(var(--head-h) + 14px); }
.home-side .mv-sec { margin: 30px 0; }
.side-box { background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-top: 30px; }
.side-head h2 { font-size: 16.5px; }
.bxh-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.bxh-tab {
	flex: 1; padding: 7px 0; border-radius: 8px; border: 1px solid var(--line);
	background: none; color: var(--mut); font-weight: 600; font-size: 12.5px;
}
.bxh-tab.cur { background: var(--grad); border-color: transparent; color: #0a0812; }
.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-item a { display: flex; align-items: center; gap: 11px; padding: 8px 4px; border-radius: 10px; }
.rank-item a:hover { background: rgba(139, 92, 246, .12); }
.rank-badge { flex: 0 0 30px; font-weight: 800; font-size: 15px; color: var(--mut); text-align: center; font-style: italic; }
.rank-item:nth-child(1) .rank-badge { color: var(--acc2); font-size: 17px; }
.rank-item:nth-child(2) .rank-badge { color: var(--acc); font-size: 16px; }
.rank-item:nth-child(3) .rank-badge { color: var(--hot); }
.rank-thumb { flex: 0 0 44px; width: 44px; height: 62px; border-radius: 7px; overflow: hidden; }
.rank-thumb img { width: 100%; height: 100%; object-fit: cover; }
.rank-tx { min-width: 0; flex: 1; }
.rank-tx b { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-meta { display: flex; align-items: center; gap: 8px; margin-top: 3px; }
.rank-views { display: inline-flex; align-items: center; gap: 4px; color: var(--mut); font-size: 12px; }
.rank-views svg { width: 12px; height: 12px; }
.chip-epi { font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: rgba(139, 92, 246, .22); color: #cabdfd; white-space: nowrap; }

/* ============ SINGLE PHIM ============ */
.mv-hero { position: relative; overflow: hidden; }
.mv-hero-bg { position: absolute; inset: 0; }
.mv-hero-bg img { width: 100%; height: 100%; object-fit: cover; filter: blur(2px); transform: scale(1.04); }
.mv-hero-scrim {
	position: absolute; inset: 0;
	background: linear-gradient(to top, var(--bg) 4%, rgba(11, 10, 20, .72) 50%, rgba(11, 10, 20, .5) 100%);
}
.mv-hero-in {
	position: relative; z-index: 2; display: flex; gap: 30px; align-items: flex-end;
	padding-top: calc(var(--head-h) + 40px); padding-bottom: 34px;
}
.mv-poster { flex: 0 0 220px; }
.mv-poster img { width: 220px; height: 330px; object-fit: cover; border-radius: 16px; box-shadow: var(--glow); }
.mv-head { min-width: 0; flex: 1; }
.mv-head h1 { font-size: clamp(24px, 3.2vw, 38px); font-weight: 800; margin: 6px 0 4px; }
.oname { color: var(--acc2); margin-bottom: 12px; }
.mv-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill.q { background: var(--grad); border: 0; color: #0a0812; font-weight: 700; }
.mv-actions { margin-top: 18px; display: flex; gap: 12px; flex-wrap: wrap; }

.crumb { font-size: 12.5px; color: var(--mut); }
.crumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 6px; padding: 0; }
.crumb li + li::before { content: "›"; margin: 0 6px 0 2px; color: var(--line); }
.crumb a:hover { color: var(--acc2); }

.block { margin: 30px 0; }
.block > h2 { font-size: 19px; font-weight: 800; padding-left: 12px; position: relative; }
.block > h2::before { content: ""; position: absolute; left: 0; top: 3px; bottom: 3px; width: 4px; border-radius: 4px; background: var(--grad); }

.info-table { width: 100%; border-collapse: collapse; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.info-table th, .info-table td { text-align: left; padding: 10px 15px; border-bottom: 1px solid var(--line); font-size: 14px; }
.info-table tr:last-child th, .info-table tr:last-child td { border-bottom: 0; }
.info-table th { color: var(--mut); font-weight: 600; width: 130px; vertical-align: top; }
.cite-src { color: var(--acc2); }

.article-body { color: #d9d6e8; font-size: 14.5px; max-width: 860px; }
.article-body h3 { font-size: 16.5px; margin-top: 1.4em; color: #fff; }
.article-body p { margin: .7em 0; }
.article-fig { margin: 18px auto; max-width: 720px; }
.article-fig img { width: 100%; border-radius: 12px; }
.article-fig figcaption { text-align: center; color: var(--mut); font-size: 12.5px; margin-top: 6px; }

.faq details { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 9px; padding: 0 16px; }
.faq summary { padding: 12px 0; font-weight: 600; font-size: 14.5px; cursor: pointer; list-style: none; position: relative; padding-right: 26px; }
.faq summary::after { content: "+"; position: absolute; right: 2px; top: 8px; font-size: 19px; color: var(--acc); transition: rotate .2s; }
.faq details[open] summary::after { rotate: 45deg; }
.faq details p { margin: 0 0 13px; color: #d3d0e4; font-size: 14px; }

/* Diễn viên */
.row-actors > * { flex: 0 0 108px; }
.actor-card { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.actor-av {
	width: 84px; height: 84px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
	font-weight: 800; font-size: 24px; color: #fff; border: 2px solid var(--line); transition: border-color .2s, transform .2s;
}
.actor-card:hover .actor-av { border-color: var(--acc); transform: scale(1.05); }
.actor-nm { font-size: 12.5px; color: var(--mut); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.person-hero { display: flex; gap: 22px; align-items: center; margin-bottom: 26px; }
.person-av span { width: 110px; height: 110px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 34px; color: #fff; }
.person-role { color: var(--acc2); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.person-info h1 { margin: 2px 0 4px; font-size: 28px; }
.person-count, .person-bio { color: var(--mut); margin: 2px 0; }

/* ============ WATCH ============ */
.watch-title { font-size: clamp(18px, 2.4vw, 26px); margin: 8px 0 14px; }
.player-box {
	position: relative; aspect-ratio: 16 / 9; max-height: 76vh; margin: 0 auto;
	background: #000; border-radius: 14px; overflow: hidden;
}
.player-box video-player, .player-box iframe { position: absolute; inset: 0; width: 100%; height: 100%; }
.player-box video-player { --media-brand: var(--acc); --media-primary-color: var(--acc); display: block; }
.facade { position: absolute; inset: 0; cursor: pointer; }
.facade img { width: 100%; height: 100%; object-fit: cover; opacity: .6; }
.facade .play {
	position: absolute; inset: 0; margin: auto; width: 84px; height: 84px; border-radius: 50%;
	background: var(--grad); box-shadow: 0 0 0 10px rgba(139, 92, 246, .25), var(--glow);
	animation: pmh-pulse 2s infinite;
}
.facade .play span {
	position: absolute; inset: 0; margin: auto; width: 0; height: 0;
	border-style: solid; border-width: 15px 0 15px 25px;
	border-color: transparent transparent transparent #0a0812; translate: 5px 0;
}
@keyframes pmh-pulse { 0%, 100% { box-shadow: 0 0 0 8px rgba(139, 92, 246, .22); } 50% { box-shadow: 0 0 0 16px rgba(139, 92, 246, .1); } }
.pb-err { color: #fff; padding: 26px; text-align: center; }
.pb-err .btn { margin-top: 12px; }
.watch-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin: 14px 0; }
.server-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.server-tabs button {
	padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line);
	background: var(--bg2); color: var(--mut); font-weight: 600; font-size: 13px;
}
.server-tabs button.cur { background: var(--grad); border-color: transparent; color: #0a0812; }
.ep-nav { display: flex; gap: 9px; }
.autonext { position: absolute; inset: 0; z-index: 8; display: flex; align-items: center; justify-content: center; background: rgba(5, 4, 10, .82); }
.an-in { text-align: center; }
.an-in p { font-size: 17px; }
.an-s { color: var(--acc2); }
.an-btns { display: flex; gap: 12px; justify-content: center; margin-top: 14px; }
.kbd-hint { color: var(--mut); font-size: 12px; margin: 6px 2px 0; }
.kbd-hint kbd { background: var(--bg2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; font-size: 11px; }

/* Grid tập */
.ep-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.ep-tab { padding: 7px 14px; border-radius: 8px; border: 1px solid var(--line); background: none; color: var(--mut); font-size: 13px; font-weight: 600; }
.ep-tab.cur { background: rgba(139, 92, 246, .2); border-color: var(--acc); color: #fff; }
.ep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 9px; }
.ep-grid a {
	display: block; text-align: center; padding: 9px 0; border-radius: 9px;
	background: var(--bg2); border: 1px solid var(--line); font-weight: 600; font-size: 13.5px; min-width: 0;
}
.ep-grid a:hover { border-color: var(--acc); color: #fff; }
.ep-grid a.cur { background: var(--grad); border-color: transparent; color: #0a0812; }

/* ============ ARCHIVE / FILTER / PAGE ============ */
.arch-head { margin-bottom: 22px; }
.arch-head h1 { font-size: clamp(22px, 3vw, 30px); padding-left: 13px; position: relative; }
.arch-head h1::before { content: ""; position: absolute; left: 0; top: 5px; bottom: 5px; width: 5px; border-radius: 5px; background: var(--grad); }
.arch-intro { color: var(--mut); font-size: 14px; max-width: 820px; }
.empty-note { color: var(--mut); padding: 30px 0; }
.empty-note a { color: var(--acc2); }

.filter-form { background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin-bottom: 26px; }
.ff-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.ff-row label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--mut); font-weight: 600; flex: 1 1 150px; min-width: 0; }
.ff-row select {
	padding: 10px 12px; border-radius: 9px; border: 1px solid var(--line);
	background: var(--card); color: var(--tx); font: inherit; font-size: 13.5px; width: 100%;
}
.ff-row select:focus { border-color: var(--acc); outline: none; }
.ff-row .btn { flex: 0 0 auto; }

.pagi { margin: 30px 0 8px; }
.pagi ul { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 0; padding: 0; }
.pagi a, .pagi span {
	display: inline-block; min-width: 38px; text-align: center; padding: 8px 12px;
	border-radius: 9px; background: var(--bg2); border: 1px solid var(--line); font-weight: 600; font-size: 13.5px;
}
.pagi a:hover { border-color: var(--acc); color: #fff; }
.pagi span.current { background: var(--grad); border-color: transparent; color: #0a0812; }
.pagi span.dots { border: 0; background: none; color: var(--mut); }

.page-content h1 { font-size: 28px; padding-left: 13px; position: relative; }
.page-content h1::before { content: ""; position: absolute; left: 0; top: 5px; bottom: 5px; width: 5px; border-radius: 5px; background: var(--grad); }
.page-content .article-body { max-width: 860px; }
.page-content .article-body img { border-radius: 12px; }

.err404 { text-align: center; padding: 50px 0 30px; }
.err404 h1 {
	font-size: 90px; margin: 0;
	background: var(--grad); -webkit-background-clip: text; background-clip: text;
	-webkit-text-fill-color: transparent; color: transparent;
}
.err404 p { color: var(--mut); }
.err404 .btn { margin: 6px; }

/* ============ XEM TIẾP ============ */
.cw-card { position: relative; }
.cw-x {
	position: absolute; top: 6px; right: 6px; z-index: 5; width: 24px; height: 24px;
	border-radius: 50%; border: 0; background: rgba(5, 4, 10, .7); color: #fff; font-size: 15px; line-height: 1;
	opacity: 0; transition: opacity .2s;
}
.cw-card:hover .cw-x { opacity: 1; }
.cw-bar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; height: 3px; background: rgba(255, 255, 255, .18); }
.cw-bar i { display: block; height: 100%; background: var(--grad); }

/* ============ TRAILER MODAL / TO-TOP ============ */
.trailer-modal {
	position: fixed; inset: 0; z-index: 120; display: flex; align-items: center; justify-content: center;
	background: rgba(5, 4, 10, .88); opacity: 0; transition: opacity .2s; padding: 20px;
}
.trailer-modal.show { opacity: 1; }
.tm-box { position: relative; width: min(960px, 96vw); aspect-ratio: 16 / 9; }
.tm-box iframe { width: 100%; height: 100%; border: 0; border-radius: 12px; }
.tm-close { position: absolute; top: -38px; right: 0; background: none; border: 0; color: #fff; font-size: 30px; }
.to-top {
	position: fixed; right: 20px; bottom: 20px; z-index: 80; width: 44px; height: 44px;
	border-radius: 50%; border: 1px solid var(--line); background: var(--bg2); color: var(--acc2);
	font-size: 19px; opacity: 0; pointer-events: none; transition: opacity .25s; box-shadow: var(--shadow);
}
.to-top.show { opacity: 1; pointer-events: auto; }

/* ============ FOOTER ============ */
.site-foot { margin-top: 50px; background: var(--bg2); border-top: 1px solid var(--line); }
.ft-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 34px; padding: 36px 0 24px; }
.ft-col { min-width: 0; }
.ft-col h4 { font-size: 14px; text-transform: uppercase; letter-spacing: .07em; color: #fff; }
.ft-col p { color: var(--mut); font-size: 13.5px; }
.ft-col > a { display: block; color: var(--mut); font-size: 13.5px; padding: 3px 0; }
.ft-col > a:hover { color: var(--acc2); }
.ft-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.ft-tags a { font-size: 12.5px; padding: 6px 11px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--mut); }
.ft-tags a:hover { border-color: var(--acc); color: #fff; }
.ft-bot { border-top: 1px solid var(--line); padding: 15px 0; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; color: var(--mut); font-size: 12.5px; }

/* ============ RESPONSIVE ============ */
@media (max-width: 1160px) {
	.home-row { grid-template-columns: minmax(0, 1fr); }
	.home-side { position: static; }
	.nav-drop-panel.mega { min-width: 440px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 940px) {
	.site-nav > a:not(.nav-random) { display: none; }
	.hs-poster { display: none; }
	.ft-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
	:root { --head-h: 56px; }
	.site-head .wrap { gap: 10px; }
	.nav-burger { display: flex; }
	.site-nav { display: none; }
	.search-btn { display: block; margin-left: auto; }
	.search-mini {
		display: none; position: absolute; top: var(--head-h); left: 0; right: 0;
		padding: 10px 14px; background: rgba(11, 10, 20, .97); border-bottom: 1px solid var(--line);
	}
	body.search-active .search-mini { display: flex; }
	.search-mini input, .search-mini input:focus { width: 100%; }
	.search-mini .sicon { left: 25px; }
	.search-drop { left: 14px; right: 14px; width: auto; }
	.brand-tx { font-size: 19px; }
	.hero-slider { height: 62vh; min-height: 380px; }
	.hs-nav { display: none; }
	.hs-desc { -webkit-line-clamp: 2; font-size: 13.5px; }
	.grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
	.row > * { flex: 0 0 138px; }
	.mv-land .row > * { flex: 0 0 240px; }
	/* lặp lại trong media query: cùng specificity với .row > * nên phải đứng SAU để thắng cascade */
	.row-fill > * { flex: 1 1 138px; }
	.row-actors > * { flex: 0 0 108px; }
	.mv-hero-in { flex-direction: row; align-items: flex-end; gap: 16px; padding-top: calc(var(--head-h) + 20px); }
	.mv-poster { flex: 0 0 120px; }
	.mv-poster img { width: 120px; height: 180px; border-radius: 10px; }
	.wrap { padding: 0 14px; }
	.ff-row label { flex: 1 1 44%; }
	.ft-grid { grid-template-columns: 1fr; gap: 22px; }
	.player-box { border-radius: 10px; }
	.ep-grid { grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 7px; }
}
@media (max-width: 420px) {
	.grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
	.movie-title { font-size: 13px; }
}
