/* ============================================================
   Feed Cpaysage — Feed front-end
   ============================================================ */

.fcp-grid {
	display: grid;
	grid-template-columns: repeat(var(--fcp-columns, 3), 1fr);
	gap: 12px;
	width: 100%;
}

/* Desktop : on élargit le feed au-delà de la largeur de contenu du thème
   pour que les carrés soient plus grands (le nombre de colonnes reste réglable). */
@media (min-width: 1024px) {
	.fcp-grid {
		width: min(92vw, 1400px);
		margin-left: 50%;
		transform: translateX(-50%);
		gap: 16px;
	}
}

/* Mobile : défilement horizontal (swipe) au lieu de la grille. */
@media (max-width: 767px) {
	.fcp-grid {
		display: flex;
		grid-template-columns: none;
		flex-wrap: nowrap;
		overflow-x: auto;
		overflow-y: hidden;
		scroll-snap-type: x mandatory;
		-webkit-overflow-scrolling: touch;
		scroll-padding: 0 12px;
		/* Marge négative + padding pour un défilement bord à bord. */
		margin-inline: -12px;
		padding-inline: 12px;
		padding-bottom: 6px;
	}

	.fcp-item {
		flex: 0 0 78%;
		max-width: 320px;
		scroll-snap-align: start;
	}

	/* Sur mobile (pas de hover), l'overlay reste visible pour la légende. */
	.fcp-overlay {
		opacity: 1;
		background: linear-gradient(to top, rgba(0,0,0,.65) 0%, rgba(0,0,0,0) 55%);
		justify-content: flex-end;
	}
}

.fcp-item {
	position: relative;
	overflow: hidden;
	border-radius: 4px;
	background: #f0f0f0;
}

.fcp-link {
	display: block;
	text-decoration: none;
	color: inherit;
}

.fcp-media-wrap {
	position: relative;
	width: 100%;
	aspect-ratio: 1 / 1;
	overflow: hidden;
}

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

.fcp-item:hover .fcp-img { transform: scale(1.05); }

.fcp-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,.55);
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	padding: 14px 12px;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.fcp-item:hover .fcp-overlay { opacity: 1; }

.fcp-caption {
	margin: 0 0 6px;
	color: #fff;
	font-size: .82rem;
	line-height: 1.4;
}

.fcp-date {
	color: rgba(255,255,255,.75);
	font-size: .75rem;
}

.fcp-type-icon {
	position: absolute;
	top: 8px;
	right: 8px;
	background: rgba(0,0,0,.5);
	color: #fff;
	font-size: .75rem;
	padding: 3px 6px;
	border-radius: 3px;
	pointer-events: none;
}

.fcp-error {
	padding: 12px 16px;
	border-left: 4px solid #d63638;
	background: #fef2f2;
	color: #b91c1c;
	border-radius: 2px;
	font-size: .9rem;
}

.fcp-empty {
	padding: 12px 16px;
	border-left: 4px solid #a8a8a8;
	background: #fafafa;
	color: #555;
	border-radius: 2px;
	font-size: .9rem;
}
