/**
 * Estilos base del grid de embeds de Facebook.
 *
 * Clases disponibles para personalizar desde el tema:
 * - .fb-embed-grid        → contenedor principal
 * - .fb-embed-item        → cada publicación / video
 * - .fbem-is-card         → modo tarjeta activado
 * - .fb-embed-title       → título de la publicación
 * - .fb-embed-media       → contenedor del iframe
 * - .fb-embed-footer      → pie de tarjeta con botón a Facebook
 */

.fb-embed-grid {
	display: grid;
	grid-template-columns: var(--fbem-grid-columns, repeat(auto-fit, minmax(280px, 1fr)));
	gap: var(--fbem-gap, 1.5rem);
	width: 100%;
	margin: 1.5rem 0;
	box-sizing: border-box;
}

/* Alineaciones de elementos en la grilla */
.fb-embed-grid.fbem-align-center {
	justify-items: center;
}

.fb-embed-grid.fbem-align-left {
	justify-items: start;
}

.fb-embed-grid.fbem-align-right {
	justify-items: end;
}

/* Elemento de cada publicación */
.fb-embed-item {
	width: 100%;
	max-width: var(--fbem-item-max-width, 100%);
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
}

/* Modo Tarjeta (Card UI) */
.fb-embed-item.fbem-is-card {
	background-color: var(--fbem-card-bg, #ffffff);
	border-radius: var(--fbem-card-radius, 10px);
	border: var(--fbem-card-border, 1px solid #e4e6eb);
	box-shadow: var(--fbem-card-shadow, 0 2px 8px rgba(0, 0, 0, 0.08));
	padding: var(--fbem-card-padding, 16px);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fb-embed-item.fbem-is-card.fbem-shadow-hover:hover {
	transform: translateY(-3px);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
}

/* Título de la publicación — especificidad aumentada para superar estilos del tema */
.fb-embed-grid .fb-embed-title {
	margin: 0 0 0.85rem 0 !important;
	font-size: var(--fbem-title-size, 1.15rem) !important;
	font-weight: 600;
	line-height: 1.4;
	color: var(--fbem-title-color, inherit) !important;
	font-family: var(--fbem-title-font-family, inherit) !important;
	text-transform: var(--fbem-title-transform, none) !important;
}

/* Truncado de líneas (Line Clamp) */
.fb-embed-grid .fb-embed-title.fbem-clamp-1 {
	display: -webkit-box;
	-webkit-line-clamp: 1;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.fb-embed-grid .fb-embed-title.fbem-clamp-2 {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.fb-embed-grid .fb-embed-title.fbem-clamp-3 {
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.fb-embed-grid .fb-embed-title.fbem-clamp-4 {
	display: -webkit-box;
	-webkit-line-clamp: 4;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Contenedor del iframe — wrapper responsivo */
.fb-embed-media {
	width: 100%;
	flex-grow: 1;
	overflow: hidden;
	border-radius: 4px;
	position: relative;
}

/* El iframe de Facebook tiene width/height fijos en el HTML.
   Usamos !important para que el CSS prevalezca sobre esos atributos. */
.fb-embed-media iframe {
	display: block !important;
	width: 100% !important;
	max-width: 100% !important;
	height: auto !important;
	min-height: 280px;
	border: 0 !important;
}

/* Pie de la tarjeta con enlace a Facebook */
.fb-embed-footer {
	margin-top: 14px;
	padding-top: 10px;
	border-top: 1px solid #f0f2f5;
	display: flex;
	align-items: center;
	justify-content: flex-end;
}

.fb-embed-fb-button {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font-size: 13px;
	font-weight: 600;
	color: #1877f2;
	text-decoration: none;
	padding: 6px 12px;
	border-radius: 6px;
	background: #f0f2f5;
	transition: background 0.15s ease, color 0.15s ease;
	line-height: 1;
}

.fb-embed-fb-button:hover {
	background: #e4e6eb;
	color: #0d65d9;
	text-decoration: none;
}

.fb-embed-fb-button svg {
    width: 15px !important;
    height: 15px !important;
    fill: currentColor;
    flex-shrink: 0;
}
