/*
Theme Name: BlackRocks
Theme URI: https://csgoblackrocks.ir
Author: Vaxi.ir
Author URI: https://vaxi.ir
Description: قالب مدرن، سئو شده و راست‌چین پایگاه گیمرهای بلک‌راکس — مخصوص اخبار، نقد و آموزش بازی‌های کامپیوتری. فونت فارسی وزیرمتن و لاله‌زار به‌صورت محلی، اسکیما کامل، فهرست مطالب خودکار، باکس نقد بازی با امتیاز و تاریخ شمسی.
Version: 1.0.0
Requires at least: 6.3
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: blackrocks
Tags: rtl-language-support, blog, news, entertainment, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* ==========================================================================
   1. Fonts (local — fast in Iran, no Google dependency)
   ========================================================================== */
@font-face {
	font-family: 'Vazirmatn';
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	src: url('assets/fonts/vazirmatn-arabic.woff2') format('woff2-variations'), url('assets/fonts/vazirmatn-arabic.woff2') format('woff2');
	unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+200C-200E, U+2010-2011, U+FB50-FDFF, U+FE70-FEFC;
}
@font-face {
	font-family: 'Vazirmatn';
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	src: url('assets/fonts/vazirmatn-latin.woff2') format('woff2-variations'), url('assets/fonts/vazirmatn-latin.woff2') format('woff2');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: 'Lalezar';
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url('assets/fonts/lalezar-arabic.woff2') format('woff2');
	unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+200C-200E, U+2010-2011, U+FB50-FDFF, U+FE70-FEFC;
}
@font-face {
	font-family: 'Lalezar';
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url('assets/fonts/lalezar-latin.woff2') format('woff2');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF;
}

/* ==========================================================================
   2. Tokens
   ========================================================================== */
:root {
	--basalt: #14172A;
	--slate: #1C2140;
	--slate-2: #262C52;
	--line: rgba(255, 255, 255, .09);
	--text: #E9EAF6;
	--muted: #A6ABCB;

	--lava: #FF5A1F;
	--magma: #F72585;
	--ice: #3DDCFF;
	--gold: #FFC43D;
	--violet: #9B6BFF;
	--toxic: #2EE59D;

	--paper: #F7F6FC;
	--ink: #1D2035;
	--ink-2: #4A4F6E;
	--paper-line: #E4E2EF;
	--paper-link: #C8155F;
	--paper-accent: #0B7FA0;

	--brand: linear-gradient(90deg, var(--lava), var(--magma));

	--f-body: 'Vazirmatn', Tahoma, 'Segoe UI', sans-serif;
	--f-display: 'Lalezar', 'Vazirmatn', Tahoma, sans-serif;

	--wrap: 1240px;
	--gap: clamp(16px, 2.4vw, 28px);
	--cut: 14px;
	--cut-lg: 28px;
	--cut-sm: 7px;
	--header-h: 68px;
}

/* ==========================================================================
   3. Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
	margin: 0;
	background: var(--basalt);
	color: var(--text);
	font-family: var(--f-body);
	font-size: 16px;
	line-height: 1.85;
	direction: rtl;
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
	font-synthesis: none;
	font-feature-settings: "ss01";
}
img, svg, video, iframe { max-width: 100%; height: auto; }
img { display: block; }
a { color: var(--ice); text-decoration: none; transition: color .15s ease; }
a:hover { color: #fff; }
h1, h2, h3, h4, h5, h6 { font-family: var(--f-display); font-weight: 400; line-height: 1.45; margin: 0 0 .5em; color: #fff; }
p { margin: 0 0 1em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--ice); outline-offset: 3px; }
::selection { background: var(--magma); color: #fff; }

.wrap { width: min(100% - 2 * var(--gap), var(--wrap)); margin-inline: auto; }
.screen-reader-text, .sr-only {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}
.skip-link {
	position: fixed; top: -100px; right: 16px; z-index: 1000;
	background: var(--gold); color: var(--basalt); padding: 10px 18px; font-weight: 700;
}
.skip-link:focus { top: 12px; color: var(--basalt); }

.facet { clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut)); }
.facet-lg { --cut: var(--cut-lg); }

.icon { width: 1em; height: 1em; flex: none; vertical-align: -.14em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Buttons */
.btn {
	--c: var(--lava);
	display: inline-flex; align-items: center; gap: .5em;
	padding: .7em 1.4em; border: 0; cursor: pointer;
	background: var(--c); color: var(--basalt); font-weight: 800; font-size: 15px; line-height: 1.4;
	clip-path: polygon(var(--cut-sm) 0, 100% 0, 100% calc(100% - var(--cut-sm)), calc(100% - var(--cut-sm)) 100%, 0 100%, 0 var(--cut-sm));
	transition: filter .15s ease, transform .15s ease;
}
.btn:hover { color: var(--basalt); filter: brightness(1.1); }
.btn:active { transform: translateY(1px); }
.btn-ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 2px var(--line); clip-path: none; }
.btn-ghost:hover { color: #fff; box-shadow: inset 0 0 0 2px var(--ice); }

/* ==========================================================================
   4. Header
   ========================================================================== */
.site-header {
	position: sticky; top: 0; z-index: 100;
	background: rgba(20, 23, 42, .9);
	-webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 0; } }
.site-header::after { content: ""; position: absolute; inset: auto 0 0 0; height: 2px; background: var(--brand); }
.header-inner { display: flex; align-items: center; gap: 20px; min-height: var(--header-h); }

.brand { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 1em; flex: none; }
.brand a { display: flex; align-items: center; gap: 10px; color: #fff; }
.brand-mark { width: 38px; height: 38px; flex: none; }
.brand-name { font-family: var(--f-display); font-size: 26px; line-height: 1; letter-spacing: 0; padding-top: 4px; }
.brand-tag { display: block; font-family: var(--f-body); font-size: 11.5px; color: var(--muted); font-weight: 500; margin-top: 2px; }
.custom-logo { max-height: 48px; width: auto; }

.primary-nav { margin-inline-start: auto; }
.primary-nav ul { list-style: none; margin: 0; padding: 0; }
.primary-nav > ul { display: flex; align-items: center; gap: 4px; }
.primary-nav li { position: relative; }
.primary-nav a { display: block; padding: 10px 12px; color: var(--text); font-weight: 600; font-size: 15px; }
.primary-nav > ul > li > a { position: relative; }
.primary-nav > ul > li > a::after {
	content: ""; position: absolute; inset: auto 12px 4px 12px; height: 3px; background: var(--cat, var(--lava));
	transform: scaleX(0); transform-origin: right; transition: transform .2s ease;
}
.primary-nav > ul > li > a:hover::after,
.primary-nav > ul > li.current-menu-item > a::after,
.primary-nav > ul > li.current-menu-ancestor > a::after,
.primary-nav > ul > li.current-category-ancestor > a::after { transform: scaleX(1); }
.primary-nav a:hover { color: #fff; }
.primary-nav .sub-menu {
	position: absolute; top: 100%; right: 0; min-width: 220px; padding: 8px;
	background: var(--slate); border: 1px solid var(--line); box-shadow: 0 18px 40px rgba(5, 6, 20, .5);
	opacity: 0; visibility: hidden; transform: translateY(6px); transition: .16s ease;
}
.primary-nav .sub-menu .sub-menu { top: 0; right: 100%; }
.primary-nav li:hover > .sub-menu, .primary-nav li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.primary-nav .sub-menu a { padding: 8px 12px; font-weight: 500; }
.primary-nav .sub-menu a:hover { background: var(--slate-2); }
.submenu-toggle { display: none; }

.header-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.icon-btn {
	display: inline-grid; place-items: center; width: 42px; height: 42px; border: 0; cursor: pointer;
	background: var(--slate); color: var(--text); font-size: 20px;
	clip-path: polygon(var(--cut-sm) 0, 100% 0, 100% calc(100% - var(--cut-sm)), calc(100% - var(--cut-sm)) 100%, 0 100%, 0 var(--cut-sm));
}
.icon-btn:hover { background: var(--slate-2); color: #fff; }
.menu-toggle { display: none; }

.search-panel { border-top: 1px solid var(--line); background: var(--slate); padding: 18px 0; }
.search-panel[hidden] { display: none; }

.read-progress { position: fixed; top: 0; right: 0; left: 0; height: 3px; z-index: 200; pointer-events: none; }
.admin-bar .read-progress { top: 32px; }
.read-progress span { display: block; height: 100%; width: 100%; background: var(--brand); transform: scaleX(0); transform-origin: right; }

/* Search form */
.search-form { display: flex; gap: 8px; max-width: 640px; }
.search-form .search-field {
	flex: 1; min-width: 0; padding: 12px 16px; background: var(--basalt); border: 1px solid var(--line); color: #fff; border-radius: 0;
}
.search-form .search-field:focus { border-color: var(--ice); outline: none; box-shadow: 0 0 0 3px rgba(61, 220, 255, .2); }

/* ==========================================================================
   5. Layout
   ========================================================================== */
.site-main { padding-block: clamp(24px, 4vw, 44px) clamp(40px, 6vw, 72px); }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: clamp(24px, 3vw, 40px); align-items: start; }
.layout > .sidebar { position: sticky; top: calc(var(--header-h) + 20px); }

.section { margin-top: clamp(36px, 5vw, 60px); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section-title {
	--c: var(--cat, var(--lava));
	display: flex; align-items: center; gap: 12px; margin: 0;
	font-size: clamp(22px, 2.2vw, 28px);
}
.section-title::before {
	content: ""; width: 14px; height: 26px; background: var(--c); flex: none;
	clip-path: polygon(40% 0, 100% 0, 60% 100%, 0 100%);
}
.section-more { font-weight: 700; font-size: 14px; color: var(--muted); white-space: nowrap; }
.section-more:hover { color: var(--cat, var(--lava)); }

/* ==========================================================================
   6. Hero (front page)
   ========================================================================== */
.hero { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 16px; }
.hero-main { position: relative; isolation: isolate; min-height: 460px; display: flex; align-items: flex-end; background: var(--slate); overflow: hidden; }
.hero-main .hero-media { position: absolute; inset: 0; z-index: -1; }
.hero-main .hero-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.hero-main .hero-media .no-thumb svg { width: 96px; height: 96px; }
.hero-main:hover .hero-media img { transform: scale(1.03); }
.hero-main .hero-media::after {
	content: ""; position: absolute; inset: 0;
	background: linear-gradient(to top, rgba(14, 16, 32, .96) 8%, rgba(14, 16, 32, .55) 45%, rgba(14, 16, 32, 0) 75%);
}
.hero-main .hero-body { padding: clamp(20px, 3.4vw, 40px); max-width: 760px; }
.hero-title { font-size: clamp(26px, 3.3vw, 44px); line-height: 1.35; margin: 12px 0 10px; text-wrap: balance; }
.hero-title a { color: #fff; }
.hero-title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.hero-main:hover .hero-title a { color: var(--cat, var(--lava)); }
.hero-excerpt { color: #D3D6EE; font-size: 16px; margin: 0 0 12px; max-width: 60ch; }
.hero-main .cat-flag, .hero-main .meta a { position: relative; z-index: 2; }
.hero-main .score-badge { top: 18px; left: 18px; width: 64px; height: 64px; font-size: 28px; }

.hero-side { display: grid; grid-template-rows: repeat(3, 1fr); gap: 16px; }
.hero-side .card-row { background: var(--slate); padding: 12px; height: 100%; }

/* ==========================================================================
   7. Cards
   ========================================================================== */
.cat-flag {
	display: inline-block; padding: 3px 12px 2px; font-size: 12.5px; font-weight: 800; line-height: 1.7;
	background: var(--cat, var(--lava)); color: var(--basalt);
	clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
}
.cat-flag:hover { color: var(--basalt); filter: brightness(1.12); }

.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.meta > span, .meta > time, .meta > a { display: inline-flex; align-items: center; gap: 5px; }
.meta a { color: var(--muted); }
.meta a:hover { color: #fff; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 22px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card { position: relative; display: flex; flex-direction: column; background: var(--slate); box-shadow: inset 0 -3px 0 var(--cat, var(--lava)); }
.card-media { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--slate-2); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.card:hover .card-media img { transform: scale(1.05); }
.card-body { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px 20px; flex: 1; }
.card-body .cat-flag { align-self: flex-start; }
.card-title { font-size: 19px; line-height: 1.6; margin: 0; }
.card-title a { color: #fff; }
.card-title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.card:hover .card-title a { color: var(--cat, var(--lava)); }
.card-excerpt { color: var(--muted); font-size: 14.5px; line-height: 1.9; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .meta { margin-top: auto; padding-top: 6px; }
.card .cat-flag, .card .meta a { position: relative; z-index: 2; }

.no-thumb {
	position: absolute; inset: 0; display: grid; place-items: center;
	background:
		linear-gradient(135deg, transparent 0 48%, rgba(255, 255, 255, .04) 48% 52%, transparent 52%),
		linear-gradient(160deg, var(--slate-2), var(--basalt));
}
.no-thumb svg { width: 56px; height: 56px; opacity: .5; }

/* Row card (compact) */
.card-row { position: relative; display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 14px; align-items: center; }
.card-row .card-media { aspect-ratio: 1 / 1; --cut: 10px; }
.card-row .card-title { font-size: 16px; line-height: 1.65; margin: 4px 0 6px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-row .card-title a { color: #fff; }
.card-row .card-title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.card-row:hover .card-title a { color: var(--cat, var(--lava)); }
.card-row .cat-flag { position: relative; z-index: 2; font-size: 11.5px; padding: 1px 10px 0; }

/* Score badge on cards */
.score-badge {
	position: absolute; top: 10px; left: 10px; z-index: 2;
	display: grid; place-items: center; width: 50px; height: 50px;
	background: var(--basalt); color: var(--gold); font-family: var(--f-display); font-size: 22px; line-height: 1; padding-top: 4px;
	clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
}
.card-row .score-badge { width: 38px; height: 38px; font-size: 17px; top: 6px; left: 6px; }

/* Category chips */
.cat-strip { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.cat-chip {
	display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px 7px;
	background: var(--slate); color: var(--text); font-weight: 700; font-size: 14px;
	box-shadow: inset -4px 0 0 var(--cat, var(--lava));
}
.cat-chip small { color: var(--muted); font-weight: 500; }
.cat-chip:hover { background: var(--slate-2); color: #fff; }

/* ==========================================================================
   8. Archive / search headers
   ========================================================================== */
.page-head { padding: clamp(22px, 3vw, 34px); margin-bottom: 26px; background: var(--slate); box-shadow: inset -6px 0 0 var(--cat, var(--lava)); }
.page-head h1 { font-size: clamp(26px, 3vw, 38px); margin: 6px 0 4px; }
.page-head .archive-desc { color: var(--muted); max-width: 72ch; margin: 0; }
.page-head .archive-desc p:last-child { margin: 0; }
.page-head .search-form { margin-top: 16px; }

/* Breadcrumbs */
.breadcrumbs { font-size: 13.5px; color: var(--muted); margin-bottom: 18px; }
.breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.breadcrumbs li { display: inline-flex; align-items: center; gap: 8px; }
.breadcrumbs li + li::before { content: ""; width: 6px; height: 6px; border-top: 2px solid currentColor; border-left: 2px solid currentColor; transform: rotate(-45deg); opacity: .6; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: #fff; }
.breadcrumbs [aria-current] { color: var(--text); }

/* Pagination */
.pagination { margin-top: 36px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.pagination .page-numbers {
	display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 12px;
	background: var(--slate); color: var(--text); font-weight: 700;
	clip-path: polygon(var(--cut-sm) 0, 100% 0, 100% calc(100% - var(--cut-sm)), calc(100% - var(--cut-sm)) 100%, 0 100%, 0 var(--cut-sm));
}
.pagination .page-numbers:hover { background: var(--slate-2); color: #fff; }
.pagination .page-numbers.current { background: var(--lava); color: var(--basalt); }
.pagination .dots { background: transparent; }

.empty-state { background: var(--slate); padding: clamp(24px, 4vw, 44px); }
.empty-state h2 { font-size: 26px; }
.empty-state p { color: var(--muted); }

/* ==========================================================================
   9. Single post
   ========================================================================== */
.single-wrap { width: min(100% - 2 * var(--gap), 920px); margin-inline: auto; }
.post-head { margin-bottom: 24px; }
.post-title { font-size: clamp(28px, 4vw, 46px); line-height: 1.4; margin: 14px 0 12px; text-wrap: balance; }
.post-lead { font-size: clamp(16.5px, 1.4vw, 19px); color: #CBCEE6; line-height: 2; margin: 0 0 18px; max-width: 68ch; }
.post-byline { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.author-chip { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 14.5px; }
.author-chip img { width: 38px; height: 38px; border-radius: 50%; box-shadow: 0 0 0 2px var(--basalt), 0 0 0 4px var(--lava); }

.post-thumb { margin: 0 0 -1px; position: relative; }
.post-thumb img { width: 100%; max-height: 560px; object-fit: cover; }
.post-thumb figcaption { font-size: 13px; color: var(--muted); padding: 8px 4px 16px; }

/* The reading slab — light paper for long, comfortable reading */
.reading-slab {
	--cut: 22px;
	background: var(--paper); color: var(--ink);
	padding: clamp(22px, 5vw, 60px) clamp(18px, 5vw, 64px);
}
.entry-content {
	font-size: clamp(16.5px, .35vw + 15px, 18.5px);
	line-height: 2.1;
	max-width: 70ch; margin-inline: auto;
	overflow-wrap: break-word;
}
.entry-content > * { margin-top: 0; margin-bottom: 1.35em; }
.entry-content > *:last-child { margin-bottom: 0; }
.entry-content h2, .entry-content h3, .entry-content h4, .entry-content h5, .entry-content h6 { color: var(--ink); }
.entry-content h2 {
	position: relative; font-size: 1.62em; line-height: 1.55; margin: 1.9em 0 .7em; padding-right: 26px;
}
.entry-content h2::before {
	content: ""; position: absolute; right: 0; top: .32em; width: 13px; height: 1.05em;
	background: linear-gradient(180deg, var(--lava), var(--magma));
	clip-path: polygon(40% 0, 100% 0, 60% 100%, 0 100%);
}
.entry-content h3 { font-size: 1.32em; line-height: 1.6; margin: 1.7em 0 .6em; color: #22264A; }
.entry-content h3::after { content: ""; display: block; width: 44px; height: 3px; margin-top: 6px; background: var(--paper-accent); }
.entry-content h4 { font-size: 1.14em; margin: 1.5em 0 .5em; }
.entry-content a { color: var(--paper-link); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 5px; text-decoration-color: rgba(200, 21, 95, .35); }
.entry-content a:hover { text-decoration-color: currentColor; color: var(--paper-link); }
.entry-content strong, .entry-content b { font-weight: 800; color: #11132A; }
.entry-content ul, .entry-content ol { padding-right: 1.4em; padding-left: 0; }
.entry-content li { margin-bottom: .45em; padding-right: .2em; }
.entry-content ul li::marker { color: var(--lava); font-size: 1.1em; }
.entry-content ol li::marker { color: var(--magma); font-weight: 800; }
.entry-content blockquote {
	position: relative; margin-inline: 0; padding: 22px 26px 22px 22px;
	background: #fff; border-right: 5px solid var(--lava); color: #2B2F50; font-size: 1.06em;
	box-shadow: 0 10px 30px rgba(29, 32, 53, .07);
}
.entry-content blockquote p:last-child { margin-bottom: 0; }
.entry-content blockquote cite { display: block; margin-top: 8px; font-size: .85em; color: var(--ink-2); font-style: normal; }
.entry-content .wp-block-pullquote { border: 0; padding: 0; }
.entry-content img { border-radius: 10px; }
.entry-content figure { margin-inline: 0; }
.entry-content figcaption, .entry-content .wp-caption-text { font-size: .8em; color: var(--ink-2); text-align: center; margin-top: 8px; line-height: 1.8; }
.entry-content .aligncenter { margin-inline: auto; }
.entry-content .alignright { float: right; margin: .3em 0 1em 1.4em; max-width: 50%; }
.entry-content .alignleft { float: left; margin: .3em 1.4em 1em 0; max-width: 50%; }
.entry-content .alignwide { margin-inline: min(-40px, calc((70ch - 100%) / 2)); max-width: none; }
.entry-content hr { border: 0; height: 4px; width: 90px; margin: 2.4em auto; background: var(--brand); }
.entry-content mark { background: #FFE38A; color: var(--ink); padding: 0 .2em; }
.entry-content code, .entry-content kbd {
	font-family: ui-monospace, Consolas, monospace; font-size: .86em; direction: ltr; unicode-bidi: embed;
	background: #ECEAF6; padding: .12em .45em; border-radius: 4px;
}
.entry-content kbd { background: var(--ink); color: #fff; box-shadow: 0 2px 0 #000; }
.entry-content pre {
	direction: ltr; text-align: left; background: var(--basalt); color: #D6F7FF; padding: 20px; overflow-x: auto;
	font-size: .86em; line-height: 1.8; border-radius: 10px;
}
.entry-content pre code { background: none; padding: 0; color: inherit; }
.entry-content table { width: 100%; border-collapse: collapse; font-size: .92em; }
.entry-content th, .entry-content td { padding: 10px 14px; border: 1px solid var(--paper-line); text-align: right; }
.entry-content th { background: var(--ink); color: #fff; font-weight: 700; }
.entry-content tr:nth-child(even) td { background: #fff; }
.entry-content iframe, .entry-content video { width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: 10px; }
.entry-content .wp-block-embed iframe { aspect-ratio: auto; }
.entry-content::after { content: ""; display: table; clear: both; }
.page-links { font-weight: 700; margin-top: 2em; }

/* Table of contents */
.toc { margin: 0 0 2em; background: #fff; border: 1px solid var(--paper-line); }
.toc summary {
	display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; list-style: none;
	padding: 14px 20px; font-family: var(--f-display); font-size: 1.12em; color: var(--ink);
}
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after { content: ""; width: 9px; height: 9px; border-bottom: 2.5px solid var(--lava); border-left: 2.5px solid var(--lava); transform: rotate(-45deg); transition: transform .2s ease; }
.toc[open] summary::after { transform: rotate(135deg); }
.toc ol { margin: 0; padding: 0 20px 16px 20px; list-style: none; counter-reset: toc; font-size: .92em; line-height: 1.9; }
.toc li { margin: 0 0 4px; padding: 0; }
.toc li.toc-h2 { counter-increment: toc; }
.toc li a { display: flex; gap: 10px; color: #2B2F50; text-decoration: none; }
.toc li a::before { content: counter(toc, persian) "."; color: var(--lava); font-weight: 800; min-width: 1.2em; }
.toc li a:hover { color: var(--paper-link); }
.toc li.toc-h3 { padding-right: 26px; }
.toc li.toc-h3 a::before { content: ""; width: 6px; height: 6px; min-width: 6px; margin-top: .85em; background: var(--paper-accent); }

/* Tags & share */
.post-foot { max-width: 70ch; margin: 2.4em auto 0; padding-top: 1.6em; border-top: 1px solid var(--paper-line); display: grid; gap: 18px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags a { padding: 4px 12px; background: #fff; border: 1px solid var(--paper-line); color: var(--ink-2); font-size: 13.5px; font-weight: 600; }
.tags a::before { content: "#"; color: var(--lava); margin-left: 2px; }
.tags a:hover { border-color: var(--lava); color: var(--ink); }
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.share-label { font-weight: 800; color: var(--ink); margin-left: 6px; font-size: 14.5px; }
.share a, .share button {
	display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border: 0; cursor: pointer;
	background: var(--ink); color: #fff; font-size: 13.5px; font-weight: 700; text-decoration: none;
}
.share a:hover, .share button:hover { color: #fff; filter: brightness(1.25); }
.share .s-telegram { background: #1C8ADB; }
.share .s-whatsapp { background: #128C4B; }
.share .s-x { background: #111; }
.share .s-linkedin { background: #0A66C2; }

/* Author box */
.author-box { display: flex; gap: 18px; align-items: flex-start; max-width: 70ch; margin: 2em auto 0; padding: 20px; background: #fff; border: 1px solid var(--paper-line); }
.author-box img { width: 72px; height: 72px; border-radius: 50%; flex: none; }
.author-box h2 { font-size: 1.15em; margin: 0 0 4px; color: var(--ink); }
.author-box p { margin: 0; color: var(--ink-2); font-size: .95em; line-height: 1.9; }

/* ==========================================================================
   10. Review box (game score)
   ========================================================================== */
.review-box {
	max-width: 70ch; margin: 2.4em auto 0; background: var(--basalt); color: var(--text);
	padding: clamp(20px, 3vw, 30px); display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 24px 28px;
}
.review-box .rb-score {
	--s: 0;
	width: 132px; height: 132px; border-radius: 50%; display: grid; place-content: center; text-align: center; position: relative;
	background: conic-gradient(var(--gold) calc(var(--s) * 36deg), rgba(255, 255, 255, .1) 0);
}
.review-box .rb-score::before { content: ""; position: absolute; inset: 10px; border-radius: 50%; background: var(--basalt); }
.review-box .rb-score b { position: relative; display: block; font-family: var(--f-display); font-weight: 400; font-size: 44px; color: var(--gold); line-height: 1; padding-top: 6px; }
.review-box .rb-score small { position: relative; display: block; font-size: 12px; color: var(--muted); line-height: 1.4; }
.review-box .rb-head h2 { font-size: 1.5em; margin: 0 0 4px; color: #fff; }
.review-box .rb-platforms { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 10px; }
.review-box .rb-platforms span { font-size: 12.5px; font-weight: 700; padding: 2px 10px; background: var(--slate-2); color: var(--ice); }
.review-box .rb-verdict { color: #D3D6EE; margin: 0; font-size: 1em; line-height: 2; }
.review-box .rb-lists { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.review-box .rb-lists h3 { font-size: 1.08em; margin: 0 0 8px; }
.review-box .rb-pros h3 { color: var(--toxic); }
.review-box .rb-cons h3 { color: var(--magma); }
.review-box ul { list-style: none; margin: 0; padding: 0; font-size: .95em; line-height: 1.9; }
.review-box li { position: relative; padding-right: 24px; margin-bottom: 6px; }
.review-box .rb-pros li::before, .review-box .rb-cons li::before { position: absolute; right: 0; top: 0; font-weight: 900; }
.review-box .rb-pros li::before { content: "+"; color: var(--toxic); font-size: 1.2em; }
.review-box .rb-cons li::before { content: "−"; color: var(--magma); font-size: 1.2em; }

/* ==========================================================================
   11. Related, comments
   ========================================================================== */
.related { margin-top: 48px; }
.related .grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.related .card-title { font-size: 16.5px; }

.comments-area { margin-top: 48px; background: var(--slate); padding: clamp(20px, 4vw, 40px); }
.comments-title { font-size: 24px; }
.comment-list, .comment-list .children { list-style: none; margin: 0; padding: 0; }
.comment-list .children { padding-right: clamp(14px, 4vw, 40px); border-right: 2px solid var(--line); margin-top: 12px; }
.comment-body { padding: 16px 0; border-bottom: 1px solid var(--line); }
.comment-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.comment-meta img { border-radius: 50%; width: 44px; height: 44px; }
.comment-author-name { font-weight: 800; color: #fff; }
.comment-meta time { display: block; color: var(--muted); font-size: 12.5px; }
.bypostauthor > .comment-body .comment-author-name::after { content: "نویسنده"; margin-right: 8px; font-size: 11px; padding: 1px 8px; background: var(--lava); color: var(--basalt); font-weight: 800; }
.comment-content { color: #DADCF0; font-size: 15.5px; }
.comment-content p:last-child { margin-bottom: 0; }
.reply a, .comment-reply-link { font-size: 13px; font-weight: 700; color: var(--ice); }
.comment-awaiting-moderation { color: var(--gold); font-size: 13px; }
.comment-respond { margin-top: 28px; }
.comment-reply-title { font-size: 22px; }
.comment-reply-title small { font-family: var(--f-body); font-size: 13px; margin-right: 10px; }
.comment-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.comment-form > p { margin: 0; }
.comment-form .comment-notes, .comment-form .comment-form-comment, .comment-form .form-submit, .comment-form .comment-form-cookies-consent, .comment-form .logged-in-as { grid-column: 1 / -1; }
.comment-form label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
	width: 100%; padding: 12px 14px; background: var(--basalt); border: 1px solid var(--line); color: #fff; border-radius: 0;
}
.comment-form input:focus, .comment-form textarea:focus { border-color: var(--ice); outline: none; box-shadow: 0 0 0 3px rgba(61, 220, 255, .2); }
.comment-form .comment-form-cookies-consent { display: flex; gap: 8px; align-items: center; font-size: 13.5px; }
.comment-form .comment-form-cookies-consent label { margin: 0; font-weight: 500; }
.comment-form .submit { background: var(--lava); color: var(--basalt); font-weight: 800; border: 0; padding: 12px 28px; cursor: pointer; clip-path: polygon(var(--cut-sm) 0, 100% 0, 100% calc(100% - var(--cut-sm)), calc(100% - var(--cut-sm)) 100%, 0 100%, 0 var(--cut-sm)); }
.comment-form .submit:hover { filter: brightness(1.1); }
.comment-notes, .logged-in-as { font-size: 13.5px; color: var(--muted); }

/* ==========================================================================
   12. Sidebar & widgets
   ========================================================================== */
.sidebar { display: grid; gap: 22px; }
.widget { background: var(--slate); padding: 20px; }
.widget-title { display: flex; align-items: center; gap: 10px; font-size: 20px; margin: 0 0 14px; }
.widget-title::before { content: ""; width: 10px; height: 20px; background: var(--cat, var(--lava)); clip-path: polygon(40% 0, 100% 0, 60% 100%, 0 100%); }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 7px 0; border-bottom: 1px solid var(--line); }
.widget li:last-child { border-bottom: 0; }
.widget li a { color: var(--text); }
.widget li a:hover { color: var(--lava); }
.widget .post-date { display: block; font-size: 12.5px; color: var(--muted); }
.widget select { width: 100%; padding: 10px; background: var(--basalt); border: 1px solid var(--line); color: var(--text); }
.widget .search-form { flex-wrap: nowrap; }
.widget .search-form .btn { padding-inline: 14px; }
.wp-block-search__input { background: var(--basalt); border: 1px solid var(--line); color: #fff; padding: 10px; }
.wp-block-search__button { background: var(--lava); color: var(--basalt); border: 0; font-weight: 800; }
.tagcloud a, .wp-block-tag-cloud a { display: inline-block; margin: 0 0 6px 4px; padding: 3px 10px; background: var(--basalt); color: var(--text); font-size: 13px !important; }

.rank-list { counter-reset: rank; display: grid; gap: 14px; }
.rank-list li { border: 0; padding: 0; }
.rank-item { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; align-items: start; }
.rank-item::before {
	counter-increment: rank; content: counter(rank, persian);
	font-family: var(--f-display); font-size: 30px; line-height: 1.1; color: transparent;
	-webkit-text-stroke: 1.5px var(--cat, var(--lava));
}
.rank-item a { color: var(--text); font-weight: 700; font-size: 14.5px; line-height: 1.75; }
.rank-item a:hover { color: var(--lava); }
.rank-item .meta { font-size: 12px; margin-top: 2px; }

.mini-list { display: grid; gap: 14px; }
.mini-list .card-row { grid-template-columns: 78px minmax(0, 1fr); gap: 12px; }
.mini-list .card-row .card-title { font-size: 14.5px; margin: 0 0 2px; -webkit-line-clamp: 2; }
.mini-list .card-row .score-badge { width: 32px; height: 32px; font-size: 14px; top: 4px; left: 4px; }

/* ==========================================================================
   13. Footer
   ========================================================================== */
.site-footer {
	margin-top: 20px; background: var(--slate); color: var(--muted); padding-top: 70px;
	clip-path: polygon(0 36px, 38% 0, 100% 24px, 100% 100%, 0 100%);
}
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: clamp(24px, 3vw, 44px); padding-bottom: 36px; }
.footer-about p { font-size: 14.5px; line-height: 2; margin: 14px 0 16px; }
.site-footer .widget { background: none; padding: 0; }
.site-footer .widget-title { font-size: 18px; }
.site-footer .widget li { border-color: rgba(255, 255, 255, .06); }
.site-footer a { color: var(--text); }
.site-footer a:hover { color: var(--lava); }
.socials { display: flex; flex-wrap: wrap; gap: 8px; }
.socials a {
	display: inline-grid; place-items: center; width: 40px; height: 40px; background: var(--basalt); color: var(--text); font-size: 18px;
	clip-path: polygon(var(--cut-sm) 0, 100% 0, 100% calc(100% - var(--cut-sm)), calc(100% - var(--cut-sm)) 100%, 0 100%, 0 var(--cut-sm));
}
.socials a:hover { background: var(--lava); color: var(--basalt); }
.footer-bottom { border-top: 1px solid var(--line); padding: 18px 0 22px; font-size: 13.5px; }
.footer-bottom .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 20px; align-items: center; }
.footer-menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer-menu a { color: var(--muted); }

.to-top {
	position: fixed; left: 20px; bottom: 20px; z-index: 90; opacity: 0; visibility: hidden; transform: translateY(10px);
	transition: .2s ease; background: var(--lava); color: var(--basalt);
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: var(--gold); color: var(--basalt); }

/* 404 */
.error-hero { text-align: center; padding: clamp(30px, 6vw, 70px) 0 20px; }
.error-hero .code {
	font-family: var(--f-display); font-size: clamp(110px, 20vw, 220px); line-height: 1;
	background: var(--brand); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.error-hero p { color: var(--muted); font-size: 17px; }
.error-hero .search-form { margin: 22px auto 0; }

/* Plain pages */
.page-article .post-title { margin-top: 0; }

/* ==========================================================================
   14. Responsive
   ========================================================================== */
@media (max-width: 1100px) {
	.layout { grid-template-columns: minmax(0, 1fr); }
	.layout > .sidebar { position: static; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
	.grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 960px) {
	.menu-toggle { display: inline-grid; }
	.header-actions { margin-inline-start: auto; }
	.primary-nav {
		position: fixed; inset: var(--header-h) 0 0 0; margin: 0; padding: 16px var(--gap) 40px;
		background: var(--basalt); overflow-y: auto; visibility: hidden; opacity: 0; transform: translateX(20px);
		transition: .2s ease;
	}
	.admin-bar .primary-nav { top: calc(var(--header-h) + 46px); }
	.primary-nav.is-open { visibility: visible; opacity: 1; transform: none; }
	.primary-nav > ul { flex-direction: column; align-items: stretch; gap: 0; }
	.primary-nav li { border-bottom: 1px solid var(--line); }
	.primary-nav a { padding: 14px 4px; font-size: 16px; }
	.primary-nav > ul > li > a::after { display: none; }
	.primary-nav .sub-menu { position: static; opacity: 1; visibility: visible; transform: none; display: none; box-shadow: none; border: 0; padding: 0 16px 8px 0; background: transparent; }
	.primary-nav li.sub-open > .sub-menu { display: block; }
	.primary-nav .sub-menu li { border: 0; }
	.primary-nav .menu-item-has-children { display: grid; grid-template-columns: 1fr auto; }
	.primary-nav .menu-item-has-children > .sub-menu { grid-column: 1 / -1; }
	.submenu-toggle { display: inline-grid; place-items: center; width: 44px; background: none; border: 0; color: var(--text); cursor: pointer; font-size: 18px; }
	.sub-open > .submenu-toggle .icon { transform: rotate(180deg); }
	.hero { grid-template-columns: minmax(0, 1fr); }
	.hero-main { min-height: 400px; }
	.hero-side { grid-template-rows: none; }
	body.nav-open { overflow: hidden; }
}
@media (max-width: 640px) {
	:root { --header-h: 60px; }
	.brand-name { font-size: 22px; }
	.brand-tag { display: none; }
	.brand-mark { width: 32px; height: 32px; }
	.grid, .grid-4 { grid-template-columns: minmax(0, 1fr); }
	.hero-main { min-height: 340px; }
	.hero-excerpt { display: none; }
	.card-row { grid-template-columns: 96px minmax(0, 1fr); }
	.review-box { grid-template-columns: minmax(0, 1fr); justify-items: start; }
	.review-box .rb-lists { grid-template-columns: minmax(0, 1fr); }
	.comment-form { grid-template-columns: minmax(0, 1fr); }
	.footer-grid { grid-template-columns: minmax(0, 1fr); }
	.entry-content .alignright, .entry-content .alignleft { float: none; margin: 0 0 1.35em; max-width: 100%; }
	.entry-content .alignwide { margin-inline: 0; }
	.entry-content table { display: block; overflow-x: auto; }
	.author-box { flex-direction: column; }
	.site-footer { clip-path: polygon(0 20px, 45% 0, 100% 14px, 100% 100%, 0 100%); padding-top: 50px; }
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

@media print {
	.site-header, .site-footer, .sidebar, .share, .related, .comments-area, .to-top, .read-progress, .toc { display: none !important; }
	body { background: #fff; color: #000; }
	.reading-slab { clip-path: none; padding: 0; }
}

/* WordPress core classes */
.sticky, .gallery-caption { display: block; }
.wp-caption { max-width: 100%; }
.alignnone { margin: 0 0 1em; }
