/* ==========================================================================
   Roshan — Apple-style reading theme for Persian magazines
   RTL-first, logical properties everywhere so LTR also works.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
	--bg: #fbfbfd;
	--surface: #ffffff;
	--surface-2: #f5f5f7;
	--surface-3: #e8e8ed;
	--text: #1d1d1f;
	--text-2: #515154;
	--text-3: #6e6e73;
	--line: rgba(0, 0, 0, 0.08);
	--accent: #0071e3;
	--on-accent: #ffffff;
	--glass: rgba(251, 251, 253, 0.72);
	--glass-strong: rgba(251, 251, 253, 0.86);
	--scrim: rgba(0, 0, 0, 0.28);
	--code-bg: #1d1d1f;
	--code-text: #f5f5f7;

	--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04), 0 2px 8px rgba(0, 0, 0, 0.04);
	--shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06), 0 16px 40px rgba(0, 0, 0, 0.08);
	--shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.1), 0 30px 80px rgba(0, 0, 0, 0.14);

	--radius-lg: 22px;
	--radius: 16px;
	--radius-sm: 10px;

	--container: 1200px;
	--wide: 1040px;
	--narrow: 720px;
	--gutter: clamp(16px, 4vw, 32px);
	--header-h: 60px;

	/* Critically damped spring (damping 1.0, response 0.4s) sampled for CSS. */
	--spring: linear(0, 0.06, 0.186, 0.329, 0.466, 0.584, 0.682, 0.76, 0.821, 0.868, 0.903, 0.929, 0.949, 0.963, 0.973, 0.981, 0.986, 0.99, 0.993, 0.995, 0.997, 0.998, 0.998, 0.999, 1);
	--spring-dur: 600ms;
	--ease-out: cubic-bezier(0.22, 1, 0.36, 1);

	--font: "Vazirmatn", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
	--font-display: "Sahel", "Vazirmatn", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
	--mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

	color-scheme: light;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--bg: #000000;
		--surface: #1c1c1e;
		--surface-2: #161618;
		--surface-3: #2c2c2e;
		--text: #f5f5f7;
		--text-2: #c7c7cc;
		--text-3: #98989d;
		--line: rgba(255, 255, 255, 0.1);
		--glass: rgba(22, 22, 24, 0.7);
		--glass-strong: rgba(28, 28, 30, 0.88);
		--scrim: rgba(0, 0, 0, 0.5);
		--code-bg: #161618;
		--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
		--shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
		--shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.6);
		color-scheme: dark;
	}
}

:root[data-theme="dark"] {
	--bg: #000000;
	--surface: #1c1c1e;
	--surface-2: #161618;
	--surface-3: #2c2c2e;
	--text: #f5f5f7;
	--text-2: #c7c7cc;
	--text-3: #98989d;
	--line: rgba(255, 255, 255, 0.1);
	--glass: rgba(22, 22, 24, 0.7);
	--glass-strong: rgba(28, 28, 30, 0.88);
	--scrim: rgba(0, 0, 0, 0.5);
	--code-bg: #161618;
	--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
	--shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
	--shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.6);
	color-scheme: dark;
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-padding-top: calc(var(--header-h) + 24px);
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font);
	font-size: 1.0625rem; /* 17px — Persian reads small, one step up */
	line-height: 1.9;
	letter-spacing: 0; /* never track Persian: it breaks letter joins */
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
	transition: background-color 400ms ease, color 400ms ease;
}

img,
svg,
video,
iframe {
	max-width: 100%;
	height: auto;
}

img {
	display: block;
}

a {
	color: inherit;
	text-decoration: none;
}

button {
	font: inherit;
	color: inherit;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	margin: 0;
	font-family: var(--font-display);
	font-weight: 700; /* Sahel Bold for H3–H6 */
	line-height: 1.5;
	color: var(--text);
}

h1,
h2 {
	font-weight: 900; /* Sahel Black for H1–H2 */
}

p {
	margin: 0;
}

:focus-visible {
	outline: 3px solid color-mix(in srgb, var(--accent) 60%, transparent);
	outline-offset: 2px;
	border-radius: 6px;
}

::selection {
	background: color-mix(in srgb, var(--accent) 22%, transparent);
}

[hidden] {
	display: none !important;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	white-space: nowrap;
}

.skip-link {
	position: fixed;
	inset-inline-start: 16px;
	top: -100px;
	z-index: 1000;
	padding: 10px 18px;
	border-radius: 999px;
	background: var(--accent);
	color: var(--on-accent);
	font-weight: 700;
}

.skip-link:focus {
	top: 12px;
}

.container {
	width: 100%;
	max-width: calc(var(--container) + var(--gutter) * 2);
	margin-inline: auto;
	padding-inline: var(--gutter);
}

.container-narrow {
	width: 100%;
	max-width: calc(var(--narrow) + var(--gutter) * 2);
	margin-inline: auto;
	padding-inline: var(--gutter);
}

.container-wide {
	width: 100%;
	max-width: calc(var(--wide) + var(--gutter) * 2);
	margin-inline: auto;
	padding-inline: var(--gutter);
}

.icon {
	flex: none;
}

/* Directional icons mirror in RTL. */
[dir="rtl"] .icon-arrow {
	transform: none;
}

[dir="ltr"] .icon-arrow {
	transform: scaleX(-1);
}

/* ---------- Buttons & press feedback (respond on press, not release) ---------- */
.btn,
.search-submit,
.comment-form .submit,
.wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 44px;
	padding: 10px 22px;
	border: 0;
	border-radius: 999px;
	background: var(--accent);
	color: var(--on-accent);
	font-weight: 700;
	font-size: 0.95rem;
	cursor: pointer;
	transition: transform 100ms ease-out, filter 200ms ease;
}

.icon-btn {
	display: inline-grid;
	place-items: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--text);
	cursor: pointer;
	transition: transform 100ms ease-out, background-color 200ms ease;
}

.btn:active,
.search-submit:active,
.comment-form .submit:active,
.wp-block-button__link:active,
.icon-btn:active,
.share-btn:active,
.tag:active,
.pagination a:active {
	transform: scale(0.96);
}

@media (hover: hover) {
	.btn:hover,
	.search-submit:hover,
	.comment-form .submit:hover,
	.wp-block-button__link:hover {
		filter: brightness(1.08);
	}

	.icon-btn:hover {
		background: var(--surface-3);
	}
}

/* ---------- Reading progress ---------- */
.progress {
	position: fixed;
	inset-inline: 0;
	top: 0;
	z-index: 60;
	height: 3px;
	pointer-events: none;
}

.progress-bar {
	display: block;
	height: 100%;
	background: var(--accent);
	transform: scaleX(0);
	transform-origin: right;
	will-change: transform;
}

[dir="ltr"] .progress-bar {
	transform-origin: left;
}

/* ---------- Header: translucent material, content scrolls beneath ---------- */
.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	height: var(--header-h);
	background: var(--glass);
	-webkit-backdrop-filter: saturate(180%) blur(20px);
	backdrop-filter: saturate(180%) blur(20px);
}

/* Scroll edge effect instead of a hard divider — only once content is underneath. */
.site-header::after {
	content: "";
	position: absolute;
	inset-inline: 0;
	top: 100%;
	height: 16px;
	background: linear-gradient(to bottom, color-mix(in srgb, var(--text) 6%, transparent), transparent);
	opacity: 0;
	pointer-events: none;
	transition: opacity 300ms ease;
}

.site-header.is-scrolled::after {
	opacity: 1;
}

.admin-bar .site-header {
	top: 32px;
}

@media (max-width: 782px) {
	.admin-bar .site-header {
		top: 46px;
	}
}

.header-inner {
	display: flex;
	align-items: center;
	gap: 24px;
	height: 100%;
}

.brand {
	flex: none;
	display: flex;
	align-items: center;
}

.site-title {
	font-size: 1.2rem;
	font-weight: 900;
	color: var(--text);
}

.custom-logo {
	max-height: 36px;
	width: auto;
}

.primary-nav {
	flex: 1;
	min-width: 0;
}

.primary-nav .menu {
	display: flex;
	align-items: center;
	gap: 4px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.primary-nav .menu > li {
	position: relative;
}

.primary-nav .menu a {
	display: block;
	padding: 6px 12px;
	border-radius: 999px;
	color: var(--text-2);
	font-size: 0.93rem;
	font-weight: 500;
	white-space: nowrap;
	transition: color 200ms ease, background-color 200ms ease;
}

.primary-nav .current-menu-item > a,
.primary-nav .current-menu-ancestor > a,
.primary-nav .current-category-ancestor > a {
	color: var(--text);
	font-weight: 700;
}

@media (hover: hover) {
	.primary-nav .menu a:hover {
		color: var(--text);
		background: color-mix(in srgb, var(--text) 6%, transparent);
	}
}

/* Submenu: glass panel that grows out of its parent item. */
.primary-nav .sub-menu {
	position: absolute;
	top: calc(100% + 8px);
	inset-inline-start: 0;
	min-width: 220px;
	margin: 0;
	padding: 8px;
	list-style: none;
	border-radius: var(--radius);
	background: var(--glass-strong);
	-webkit-backdrop-filter: saturate(180%) blur(30px);
	backdrop-filter: saturate(180%) blur(30px);
	box-shadow: var(--shadow-md);
	border: 1px solid var(--line);
	transform-origin: top right;
	opacity: 0;
	visibility: hidden;
	transform: scale(0.96) translateY(-4px);
	transition: opacity 200ms ease, transform var(--spring-dur) var(--spring), visibility 0s linear 200ms;
}

[dir="ltr"] .primary-nav .sub-menu {
	transform-origin: top left;
}

.primary-nav li:hover > .sub-menu,
.primary-nav li:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: none;
	transition: opacity 200ms ease, transform var(--spring-dur) var(--spring), visibility 0s;
}

.primary-nav .sub-menu a {
	border-radius: var(--radius-sm);
	padding: 8px 12px;
}

.header-actions {
	display: flex;
	align-items: center;
	gap: 2px;
	margin-inline-start: auto;
}

.menu-btn {
	display: none;
}

/* Theme toggle shows the icon for the mode you'd switch to. */
[data-theme-toggle] .icon-sun {
	display: none;
}

:root[data-theme="dark"] [data-theme-toggle] .icon-sun {
	display: block;
}

:root[data-theme="dark"] [data-theme-toggle] .icon-moon {
	display: none;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) [data-theme-toggle] .icon-sun {
		display: block;
	}

	:root:not([data-theme="light"]) [data-theme-toggle] .icon-moon {
		display: none;
	}
}

@media (max-width: 900px) {
	.primary-nav {
		display: none;
	}

	.menu-btn {
		display: inline-grid;
	}
}

/* ---------- Drawer (mobile menu) — driven by a JS spring, drag to dismiss ---------- */
.scrim {
	position: fixed;
	inset: 0;
	z-index: 80;
	background: var(--scrim);
	opacity: 0;
	touch-action: none;
}

.drawer {
	position: fixed;
	inset-block: 0;
	inset-inline-start: 0;
	z-index: 90;
	display: flex;
	flex-direction: column;
	width: min(86vw, 360px);
	padding: 12px 16px calc(24px + env(safe-area-inset-bottom));
	background: color-mix(in srgb, var(--surface) 94%, transparent);
	-webkit-backdrop-filter: saturate(180%) blur(30px);
	backdrop-filter: saturate(180%) blur(30px);
	box-shadow: var(--shadow-lg);
	transform: translateX(105%);
	visibility: hidden;
	overflow-y: auto;
	overscroll-behavior: contain;
	touch-action: pan-y;
	will-change: transform;
}

[dir="ltr"] .drawer {
	transform: translateX(-105%);
}

.drawer.is-active {
	visibility: visible;
}

.drawer-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 48px;
	margin-bottom: 8px;
}

.drawer-title {
	font-weight: 900;
	font-size: 1.1rem;
}

.drawer-nav .menu,
.drawer-nav .sub-menu {
	margin: 0;
	padding: 0;
	list-style: none;
}

.drawer-nav .menu a {
	display: block;
	padding: 12px 12px;
	border-radius: var(--radius-sm);
	font-size: 1.05rem;
	font-weight: 700;
	transition: background-color 150ms ease;
}

.drawer-nav .menu a:active {
	background: var(--surface-3);
}

.drawer-nav .sub-menu {
	padding-inline-start: 12px;
}

.drawer-nav .sub-menu a {
	font-weight: 500;
	font-size: 0.98rem;
	color: var(--text-2);
	padding-block: 8px;
}

.drawer-search {
	margin-top: auto;
	padding-top: 24px;
}

/* ---------- Search panel — materializes from the search button ---------- */
.search-panel {
	position: fixed;
	inset: 0;
	z-index: 95;
	display: flex;
	justify-content: center;
	align-items: flex-start;
	padding: calc(var(--header-h) + 24px) var(--gutter) 24px;
	background: var(--scrim);
	opacity: 0;
	transition: opacity 250ms ease;
}

.search-panel.is-open {
	opacity: 1;
}

.search-panel-inner {
	width: min(640px, 100%);
	padding: 20px;
	border-radius: var(--radius-lg);
	background: var(--glass-strong);
	-webkit-backdrop-filter: saturate(180%) blur(0px);
	backdrop-filter: saturate(180%) blur(0px);
	box-shadow: var(--shadow-lg);
	transform: scale(0.94);
	transition: transform var(--spring-dur) var(--spring), -webkit-backdrop-filter 400ms ease, backdrop-filter 400ms ease;
}

.search-panel.is-open .search-panel-inner {
	transform: none;
	-webkit-backdrop-filter: saturate(180%) blur(30px);
	backdrop-filter: saturate(180%) blur(30px);
}

.search-hint {
	margin-top: 10px;
	font-size: 0.82rem;
	color: var(--text-3);
	text-align: center;
}

@media (hover: none) {
	.search-hint {
		display: none;
	}
}

/* ---------- Search form ---------- */
.search-form {
	position: relative;
	display: flex;
	align-items: center;
	gap: 8px;
}

.search-icon {
	position: absolute;
	inset-inline-start: 16px;
	display: grid;
	color: var(--text-3);
	pointer-events: none;
}

.search-field {
	flex: 1;
	min-width: 0;
	height: 48px;
	padding-inline: 48px 16px;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--surface);
	color: var(--text);
	font: inherit;
	font-size: 1rem;
	transition: border-color 200ms ease, box-shadow 200ms ease;
	-webkit-appearance: none;
	appearance: none;
}

.search-field:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}

.search-field::-webkit-search-cancel-button {
	-webkit-appearance: none;
}

.search-submit {
	height: 48px;
}

/* ---------- Sections ---------- */
.site-main {
	display: block;
	min-height: 60vh;
	padding-bottom: 96px;
}

.site-main:focus {
	outline: none;
}

.section {
	margin-top: clamp(56px, 8vw, 96px);
}

.section-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 24px;
	padding-bottom: 14px;
	border-bottom: 1px solid var(--line);
}

.section-title,
.rail-title {
	font-size: clamp(1.35rem, 2.4vw, 1.75rem);
	font-weight: 900;
	line-height: 1.4;
}

.rail-title {
	font-size: 1.15rem;
	margin-bottom: 8px;
}

.section-more {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	color: var(--accent);
	font-weight: 700;
	font-size: 0.93rem;
}

.section-more .icon {
	width: 16px;
	height: 16px;
	transition: transform var(--spring-dur) var(--spring);
}

@media (hover: hover) {
	[dir="rtl"] .section-more:hover .icon {
		transform: translateX(-3px);
	}

	[dir="ltr"] .section-more:hover .icon {
		transform: scaleX(-1) translateX(-3px);
	}
}

/* ---------- Lead (home top) ---------- */
.lead-section {
	margin-top: clamp(24px, 4vw, 48px);
}

.lead-grid {
	display: grid;
	grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr);
	gap: clamp(24px, 3vw, 48px);
	align-items: start;
}

.lead-side {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

@media (max-width: 900px) {
	.lead-grid {
		grid-template-columns: 1fr;
	}
}

/* ---------- Grid ---------- */
.grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
	gap: 40px 28px;
}

.grid--4 {
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
}

/* ---------- Cards ---------- */
.card {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 14px;
	transition: transform 120ms ease-out;
}

/* Feedback on press — instant, subtle. */
.card:active {
	transform: scale(0.985);
}

.card-media {
	position: relative;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	border-radius: var(--radius);
	background: var(--surface-2);
	isolation: isolate;
}

.card-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 800ms var(--spring);
}

.card-placeholder {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	font-size: 3rem;
	font-weight: 900;
	color: color-mix(in srgb, var(--accent) 45%, var(--surface-3));
	background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, var(--surface-2)), var(--surface-2));
}

@media (hover: hover) {
	.card:hover .card-media img {
		transform: scale(1.035);
	}

	.card:hover .card-title a {
		color: var(--accent);
	}
}

.card-body {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.card-title {
	font-size: 1.15rem;
	font-weight: 800;
	line-height: 1.65;
}

.card-title a {
	transition: color 200ms ease;
}

/* Whole card is one hit target; chips stay independently clickable. */
.card-title a::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}

.card .chip {
	position: relative;
	z-index: 2;
	align-self: flex-start;
}

.card .meta-author {
	position: relative;
	z-index: 2;
}

.card-excerpt {
	color: var(--text-2);
	font-size: 0.95rem;
	line-height: 1.85;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Hero card */
.card--hero {
	gap: 20px;
}

.card--hero .card-media {
	aspect-ratio: 16 / 9;
	border-radius: var(--radius-lg);
}

.card--hero .card-title {
	font-size: clamp(1.5rem, 3vw, 2.25rem);
	font-weight: 900;
	line-height: 1.45;
}

.card--hero .card-excerpt {
	font-size: 1.05rem;
	-webkit-line-clamp: 3;
}

/* Compact card (side list) */
.card--compact {
	flex-direction: row;
	align-items: center;
	gap: 14px;
	padding-block: 14px;
	border-bottom: 1px solid var(--line);
}

.card--compact:last-child {
	border-bottom: 0;
}

.card--compact .card-link {
	flex: none;
	width: 104px;
}

.card--compact .card-media {
	aspect-ratio: 1;
	border-radius: 12px;
}

.card--compact .card-placeholder {
	font-size: 1.6rem;
}

.card--compact .card-title {
	font-size: 1rem;
	line-height: 1.7;
}

.card--compact .card-body {
	gap: 4px;
}

/* ---------- Chip & meta ---------- */
.chip {
	display: inline-block;
	color: var(--accent);
	font-size: 0.82rem;
	font-weight: 700;
	line-height: 1.6;
}

@media (hover: hover) {
	.chip:hover {
		text-decoration: underline;
		text-underline-offset: 4px;
	}
}

.meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	color: var(--text-3);
	font-size: 0.82rem;
	line-height: 1.6;
}

.meta-sep {
	opacity: 0.6;
}

.meta-author {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--text-2);
	font-weight: 700;
}

.meta-avatar {
	width: 28px;
	height: 28px;
	border-radius: 50%;
}

/* ---------- Page header (archives, search) ---------- */
.page-header {
	padding-block: clamp(32px, 6vw, 72px) clamp(24px, 4vw, 48px);
}

.eyebrow {
	color: var(--accent);
	font-weight: 700;
	font-size: 0.9rem;
	margin-bottom: 4px;
}

.page-title {
	font-size: clamp(2rem, 5vw, 3.25rem);
	font-weight: 900;
	line-height: 1.35;
}

.page-desc {
	max-width: 62ch;
	margin-top: 12px;
	color: var(--text-2);
	font-size: 1.1rem;
}

.page-count {
	margin-top: 12px;
	color: var(--text-3);
	font-size: 0.9rem;
}

.page-search {
	max-width: 560px;
	margin-top: 20px;
}

.breadcrumbs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 16px;
	color: var(--text-3);
	font-size: 0.85rem;
}

.breadcrumbs a {
	color: var(--text-2);
}

@media (hover: hover) {
	.breadcrumbs a:hover {
		color: var(--accent);
	}
}

/* ---------- Article ---------- */
.article-header {
	padding-top: clamp(32px, 6vw, 72px);
	padding-bottom: 32px;
}

.article-header .chip {
	margin-bottom: 8px;
	font-size: 0.9rem;
}

.article-title {
	font-size: clamp(1.9rem, 4.6vw, 3rem);
	font-weight: 900;
	line-height: 1.4;
	text-wrap: balance;
}

.article-lead {
	margin-top: 16px;
	color: var(--text-2);
	font-size: clamp(1.1rem, 2vw, 1.3rem);
	line-height: 1.85;
}

.article-header .meta {
	margin-top: 24px;
	font-size: 0.88rem;
}

.article-cover {
	margin-top: 0;
	margin-bottom: clamp(32px, 5vw, 56px);
}

.article-cover img {
	width: 100%;
	border-radius: var(--radius-lg);
	aspect-ratio: 16 / 9;
	object-fit: cover;
	background: var(--surface-2);
}

.article-cover figcaption {
	margin-top: 10px;
	color: var(--text-3);
	font-size: 0.85rem;
	text-align: center;
}

.article-layout {
	width: 100%;
	max-width: calc(var(--narrow) + var(--gutter) * 2);
	margin-inline: auto;
	padding-inline: var(--gutter);
}

/* Table of contents: collapsible card on small screens, sticky rail on wide ones. */
.toc {
	margin-bottom: 32px;
}

.toc-box {
	border-radius: var(--radius);
	background: var(--surface-2);
	padding: 4px 16px;
}

.toc-box summary {
	display: flex;
	align-items: center;
	gap: 8px;
	min-height: 48px;
	font-weight: 800;
	font-size: 0.95rem;
	cursor: pointer;
	list-style: none;
}

.toc-box summary::-webkit-details-marker {
	display: none;
}

.toc-list {
	margin: 0 0 12px;
	padding: 0;
	list-style: none;
	counter-reset: toc;
}

.toc-list li {
	font-size: 0.9rem;
	line-height: 1.7;
}

.toc-list a {
	position: relative;
	display: block;
	padding: 6px 12px;
	border-inline-start: 2px solid var(--line);
	color: var(--text-2);
	transition: color 200ms ease, border-color 200ms ease;
}

.toc-list .toc-h3 a {
	padding-inline-start: 26px;
	font-size: 0.85rem;
}

.toc-list a.is-active {
	color: var(--accent);
	border-color: var(--accent);
	font-weight: 700;
}

@media (hover: hover) {
	.toc-list a:hover {
		color: var(--text);
	}
}

@media (min-width: 1200px) {
	.article-layout.has-toc {
		display: grid;
		grid-template-columns: minmax(0, 1fr) minmax(0, var(--narrow)) minmax(0, 1fr);
		column-gap: 48px;
		max-width: none;
		padding-inline: var(--gutter);
	}

	.has-toc .toc {
		grid-column: 1;
		justify-self: end;
		width: 250px;
		margin: 0;
	}

	.has-toc .toc-box {
		position: sticky;
		top: calc(var(--header-h) + 32px);
		max-height: calc(100vh - var(--header-h) - 64px);
		overflow-y: auto;
		background: transparent;
		padding: 0;
	}

	.has-toc .toc-box summary {
		pointer-events: none;
		color: var(--text-3);
		font-size: 0.85rem;
	}

	.has-toc .toc-box summary .icon {
		display: none;
	}

	.has-toc .entry-content {
		grid-column: 2;
	}
}

/* ---------- Entry content typography ---------- */
.entry-content {
	font-size: 1.125rem; /* 18px for long reads */
	line-height: 2;
	color: var(--text);
	overflow-wrap: break-word;
}

.entry-content > * + * {
	margin-top: 1.35em;
}

.entry-content p {
	margin-bottom: 0;
}

.entry-content h2 {
	margin-top: 2.2em;
	font-size: clamp(1.45rem, 2.6vw, 1.8rem);
	font-weight: 900;
	line-height: 1.55;
}

.entry-content h3 {
	margin-top: 1.9em;
	font-size: clamp(1.2rem, 2vw, 1.4rem);
	font-weight: 800;
	line-height: 1.6;
}

.entry-content h4 {
	margin-top: 1.6em;
	font-size: 1.1rem;
}

.entry-content h2 + *,
.entry-content h3 + *,
.entry-content h4 + * {
	margin-top: 0.6em;
}

.entry-content a {
	color: var(--accent);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 5px;
	text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
	transition: text-decoration-color 200ms ease;
}

@media (hover: hover) {
	.entry-content a:hover {
		text-decoration-color: currentColor;
	}
}

.entry-content strong {
	font-weight: 800;
}

.entry-content ul,
.entry-content ol {
	padding-inline-start: 1.4em;
}

.entry-content li + li {
	margin-top: 0.4em;
}

.entry-content li::marker {
	color: var(--text-3);
}

.entry-content blockquote,
.entry-content .wp-block-quote {
	margin-inline: 0;
	padding: 20px 24px;
	border-inline-start: 3px solid var(--accent);
	border-radius: var(--radius-sm);
	background: var(--surface-2);
	color: var(--text-2);
	font-size: 1.08rem;
}

.entry-content blockquote cite {
	display: block;
	margin-top: 8px;
	font-size: 0.85rem;
	font-style: normal;
	color: var(--text-3);
}

.entry-content .wp-block-pullquote {
	padding: 32px 0;
	border-block: 1px solid var(--line);
	text-align: center;
	font-size: 1.4rem;
	font-weight: 800;
}

.entry-content code,
.entry-content kbd {
	direction: ltr;
	unicode-bidi: isolate;
	padding: 0.15em 0.45em;
	border-radius: 6px;
	background: var(--surface-3);
	font-family: var(--mono);
	font-size: 0.85em;
}

.entry-content pre {
	direction: ltr;
	text-align: left;
	padding: 20px 22px;
	border-radius: var(--radius);
	background: var(--code-bg);
	color: var(--code-text);
	font-family: var(--mono);
	font-size: 0.9rem;
	line-height: 1.7;
	overflow-x: auto;
	tab-size: 4;
}

.entry-content pre code {
	padding: 0;
	background: none;
	font-size: inherit;
	color: inherit;
}

.entry-content img,
.entry-content .wp-block-image img,
.entry-content video {
	border-radius: var(--radius);
}

.entry-content figure {
	margin-inline: 0;
}

.entry-content figcaption,
.entry-content .wp-caption-text,
.entry-content .wp-element-caption {
	margin-top: 10px;
	color: var(--text-3);
	font-size: 0.85rem;
	line-height: 1.7;
	text-align: center;
}

.entry-content hr {
	margin-block: 3em;
	border: 0;
	height: 1px;
	background: var(--line);
}

.entry-content table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.95rem;
	line-height: 1.7;
}

.entry-content .wp-block-table {
	overflow-x: auto;
}

.entry-content th,
.entry-content td {
	padding: 12px 14px;
	border-bottom: 1px solid var(--line);
	text-align: start;
}

.entry-content th {
	font-weight: 800;
	background: var(--surface-2);
}

.entry-content .alignwide {
	width: min(var(--wide), 100vw - var(--gutter) * 2);
	max-width: none;
	margin-inline: calc((100% - min(var(--wide), 100vw - var(--gutter) * 2)) / 2);
}

.entry-content .alignfull {
	width: 100vw;
	max-width: none;
	margin-inline: calc(50% - 50vw);
}

.entry-content .alignfull img {
	border-radius: 0;
}

.alignleft {
	float: left;
	margin: 0.4em 0 1em 1.5em;
}

.alignright {
	float: right;
	margin: 0.4em 1.5em 1em 0;
}

.aligncenter {
	margin-inline: auto;
}

.entry-content::after {
	content: "";
	display: table;
	clear: both;
}

.entry-content .wp-block-embed iframe {
	border-radius: var(--radius);
}

/* Callout-style group blocks with a background */
.entry-content .has-background {
	padding: 20px 24px;
	border-radius: var(--radius);
}

.page-links {
	display: flex;
	gap: 8px;
	margin-top: 32px;
}

/* ---------- Article footer ---------- */
.article-footer {
	margin-top: 56px;
	display: flex;
	flex-direction: column;
	gap: 32px;
}

.tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.tag {
	display: inline-block;
	padding: 6px 14px;
	border-radius: 999px;
	background: var(--surface-2);
	color: var(--text-2);
	font-size: 0.85rem;
	font-weight: 500;
	transition: background-color 200ms ease, transform 100ms ease-out;
}

@media (hover: hover) {
	.tag:hover {
		background: var(--surface-3);
		color: var(--text);
	}
}

.share {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	padding-block: 20px;
	border-block: 1px solid var(--line);
}

.share-label {
	margin-inline-end: 8px;
	color: var(--text-3);
	font-size: 0.88rem;
	font-weight: 700;
}

.share-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 38px;
	padding: 6px 14px;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--surface);
	color: var(--text);
	font-size: 0.85rem;
	font-weight: 500;
	cursor: pointer;
	transition: background-color 200ms ease, transform 100ms ease-out;
}

.share-btn .icon {
	width: 16px;
	height: 16px;
}

.share-btn.is-done {
	color: #1a7f37;
	border-color: currentColor;
}

@media (hover: hover) {
	.share-btn:hover {
		background: var(--surface-2);
	}
}

.author-box {
	display: flex;
	gap: 16px;
	align-items: flex-start;
	padding: 20px;
	border-radius: var(--radius);
	background: var(--surface-2);
}

.author-box img {
	flex: none;
	border-radius: 50%;
}

.author-name {
	font-weight: 800;
}

.author-bio {
	color: var(--text-2);
	font-size: 0.92rem;
	line-height: 1.8;
}

.post-navigation .nav-links {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

.post-navigation a {
	display: flex;
	flex-direction: column;
	gap: 4px;
	height: 100%;
	padding: 16px 20px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	transition: border-color 200ms ease, transform 100ms ease-out;
}

.post-navigation a:active {
	transform: scale(0.98);
}

.post-navigation .nav-next {
	text-align: end;
}

.post-navigation .nav-next:only-child {
	grid-column: 2;
}

.nav-label {
	color: var(--text-3);
	font-size: 0.8rem;
}

.nav-title {
	font-weight: 800;
	font-size: 0.95rem;
	line-height: 1.7;
}

@media (hover: hover) {
	.post-navigation a:hover {
		border-color: var(--accent);
	}
}

@media (max-width: 600px) {
	.post-navigation .nav-links {
		grid-template-columns: 1fr;
	}

	.post-navigation .nav-next:only-child {
		grid-column: auto;
	}
}

.related {
	margin-top: 80px;
}

/* ---------- Comments ---------- */
.comments {
	margin-top: 72px;
}

.comments-title,
.comment-reply-title {
	font-size: 1.4rem;
	font-weight: 900;
	margin-bottom: 24px;
}

.comment-list,
.comment-list .children {
	margin: 0;
	padding: 0;
	list-style: none;
}

.comment-list .children {
	padding-inline-start: 24px;
	border-inline-start: 2px solid var(--line);
	margin-top: 16px;
}

.comment-body {
	padding: 16px 0;
	border-bottom: 1px solid var(--line);
	font-size: 0.97rem;
}

.comment-author {
	display: flex;
	align-items: center;
	gap: 10px;
	font-weight: 800;
}

.comment-author img {
	border-radius: 50%;
}

.comment-author .says {
	display: none;
}

.comment-metadata {
	font-size: 0.8rem;
	color: var(--text-3);
	margin-top: 2px;
}

.comment-content {
	margin-top: 8px;
}

.reply a {
	font-size: 0.85rem;
	color: var(--accent);
	font-weight: 700;
}

.comment-respond {
	margin-top: 40px;
}

.comment-form {
	display: grid;
	gap: 16px;
}

.comment-form label {
	display: block;
	margin-bottom: 6px;
	font-size: 0.88rem;
	font-weight: 700;
	color: var(--text-2);
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
	width: 100%;
	padding: 12px 16px;
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	background: var(--surface);
	color: var(--text);
	font: inherit;
	transition: border-color 200ms ease, box-shadow 200ms ease;
}

.comment-form input[type="email"],
.comment-form input[type="url"] {
	direction: ltr;
	text-align: start;
}

.comment-form input:focus,
.comment-form textarea:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}

.comment-form-cookies-consent {
	display: flex;
	gap: 8px;
	align-items: flex-start;
	font-size: 0.85rem;
}

.comment-form-cookies-consent label {
	font-weight: 500;
}

/* ---------- Pagination ---------- */
.pagination {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px;
	margin-top: 56px;
}

.pagination .page-numbers {
	display: inline-grid;
	place-items: center;
	min-width: 44px;
	height: 44px;
	padding-inline: 14px;
	border-radius: 999px;
	color: var(--text-2);
	font-weight: 700;
	transition: background-color 200ms ease, transform 100ms ease-out;
}

.pagination .page-numbers.current {
	background: var(--text);
	color: var(--bg);
}

.pagination .dots {
	min-width: 24px;
	padding: 0;
}

@media (hover: hover) {
	.pagination a.page-numbers:hover {
		background: var(--surface-3);
		color: var(--text);
	}
}

/* ---------- Empty / 404 ---------- */
.empty {
	max-width: 560px;
	margin: 64px auto 0;
	text-align: center;
	display: grid;
	gap: 16px;
	justify-items: center;
}

.empty h1,
.empty h2 {
	font-size: clamp(1.5rem, 3vw, 2rem);
	font-weight: 900;
}

.empty p {
	color: var(--text-2);
}

.empty .search-form {
	width: 100%;
}

.big-num {
	font-size: clamp(5rem, 16vw, 9rem);
	font-weight: 900;
	line-height: 1;
	background: linear-gradient(180deg, var(--text), color-mix(in srgb, var(--text) 30%, transparent));
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

/* ---------- Footer ---------- */
.site-footer {
	padding-block: 56px 32px;
	background: var(--surface-2);
	color: var(--text-2);
	font-size: 0.9rem;
}

.footer-widgets {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 32px;
	padding-bottom: 40px;
	margin-bottom: 24px;
	border-bottom: 1px solid var(--line);
}

.widget-title {
	margin-bottom: 12px;
	font-size: 0.95rem;
	font-weight: 900;
	color: var(--text);
}

.site-footer ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-footer li + li {
	margin-top: 6px;
}

@media (hover: hover) {
	.site-footer a:hover {
		color: var(--text);
		text-decoration: underline;
		text-underline-offset: 4px;
	}
}

.footer-bottom {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	color: var(--text-3);
	font-size: 0.82rem;
}

.footer-nav ul {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
}

.footer-nav li + li {
	margin-top: 0;
}

/* ---------- Back to top ---------- */
.to-top {
	position: fixed;
	inset-inline-end: 20px;
	bottom: calc(20px + env(safe-area-inset-bottom));
	z-index: 40;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--glass-strong);
	-webkit-backdrop-filter: saturate(180%) blur(20px);
	backdrop-filter: saturate(180%) blur(20px);
	box-shadow: var(--shadow-md);
	color: var(--text);
	cursor: pointer;
	opacity: 0;
	transform: translateY(12px) scale(0.9);
	pointer-events: none;
	transition: opacity 250ms ease, transform var(--spring-dur) var(--spring);
}

.to-top.is-visible {
	opacity: 1;
	transform: none;
	pointer-events: auto;
}

.to-top:active {
	transform: scale(0.92);
}

/* ---------- WordPress core ---------- */
.sticky .card-title::before {
	content: "★ ";
	color: var(--accent);
}

.wp-caption {
	max-width: 100%;
}

.gallery {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: 12px;
}

.bypostauthor > .comment-body .comment-author b::after {
	content: " · نویسنده";
	color: var(--accent);
	font-weight: 700;
	font-size: 0.8rem;
}

/* ==========================================================================
   Front page
   ========================================================================== */
:root {
	--tint-0: #007aff;
	--tint-1: #af52de;
	--tint-2: #248a3d;
	--tint-3: #c93400;
	--tint-4: #d70015;
	--tint-5: #0071a4;
}

:root[data-theme="dark"] {
	--tint-0: #0a84ff;
	--tint-1: #bf5af2;
	--tint-2: #30d158;
	--tint-3: #ff9f0a;
	--tint-4: #ff375f;
	--tint-5: #64d2ff;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--tint-0: #0a84ff;
		--tint-1: #bf5af2;
		--tint-2: #30d158;
		--tint-3: #ff9f0a;
		--tint-4: #ff375f;
		--tint-5: #64d2ff;
	}
}

.btn--lg {
	min-height: 52px;
	padding: 12px 28px;
	font-size: 1rem;
}

.btn--ghost {
	background: color-mix(in srgb, var(--text) 7%, transparent);
	color: var(--text);
}

@media (hover: hover) {
	.btn--ghost:hover {
		filter: none;
		background: color-mix(in srgb, var(--text) 11%, transparent);
	}
}

/* Hero */
.hero {
	position: relative;
	overflow: hidden;
	padding-block: clamp(64px, 12vw, 140px) clamp(56px, 9vw, 110px);
	text-align: center;
	isolation: isolate;
}

.hero-glow {
	position: absolute;
	inset: -20% -10% auto;
	height: 120%;
	z-index: -1;
	background:
		radial-gradient(40% 50% at 30% 40%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
		radial-gradient(35% 45% at 70% 30%, color-mix(in srgb, var(--tint-1) 16%, transparent), transparent 70%),
		radial-gradient(30% 40% at 55% 75%, color-mix(in srgb, var(--tint-5) 14%, transparent), transparent 70%);
	filter: blur(20px);
	pointer-events: none;
}

.hero-inner {
	display: flex;
	flex-direction: column;
	align-items: center;
}

.hero-eyebrow {
	margin-bottom: 12px;
	color: var(--accent);
	font-weight: 800;
	font-size: clamp(0.95rem, 1.6vw, 1.1rem);
}

.hero-title {
	max-width: 16ch;
	font-size: clamp(2.3rem, 6.4vw, 4.6rem);
	font-weight: 900;
	line-height: 1.3;
	text-wrap: balance;
}

.hero-sub {
	max-width: 46ch;
	margin-top: 20px;
	color: var(--text-2);
	font-size: clamp(1.05rem, 2vw, 1.3rem);
	line-height: 1.9;
	text-wrap: pretty;
}

.hero-search {
	width: min(560px, 100%);
	margin-top: 36px;
}

.hero-search .search-field {
	height: 56px;
	font-size: 1.05rem;
	box-shadow: var(--shadow-md);
	border-color: transparent;
}

.hero-search .search-submit {
	height: 56px;
	padding-inline: 26px;
}

.hero-actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 12px;
	margin-top: 24px;
}

.hero-stats {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 12px 40px;
	margin: 48px 0 0;
	padding: 0;
	list-style: none;
}

.hero-stats li {
	display: flex;
	flex-direction: column;
	align-items: center;
	line-height: 1.4;
}

.hero-stats strong {
	font-size: clamp(1.5rem, 3vw, 2rem);
	font-weight: 900;
}

.hero-stats span {
	color: var(--text-3);
	font-size: 0.85rem;
}

/* Section intro (centered heading + description) */
.section-intro {
	max-width: 640px;
	margin: 0 auto 36px;
	text-align: center;
}

.section-desc {
	margin-top: 8px;
	color: var(--text-2);
	font-size: 1.05rem;
}

/* Learning paths */
.paths {
	margin-top: clamp(24px, 4vw, 48px);
}

.paths-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
	gap: 16px;
}

.path {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 24px;
	border: 1px solid var(--line);
	border-radius: var(--radius-lg);
	background: var(--surface);
	box-shadow: var(--shadow-sm);
	transition: transform var(--spring-dur) var(--spring), box-shadow 300ms ease, border-color 300ms ease;
}

.path:active {
	transform: scale(0.98);
	transition-duration: 100ms;
}

@media (hover: hover) {
	.path:hover {
		transform: translateY(-3px);
		box-shadow: var(--shadow-md);
		border-color: color-mix(in srgb, var(--tint) 35%, var(--line));
	}

	.path:hover .path-go {
		background: var(--tint);
		color: #fff;
	}
}

.path-icon {
	display: grid;
	place-items: center;
	width: 48px;
	height: 48px;
	margin-bottom: 8px;
	border-radius: 14px;
	background: color-mix(in srgb, var(--tint) 13%, transparent);
	color: var(--tint);
}

.path-icon .icon {
	width: 24px;
	height: 24px;
}

.path-name {
	font-size: 1.15rem;
	font-weight: 800;
	line-height: 1.5;
}

.path-desc {
	color: var(--text-2);
	font-size: 0.92rem;
	line-height: 1.8;
}

.path-foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: auto;
	padding-top: 12px;
}

.path-count {
	color: var(--text-3);
	font-size: 0.85rem;
	font-weight: 500;
}

.path-go {
	display: grid;
	place-items: center;
	width: 32px;
	height: 32px;
	border-radius: 999px;
	background: var(--surface-2);
	color: var(--text-2);
	transition: background-color 250ms ease, color 250ms ease;
}

.path-go .icon {
	width: 16px;
	height: 16px;
}

@media (max-width: 600px) {
	.paths-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 10px;
	}

	.path {
		padding: 16px;
		gap: 4px;
		border-radius: var(--radius);
	}

	.path-icon {
		width: 40px;
		height: 40px;
		border-radius: 12px;
	}

	.path-name {
		font-size: 1rem;
	}

	.path-desc,
	.path-go {
		display: none;
	}

	.path-foot {
		padding-top: 4px;
	}
}

/* Featured */
.feature {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
	overflow: hidden;
	border-radius: 28px;
	background: var(--surface);
	border: 1px solid var(--line);
	box-shadow: var(--shadow-sm);
}

.feature-media {
	position: relative;
	display: block;
	min-height: 360px;
	background: var(--surface-2);
	overflow: hidden;
}

.feature-media img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 900ms var(--spring);
}

@media (hover: hover) {
	.feature:hover .feature-media img {
		transform: scale(1.03);
	}
}

.feature-body {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 10px;
	padding: clamp(28px, 4vw, 48px);
	align-self: center;
}

.feature-label {
	color: var(--text-3);
	font-size: 0.8rem;
	font-weight: 800;
}

.feature-title {
	font-size: clamp(1.5rem, 2.8vw, 2.2rem);
	font-weight: 900;
	line-height: 1.45;
	text-wrap: balance;
}

@media (hover: hover) {
	.feature-title a:hover {
		color: var(--accent);
	}
}

.feature-excerpt {
	color: var(--text-2);
	line-height: 1.9;
}

.feature-btn {
	margin-top: 12px;
}

@media (max-width: 860px) {
	.feature {
		grid-template-columns: 1fr;
	}

	.feature-media {
		min-height: 0;
		aspect-ratio: 16 / 9;
	}
}

/* Latest + popular */
.latest-wrap.has-aside {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 340px;
	gap: clamp(32px, 4vw, 56px);
	align-items: start;
}

@media (min-width: 1000px) {
	.grid--2col {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 1000px) {
	.latest-wrap.has-aside {
		grid-template-columns: 1fr;
	}
}

.more-row {
	margin-top: 40px;
	text-align: center;
}

.popular {
	position: sticky;
	top: calc(var(--header-h) + 24px);
	padding: 24px;
	border-radius: var(--radius-lg);
	background: var(--surface-2);
}

.rank {
	margin: 0;
	padding: 0;
	list-style: none;
}

.rank-item {
	display: flex;
	gap: 16px;
	align-items: flex-start;
	padding-block: 16px;
	border-bottom: 1px solid var(--line);
}

.rank-item:last-child {
	border-bottom: 0;
	padding-bottom: 0;
}

.rank-num {
	flex: none;
	width: 32px;
	font-size: 1.9rem;
	font-weight: 900;
	line-height: 1.1;
	color: color-mix(in srgb, var(--text) 22%, transparent);
	text-align: center;
}

.rank-item:first-child .rank-num {
	color: var(--accent);
}

.rank-body {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.rank-title {
	font-weight: 800;
	font-size: 0.98rem;
	line-height: 1.7;
	transition: color 200ms ease;
}

@media (hover: hover) {
	.rank-title:hover {
		color: var(--accent);
	}
}

.rank-meta {
	color: var(--text-3);
	font-size: 0.8rem;
}

/* CTA */
.cta {
	position: relative;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	padding: clamp(40px, 7vw, 80px) clamp(20px, 5vw, 64px);
	border-radius: 32px;
	background: var(--surface);
	border: 1px solid var(--line);
	text-align: center;
	isolation: isolate;
}

.cta-glow {
	position: absolute;
	inset: 0;
	z-index: -1;
	background:
		radial-gradient(50% 70% at 50% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
		radial-gradient(40% 60% at 90% 100%, color-mix(in srgb, var(--tint-1) 12%, transparent), transparent 70%);
	pointer-events: none;
}

.cta-icon {
	display: grid;
	place-items: center;
	width: 56px;
	height: 56px;
	margin-bottom: 4px;
	border-radius: 18px;
	background: var(--accent);
	color: var(--on-accent);
	box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 35%, transparent);
}

.cta-icon .icon {
	width: 26px;
	height: 26px;
}

.cta-title {
	max-width: 22ch;
	font-size: clamp(1.6rem, 3.6vw, 2.5rem);
	font-weight: 900;
	line-height: 1.45;
	text-wrap: balance;
}

.cta-text {
	max-width: 48ch;
	color: var(--text-2);
	font-size: 1.05rem;
}

.cta-form {
	display: flex;
	gap: 8px;
	width: min(480px, 100%);
	margin-top: 16px;
}

.cta-form--sc {
	display: block;
}

.cta-input {
	flex: 1;
	min-width: 0;
	height: 52px;
	padding-inline: 20px;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--bg);
	color: var(--text);
	font: inherit;
	text-align: start;
	transition: border-color 200ms ease, box-shadow 200ms ease;
}

.cta-input::placeholder {
	text-align: right;
}

.cta-input:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}

.cta-form .btn {
	height: 52px;
}

.cta .btn--lg {
	margin-top: 16px;
}

.cta-admin-note {
	margin-top: 12px;
	padding: 10px 16px;
	border-radius: var(--radius-sm);
	border: 1px dashed var(--line);
	color: var(--text-3);
	font-size: 0.85rem;
}

@media (max-width: 520px) {
	.cta-form {
		flex-direction: column;
	}
}

/* Scroll reveal — only when JS is running, so content never hides without it. */
.has-reveal .reveal {
	opacity: 0;
	transform: translateY(18px);
	transition: opacity 500ms ease, transform 800ms var(--spring);
	transition-delay: var(--delay, 0ms);
}

.has-reveal .reveal.is-in {
	opacity: 1;
	transform: none;
}

/* ==========================================================================
   Accessibility preferences
   ========================================================================== */

/* Reduced motion: gentle cross-fades instead of movement, no scaling. */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		scroll-behavior: auto !important;
	}

	.card,
	.card-media img,
	.btn,
	.icon-btn,
	.share-btn,
	.tag,
	.to-top,
	.search-panel-inner,
	.primary-nav .sub-menu,
	.section-more .icon {
		transition-property: opacity, color, background-color, border-color !important;
		transition-duration: 200ms !important;
	}

	.card:active,
	.btn:active,
	.icon-btn:active,
	.card:hover .card-media img {
		transform: none !important;
	}

	.search-panel-inner,
	.primary-nav .sub-menu,
	.to-top,
	.path,
	.path:hover,
	.has-reveal .reveal {
		transform: none !important;
	}
}

/* Reduced transparency: solid surfaces, no blur. */
@media (prefers-reduced-transparency: reduce) {
	.site-header,
	.drawer,
	.search-panel-inner,
	.primary-nav .sub-menu,
	.to-top {
		background: var(--surface);
		-webkit-backdrop-filter: none;
		backdrop-filter: none;
	}
}

/* Increased contrast: defined borders and stronger secondary text. */
@media (prefers-contrast: more) {
	:root {
		--text-2: var(--text);
		--text-3: color-mix(in srgb, var(--text) 80%, var(--bg));
		--line: color-mix(in srgb, var(--text) 45%, transparent);
	}

	.site-header,
	.drawer,
	.search-panel-inner {
		background: var(--surface);
		border-bottom: 1px solid var(--line);
		-webkit-backdrop-filter: none;
		backdrop-filter: none;
	}
}

@media print {
	.site-header,
	.site-footer,
	.drawer,
	.scrim,
	.search-panel,
	.progress,
	.to-top,
	.toc,
	.share,
	.related,
	.comments,
	.post-navigation {
		display: none !important;
	}

	body {
		background: #fff;
		color: #000;
	}
}
