/* =====================================================================
   مرد ۳۰۰۰ چهره — قالب پخش آنلاین
   ایده‌ی بصری: «هر قسمت، یک چهره». پایه‌ی تیره و خنثی؛ رنگ‌های پوستر فقط برای تأکید:
   زرد = اقدام اصلی · قرمز = نشانه‌ی وضعیت · بنفش = برچسب کیفیت
   ===================================================================== */

@font-face { font-family: "Vazirmatn FD"; src: url("../fonts/Vazirmatn-FD-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Vazirmatn FD"; src: url("../fonts/Vazirmatn-FD-Medium.woff2") format("woff2"); font-weight: 500 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Vazirmatn FD"; src: url("../fonts/Vazirmatn-FD-Bold.woff2") format("woff2"); font-weight: 700 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Vazirmatn FD"; src: url("../fonts/Vazirmatn-FD-Black.woff2") format("woff2"); font-weight: 900; font-style: normal; font-display: swap; }

:root {
	--accent: #FFD21F;
	--accent-ink: #17140A;
	--red: #E5484D;
	--red-soft: #FF7A7E;
	--purple: #7B4FC0;

	--bg: #0E0D10;
	--bg-2: #141217;
	--surface: #1A181D;
	--surface-2: #232027;
	--line: rgba(255, 255, 255, .08);
	--line-2: rgba(255, 255, 255, .15);

	--text: #F5F2F4;
	--text-2: #BDB6C0;
	--text-3: #8E8792;

	--r-lg: 20px;
	--r: 14px;
	--r-sm: 10px;

	--header-h: 68px;
	--font: "Vazirmatn FD", "Vazirmatn", Tahoma, sans-serif;
	--font-latin: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--ease-out: cubic-bezier(.16, 1, .3, 1);
}

/* ---------- پایه ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }

body {
	margin: 0; min-height: 100vh; display: flex; flex-direction: column;
	background: var(--bg); color: var(--text);
	font-family: var(--font); font-size: 16px; line-height: 1.8;
	direction: rtl; text-align: right;
	-webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
main { flex: 1 0 auto; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
h1, h2, h3, h4, p, figure { margin: 0; }
ul, ol { margin: 0; padding: 0; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; top: -100px; inset-inline-start: 16px; z-index: 1000; background: var(--accent); color: var(--accent-ink); padding: 10px 16px; border-radius: var(--r-sm); font-weight: 700; }
.skip-link:focus { top: 12px; }

.container { width: 100%; max-width: 1360px; margin-inline: auto; padding-inline: 32px; }
@media (min-width: 1800px) { .container { max-width: 1640px; } }
.container-narrow { max-width: 820px; }

.icon { flex: none; display: block; }

/* پیش از آماده‌شدن موشن، عناصرِ متحرک پنهان می‌مانند تا پرش دیده نشود (بدون JS یا با کاهش حرکت، همیشه نمایان) */
.mdh-motion:not(.mdh-ready) .hero-title,
.mdh-motion:not(.mdh-ready) .hero-reveal,
.mdh-motion:not(.mdh-ready) .hero-poster,
.mdh-motion:not(.mdh-ready) .ep-card,
.mdh-motion:not(.mdh-ready) [data-reveal] { visibility: hidden; }

/* ---------- دکمه‌ها ---------- */

.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent; background: none; cursor: pointer;
	font-size: 15px; font-weight: 700; line-height: 1; white-space: nowrap;
	transition: background-color .2s, border-color .2s, color .2s, filter .2s;
}
.btn-lg { height: 54px; padding: 0 26px; font-size: 16px; border-radius: 14px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.07); }
.btn-ghost { border-color: var(--line-2); color: var(--text); }
.btn-ghost:hover { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .28); }
.btn-soft { background: var(--surface-2); border-color: var(--line); color: var(--text); }
.btn-soft:hover { border-color: var(--line-2); background: #2a272f; }

.segmented { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.segmented > a, .segmented > button {
	display: inline-flex; align-items: center; justify-content: center; height: 36px; min-width: 64px; padding: 0 14px;
	border-radius: 9px; border: 0; background: transparent; color: var(--text-2); font-size: 14px; font-weight: 600; cursor: pointer;
	transition: background-color .15s, color .15s;
}
.segmented > a:hover, .segmented > button:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.segmented > [aria-current="true"], .segmented > [aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.segmented-sm > button { height: 34px; min-width: 62px; font-family: var(--font-latin); font-weight: 700; }

/* ---------- هدر ---------- */

.site-header {
	position: sticky; top: 0; z-index: 100;
	background: rgba(14, 13, 16, .82);
	-webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
	border-bottom: 1px solid var(--line);
}
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }
@media (max-width: 600px) { .admin-bar .site-header { top: 0; } }

.header-inner { display: flex; align-items: center; gap: 28px; min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.brand-logo { max-height: 40px; width: auto; }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); }
.brand-name { font-size: 19px; font-weight: 900; }

.nav-list { display: flex; gap: 4px; list-style: none; }
.nav-list a { display: inline-flex; align-items: center; height: 38px; padding: 0 14px; border-radius: 10px; color: var(--text-2); font-size: 15px; font-weight: 600; transition: color .15s, background-color .15s; }
.nav-list a:hover { color: var(--text); }
.nav-list .current-menu-item > a, .nav-list .current_page_item > a { color: var(--text); background: var(--surface-2); }

.header-search {
	margin-inline-start: auto; display: flex; align-items: center; width: 280px; height: 42px; padding-inline: 16px 4px;
	border-radius: 999px; background: var(--surface); border: 1px solid var(--line); transition: border-color .15s;
}
.header-search:focus-within { border-color: rgba(255, 210, 31, .55); }
.header-search input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; outline: none; font-size: 14px; }
.header-search input::placeholder { color: var(--text-3); }
.header-search input::-webkit-search-cancel-button { display: none; }
.header-search button { width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.header-search button:hover { color: var(--text); }

/* ---------- هیرو ---------- */

.hero { position: relative; overflow: hidden; isolation: isolate; padding: clamp(48px, 7vw, 104px) 0 clamp(56px, 7vw, 96px); }
.hero-backdrop {
	position: absolute; inset: -80px; z-index: -1;
	background-size: cover; background-position: center 25%;
	filter: blur(64px) saturate(1.25); opacity: .38; transform: scale(1.1);
	-webkit-mask-image: linear-gradient(to bottom, #000 35%, transparent 100%);
	mask-image: linear-gradient(to bottom, #000 35%, transparent 100%);
}

.hero-inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 400px); gap: clamp(32px, 6vw, 96px); align-items: center; }

.hero-season { color: var(--red-soft); font-size: 15px; font-weight: 800; }
.hero-title { margin: 6px 0 18px; font-size: clamp(52px, 8.4vw, 132px); font-weight: 900; line-height: 1.08; letter-spacing: -.01em; }
.w-mask { display: inline-block; overflow: hidden; vertical-align: top; padding: .06em .05em .16em; margin: -.06em -.05em -.16em; }
.w { display: inline-block; }
.w.is-accent { color: var(--accent); }
.hero-meta { color: var(--text-2); font-size: 17px; font-weight: 500; white-space: pre-wrap; }
.hero-credits { margin-top: 4px; max-width: 64ch; color: var(--text-3); font-size: 15px; white-space: pre-wrap; }
.hero-summary { margin-top: 20px; max-width: 58ch; color: var(--text-2); font-size: 17px; line-height: 1.95; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-schedule { display: flex; align-items: center; gap: 8px; margin-top: 18px; color: var(--text-3); font-size: 14px; white-space: pre-wrap; }
.hero-schedule .icon { color: var(--accent); }

.hero-poster {
	position: relative; border-radius: 22px; overflow: hidden; will-change: transform;
	clip-path: inset(0% 0% 0% 0% round 22px);
	box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .85), 0 0 0 1px rgba(255, 255, 255, .1);
}
.hero-poster img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }

/* ---------- بخش قسمت‌ها ---------- */

.section { padding: 24px 0 96px; }
.page-top { padding-top: 32px; }
.section-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-bottom: 28px; }
.section-title { font-size: clamp(26px, 3vw, 34px); font-weight: 900; line-height: 1.3; }

.ep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 32px 20px; }

.ep-card-link { display: block; }
.ep-card-media { position: relative; aspect-ratio: 2 / 3; border-radius: var(--r); overflow: hidden; background: var(--surface); box-shadow: 0 0 0 1px var(--line); transition: box-shadow .25s; }
.media-img, .media-face { position: absolute; inset: 0; width: 100%; height: 100%; transition: transform .6s var(--ease-out); }
.media-img { object-fit: cover; }
.media-face { display: block; background-size: 290% auto; background-repeat: no-repeat; }
.ep-card-shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(8, 7, 10, .9) 0%, rgba(8, 7, 10, .4) 34%, rgba(8, 7, 10, 0) 60%); }
.ep-card-num { position: absolute; bottom: 2px; inset-inline-start: 14px; font-size: 76px; font-weight: 900; line-height: 1; color: #fff; }
.ep-card-play {
	position: absolute; bottom: 16px; inset-inline-end: 14px; width: 44px; height: 44px; border-radius: 50%;
	background: var(--accent); color: var(--accent-ink); display: flex; align-items: center; justify-content: center;
	opacity: 0; transform: scale(.8); transition: opacity .2s, transform .3s var(--ease-out);
}
.ep-card-link:hover .ep-card-media, .ep-card-link:focus-visible .ep-card-media { box-shadow: 0 0 0 2px var(--accent); }
.ep-card-link:hover .media-img, .ep-card-link:hover .media-face { transform: scale(1.06); }
.ep-card-link:hover .ep-card-play, .ep-card-link:focus-visible .ep-card-play { opacity: 1; transform: scale(1); }
.ep-card-link:focus-visible { outline: none; }
.ep-card-title { margin-top: 12px; font-size: 16px; font-weight: 800; line-height: 1.5; }
.ep-card-meta { color: var(--text-3); font-size: 13px; }

/* ---------- صفحه پخش ---------- */

.watch { position: relative; isolation: isolate; padding: 28px 0 88px; }
.watch-backdrop {
	position: absolute; top: -80px; left: 0; right: 0; height: 620px; z-index: -1;
	background-size: cover; background-position: center 20%; filter: blur(72px) saturate(1.25); opacity: .24;
	-webkit-mask-image: linear-gradient(to bottom, #000 25%, transparent 100%); mask-image: linear-gradient(to bottom, #000 25%, transparent 100%);
}
.watch-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 40px; align-items: start; }

.ep-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 18px; }
.ep-title { font-size: clamp(28px, 3.4vw, 40px); font-weight: 900; line-height: 1.25; }
.ep-context { color: var(--text-3); font-size: 15px; font-weight: 500; }
.ep-context a { color: var(--text-2); }
.ep-context a:hover { color: var(--accent); }

.player-shell { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-lg); overflow: hidden; background: #000; box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .8), 0 0 0 1px var(--line); }
.player-shell video, .player-shell .plyr { width: 100%; height: 100%; }
.player-shell video { display: block; object-fit: contain; background: #000; }

.plyr {
	--plyr-color-main: var(--accent);
	--plyr-video-control-color: #fff;
	--plyr-video-control-color-hover: var(--accent-ink);
	--plyr-video-control-background-hover: var(--accent);
	--plyr-control-radius: 8px;
	--plyr-font-family: var(--font);
	--plyr-menu-background: rgba(26, 24, 29, .96);
	--plyr-menu-color: var(--text);
	--plyr-range-thumb-background: #fff;
	--plyr-video-range-track-background: rgba(255, 255, 255, .25);
	--plyr-tooltip-background: rgba(26, 24, 29, .96);
	--plyr-tooltip-color: var(--text);
	direction: ltr;
}
.plyr__control--overlaid { padding: 22px; }
.plyr__poster { background-size: contain; background-color: #000; }

.player-empty { aspect-ratio: 16 / 9; border-radius: var(--r-lg); border: 1px dashed var(--line-2); background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--text-3); }

.player-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
.quality-switch { display: flex; align-items: center; gap: 12px; }
.quality-label { color: var(--text-2); font-size: 14px; font-weight: 600; }
.ep-nav { display: flex; gap: 8px; }

.ep-summary { margin-top: 28px; max-width: 72ch; color: var(--text-2); }
.ep-summary p + p { margin-top: 10px; }
.ep-summary .ep-cast { margin-top: 14px; color: var(--text-3); font-size: 14px; white-space: pre-wrap; }
.section-title.block-title { font-size: clamp(26px, 3vw, 34px); }

.block-title { display: flex; align-items: baseline; gap: 10px; font-size: 20px; font-weight: 900; line-height: 1.4; }
.block-count { color: var(--text-3); font-size: 14px; font-weight: 500; }

/* دانلود — فهرست ساده با خط جداکننده، بدون جعبه‌ی تودرتو */
.downloads { margin-top: 44px; }
.dl-list { list-style: none; margin-top: 10px; border-top: 1px solid var(--line); }
.dl-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 18px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.dl-badge { min-width: 70px; padding: 7px 10px; border-radius: 9px; text-align: center; font-family: var(--font-latin); font-size: 14px; font-weight: 800; background: var(--surface-2); color: var(--text); }
.dl-badge-1080 { background: var(--accent); color: var(--accent-ink); }
.dl-badge-720 { background: var(--purple); color: #fff; }
.dl-info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dl-info strong { font-family: var(--font-latin); font-size: 15px; font-weight: 700; }
.dl-info span { color: var(--text-3); font-size: 13px; }

/* فهرست قسمت‌ها کنار پلیر */
.playlist { position: sticky; top: calc(var(--header-h) + 24px); max-height: calc(100vh - var(--header-h) - 48px); display: flex; flex-direction: column; gap: 12px; }
.admin-bar .playlist { top: calc(var(--header-h) + 56px); max-height: calc(100vh - var(--header-h) - 80px); }
.playlist-list { list-style: none; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 4px; padding-inline-end: 2px; scrollbar-width: thin; scrollbar-color: var(--surface-2) transparent; }
.pl-item { display: flex; align-items: center; gap: 14px; padding: 8px; border-radius: 14px; transition: background-color .15s; }
.pl-item:hover { background: var(--surface); }
.pl-item.is-current { background: var(--surface); box-shadow: inset 0 0 0 1px rgba(255, 210, 31, .5); }
.pl-thumb { position: relative; flex: none; width: 60px; height: 80px; border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.pl-thumb::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, .75), transparent 60%); }
.pl-num { position: absolute; bottom: 1px; inset-inline-start: 7px; z-index: 1; font-size: 24px; font-weight: 900; line-height: 1.2; color: #fff; }
.pl-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pl-title { font-size: 15px; font-weight: 700; }
.pl-sub { color: var(--text-3); font-size: 13px; }
.pl-now { display: inline-flex; align-items: center; gap: 6px; color: var(--red-soft); font-size: 13px; font-weight: 700; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--red); animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(229, 72, 77, .55); } 70% { box-shadow: 0 0 0 8px rgba(229, 72, 77, 0); } 100% { box-shadow: 0 0 0 0 rgba(229, 72, 77, 0); } }

/* ---------- حالت خالی، برگه‌ها، ۴۰۴ ---------- */

.empty-state { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; padding: 64px 24px; border-radius: var(--r-lg); border: 1px dashed var(--line-2); color: var(--text-2); }
.empty-404 { border: 0; padding: 96px 24px; }
.empty-404 h1 { font-size: 28px; font-weight: 900; color: var(--text); }
.big-404 { font-size: 120px; font-weight: 900; line-height: 1; color: var(--accent); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; }
.text-card h2 { font-size: 17px; font-weight: 700; }
.prose { padding: 32px 0 80px; color: var(--text-2); }
.page-title { font-size: 36px; font-weight: 900; color: var(--text); margin-bottom: 20px; }
.prose p + p { margin-top: 14px; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }

/* ---------- فوتر ---------- */

.site-footer { border-top: 1px solid var(--line); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; padding-block: 28px; }
.footer-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; }
.footer-brand .brand-mark { width: 28px; height: 28px; border-radius: 8px; }
.footer-nav { display: flex; gap: 18px; list-style: none; font-size: 14px; color: var(--text-2); }
.footer-nav a:hover { color: var(--text); }
.footer-copy { color: var(--text-3); font-size: 13px; }

/* ---------- واکنش‌گرا ---------- */

@media (max-width: 1080px) {
	.watch-grid { grid-template-columns: minmax(0, 1fr); gap: 48px; }
	.playlist, .admin-bar .playlist { position: static; max-height: none; }
	.playlist-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; }
}

@media (max-width: 820px) {
	.header-inner { flex-wrap: wrap; gap: 10px 16px; padding-block: 12px; min-height: 0; }
	.main-nav { order: 2; }
	.header-search { order: 3; width: 100%; margin-inline-start: 0; }
	.hero-inner { grid-template-columns: minmax(0, 1fr); gap: 32px; }
	.hero-poster { order: -1; width: min(240px, 62vw); margin-inline: auto; }
	.hero-body { text-align: center; }
	.hero-actions, .hero-schedule { justify-content: center; }
	.hero-credits { margin-inline: auto; }
	.hero-summary { margin-inline: auto; }
}

@media (max-width: 640px) {
	.container { padding-inline: 16px; }
	.brand-name { font-size: 17px; }
	.nav-list a { padding: 0 10px; font-size: 14px; }
	.section { padding-bottom: 64px; }
	.ep-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 12px; }
	.ep-card-num { font-size: 60px; }
	.hero-meta { font-size: 15px; }
	.hero-actions .btn { flex: 1 1 100%; }
	.watch { padding-top: 16px; }
	.player-shell { border-radius: 12px; }
	.player-bar { flex-direction: column; align-items: stretch; }
	.quality-switch { justify-content: space-between; }
	.ep-nav .btn { flex: 1; }
	.dl-row { grid-template-columns: auto minmax(0, 1fr); }
	.dl-row .btn { grid-column: 1 / -1; width: 100%; }
	.plyr [data-plyr="rewind"], .plyr [data-plyr="fast-forward"], .plyr [data-plyr="pip"], .plyr__time--duration { display: none; }
}

@media (hover: none) { .ep-card-play { display: none; } }

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