/*
 * Home block "Popular wardrobes". Source: wordpress/aronex mvp/Home.dc.html.
 * Mobile first (390): 2 columns. Desktop from 1024px (1440): 4 columns.
 * Colors and sizes come only from assets/css/tokens.css.
 */

.aronex-popular {
	padding: var(--space-6) var(--space-5) var(--space-6);
	background: var(--color-bg);
}

.aronex-popular__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--space-4);
	margin-bottom: var(--space-5);
}

.aronex-popular__title {
	margin: 0;
	font-size: var(--text-xl);
	line-height: var(--leading-h3);
	font-weight: var(--font-weight-medium);
	color: var(--color-text);
}

.aronex-popular__all {
	font-size: var(--text-sm);
	color: var(--color-link);
	text-decoration: none;
	white-space: nowrap;
}

.aronex-popular__all:hover {
	color: var(--color-link-hover);
	text-decoration: underline;
}

.aronex-popular__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--space-7) var(--space-4);
	margin: 0;
	padding: 0;
	list-style: none;
}

/*
 * Which cards are visible per breakpoint is set in popular.php (full rows only).
 * Mobile: hide the ones marked for mobile. Tablet and desktop override below.
 */
.aronex-popular__item--hide-mobile {
	display: none;
}

.aronex-popular__card {
	display: flex;
	flex-direction: column;
	gap: var(--space-2);
	color: var(--color-text);
	text-decoration: none;
}

.aronex-popular__card:focus-visible {
	outline: 2px solid var(--color-focus);
	outline-offset: 4px;
	border-radius: var(--radius-md);
}

.aronex-popular__media {
	display: block;
	aspect-ratio: 3 / 4;
	overflow: hidden;
	border-radius: var(--radius-md);
	background: var(--color-bg-muted);
}

.aronex-popular__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.aronex-popular__card:hover .aronex-popular__media img {
	transform: scale(1.02);
}

.aronex-popular__name {
	font-size: var(--text-base);
	font-weight: var(--font-weight-medium);
	line-height: 1.3;
}

.aronex-popular__sizes {
	font-size: var(--text-xs);
	line-height: var(--leading-caption);
	color: var(--color-text-muted);
}

.aronex-popular__price {
	font-size: var(--text-base);
	font-weight: var(--font-weight-bold);
	color: var(--color-price);
}

.aronex-popular__price-prefix {
	font-weight: var(--font-weight-regular);
}

/* Tablet and large phones: three smaller columns, so photos do not fill the screen */
@media (min-width: 600px) {
	.aronex-popular__grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: var(--space-6) var(--space-4);
	}

	.aronex-popular__item--hide-mobile {
		display: list-item;
	}

	.aronex-popular__item--hide-tablet {
		display: none;
	}
}

/* Desktop */
@media (min-width: 1024px) {
	.aronex-popular {
		padding: var(--space-7) var(--gutter-desktop);
	}

	/* Keep the block at container width on large monitors so the photos do not grow with the screen */
	.aronex-popular__head,
	.aronex-popular__grid {
		max-width: var(--container-max);
		margin-inline: auto;
	}

	.aronex-popular__head {
		margin-bottom: var(--space-7);
	}

	.aronex-popular__title {
		font-size: var(--text-3xl);
		line-height: var(--leading-h2);
	}

	.aronex-popular__all {
		font-size: var(--text-base);
	}

	.aronex-popular__grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
		gap: var(--space-7) var(--space-6);
	}

	.aronex-popular__item--hide-tablet {
		display: list-item;
	}

	.aronex-popular__item--hide-desktop {
		display: none;
	}

	.aronex-popular__card {
		gap: var(--space-3);
	}

	/* Block width stays the same; only the photo is narrower, centred in its column, text centred under it */
	.aronex-popular__card {
		align-items: center;
		text-align: center;
	}

	.aronex-popular__media {
		aspect-ratio: 4 / 5;
		width: 85%;
	}

	.aronex-popular__name {
		font-size: var(--text-md);
	}

	.aronex-popular__sizes {
		font-size: var(--text-sm);
	}

	.aronex-popular__price {
		font-size: var(--text-base);
	}
}
