/* ======================================================================
   Vexona — «طرح‌های آماده» (ready designs) section
   Theme stylesheet:  wp-content/themes/vexona/assets/css/ready-designs.css

   All component classes are prefixed with .vx-ready-
   (the approximate-preview note uses the contract class .vx-approx-note)

   Depends on the theme tokens:
     --bg --surface --ink --muted --line --brass-text --r --r-lg
   ====================================================================== */

.vx-ready-section {
	margin: 32px 0 48px;
	font-family: "Vazirmatn", system-ui, -apple-system, sans-serif;
	color: var(--ink);
	content-visibility: auto;
	contain-intrinsic-size: auto 560px;
}

/* Header & Approximate Note */
.vx-ready-header {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px 16px;
	margin-bottom: 18px;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--line);
}

.vx-ready-titles {
	min-width: 0;
}

.vx-ready-heading {
	margin: 0;
	font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
	font-weight: 800;
	line-height: 1.6;
	letter-spacing: -0.01em;
	color: var(--ink);
}

.vx-approx-note {
	margin: 4px 0 0;
	font-size: 0.78rem;
	font-weight: 400;
	line-height: 1.8;
	color: var(--muted);
}

.vx-ready-section .vx-approx-note[hidden] {
	display: none;
}

/* Grid — Mobile-first: 2 columns, scaling up calmly on larger screens */
.vx-ready-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px;
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 640px) {
	.vx-ready-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 18px;
	}
}

@media (min-width: 1024px) {
	.vx-ready-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
		gap: 20px;
	}
}

@media (min-width: 1440px) {
	.vx-ready-grid {
		grid-template-columns: repeat(5, minmax(0, 1fr));
		gap: 22px;
	}
}

/* Few-items handling (1–2 cards): prevent lonely stretched or broken rows */
.vx-ready-grid--single {
	grid-template-columns: minmax(0, 460px);
}

.vx-ready-grid--pair {
	grid-template-columns: repeat(auto-fit, minmax(260px, 460px));
}

@media (min-width: 480px) {
	.vx-ready-grid--few .vx-ready-link {
		flex-direction: row;
		align-items: center;
		padding: 14px;
		gap: 16px;
	}

	.vx-ready-grid--few .vx-ready-preview {
		width: 168px;
		flex: 0 0 168px;
	}

	.vx-ready-grid--few .vx-ready-body {
		padding: 0;
		justify-content: center;
		gap: 6px;
	}

	.vx-ready-grid--few .vx-ready-name {
		white-space: normal;
		display: -webkit-box;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
	}
}

/* Card & Interactive Link */
.vx-ready-card {
	min-width: 0;
	display: flex;
}

.vx-ready-link {
	position: relative;
	flex: 1 1 auto;
	width: 100%;
	min-height: 44px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 10px 10px 14px;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--r-lg);
	color: var(--ink);
	text-decoration: none;
	-webkit-tap-highlight-color: transparent;
	transition:
		border-color 0.25s ease,
		box-shadow 0.25s ease,
		transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (hover: hover) {
	.vx-ready-link:hover {
		border-color: var(--brass-text);
		box-shadow: 0 12px 28px -8px rgba(0, 0, 0, 0.09);
		transform: translateY(-2px);
	}
}

.vx-ready-link:focus {
	outline: none;
}

.vx-ready-link:focus-visible {
	border-color: var(--brass-text);
	outline: 2px solid var(--brass-text);
	outline-offset: 3px;
}

.vx-ready-link:active {
	transform: translateY(0);
}

/* Preview Frame: 3/4 editorial mat with subtle inner ring */
.vx-ready-preview {
	position: relative;
	width: 100%;
	aspect-ratio: 3 / 4;
	overflow: hidden;
	border-radius: var(--r);
	background: var(--bg);
	box-shadow: inset 0 0 0 1px var(--line);
	display: flex;
	align-items: center;
	justify-content: center;
}

.vx-ready-preview > * {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (hover: hover) {
	.vx-ready-link:hover .vx-ready-preview > * {
		transform: scale(1.025);
	}
}

/* Card Typography & Hierarchy */
.vx-ready-body {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 0 4px;
	min-width: 0;
	flex: 1 1 auto;
}

.vx-ready-name {
	display: block;
	font-size: 0.9rem;
	font-weight: 600;
	line-height: 1.65;
	color: var(--ink);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	text-align: start;
}

.vx-ready-cta {
	margin-top: auto;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 0.78rem;
	font-weight: 700;
	line-height: 1.7;
	color: var(--brass-text);
	text-align: start;
}

.vx-ready-arrow {
	display: inline-block;
	font-weight: 400;
	transition: transform 0.2s ease;
}

@media (hover: hover) {
	.vx-ready-link:hover .vx-ready-arrow {
		transform: translateX(-3px);
	}
}

/* Footer: «همهٔ طرح‌ها» editorial pill link */
.vx-ready-footer {
	margin-top: 22px;
	display: flex;
	justify-content: flex-end;
}

.vx-ready-all {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 44px;
	padding: 8px 18px;
	font-size: 0.85rem;
	font-weight: 700;
	line-height: 1.6;
	color: var(--ink);
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--r);
	text-decoration: none;
	-webkit-tap-highlight-color: transparent;
	transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

@media (hover: hover) {
	.vx-ready-all:hover {
		border-color: var(--brass-text);
		color: var(--brass-text);
	}

	.vx-ready-all:hover .vx-ready-all-icon {
		transform: translateX(-3px);
	}
}

.vx-ready-all:focus {
	outline: none;
}

.vx-ready-all:focus-visible {
	border-color: var(--brass-text);
	outline: 2px solid var(--brass-text);
	outline-offset: 3px;
}

.vx-ready-all-icon {
	display: inline-block;
	color: var(--brass-text);
	transition: transform 0.2s ease;
}

/* Empty state: hidden whenever the ready-designs section rendered. */
body.vx-has-ready-designs .store-empty {
	display: none !important;
}

@media (prefers-reduced-motion: reduce) {
	.vx-ready-link,
	.vx-ready-preview > *,
	.vx-ready-arrow,
	.vx-ready-all,
	.vx-ready-all-icon {
		transition: none;
	}

	.vx-ready-link:hover,
	.vx-ready-link:focus,
	.vx-ready-link:hover .vx-ready-preview > *,
	.vx-ready-link:hover .vx-ready-arrow,
	.vx-ready-all:hover .vx-ready-all-icon {
		transform: none;
	}
}
