/* ==========================================================================
   MIRZAX CO: single article (single.php, template-parts/single/*)
   ========================================================================== */

/* Reading progress: CSS scroll timeline where supported, hidden otherwise */
.mx-progress {
	position: fixed;
	left: 0;
	right: 0;
	top: 0;
	z-index: 140;
	height: 3px;
	pointer-events: none;
	display: none;
}
@supports (animation-timeline: scroll()) {
	.mx-progress { display: block; }
	.mx-progress span {
		display: block;
		height: 100%;
		background: var(--mx-gold);
		transform-origin: left center;
		animation: mx-progress linear both;
		animation-timeline: scroll(root);
	}
	@keyframes mx-progress {
		from { transform: scaleX(0); }
		to   { transform: scaleX(1); }
	}
}

/* ---------- Header ---------- */
.mx-article__header { background: linear-gradient(to bottom, var(--mx-cotton) 0, var(--mx-cotton) calc(100% - 180px), transparent calc(100% - 180px)); }
.mx-article__header:not(:has(.mx-article__cover)) { background: var(--mx-cotton); padding-bottom: 40px; }
.mx-article__header-inner {
	max-width: 900px;
	padding-top: clamp(24px, 3.6vw, 40px);
	padding-bottom: clamp(28px, 4vw, 44px);
}
.mx-article__header .mx-breadcrumbs { margin-bottom: 24px; }
.mx-article__title {
	margin: 16px 0 0;
	color: var(--mx-ink);
	font-size: clamp(34px, 5vw, 62px);
	font-weight: 780;
	font-stretch: 84%;
	line-height: 1.03;
	letter-spacing: -0.022em;
	text-wrap: balance;
	animation: mx-rise 0.7s var(--mx-ease-out) backwards;
}
.mx-article__lead {
	max-width: 62ch;
	margin: 18px 0 0;
	color: var(--mx-text-muted);
	font-size: clamp(17px, 1.6vw, 20px);
	line-height: 1.55;
	animation: mx-rise 0.7s var(--mx-ease-out) 0.08s backwards;
}
.mx-article__byline {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-top: 24px;
	animation: mx-rise 0.7s var(--mx-ease-out) 0.14s backwards;
}
.mx-article__avatar {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: var(--mx-ink);
	color: var(--mx-gold);
}
.mx-article__author { margin: 0; color: var(--mx-ink); font-weight: 600; font-size: 15px; }
.mx-article__cover { margin: 0 auto; max-width: 1240px; animation: mx-rise 0.9s var(--mx-ease-out) 0.2s backwards; }
.mx-article__cover img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	border-radius: 24px;
}
.mx-article__cover figcaption { margin-top: 10px; color: var(--mx-text-muted); font-size: 14px; text-align: center; }

/* ---------- Body with sticky aside ---------- */
.mx-article__layout {
	display: grid;
	grid-template-columns: 220px minmax(0, 720px);
	justify-content: center;
	gap: clamp(32px, 5vw, 72px);
	padding-block: clamp(36px, 5vw, 64px) 0;
}
.mx-article__aside-inner { position: sticky; top: calc(var(--mx-header-h) + 28px); display: grid; gap: 28px; }
.mx-toc__title { margin: 0 0 10px; color: var(--mx-ink); font-size: 14px; font-weight: 700; }
.mx-toc__list {
	margin: 0;
	padding: 0 0 0 14px;
	border-left: 1px dashed rgba(201, 154, 69, 0.6);
	list-style: none;
	font-size: 14px;
}
.mx-toc__list li { margin: 0; }
.mx-toc__list a {
	position: relative;
	display: block;
	padding: 6px 0;
	color: var(--mx-text-muted);
	line-height: 1.4;
	text-decoration: none;
	transition: color 0.2s var(--mx-ease);
}
.mx-toc__list a:hover { color: var(--mx-ink); }
.mx-toc__list a[aria-current] { color: var(--mx-ink); font-weight: 600; }
.mx-toc__list a[aria-current]::before {
	content: "";
	position: absolute;
	left: -16px;
	top: 50%;
	width: 4px;
	height: 18px;
	margin-top: -9px;
	border-radius: 2px;
	background: var(--mx-gold-deep);
}

.mx-share { display: flex; flex-direction: column; gap: 10px; }
.mx-share__label { color: var(--mx-ink); font-size: 14px; font-weight: 700; }
.mx-share ul { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.mx-share a,
.mx-share button {
	position: relative;
	display: grid;
	place-items: center;
	width: 42px;
	height: 42px;
	padding: 0;
	border: 1px solid var(--mx-line-light);
	border-radius: 50%;
	background: var(--mx-surface);
	color: var(--mx-ink);
	cursor: pointer;
	transition: border-color 0.2s var(--mx-ease), background-color 0.2s var(--mx-ease), transform 0.3s var(--mx-ease-out);
}
.mx-share a:hover,
.mx-share button:hover { border-color: var(--mx-ink); transform: translateY(-2px); }
.mx-share button.is-copied { background: var(--mx-ink); color: var(--mx-gold); }
.mx-share__copied {
	position: absolute;
	bottom: calc(100% + 8px);
	left: 50%;
	padding: 4px 8px;
	border-radius: 6px;
	background: var(--mx-ink);
	color: var(--mx-thread);
	font-size: 12px;
	white-space: nowrap;
	transform: translateX(-50%);
}
.mx-share__copied:empty { display: none; }

.mx-article__content { min-width: 0; }
.mx-article__content > p:first-child::first-letter {
	float: left;
	margin: 6px 12px 0 0;
	color: var(--mx-ink);
	font-size: 3.6em;
	font-weight: 800;
	font-stretch: 80%;
	line-height: 0.8;
}

.mx-article__footer {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 18px;
	margin-top: 40px;
	padding-top: 24px;
	border-top: 1px dashed var(--mx-line-light);
}
.mx-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.mx-tags a {
	display: inline-flex;
	padding: 6px 12px;
	border-radius: 999px;
	background: var(--mx-cotton);
	color: var(--mx-ink);
	font-size: 13.5px;
	font-weight: 500;
	text-decoration: none;
}
.mx-tags a:hover { background: rgba(16, 32, 25, 0.12); }
.mx-article__share-bottom { display: none; }
.mx-article__share-bottom .mx-share { flex-direction: row; align-items: center; }

/* ---------- After the article ---------- */
.mx-article-cta { margin-top: clamp(48px, 6vw, 80px); }
.mx-article-cta__inner {
	position: relative;
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	gap: 18px 26px;
	max-width: 1012px;
	margin: 0 auto;
	padding: clamp(24px, 3.4vw, 40px);
	border-radius: 22px;
	background: var(--mx-ink);
	color: var(--mx-muted);
}
.mx-article-cta__inner::before {
	content: "";
	position: absolute;
	inset: 9px;
	border: 1px dashed rgba(242, 207, 133, 0.35);
	border-radius: 14px;
	pointer-events: none;
}
.mx-article-cta__icon { position: relative; display: grid; place-items: center; width: 60px; height: 60px; border-radius: 50%; background: var(--mx-gold); color: var(--mx-ink); }
.mx-article-cta__text { position: relative; }
.mx-article-cta h2 { margin: 0 0 6px; color: var(--mx-thread); font-size: clamp(20px, 2.2vw, 26px); font-stretch: 88%; }
.mx-article-cta p { margin: 0; line-height: 1.55; }
.mx-article-cta .mx-btn { position: relative; }

.mx-postnav {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
	max-width: 1012px !important;
	margin: clamp(32px, 4vw, 48px) auto 0;
}
.mx-postnav__link {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 20px 22px;
	border: 1px solid var(--mx-line-light);
	border-radius: 16px;
	background: var(--mx-surface);
	text-decoration: none;
	transition: border-color 0.2s var(--mx-ease), transform 0.3s var(--mx-ease-out);
}
.mx-postnav__link:hover { border-color: var(--mx-ink); transform: translateY(-2px); }
.mx-postnav__link--next { grid-column: 2; text-align: right; align-items: flex-end; }
.mx-postnav__label { display: inline-flex; align-items: center; gap: 6px; color: var(--mx-text-muted); font-size: 13px; font-weight: 600; }
.mx-postnav__link--prev .mx-icon { transform: rotate(180deg); }
.mx-postnav__title { color: var(--mx-ink); font-weight: 650; line-height: 1.35; }

.mx-related { padding-top: clamp(56px, 7vw, 96px) !important; }
.mx-article__comments { max-width: 760px; }

/* ---------- Responsive ---------- */
@media (max-width: 1023px) {
	.mx-article__layout { grid-template-columns: minmax(0, 720px); }
	.mx-article__aside { display: none; }
	.mx-article__share-bottom { display: block; }
}
@media (max-width: 719px) {
	.mx-article-cta__inner { grid-template-columns: 1fr; text-align: left; }
	.mx-article-cta .mx-btn { justify-self: start; }
	.mx-postnav { grid-template-columns: 1fr; }
	.mx-postnav__link--next { grid-column: auto; }
	.mx-article__cover img { border-radius: 16px; }
}

@media (prefers-reduced-motion: reduce) {
	.mx-article__title,
	.mx-article__lead,
	.mx-article__byline,
	.mx-article__cover { animation: none; }
	.mx-progress { display: none; }
	.mx-share a:hover,
	.mx-share button:hover,
	.mx-postnav__link:hover { transform: none; }
}
