/* ==========================================================================
   CPT Réalisation - Showcase / Filtre + Grille
   ========================================================================== */

.rs-showcase {
	--rs-columns: 4;
}

/* ---------- Filtre horizontal ---------- */

.rs-filter {
	position: relative;
	background: #f0f0f0;
	border-radius: 16px;
	margin: 0 0 32px;
	overflow: visible; /* les items agrandis (hover/actif) doivent pouvoir dépasser de l'ul */
}

.rs-filter__list {
	position: relative;
	display: flex;
	list-style: none;
	margin: 0;
	padding: 0;
	z-index: 2;
}

.rs-filter__item {
	flex: 1 1 0;
	min-width: 0;
	height: 78px; /* hauteur fixe de la barre, indépendante de l'agrandissement au survol */
	position: relative;
	z-index: 2;
}

.rs-filter__item:hover,
.rs-filter__item.is-active {
	z-index: 3; /* passe au-dessus des items voisins quand il dépasse verticalement */
}

.rs-filter__item a {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 3px;
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 16px 20px;
	text-decoration: none;
	color: #191919;
	border-radius: 12px;
	cursor: pointer;
	transition: color .3s ease, background-color .3s ease, top .35s cubic-bezier(.34, 1.56, .64, 1), bottom .35s cubic-bezier(.34, 1.56, .64, 1);
}

/* Item plus grand en hauteur que l'ul, au survol ou à l'état actif */
.rs-filter__item:hover a,
.rs-filter__item.is-active a {
	top: -14px;
	bottom: -14px;
}

.rs-filter__label {
	font-weight: 700;
	font-size: 14px;
	text-transform: uppercase;
	letter-spacing: .03em;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.rs-filter__desc {
	font-size: 12.5px;
	font-weight: 400;
	line-height: 1.3;
	opacity: .85;
}

/* Couleur de survol propre à chaque item (définie via le champ ACF "couleur"),
   appliquée aussi à l'état actif : le background de .is-active suit celui du survol. */
.rs-filter__item.is-active a,
.rs-filter__item:hover a {
	background-color: var(--rs-item-color, #191919);
	color: #fff;
}

/* Indicateur qui glisse d'un item à l'autre avec un effet "élastique" */
.rs-filter__indicator {
	position: absolute;
	top: 0;
	left: 0;
	height: 100%;
	width: 0;
	background: #0b3d6d;
	border-radius: 12px;
	z-index: 1;
	transition:
		transform .55s cubic-bezier(.34, 1.56, .64, 1),
		width .55s cubic-bezier(.34, 1.56, .64, 1);
	will-change: transform, width;
}

@media (max-width: 992px) {
	.rs-filter__desc { display: none; }
}

@media (max-width: 700px) {
	.rs-filter__list { flex-wrap: wrap; }
	.rs-filter__item { flex: 1 1 45%; }
	.rs-filter { border-radius: 12px; }
	.rs-filter__indicator { display: none; } /* le wrap casse le calcul de position, on masque proprement */
}

/* ---------- Grille des réalisations ---------- */

.rs-grid {
	position: relative;
	display: grid;
	grid-template-columns: repeat(var(--rs-columns), 1fr);
	gap: 20px;
	transition: opacity .25s ease;
}

.rs-grid.is-loading {
	opacity: .4;
	pointer-events: none;
}

.rs-item {
	position: relative;
	overflow: hidden;
	border-radius: 6px;
	aspect-ratio: 1 / 1;
	background: #eaeaea;
}

.rs-item__link {
	display: block;
	width: 100%;
	height: 100%;
	position: relative;
}

.rs-item__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .5s ease;
}

.rs-item__img--placeholder {
	background: linear-gradient(135deg, #dcdcdc, #efefef);
}

.rs-item:hover .rs-item__img {
	transform: scale(1.06);
}

.rs-item__title {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	background: #191919;
	color: #fff;
	padding: 14px 16px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
	transform: translateY(100%);
	transition: transform .4s cubic-bezier(.22, 1, .36, 1);
}

.rs-item:hover .rs-item__title {
	transform: translateY(0);
}

.rs-grid__empty {
	grid-column: 1 / -1;
	text-align: center;
	color: #777;
	padding: 40px 0;
}

@media (max-width: 992px) {
	.rs-grid { grid-template-columns: repeat(3, 1fr) !important; }
}

@media (max-width: 700px) {
	.rs-grid { grid-template-columns: repeat(2, 1fr) !important; }
}

@media (max-width: 480px) {
	.rs-grid { grid-template-columns: 1fr !important; }
}

/* ---------- Pagination ---------- */

.rs-pagination-wrapper {
	display: flex;
	justify-content: center;
	margin-top: 36px;
	transition: opacity .25s ease;
}

.rs-pagination-wrapper.is-loading {
	opacity: .4;
	pointer-events: none;
}

.rs-pagination {
	display: flex;
	align-items: center;
	gap: 8px;
}

.rs-pagination__list {
	display: flex;
	align-items: center;
	gap: 4px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.rs-pagination__num,
.rs-pagination__arrow {
	min-width: 36px;
	height: 36px;
	padding: 0 10px;
	border: none;
	background: #f0f0f0;
	color: #191919;
	border-radius: 8px;
	font-weight: 600;
	font-size: 14px;
	line-height: 1;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: background-color .25s ease, color .25s ease;
}

.rs-pagination__arrow {
	font-size: 18px;
}

.rs-pagination__num:hover,
.rs-pagination__arrow:hover:not(:disabled) {
	background: #191919;
	color: #fff;
}

.rs-pagination__num.is-active {
	background: #0b3d6d;
	color: #fff;
	cursor: default;
}

.rs-pagination__arrow:disabled {
	opacity: .35;
	cursor: not-allowed;
}

.rs-pagination__ellipsis {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 24px;
	color: #999;
}

@media (max-width: 480px) {
	.rs-pagination__num,
	.rs-pagination__arrow {
		min-width: 32px;
		height: 32px;
		font-size: 13px;
	}
}
