/*
 * Call Me Gems — archives (grille catégories)
 * Updated: 2026-08-09 15:20 (Europe/Zurich)
 */

/* Titre d'archive : serif, tiret or, aligné à gauche. */
.archive-header {
	margin: 0 0 30px;
}

.archive-title {
	display: flex;
	align-items: center;
	gap: 18px;
	margin: 0;
	font-family: var(--cmg-serif);
	font-weight: 500;
	font-size: 34px;
	line-height: 1.2;
	color: var(--cmg-ink);
}

.archive-title::before {
	content: "";
	flex: 0 0 auto;
	width: 44px;
	height: 2px;
	background: var(--cmg-gold);
}

/* Grille. */
.cmg-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 34px 30px;
}

.cmg-card__link {
	display: block;
	color: var(--cmg-ink);
}

.cmg-card__media {
	position: relative;
	display: block;
	overflow: hidden;
	aspect-ratio: 1 / 1;
	background: #efe9df;
}

.cmg-card__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.5s ease;
}

/* Voile + loupe au survol. */
.cmg-card__media::after {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(28, 26, 23, 0);
	transition: background 0.3s ease;
}

.cmg-card__media::before {
	content: "";
	position: absolute;
	z-index: 1;
	top: 50%;
	left: 50%;
	width: 46px;
	height: 46px;
	margin: -23px 0 0 -23px;
	border-radius: 50%;
	background: rgba(250, 248, 243, 0.92) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a4884f' stroke-width='2' stroke-linecap='round'%3E%3Cline x1='12' y1='7' x2='12' y2='17'/%3E%3Cline x1='7' y1='12' x2='17' y2='12'/%3E%3C/svg%3E") center / 22px 22px no-repeat;
	opacity: 0;
	transform: scale(0.8);
	transition: opacity 0.3s ease, transform 0.3s ease;
	pointer-events: none;
}

.cmg-card__link:hover .cmg-card__media img,
.cmg-card__link:focus-visible .cmg-card__media img {
	transform: scale(1.05);
}

.cmg-card__link:hover .cmg-card__media::after,
.cmg-card__link:focus-visible .cmg-card__media::after {
	background: rgba(28, 26, 23, 0.22);
}

.cmg-card__link:hover .cmg-card__media::before,
.cmg-card__link:focus-visible .cmg-card__media::before {
	opacity: 1;
	transform: scale(1);
}

/* Pastille « Vendu ». */
.cmg-card__badge {
	position: absolute;
	z-index: 2;
	top: 12px;
	left: 12px;
	font-family: var(--cmg-sans);
	font-size: 10px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.16em;
	color: var(--cmg-ivory);
	background: rgba(28, 26, 23, 0.72);
	padding: 5px 10px;
}

/* Titre de carte. */
.cmg-card__title {
	display: block;
	margin-top: 14px;
	font-family: var(--cmg-serif);
	font-size: 18px;
	line-height: 1.3;
	color: var(--cmg-ink);
	text-align: center;
	transition: color 0.2s ease;
}

.cmg-card__link:hover .cmg-card__title,
.cmg-card__link:focus-visible .cmg-card__title {
	color: var(--cmg-gold);
}

/* Pagination. */
.pagination {
	margin-top: 50px;
	text-align: center;
}

.pagination .nav-links {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 6px;
	justify-content: center;
}

.pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 42px;
	height: 42px;
	padding: 0 10px;
	border: 1px solid var(--cmg-rule);
	color: var(--cmg-menu);
	font-family: var(--cmg-serif);
	font-size: 18px;
}

.pagination .page-numbers.current,
.pagination a.page-numbers:hover,
.pagination a.page-numbers:focus {
	background: var(--cmg-gold);
	border-color: var(--cmg-gold);
	color: var(--cmg-ivory);
}

.cmg-empty {
	padding: 30px 0;
	color: var(--cmg-taupe);
}

@media (max-width: 600px) {

	.archive-title {
		font-size: 28px;
		gap: 14px;
	}

	.archive-title::before {
		width: 32px;
	}

	.cmg-grid {
		grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
		gap: 22px 16px;
	}
}
