/**
 * Custom Facebook Feed Light — clone visuel Elfsight / Facebook
 * Spécificité haute pour résister aux styles du thème WP.
 */

.cffl-feed {
	--cffl-blue: #0866ff;
	--cffl-blue-link: #14B9DF;
	--cffl-text: #080809;
	--cffl-muted: #65686c;
	--cffl-border: #d0d3d7;
	--cffl-card: #ffffff;
	--cffl-gap-cards: 25px;
	--cffl-radius: 0px;
	--cffl-media-h: 372px;
	--cffl-gutter: 2px;

	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	margin: 0;
	padding: 30px;
	background-color: #FAFAFA;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--cffl-text);
	line-height: 1.3333;
	-webkit-font-smoothing: antialiased;
}

.cffl-feed *,
.cffl-feed *::before,
.cffl-feed *::after {
	box-sizing: border-box;
}

.cffl-feed .cffl-feed__empty {
	margin: 0;
	padding: 1.25rem 0;
	color: var(--cffl-muted);
	text-align: center;
	font-size: 15px;
}

.cffl-feed .cffl-feed__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--cffl-gap-cards);
	margin: 0;
	padding: 0;
	list-style: none;
}

.cffl-feed .cffl-card {
	display: flex;
	flex-direction: column;
	min-width: 0;
	height: 100%;
	margin: 0;
	overflow: hidden;
	background: var(--cffl-card);
	border: none;
	border-radius: var(--cffl-radius);
	box-shadow:
		0 1px 2px rgba(0, 0, 0, 0.1),
		0 0 0 1px rgba(0, 0, 0, 0.05);
}

.cffl-feed .cffl-card--no-media {
	height: auto;
	align-self: start;
}

.cffl-feed .cffl-card[hidden],
.cffl-feed .cffl-card.is-collapsed:not(.is-animating) {
	display: none !important;
}

.cffl-feed .cffl-card.is-animating {
	display: flex !important;
	will-change: max-height, opacity;
}

@media (prefers-reduced-motion: reduce) {
	.cffl-feed .cffl-card.is-animating {
		transition: none !important;
	}
}

/* —— Header Facebook —— */
.cffl-feed .cffl-card__header {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	padding: 12px 12px 0;
}

.cffl-feed .cffl-card__avatar {
	flex: 0 0 40px;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	object-fit: cover;
	background: #e4e6eb;
}

.cffl-feed .cffl-card__avatar--fallback {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 15px;
	font-weight: 700;
	color: #fff;
	background: var(--cffl-blue);
}

.cffl-feed .cffl-card__meta {
	flex: 1 1 auto;
	min-width: 0;
	padding-top: 2px;
}

.cffl-feed .cffl-card__author {
	display: block;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	color: var(--cffl-text);
	text-decoration: none;
}

.cffl-feed a.cffl-card__author:hover,
.cffl-feed a.cffl-card__author:focus-visible {
	text-decoration: underline;
	outline: none;
}

.cffl-feed .cffl-card__date-row {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin-top: 1px;
	color: var(--cffl-muted);
}

.cffl-feed .cffl-card__date {
	font-size: 13px;
	font-weight: 400;
	line-height: 1.2;
}

.cffl-feed .cffl-card__globe {
	display: inline-flex;
	width: 12px;
	height: 12px;
	opacity: 0.8;
}

.cffl-feed .cffl-card__globe svg {
	display: block;
	width: 12px;
	height: 12px;
}

.cffl-feed .cffl-card__menu {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	margin: -6px -4px 0 0;
	border-radius: 50%;
	color: var(--cffl-muted);
	text-decoration: none;
	transition: background 0.15s ease;
}

.cffl-feed .cffl-card__menu:hover {
	background: #f2f3f5;
}

.cffl-feed .cffl-card__menu svg {
	display: block;
}

/* —— Texte —— */
.cffl-feed .cffl-card__text {
	padding: 6px 12px 10px;
}

/* Replié : texte + « En voir plus » sur la même ligne */
.cffl-feed .cffl-card__text:not(.is-expanded) .cffl-card__message {
	display: inline;
	margin: 0;
}

.cffl-feed .cffl-card__text:not(.is-expanded) .cffl-card__see-more {
	display: inline;
	margin-left: 0.2em;
}

/* Déplié : texte complet, puis « Afficher moins » en dessous */
.cffl-feed .cffl-card__text.is-expanded .cffl-card__message {
	display: block;
	margin: 0;
}

.cffl-feed .cffl-card__text.is-expanded .cffl-card__see-more {
	display: block;
	margin: 8px 0 0;
}

.cffl-feed .cffl-card__message {
	font-size: 15px;
	font-weight: 400;
	line-height: 1.3333;
	color: var(--cffl-text);
	word-wrap: break-word;
}

.cffl-feed .cffl-card__see-more {
	padding: 0;
	border: 0;
	background: none;
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: inherit;
	color: var(--cffl-blue-link);
	cursor: pointer;
}

.cffl-feed .cffl-card__see-more:hover,
.cffl-feed .cffl-card__see-more:focus-visible {
	text-decoration: underline;
	outline: none;
}

/* —— Collage photos (cœur du look Elfsight) —— */
.cffl-feed .cffl-card__media {
	display: grid;
	gap: var(--cffl-gutter);
	width: 100%;
	height: var(--cffl-media-h);
	margin-top: auto;
	background: #1c1e21;
	overflow: hidden;
}

.cffl-feed .cffl-card__shot {
	position: relative;
	display: block;
	min-width: 0;
	min-height: 0;
	height: 100%;
	overflow: hidden;
	background: #242526;
}

.cffl-feed .cffl-card__shot.is-empty,
.cffl-feed .cffl-card__shot.is-video:not(:has(img:not(.is-broken))) {
	background: #1c1e21;
}

.cffl-feed .cffl-card__play {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
	z-index: 1;
}

.cffl-feed .cffl-card__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	background: #242526;
}

.cffl-feed .cffl-card__image.is-broken {
	display: none;
}

.cffl-feed .cffl-card__media--one {
	grid-template-columns: 1fr;
	grid-template-rows: 1fr;
}

.cffl-feed .cffl-card__media--two {
	grid-template-columns: 1fr 1fr;
	grid-template-rows: 1fr;
}

.cffl-feed .cffl-card__media--three {
	grid-template-columns: 1.55fr 1fr;
	grid-template-rows: 1fr 1fr;
}

.cffl-feed .cffl-card__media--three .cffl-card__shot:nth-child(1) {
	grid-column: 1;
	grid-row: 1 / span 2;
}

.cffl-feed .cffl-card__media--four {
	grid-template-columns: 1.62fr 1fr;
	grid-template-rows: repeat(3, 1fr);
}

.cffl-feed .cffl-card__media--four .cffl-card__shot:nth-child(1) {
	grid-column: 1;
	grid-row: 1 / span 3;
}

.cffl-feed .cffl-card__media--four .cffl-card__shot:nth-child(2) {
	grid-column: 2;
	grid-row: 1;
}

.cffl-feed .cffl-card__media--four .cffl-card__shot:nth-child(3) {
	grid-column: 2;
	grid-row: 2;
}

.cffl-feed .cffl-card__media--four .cffl-card__shot:nth-child(4) {
	grid-column: 2;
	grid-row: 3;
}

.cffl-feed .cffl-card__more-count {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 28px;
	font-weight: 700;
	letter-spacing: -0.02em;
	color: #fff;
	background: rgba(0, 0, 0, 0.4);
	pointer-events: none;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

/* —— Bouton Voir plus (feed) —— */
.cffl-feed .cffl-feed__actions {
	display: flex;
	justify-content: center;
	margin-top: 20px;
}

.cffl-feed .cffl-feed__more {
	appearance: none;
	min-width: 140px;
	padding: 10px 28px;
	border: 1px solid var(--cffl-border);
	border-radius: 6px;
	background: #fff;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	color: var(--cffl-text);
	cursor: pointer;
	transition: background 0.15s ease;
}

.cffl-feed .cffl-feed__more:hover,
.cffl-feed .cffl-feed__more:focus-visible {
	background: #f2f3f5;
	outline: none;
}

@media (max-width: 1024px) {
	.cffl-feed {
		--cffl-media-h: 320px;
	}

	.cffl-feed .cffl-feed__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	.cffl-feed {
		--cffl-media-h: 280px;
		--cffl-gap-cards: 12px;
	}

	.cffl-feed .cffl-feed__grid {
		grid-template-columns: 1fr;
	}
}
