/* --------------------------------------------------------------------------
   Daftar — editorial bilingual journal
   Logical properties are used so RTL and LTR share one layout system.
   -------------------------------------------------------------------------- */

@font-face {
	font-family: "Journal Mono";
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url("../fonts/IBMPlexMono-Latin.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0100-024F, U+1E00-1EFF, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
	font-family: "Journal Text";
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	src: url("../fonts/Vazirmatn-Variable.woff2") format("woff2");
	unicode-range: U+0600-06FF, U+0750-077F, U+0870-089F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200D;
}

@font-face {
	font-family: "Journal Text";
	font-style: normal;
	font-weight: 200 900;
	font-display: swap;
	src: url("../fonts/Literata-Variable.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0100-024F, U+1E00-1EFF, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
	font-family: "Journal Text";
	font-style: italic;
	font-weight: 200 900;
	font-display: swap;
	src: url("../fonts/Literata-Variable-Italic.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0100-024F, U+1E00-1EFF, U+2000-206F;
}

:root {
	--background: #fbf9f6;
	--surface: #ffffff;
	--foreground: #1a1714;
	--muted: #6a635b;
	--border: #e8e2d8;
	--code-bg: #f4efe6;
	--code-surface: #ffffff;
	--code-border: #e8e2d8;
	--code-bar: #f7f3ec;
	--code-text: #2a2622;
	--code-muted: #7a736a;
	--code-accent: #8a7f72;
	--focus: #1a1714;
	--shadow: 0 1px 2px rgba(26, 23, 20, 0.04), 0 8px 24px rgba(26, 23, 20, 0.04);
	--radius: 0.45rem;
	--control-height: 2.5rem;
	--theme-control-height: 2.5rem;
	--content-width: 42rem;
	--title-width: 46rem;
	--sheet-width: 48rem;
	--page-width: 72rem;
	--body-size: 1.125rem;
	--line-height: 1.8;
	--space: 1rem;
	--header-pad: 0.9rem;
	color-scheme: light;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--background: #161310;
		--surface: #221e1a;
		--foreground: #f0ebe3;
		--muted: #a8a095;
		--border: #3a342e;
		--code-bg: #2a2521;
		--code-surface: #1f1b17;
		--code-border: #3a342e;
		--code-bar: #26211d;
		--code-text: #e8e2d8;
		--code-muted: #a8a095;
		--code-accent: #c4b8a8;
		--focus: #f0ebe3;
		--shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 10px 28px rgba(0, 0, 0, 0.18);
		color-scheme: dark;
	}
}

:root[data-theme="dark"] {
	--background: #161310;
	--surface: #221e1a;
	--foreground: #f0ebe3;
	--muted: #a8a095;
	--border: #3a342e;
	--code-bg: #2a2521;
	--code-surface: #1f1b17;
	--code-border: #3a342e;
	--code-bar: #26211d;
	--code-text: #e8e2d8;
	--code-muted: #a8a095;
	--code-accent: #c4b8a8;
	--focus: #f0ebe3;
	--shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 10px 28px rgba(0, 0, 0, 0.18);
	color-scheme: dark;
}

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

html {
	font-size: 100%;
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

body {
	margin: 0;
	min-height: 100vh;
	background: var(--background);
	color: var(--foreground);
	font-family: "Journal Text", Literata, Vazirmatn, Georgia, serif;
	font-size: var(--body-size);
	line-height: var(--line-height);
	font-weight: 400;
	font-optical-sizing: auto;
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
}

html[lang^="fa"] body,
body.lang-fa {
	font-family: "Journal Text", Vazirmatn, Literata, sans-serif;
}

html[lang^="en"] body,
body.lang-en {
	font-family: "Journal Text", Literata, Vazirmatn, Georgia, serif;
}

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

figure {
	margin: 2rem 0;
}

figcaption {
	margin-top: 0.6rem;
	font-size: 0.9rem;
	color: var(--muted);
	text-align: center;
}

a {
	color: inherit;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.22em;
}

a:hover {
	color: var(--muted);
}

:focus-visible {
	outline: 2px solid var(--focus);
	outline-offset: 3px;
}

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

.skip-link {
	position: absolute;
	inset-block-start: 0.75rem;
	inset-inline-start: 0.75rem;
	z-index: 100;
	padding: 0.4rem 0.7rem;
	background: var(--foreground);
	color: var(--background);
	text-decoration: none;
	transform: translateY(-150%);
}

.skip-link:focus {
	transform: none;
}

.arrow {
	display: inline-block;
	margin-inline-start: 0.2em;
}

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

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

/* Header
   -------------------------------------------------------------------------- */

.site-header {
	background: var(--surface);
	border-bottom: 1px solid var(--border);
	padding-block: var(--header-pad);
	padding-inline: clamp(1.25rem, 4vw, 3rem);
}

.site-header__inner {
	max-width: var(--page-width);
	margin-inline: auto;
	display: flex;
	align-items: center;
	gap: 1.5rem;
	position: relative;
}

.site-brand {
	display: inline-flex;
	align-items: center;
	gap: 0.55rem;
	font-size: 1.05rem;
	font-weight: 600;
	letter-spacing: 0.01em;
	text-decoration: none;
	flex: 0 0 auto;
	margin-inline-end: 0.35rem;
	color: inherit;
}

.site-brand:hover {
	color: var(--foreground);
	text-decoration: none;
}

.site-brand__mark {
	display: flex;
	width: 1.45rem;
	height: 1.45rem;
	flex: 0 0 auto;
}

.site-brand__mark svg {
	width: 100%;
	height: 100%;
	display: block;
}

.site-brand__name {
	line-height: 1;
}

.site-nav {
	display: flex;
	align-items: center;
	flex: 1 1 auto;
	min-width: 0;
}

.site-nav__search {
	display: none;
}

.menu {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	gap: 1.25rem;
}

.menu a {
	text-decoration: none;
	font-size: 0.95rem;
}

.menu a:hover,
.menu .current-menu-item > a {
	text-decoration: underline;
}

.site-header__end {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-inline-start: auto;
	flex: 0 0 auto;
}

.site-utils {
	display: flex;
	align-items: center;
	gap: 0.4rem;
}

.util-control {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.35rem;
	height: var(--control-height);
	padding: 0 0.7rem;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
	color: var(--muted);
	font-family: inherit;
	font-size: 0.78rem;
	line-height: 1;
	text-decoration: none;
	white-space: nowrap;
}

.icon {
	display: block;
	flex: 0 0 auto;
}

.util-control--icon {
	width: var(--control-height);
	padding: 0;
}

.util-control:focus-within {
	border-color: var(--foreground);
}

.util-control a,
.util-control button {
	appearance: none;
	border: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	padding: 0;
	cursor: pointer;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.util-control a:hover,
.util-control button:hover {
	color: var(--foreground);
}

.lang-switcher {
	height: var(--control-height);
	padding: 0.15rem;
	gap: 0.1rem;
}

.lang-switcher__opt {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2rem;
	height: calc(var(--control-height) - 0.3rem);
	padding: 0 0.45rem;
	border-radius: calc(var(--radius) - 0.1rem);
	font-size: 0.72rem;
	letter-spacing: 0.04em;
	font-weight: 600;
	color: var(--muted);
}

.lang-switcher__opt.is-active {
	background: var(--code-bg);
	color: var(--foreground);
}

.theme-toggle {
	height: var(--theme-control-height);
	min-width: 5.1rem;
	padding: 0 0.7rem;
	gap: 0.45rem;
}

.theme-toggle__btn {
	min-width: 1.5rem;
	min-height: 1.5rem;
}

.theme-toggle__btn[aria-pressed="true"] {
	color: var(--foreground);
}

.theme-toggle__btn .icon {
	display: block;
	width: 18px;
	height: 18px;
}

.search-control {
	display: flex;
	align-items: center;
	position: relative;
}

.search-control__form {
	display: flex;
	align-items: center;
	height: var(--control-height);
	width: 0;
	opacity: 0;
	overflow: hidden;
	pointer-events: none;
	border: 1px solid transparent;
	border-radius: var(--radius);
	background: var(--surface);
	transition: width 0.22s ease, opacity 0.18s ease, padding 0.22s ease;
}

.search-control.is-open .search-control__toggle {
	display: none;
}

.search-control.is-open .search-control__form,
.search-control[data-open="true"] .search-control__form {
	width: min(16.5rem, 42vw);
	opacity: 1;
	pointer-events: auto;
	padding-inline: 0.65rem;
	border-color: var(--border);
}

.search-control__input {
	flex: 1;
	min-width: 0;
	border: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	font-size: 0.85rem;
	padding: 0;
	height: 100%;
	border-radius: 0;
}

.search-control__input::placeholder {
	color: var(--muted);
}

.search-control__input:focus {
	outline: none;
}

.search-control__submit {
	flex: 0 0 auto;
	border: 0;
	background: transparent;
	color: var(--muted);
	font: inherit;
	font-size: 0.78rem;
	cursor: pointer;
	padding: 0;
	margin-inline-start: 0.4rem;
}

.search-control__submit:hover {
	color: var(--foreground);
}

.menu-toggle {
	display: none;
}

.menu-toggle__icon,
.menu-toggle__icon::before,
.menu-toggle__icon::after {
	display: block;
	width: 1.05rem;
	height: 1px;
	background: currentColor;
	position: relative;
}

.menu-toggle__icon::before,
.menu-toggle__icon::after {
	content: "";
	position: absolute;
	inset-inline-start: 0;
}

.menu-toggle__icon::before {
	inset-block-start: -5px;
}

.menu-toggle__icon::after {
	inset-block-start: 5px;
}

.menu-toggle[aria-expanded="true"] .menu-toggle__icon {
	background: transparent;
}

.menu-toggle[aria-expanded="true"] .menu-toggle__icon::before {
	transform: rotate(45deg);
	inset-block-start: 0;
}

.menu-toggle[aria-expanded="true"] .menu-toggle__icon::after {
	transform: rotate(-45deg);
	inset-block-start: 0;
}

/* Layout
   -------------------------------------------------------------------------- */

.site-main {
	padding-inline: clamp(1.25rem, 4vw, 3rem);
	padding-block: 2.75rem 5rem;
}

.home-page,
.index-page,
.search-page,
.archive-page,
.archive-term,
.article,
.page-article,
.contact-page,
.error-404 {
	max-width: var(--sheet-width);
	margin-inline: auto;
}

.home-page.content-with-author,
.index-page.content-with-author {
	max-width: min(100%, calc(var(--sheet-width) + 13.5rem + 3rem));
}

.sheet {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	padding: clamp(1.6rem, 3.5vw, 2.85rem) clamp(1.4rem, 3.5vw, 2.85rem);
	min-width: 0;
	overflow-x: clip;
}

.article.sheet {
	overflow: visible;
}

.article__title,
.page-article__title {
	max-width: var(--title-width);
}

.section-label {
	margin: 2.75rem 0 0.85rem;
	font-size: 0.78rem;
	font-weight: 500;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--muted);
}

.lang-fa .section-label {
	letter-spacing: 0.04em;
	text-transform: none;
	font-size: 0.92rem;
}

.post-list.sheet .post-preview:last-child {
	border-bottom: 0;
	padding-bottom: 0;
}

.post-list.sheet .post-preview:first-child {
	padding-top: 0;
}

.post-preview {
	padding-block: 2.75rem;
	border-bottom: 1px solid var(--border);
}

.post-preview__date {
	margin: 0;
	font-size: 0.72rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--muted);
}

.lang-fa .post-preview__date {
	letter-spacing: 0;
	text-transform: none;
	font-size: 0.92rem;
}

.post-preview__title {
	margin: 0.7rem 0 0;
	font-size: clamp(1.45rem, 2.4vw, 1.9rem);
	font-weight: 600;
	line-height: 1.28;
	text-wrap: balance;
}

.post-preview__title a {
	text-decoration: none;
}

.post-preview__title a:hover {
	text-decoration: underline;
	color: inherit;
}

.post-preview__excerpt {
	margin: 0.85rem 0 0;
	color: var(--muted);
	max-width: 38rem;
}

.post-preview__more {
	margin: 1rem 0 0;
}

.read-more {
	text-decoration: none;
	font-size: 0.95rem;
}

.read-more:hover {
	text-decoration: underline;
}

.archive-link {
	margin: 2.5rem 0 0;
}

.archive-link a {
	text-decoration: none;
}

.archive-link a:hover {
	text-decoration: underline;
}

.home-aside {
	margin: 3rem 0 0;
	color: var(--muted);
	font-size: 0.95rem;
}

.home-aside a {
	text-decoration: none;
}

.home-aside a:hover {
	text-decoration: underline;
}

/* Author / Cloudzio note
   -------------------------------------------------------------------------- */

.author-card {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 0.85rem;
	max-width: 22rem;
	margin-block: 0;
	color: var(--muted);
	font-size: 0.84rem;
	line-height: 1.55;
	text-align: start;
}

.author-card__photo {
	width: 4rem;
	height: 4rem;
	border-radius: 50%;
	object-fit: cover;
	flex: 0 0 auto;
	display: block;
}

.author-card__photo--mark {
	display: grid;
	place-items: center;
	background: var(--code-bg);
	color: var(--muted);
}

.author-card__photo--mark svg {
	width: 1.25rem;
	height: 1.25rem;
}

.author-card__text {
	min-width: 0;
}

.author-card__name {
	margin: 0;
	font-size: 0.95rem;
	font-weight: 600;
	line-height: 1.35;
	color: var(--foreground);
}

.lang-fa .author-card__name {
	font-weight: 700;
}

.author-card__bio,
.author-card__site {
	margin: 0.2rem 0 0;
	font-size: 0.82rem;
	line-height: 1.55;
	text-wrap: pretty;
}

.author-card__profiles {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.25rem;
	list-style: none;
	margin: 0.65rem 0 0;
	padding: 0;
}

.author-card__profiles a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	color: var(--foreground);
	text-decoration: none;
	opacity: 0.78;
}

.author-card__profiles a:hover,
.author-card__profiles a:focus-visible {
	opacity: 1;
	color: var(--foreground);
}

.author-card__profiles .icon {
	width: 1.5rem;
	height: 1.5rem;
}

.content-with-author {
	display: flex;
	flex-direction: column;
	gap: 1.35rem;
	max-width: var(--sheet-width);
	margin-inline: auto;
	min-width: 0;
}

.content-with-author__main {
	min-width: 0;
}

.content-with-author__main > .article,
.content-with-author__main > .page-article {
	max-width: none;
	margin-inline: 0;
}

.content-with-author .author-card {
	order: 2;
	margin-block: 0.25rem 0;
}

/* Desktop: dedicated start-side sidebar (left in LTR, right in RTL). */
@media (min-width: 960px) {
	.content-with-author {
		display: grid;
		grid-template-columns: 13.5rem minmax(0, var(--sheet-width));
		justify-content: center;
		align-items: start;
		column-gap: 3rem;
		row-gap: 0;
		max-width: calc(var(--sheet-width) + 13.5rem + 3rem);
	}

	.content-with-author .author-card {
		order: 0;
		position: sticky;
		inset-block-start: 1.5rem;
		align-self: start;
		flex-direction: column;
		align-items: start;
		max-width: none;
		width: 100%;
		margin: 3.15rem 0 0;
		gap: 0.7rem;
		z-index: 1;
	}

	.content-with-author .author-card--home,
	.content-with-author .author-card--page {
		margin-block-start: 0.15rem;
	}

	.content-with-author .author-card__photo {
		width: 4.5rem;
		height: 4.5rem;
	}

	.content-with-author .author-card__profiles a {
		width: 2.75rem;
		height: 2.75rem;
	}

	.content-with-author .author-card__profiles .icon {
		width: 1.75rem;
		height: 1.75rem;
	}

	.content-with-author__main {
		order: 0;
		min-width: 0;
	}
}

.home-page .section-label:first-child {
	margin-block-start: 0;
}

.project-year {
	margin: 2.1rem 0 0.15rem;
	font-size: 0.92rem;
	font-weight: 500;
	color: var(--muted);
	letter-spacing: 0.08em;
}

.project-list--full .project-year:first-child {
	margin-top: 0;
}

.lang-fa .project-year {
	letter-spacing: 0;
}

.project-list {
	display: flex;
	flex-direction: column;
}

.project-row {
	padding-block: 1.5rem;
	border-bottom: 1px solid var(--border);
}

.project-list--full .project-row:first-child,
.home-page .project-list .project-row:first-child {
	padding-top: 0;
}

.project-row:last-child {
	border-bottom: 0;
	padding-bottom: 0;
}

.project-row__meta {
	margin: 0;
	font-size: 0.78rem;
	color: var(--muted);
	letter-spacing: 0.08em;
}

.lang-fa .project-row__meta {
	letter-spacing: 0;
}

.project-row__title {
	margin: 0.35rem 0 0;
	font-size: 1.2rem;
	font-weight: 600;
	line-height: 1.3;
}

.project-row__title a {
	text-decoration: none;
}

.project-row__title a:hover {
	text-decoration: underline;
}

.project-row__excerpt,
.project-row__tech {
	margin: 0.4rem 0 0;
	color: var(--muted);
	font-size: 0.95rem;
}

.project-row__more {
	margin: 0.55rem 0 0;
}

.project-row__more a {
	text-decoration: none;
	font-size: 0.92rem;
	color: var(--muted);
}

.project-row__more a:hover {
	color: var(--foreground);
	text-decoration: underline;
}

.project-lede {
	margin: 0.85rem 0 0;
	color: var(--muted);
	font-size: 1.1rem;
	line-height: 1.5;
}

.project-links {
	display: flex;
	flex-wrap: wrap;
	gap: 1.25rem;
	margin: 0;
}

.project-links a {
	text-decoration: none;
}

.project-links a:hover {
	text-decoration: underline;
}

.contact-intro {
	max-width: 28rem;
	font-size: 1.2rem;
	line-height: 1.6;
	margin-bottom: 2rem;
}

.contact-intro p {
	margin: 0;
}

.contact-status {
	margin: 0 0 1.5rem;
	color: var(--muted);
}

.contact-links {
	list-style: none;
	margin: 0 0 2rem;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
}

.contact-links a {
	text-decoration: none;
}

.contact-links a:hover {
	text-decoration: underline;
}

.contact-form,
.wpcf7 {
	max-width: 28rem;
}

.contact-form p,
.wpcf7 p {
	margin: 0 0 1.1rem;
}

.contact-form label,
.wpcf7 label {
	display: block;
	margin-bottom: 0.4rem;
	font-size: 0.92rem;
	color: var(--muted);
}

.contact-form input:not([type="submit"]):not([type="checkbox"]):not([type="hidden"]),
.contact-form textarea,
.wpcf7 input:not([type="submit"]):not([type="checkbox"]):not([type="hidden"]),
.wpcf7 textarea {
	width: 100%;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
	color: inherit;
	font: inherit;
	padding: 0.7rem 0.85rem;
}

.contact-form textarea,
.wpcf7 textarea {
	resize: vertical;
	min-height: 9rem;
}

.contact-form input:focus,
.contact-form textarea:focus,
.wpcf7 input:focus,
.wpcf7 textarea:focus {
	outline: 2px solid var(--focus);
	outline-offset: 2px;
}

.wpcf7 input[type="email"],
.wpcf7 input.wpcf7-email {
	direction: ltr;
	unicode-bidi: isolate;
	text-align: left;
}

.wpcf7 img.wpcf7-captcha,
.wpcf7 img.captcha {
	display: block;
	margin: 0 0 0.55rem;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
	max-width: 100%;
	height: auto;
}

.wpcf7 input.wpcf7-captchar {
	max-width: 12rem;
	direction: ltr;
	unicode-bidi: isolate;
	text-align: left;
}

.wpcf7 input[type="submit"],
.contact-form__submit {
	appearance: none;
	height: var(--theme-control-height);
	padding: 0 1.1rem;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
	color: inherit;
	font: inherit;
	font-size: 0.95rem;
	cursor: pointer;
	width: auto;
}

.wpcf7 input[type="submit"]:hover,
.contact-form__submit:hover {
	border-color: var(--foreground);
}

.wpcf7 .wpcf7-not-valid-tip {
	display: block;
	margin-top: 0.35rem;
	font-size: 0.85rem;
	color: var(--muted);
}

.wpcf7 .screen-reader-response {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.wpcf7 .wpcf7-response-output {
	margin: 0 0 1.25rem;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--muted);
}

.wpcf7 form.failed .wpcf7-response-output,
.wpcf7 form.aborted .wpcf7-response-output,
.wpcf7 form.spam .wpcf7-response-output,
.wpcf7 form.invalid .wpcf7-response-output,
.wpcf7 form.unaccepted .wpcf7-response-output {
	color: var(--foreground);
}

.wpcf7 .wpcf7-spinner {
	background: none;
}

.donate-wallets {
	list-style: none;
	margin: 1.25rem 0 2rem;
	padding: 0;
	display: grid;
	gap: 1rem;
}

.donate-wallet {
	padding: 0.9rem 0;
	border-bottom: 1px solid var(--border);
}

.donate-wallet:first-child {
	padding-top: 0;
}

.donate-wallet:last-child {
	border-bottom: 0;
}

.donate-wallet__head {
	display: flex;
	align-items: center;
	gap: 0.7rem;
	margin-bottom: 0.55rem;
}

.donate-wallet__icon {
	width: 1.75rem;
	height: 1.75rem;
	flex: 0 0 auto;
	display: block;
}

.donate-wallet__icon svg {
	width: 100%;
	height: 100%;
	display: block;
}

.donate-wallet__name {
	font-size: 0.98rem;
	font-weight: 600;
}

.donate-wallet__row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.6rem 0.75rem;
}

.donate-wallet__address {
	flex: 1 1 14rem;
	min-width: 0;
	font-family: "Journal Mono", ui-monospace, monospace;
	font-size: 0.82rem;
	line-height: 1.5;
	word-break: break-all;
	background: var(--code-bg);
	padding: 0.45rem 0.6rem;
	border-radius: var(--radius);
}

.donate-copy,
.donate-cta {
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: var(--theme-control-height);
	padding: 0 1rem;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
	color: inherit;
	font: inherit;
	font-size: 0.9rem;
	text-decoration: none;
	cursor: pointer;
}

.donate-copy:hover,
.donate-cta:hover {
	border-color: var(--foreground);
	color: inherit;
}

.entry-content ul.donate-wallets {
	list-style: none;
	padding-inline-start: 0;
}

.entry-content a.donate-cta {
	text-decoration: none;
	color: inherit;
}

.about-page .entry-content,
.donate-page .entry-content {
	max-width: 40rem;
}

.donate-page h2 {
	margin: 2.1rem 0 0.7rem;
	font-size: 1.15rem;
	font-weight: 650;
}

/* Article
   -------------------------------------------------------------------------- */

.article__back,
.error-404 a {
	margin: 0 0 2rem;
	font-size: 0.95rem;
}

.article__back a,
.error-404 a {
	text-decoration: none;
}

.article__back a:hover,
.error-404 a:hover {
	text-decoration: underline;
}

.article__date {
	margin: 0;
	font-size: 0.78rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--muted);
}

.lang-fa .article__date {
	letter-spacing: 0;
	text-transform: none;
	font-size: 0.95rem;
}

.article__title,
.page-article__title {
	margin: 0.8rem 0 0;
	font-size: clamp(1.85rem, 4vw, 2.55rem);
	font-weight: 650;
	line-height: 1.22;
	text-wrap: balance;
	letter-spacing: -0.015em;
}

.lang-fa .article__title,
.lang-fa .page-article__title {
	letter-spacing: 0;
	font-weight: 700;
	line-height: 1.4;
}

.article__header {
	padding-bottom: 2rem;
	margin-bottom: 2rem;
	border-bottom: 1px solid var(--border);
}

.page-article__header {
	margin-bottom: 2rem;
}

.page-article__title {
	font-size: clamp(1.6rem, 3vw, 2.1rem);
}

.projects-archive .page-article__title,
.contact-page .page-article__title {
	margin-top: 0;
}

.article__image img {
	width: 100%;
	display: block;
	aspect-ratio: auto;
}

.article__footer {
	margin-top: 3rem;
	padding-top: 1.75rem;
	border-top: 1px solid var(--border);
}

.post-meta {
	margin-top: 1.75rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--border);
	color: var(--muted);
	font-size: 0.92rem;
}

.post-meta__row {
	margin: 0 0 0.35rem;
}

.post-meta__label {
	margin-inline-end: 0.35rem;
}

.post-meta a {
	text-decoration: none;
}

.post-meta a:hover {
	text-decoration: underline;
}

.share {
	display: block;
	width: 100%;
	max-width: 100%;
}

.share__title {
	margin: 0 0 0.85rem;
	color: var(--foreground);
	font-family: var(--font-ui);
	font-size: 0.88rem;
	font-weight: 600;
	line-height: 1.4;
}

.share__item .icon {
	flex: 0 0 auto;
	width: 21px;
	height: 21px;
	transform: none;
}

.share__actions {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	width: 100%;
	max-width: 100%;
}

.share__item {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	width: auto;
	max-width: 100%;
	min-height: 42px;
	margin: 0;
	padding: 0.5rem 0.75rem;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
	color: var(--muted);
	font: inherit;
	font-size: 0.84rem;
	line-height: 1.2;
	text-align: start;
	text-decoration: none;
	cursor: pointer;
	white-space: nowrap;
}

.share__item:hover,
.share__item:focus-visible {
	background: var(--code-bg);
	color: var(--foreground);
	border-color: var(--foreground);
	text-decoration: none;
}

.share__item:focus-visible {
	outline: 2px solid var(--foreground);
	outline-offset: 2px;
}

[dir="rtl"] .share__item .icon {
	transform: none;
}

/* Comments — native WordPress, Daftar chrome
   -------------------------------------------------------------------------- */

.comments {
	margin-top: 3rem;
	padding-top: 1.75rem;
	border-top: 1px solid var(--border);
	min-width: 0;
	max-width: var(--content-width);
}

.comments__title,
.comment-reply-title {
	margin: 0 0 1.25rem;
	font-size: 1.15rem;
	font-weight: 650;
	line-height: 1.4;
}

.lang-fa .comments__title,
.lang-fa .comment-reply-title {
	font-weight: 700;
}

.comments__count {
	margin-inline-start: 0.4rem;
	color: var(--muted);
	font-weight: 400;
	font-size: 0.92em;
}

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

.comment-list > .comment + .comment {
	margin-top: 1.5rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--border);
}

.comment-list .children {
	margin-top: 1.1rem;
	padding-inline-start: 1rem;
	border-inline-start: 1px solid var(--border);
}

.comment-list .children .comment {
	margin-top: 1.1rem;
	padding-inline-start: 0.85rem;
}

.comment__body {
	min-width: 0;
}

.comment__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.35rem 0.85rem;
	margin-bottom: 0.45rem;
	color: var(--muted);
	font-size: 0.92rem;
}

.comment__author {
	color: var(--foreground);
	font-weight: 600;
	text-decoration: none;
	overflow-wrap: anywhere;
}

.comment__author:hover {
	text-decoration: underline;
}

.comment__date {
	color: var(--muted);
}

.comment__awaiting {
	margin: 0 0 0.5rem;
	color: var(--muted);
	font-size: 0.92rem;
}

.comment__content {
	min-width: 0;
	overflow-wrap: anywhere;
	overflow-x: clip;
}

.comment__content p {
	margin: 0;
}

.comment__content p + p {
	margin-top: 0.85em;
}

.comment__content a {
	overflow-wrap: anywhere;
	unicode-bidi: isolate;
}

.comment__reply {
	margin: 0.55rem 0 0;
	font-size: 0.9rem;
}

.comment__reply a {
	text-decoration: none;
}

.comment__reply a:hover {
	text-decoration: underline;
}

.comments__closed,
.no-comments {
	margin: 0 0 1.25rem;
	color: var(--muted);
}

.comment-respond {
	margin-top: 2rem;
}

.comment-reply-title small {
	margin-inline-start: 0.65rem;
	font-size: 0.85rem;
	font-weight: 400;
}

.comment-reply-title small a {
	text-decoration: none;
}

.comment-reply-title small a:hover {
	text-decoration: underline;
}

.comment-notes,
.logged-in-as,
.must-log-in {
	margin: 0 0 1.1rem;
	color: var(--muted);
	font-size: 0.92rem;
}

.comment-form p {
	margin: 0 0 1.1rem;
}

.comment-form label {
	display: block;
	margin-bottom: 0.4rem;
	font-size: 0.92rem;
	color: var(--muted);
}

.comment-form__req {
	color: var(--muted);
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
	width: 100%;
	max-width: 100%;
	min-width: 0;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
	color: inherit;
	font: inherit;
	padding: 0.7rem 0.85rem;
}

.comment-form textarea {
	resize: vertical;
	min-height: 8.5rem;
}

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

.comment-form input:focus,
.comment-form textarea:focus {
	outline: 2px solid var(--focus);
	outline-offset: 2px;
}

.comment-form-cookies-consent {
	display: flex;
	align-items: flex-start;
	gap: 0.55rem;
}

.comment-form-cookies-consent input {
	margin-block-start: 0.35rem;
	flex: 0 0 auto;
}

.comment-form-cookies-consent label {
	margin: 0;
	line-height: 1.55;
}

.comment-form__submit {
	appearance: none;
	height: var(--theme-control-height);
	padding: 0 1.1rem;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
	color: inherit;
	font: inherit;
	font-size: 0.95rem;
	cursor: pointer;
}

.comment-form__submit:hover {
	border-color: var(--foreground);
}

.comments-pagination {
	margin: 1.5rem 0 0;
	font-size: 0.92rem;
}

.comments-pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
}

/* Entry content — long-form reading
   -------------------------------------------------------------------------- */

.entry-content {
	max-width: var(--content-width);
	min-width: 0;
	overflow-wrap: break-word;
	overflow-x: clip;
}

.entry-content > * {
	margin-block: 0;
}

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

.entry-content h2,
.entry-content h3,
.entry-content h4 {
	font-weight: 650;
	line-height: 1.3;
	text-wrap: balance;
	margin-block-start: 2em;
}

.entry-content h2 {
	font-size: 1.35rem;
}

.entry-content h3 {
	font-size: 1.15rem;
}

.lang-fa .entry-content h2,
.lang-fa .entry-content h3 {
	font-weight: 700;
	line-height: 1.45;
}

.entry-content p {
	overflow-wrap: break-word;
}

.lang-en .entry-content p {
	hyphens: auto;
}

.lang-fa .entry-content p {
	hyphens: none;
}

.entry-content ul,
.entry-content ol {
	padding-inline-start: 1.25rem;
}

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

.entry-content blockquote {
	margin-inline: 0;
	padding-inline-start: 1.2rem;
	border-inline-start: 2px solid var(--border);
	color: var(--muted);
	font-style: italic;
}

.lang-fa .entry-content blockquote,
.lang-fa em,
.lang-fa i {
	font-style: normal;
}

.entry-content a[href^="http"],
.entry-content a[href^="mailto:"],
.entry-content a[dir="ltr"],
.entry-content code,
.entry-content kbd,
.entry-content samp,
.entry-content pre,
.ltr-isolate,
span[lang="en"][dir="ltr"] {
	unicode-bidi: isolate;
	direction: ltr;
}

.entry-content pre {
	text-align: start;
	overflow-x: auto;
	padding: 0;
	margin: 0;
	background: transparent;
	border: 0;
	tab-size: 2;
	max-width: 100%;
}

.entry-content code,
.entry-content kbd,
.entry-content samp {
	font-family: "Journal Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
	font-size: 0.9em;
	background: var(--code-bg);
	color: inherit;
	padding: 0.12em 0.38em;
	border-radius: 0.28rem;
	overflow-wrap: anywhere;
	unicode-bidi: isolate;
	direction: ltr;
}

.entry-content pre code {
	display: block;
	background: transparent;
	padding: 0;
	font-size: inherit;
	overflow-wrap: normal;
	white-space: pre;
	color: inherit;
}

.code-block {
	--code-block: #111111;
	--code-block-bar: #0d0d0d;
	--code-block-line: #1c1c1c;
	--code-block-text: #e6e1d8;
	--code-block-muted: #8a847c;
	--token-comment: #7a746c;
	--token-keyword: #c9a8c6;
	--token-function: #8fb4d0;
	--token-string: #b4c896;
	--token-number: #d0a07c;
	--token-variable: #d6c4a8;
	--token-constant: #d4b07a;
	--token-type: #9ab8c4;
	--token-property: #c8b894;
	--token-operator: #a39c93;
	--token-punctuation: #8a847c;
	--token-tag: #c99284;
	margin: 1.85rem 0;
	max-width: 100%;
	border: 1px solid var(--code-block-line);
	border-radius: var(--radius);
	background: var(--code-block);
	color: var(--code-block-text);
	box-shadow: none;
	overflow: hidden;
	direction: ltr;
	unicode-bidi: isolate;
	text-align: left;
}

.code-block,
.code-block pre,
.code-block code,
.code-block .token {
	direction: ltr;
	unicode-bidi: isolate;
	text-align: left;
}

.code-block__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.55rem 1.25rem;
	background: var(--code-block-bar);
	border-bottom: 1px solid var(--code-block-line);
}

.code-block__lang {
	font-family: "Journal Mono", ui-monospace, Menlo, Consolas, monospace;
	font-size: 0.68rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--code-block-muted);
}

.code-block__copy {
	appearance: none;
	border: 0;
	background: transparent;
	color: var(--code-block-muted);
	font-family: inherit;
	font-size: 0.72rem;
	line-height: 1;
	padding: 0.2rem 0.1rem;
	cursor: pointer;
}

.code-block__copy:hover,
.code-block__copy:focus-visible {
	color: #d8d2c8;
}

.code-block pre {
	margin: 0;
	padding: 1.35rem 1.45rem 1.45rem;
	overflow-x: auto;
	overflow-y: hidden;
	max-width: 100%;
	color: var(--code-block-text);
	font-family: "Journal Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
	font-size: 0.9375rem;
	line-height: 1.7;
	tab-size: 2;
	background: transparent;
	-webkit-overflow-scrolling: touch;
}

.code-block pre code {
	display: block;
	min-width: max-content;
	padding: 0;
	font-size: inherit;
	line-height: inherit;
	font-family: inherit;
	color: inherit;
	background: transparent;
	white-space: pre;
}

.code-block .token.comment {
	color: var(--token-comment);
	font-style: italic;
}

.code-block .token.keyword {
	color: var(--token-keyword);
}

.code-block .token.function {
	color: var(--token-function);
}

.code-block .token.string,
.code-block .token.selector {
	color: var(--token-string);
}

.code-block .token.number,
.code-block .token.constant {
	color: var(--token-number);
}

.code-block .token.variable {
	color: var(--token-variable);
}

.code-block .token.type {
	color: var(--token-type);
}

.code-block .token.property,
.code-block .token.attr-name {
	color: var(--token-property);
}

.code-block .token.operator {
	color: var(--token-operator);
}

.code-block .token.punctuation {
	color: var(--token-punctuation);
}

.code-block .token.tag {
	color: var(--token-tag);
}

.code-block .token.boolean {
	color: var(--token-keyword);
}

.entry-content span[lang="fa"][dir="rtl"] {
	unicode-bidi: isolate;
	direction: rtl;
}

/* Archive page
   -------------------------------------------------------------------------- */

.archive-year {
	margin-top: 2.5rem;
}

.archive-year__title {
	margin: 0 0 1rem;
	font-size: 1.4rem;
	font-weight: 650;
}

.archive-month {
	margin-bottom: 1.5rem;
	padding-inline-start: 0.25rem;
}

.archive-month__title {
	margin: 0 0 0.4rem;
	font-size: 1rem;
	font-weight: 500;
	color: var(--muted);
}

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

.archive-month__list li {
	margin: 0.2rem 0;
}

.archive-month__list a {
	text-decoration: none;
}

.archive-month__list a:hover {
	text-decoration: underline;
}

/* Search, 404, pagination, footer
   -------------------------------------------------------------------------- */

.search-form {
	display: flex;
	gap: 0.6rem;
	align-items: center;
	margin: 0 0 2rem;
	max-width: 24rem;
}

.search-form input[type="search"] {
	flex: 1;
	min-width: 0;
	height: var(--control-height);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
	color: inherit;
	font: inherit;
	padding: 0 0.75rem;
}

.search-form input[type="search"]::placeholder {
	color: var(--muted);
}

.search-form input[type="search"]:focus {
	outline: 2px solid var(--focus);
	outline-offset: 2px;
}

.search-form button {
	appearance: none;
	height: var(--control-height);
	padding: 0 0.8rem;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
	color: var(--muted);
	font: inherit;
	font-size: 0.85rem;
	cursor: pointer;
}

.search-form button:hover {
	color: var(--foreground);
}

.muted {
	color: var(--muted);
}

.empty {
	margin: 0.2rem 0 0;
	color: var(--muted);
	font-size: 0.95rem;
	line-height: 1.75;
}

.error-404 {
	padding-block: 1.25rem;
}

.error-404__code {
	margin: 0;
	font-size: 0.8rem;
	letter-spacing: 0.16em;
	color: var(--muted);
}

.lang-fa .error-404__code {
	letter-spacing: 0;
	font-size: 1rem;
}

.error-404__title {
	margin: 0.8rem 0 1.5rem;
	font-size: 1.8rem;
	font-weight: 600;
	line-height: 1.35;
}

.pagination {
	margin-top: 2.5rem;
}

.nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	font-size: 0.95rem;
}

.page-numbers {
	text-decoration: none;
	color: var(--muted);
}

.page-numbers.current,
.page-numbers:hover {
	color: var(--foreground);
}

.site-footer {
	padding-inline: clamp(1.25rem, 4vw, 3rem);
	padding-block: 2.5rem 3rem;
}

.site-footer__inner {
	max-width: var(--sheet-width);
	margin-inline: auto;
}

.site-footer__brand {
	margin: 0 0 0.7rem;
	font-weight: 600;
}

.site-footer__nav,
.site-footer__social {
	margin: 0 0 0.55rem;
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.35rem 0.15rem;
	color: var(--muted);
	font-size: 0.92rem;
}

.site-footer__nav a,
.site-footer__social a {
	text-decoration: none;
	color: var(--muted);
}

.site-footer__nav a:hover,
.site-footer__social a:hover {
	color: var(--foreground);
	text-decoration: underline;
}

.site-footer__dot {
	margin-inline: 0.45rem;
	opacity: 0.6;
}

.site-footer__copy {
	margin: 1.1rem 0 0;
	color: var(--muted);
	font-size: 0.85rem;
}

/* Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 767px) {
	:root {
		--body-size: 1rem;
		--header-pad: 0.7rem;
	}

	.menu-toggle {
		display: inline-flex;
	}

	.site-utils__search {
		display: none;
	}

	.theme-toggle .util-control__sep {
		display: none;
	}

	.theme-toggle__btn[aria-pressed="true"] {
		display: none;
	}

	.theme-toggle {
		width: 2.75rem;
		height: 2.75rem;
		min-width: 2.75rem;
		padding: 0;
	}

	.site-nav {
		display: none;
		position: absolute;
		inset-inline: 0;
		inset-block-start: calc(100% + 0.7rem);
		flex-direction: column;
		align-items: stretch;
		gap: 1.1rem;
		padding: 1.15rem 0 1.25rem;
		background: var(--surface);
		border-bottom: 1px solid var(--border);
		box-shadow: var(--shadow);
		z-index: 20;
	}

	.site-nav[data-open="true"] {
		display: flex;
	}

	.menu {
		flex-direction: column;
		gap: 0.85rem;
	}

	.site-nav__search {
		display: block;
	}

	.site-nav__search .search-control__toggle {
		display: none;
	}

	.site-nav__search .search-control__form {
		width: 100%;
		opacity: 1;
		pointer-events: auto;
		padding-inline: 0.75rem;
		border-color: var(--border);
	}

	.post-preview {
		padding-block: 2.1rem;
	}

	.article__title {
		font-size: 1.7rem;
	}

	.author-card {
		max-width: none;
		gap: 0.75rem;
	}

	.author-card__photo {
		width: 4rem;
		height: 4rem;
	}

	.sheet {
		padding: 1.4rem 1.15rem 1.7rem;
	}

	.comment-list .children {
		padding-inline-start: 0.7rem;
	}

	.comment-list .children .comment {
		padding-inline-start: 0.55rem;
	}

	.comment-form input[type="text"],
	.comment-form input[type="email"],
	.comment-form input[type="url"],
	.comment-form textarea {
		font-size: 1rem;
	}

	.code-block__bar {
		padding: 0.5rem 1rem;
	}

	.code-block pre {
		padding: 1.1rem 1.05rem 1.2rem;
		font-size: 0.875rem;
		line-height: 1.65;
	}

	.site-main {
		padding-block-start: 1.75rem;
	}

}

@media (min-width: 768px) {
	.site-nav {
		display: flex !important;
	}
}

@media (max-width: 389px) {
	.site-brand__name {
		font-size: 0.98rem;
	}

	.post-preview__title {
		font-size: 1.35rem;
	}

	.site-header__inner {
		gap: 0.75rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.search-control__form {
		transition: none;
	}
}
