/*!
 * Zardis Toolkit — magazine / blog listing and article typography.
 *
 * Scope: `.zardis-mag` is added by class-magazine.php to the blog archive
 * body, and to the Elementor blog widget wrapper on the «مجله» page.
 * Nothing here targets `.wd-post` globally, so any other blog element the
 * merchant adds keeps the theme's own look.
 */

/* ---------- listing: card ------------------------------------------- */

.zardis-mag .wd-post.blog-post-loop {
	position: relative;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid var(--ztk-line, rgba(0, 25, 68, .12));
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 4px 16px rgba(0, 25, 68, .05);
	transition: box-shadow .22s ease, transform .22s ease, border-color .22s ease;
}

.zardis-mag .wd-post.blog-post-loop:hover,
.zardis-mag .wd-post.blog-post-loop:focus-within {
	border-color: rgba(201, 162, 71, .55);
	box-shadow: 0 16px 38px rgba(0, 25, 68, .13);
	transform: translateY(-3px);
}

.zardis-mag .wd-post.blog-post-loop .wd-post-inner {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	height: 100%;
}

/* ---------- listing: image ------------------------------------------ */

.zardis-mag .wd-post .wd-post-thumb {
	position: relative;
	overflow: hidden;
	aspect-ratio: 16 / 10;
	background: var(--ztk-surface-alt, #f7f8fa);
}

.zardis-mag .wd-post .wd-post-img,
.zardis-mag .wd-post .wd-post-img img {
	width: 100%;
	height: 100%;
}

.zardis-mag .wd-post .wd-post-img img {
	object-fit: cover;
	object-position: center;
	transition: transform .5s cubic-bezier(.2, .7, .3, 1);
}

.zardis-mag .wd-post:hover .wd-post-img img {
	transform: scale(1.045);
}

/* ---------- listing: content ---------------------------------------- */

.zardis-mag .wd-post .wd-post-content {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 8px;
	padding: 16px 18px 20px;
}

.zardis-mag .wd-post .wd-post-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 12px;
	margin: 0;
	font-size: 12px;
	line-height: 1.6;
	color: var(--ztk-ink-soft, #5a6169);
}

.zardis-mag .wd-post .wd-post-date {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	padding: 3px 9px;
	border-radius: 999px;
	background: var(--ztk-gold-soft, #f6edda);
	color: var(--ztk-gold-deep, #a9862f);
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.zardis-mag .wd-post .wd-modified-date {
	display: none;
}

.zardis-mag .wd-post .wd-post-title {
	margin: 0;
	font-size: 16px;
	font-weight: 800;
	line-height: 1.65;
}

.zardis-mag .wd-post .wd-post-title a {
	color: var(--ztk-ink, #1d2327);
	text-decoration: none;
}

.zardis-mag .wd-post .wd-post-title a:hover,
.zardis-mag .wd-post .wd-post-title a:focus-visible {
	color: var(--ztk-gold-deep, #a9862f);
	text-decoration: none;
}

.zardis-mag .wd-post .wd-post-excerpt {
	display: -webkit-box;
	overflow: hidden;
	margin: 0;
	color: var(--ztk-ink-soft, #5a6169);
	font-size: 13px;
	line-height: 1.95;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	line-clamp: 3;
}

/* A quiet "read" affordance that keeps the whole card clickable. */
.zardis-mag .wd-post .wd-post-content::after {
	content: "ادامه مطلب";
	align-self: flex-start;
	margin-block-start: auto;
	padding-block-start: 10px;
	color: var(--ztk-gold-deep, #a9862f);
	font-size: 12.5px;
	font-weight: 800;
}

/* ---------- listing: grid spacing ----------------------------------- */

.zardis-mag .wd-blog-holder {
	--wd-gap-lg: 22px;
	--wd-gap-sm: 16px;
}

/* ---------- single article body ------------------------------------- */

.single-post.zardis-mag .entry-content,
.zardis-mag .zardis-article {
	font-size: 15.5px;
	line-height: 2.05;
	color: var(--ztk-ink, #1d2327);
}

.single-post.zardis-mag .entry-content > * + * {
	margin-block-start: 1.05em;
}

.single-post.zardis-mag .entry-content h2,
.single-post.zardis-mag .entry-content h3 {
	margin-block-start: 1.9em;
	margin-block-end: .6em;
	padding-block-end: .35em;
	border-block-end: 2px solid var(--ztk-gold-soft, #f6edda);
	font-weight: 800;
	line-height: 1.55;
}

.single-post.zardis-mag .entry-content h2 {
	font-size: 22px;
}

.single-post.zardis-mag .entry-content h3 {
	font-size: 18.5px;
	border-block-end-width: 1px;
}

.single-post.zardis-mag .entry-content a {
	color: var(--ztk-gold-deep, #a9862f);
	text-decoration: underline;
	text-underline-offset: 3px;
	text-decoration-thickness: 1px;
}

.single-post.zardis-mag .entry-content a:hover {
	color: var(--ztk-navy, #001944);
}

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

.single-post.zardis-mag .entry-content li + li {
	margin-block-start: .45em;
}

.single-post.zardis-mag .entry-content li::marker {
	color: var(--ztk-gold, #c9a247);
	font-weight: 700;
}

.single-post.zardis-mag .entry-content img {
	border-radius: 14px;
	box-shadow: 0 10px 28px rgba(0, 25, 68, .10);
}

.single-post.zardis-mag .entry-content blockquote {
	margin-block: 1.6em;
	padding: 16px 20px;
	border-inline-start: 4px solid var(--ztk-gold, #c9a247);
	border-radius: 0 12px 12px 0;
	background: var(--ztk-surface-alt, #f7f8fa);
	color: var(--ztk-ink-soft, #5a6169);
	font-style: normal;
}

.single-post.zardis-mag .entry-content blockquote > :first-child {
	margin-block-start: 0;
}

.single-post.zardis-mag .entry-content blockquote > :last-child {
	margin-block-end: 0;
}

.single-post.zardis-mag .entry-content table {
	width: 100%;
	border-collapse: collapse;
	overflow: hidden;
	border-radius: 12px;
	font-size: 14px;
}

.single-post.zardis-mag .entry-content th,
.single-post.zardis-mag .entry-content td {
	padding: 10px 12px;
	border: 1px solid var(--ztk-line, rgba(0, 25, 68, .12));
	text-align: start;
}

.single-post.zardis-mag .entry-content th {
	background: var(--ztk-surface-alt, #f7f8fa);
	font-weight: 800;
}

/* ---------- single article: header ---------------------------------- */

.single-post.zardis-mag .entry-header .entry-title {
	font-size: clamp(22px, 3vw, 32px);
	font-weight: 800;
	line-height: 1.55;
}

/* ---------- responsive ---------------------------------------------- */

@media (max-width: 767px) {
	.zardis-mag .wd-post .wd-post-content {
		padding: 14px 14px 16px;
	}

	.zardis-mag .wd-post .wd-post-title {
		font-size: 15px;
	}

	.zardis-mag .wd-post .wd-post-thumb {
		aspect-ratio: 16 / 9;
	}

	.single-post.zardis-mag .entry-content {
		font-size: 15px;
		line-height: 2;
	}
}

@media (prefers-reduced-motion: reduce) {
	.zardis-mag .wd-post,
	.zardis-mag .wd-post .wd-post-img img {
		transition: none;
	}

	.zardis-mag .wd-post:hover {
		transform: none;
	}

	.zardis-mag .wd-post:hover .wd-post-img img {
		transform: none;
	}
}

/* ---------- richer article cards ------------------------------------- */

/*
 * Second pass on the listing: a category ribbon, a bigger title, a header
 * strip on the image and a clearer call to action. Everything stays inside
 * `.zardis-mag`, so other blog elements are unaffected.
 */

.zardis-mag .wd-post.blog-post-loop {
	border-radius: 20px;
}

.zardis-mag .wd-post .wd-post-thumb {
	aspect-ratio: 16 / 9;
	border-radius: 20px 20px 0 0;
}

/* Gradient scrim so the category chip stays readable on any photo. */
.zardis-mag .wd-post .wd-post-thumb::after {
	content: "";
	position: absolute;
	inset-block-start: 0;
	inset-inline: 0;
	height: 45%;
	background: linear-gradient(180deg, rgba(0, 15, 43, .55) 0%, rgba(0, 15, 43, 0) 100%);
	pointer-events: none;
	z-index: 1;
}

/* Category chip pulled from the first category link on the card. */
.zardis-mag .wd-post .wd-post-cat {
	position: absolute;
	inset-block-start: 12px;
	inset-inline-start: 12px;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	max-inline-size: calc(100% - 24px);
	padding: 5px 12px;
	border-radius: 999px;
	background: rgba(255, 255, 255, .92);
	color: var(--ztk-navy);
	font-size: 11.5px;
	font-weight: 800;
	line-height: 1.4;
	text-decoration: none;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
}

.zardis-mag .wd-post .wd-post-cat:hover,
.zardis-mag .wd-post .wd-post-cat:focus {
	background: var(--ztk-gold);
	color: #14181c;
	text-decoration: none;
}

.zardis-mag .wd-post .wd-post-content {
	gap: 10px;
	padding: 18px 20px 22px;
}

.zardis-mag .wd-post .wd-post-title {
	font-size: 17px;
	line-height: 1.6;
	font-weight: 800;
}

.zardis-mag .wd-post .wd-post-title a {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.zardis-mag .wd-post .wd-post-excerpt {
	font-size: 13.5px;
	line-height: 1.95;
	-webkit-line-clamp: 3;
	line-clamp: 3;
}

/* The faux "continue" link becomes a real pill. */
.zardis-mag .wd-post .wd-post-content::after {
	content: "ادامه مطلب";
	align-self: flex-start;
	margin-block-start: auto;
	padding: 7px 14px;
	border: 1px solid rgba(201, 162, 71, .45);
	border-radius: 999px;
	background: transparent;
	color: var(--ztk-gold-deep);
	font-size: 12.5px;
	font-weight: 800;
	transition: background-color .18s ease, color .18s ease;
}

.zardis-mag .wd-post:hover .wd-post-content::after {
	background: var(--ztk-gold);
	border-color: var(--ztk-gold);
	color: #14181c;
}

/* Date pill, slimmer and aligned with the new rhythm. */
.zardis-mag .wd-post .wd-post-date {
	font-size: 11.5px;
	padding: 3px 10px;
}

@media (hover: none) {
	/* On touch there is no hover, so show the CTA in its active colours. */
	.zardis-mag .wd-post .wd-post-content::after {
		background: var(--ztk-gold-soft);
	}
}

@media (max-width: 767px) {
	.zardis-mag .wd-post.blog-post-loop {
		border-radius: 16px;
	}

	.zardis-mag .wd-post .wd-post-thumb {
		border-radius: 16px 16px 0 0;
		aspect-ratio: 16 / 10;
	}

	.zardis-mag .wd-post .wd-post-title {
		font-size: 15.5px;
	}

	.zardis-mag .wd-post .wd-post-content {
		padding: 14px 16px 18px;
	}
}
