/**
 * Lefevre Posts Grid Widget - Estilos
 *
 * Grid de 3 columnas, cards misma altura, imagen de fondo, overlay degradado,
 * fecha, título, descripción (3 líneas), Leer más.
 *
 * @package Lefevre_Core
 */

/* Contenedor principal */
.lefevre-posts-grid {
	width: 100%;
}

/* Filtros (botones pill) */
.lefevre-posts-grid__filters {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.75rem;
	margin-bottom: 2rem;
}

.lefevre-posts-grid__filter {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.625rem 1.25rem;
	border: 1px solid transparent;
	border-radius: 9999px;
	font-size: 0.9375rem;
	font-weight: 500;
	cursor: pointer;
	padding: 1.5rem 2rem;
	gap: 0.625rem;
	
	border-radius: 0.5rem;
	background: rgba(96, 96, 107, 0.30);
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.lefevre-posts-grid__filter:hover {
	opacity: 0.9;
}

.lefevre-posts-grid__filter:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* Icono en botón de filtro (desde WordPress > Categorías) */
.lefevre-posts-grid__filter-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	line-height: 0;
}

.lefevre-posts-grid__filter-icon--svg {
	width: 20px;
	height: 20px;
}

.lefevre-posts-grid__filter-icon--svg svg {
	width: 100%;
	height: 100%;
	display: block;
	fill: currentColor;
	stroke: none;
}

.lefevre-posts-grid__filter-icon--img img {
	width: 20px;
	height: 20px;
	object-fit: contain;
	vertical-align: middle;
}

/* Grid 3 columnas, misma altura */
.lefevre-posts-grid__grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1.5rem;
	align-items: stretch;
}

@media (max-width: 1024px) {
	.lefevre-posts-grid__grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 600px) {
	.lefevre-posts-grid__grid {
		grid-template-columns: 1fr;
	}
}

/* Card (article) - misma altura por grid */
.lefevre-posts-grid__card {
	display: flex;
	min-height: 380px;
	transition: opacity 0.25s ease, transform 0.25s ease;
}

.lefevre-posts-grid__card.is-hidden {
	display: none;
}

/* Enlace que ocupa toda la card */
.lefevre-posts-grid__card-link {
	display: flex;
	flex-direction: column;
	width: 100%;
	height: 100%;
	min-height: inherit;
	text-decoration: none;
	position: relative;
	overflow: hidden;
}

.lefevre-posts-grid__card-link:hover {
	text-decoration: none;
}

/* Imagen de fondo */
.lefevre-posts-grid__bg {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	transition: transform 0.5s ease;
}

.lefevre-posts-grid__card-link:hover .lefevre-posts-grid__bg {
	transform: scale(1.05);
}

/* Overlay degradado (transparente a negro) */
.lefevre-posts-grid__overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
}

/* Contenido sobre la imagen */
.lefevre-posts-grid__content {
	position: relative;
	z-index: 2;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	flex: 1;
	min-height: 0;
	padding: 1.5rem;
	box-sizing: border-box;
}

/* Fecha (badge superior) */
.lefevre-posts-grid__date {
	position: absolute;
	top: 1rem;
	left: 1rem;
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	padding: 0.375rem 0.75rem;
	border-radius: 9999px;
	font-size: 0.8125rem;
	font-weight: 500;
	line-height: 1.3;
}

.lefevre-posts-grid__date-icon {
	flex-shrink: 0;
	vertical-align: middle;
}

/* Título */
.lefevre-posts-grid__title {
	margin: 0 0 1rem !important;
	font-size: 1.25rem;
	font-weight: 700;
	line-height: 1.25;
	color: #fff;
}

/* Descripción: máximo 3 líneas con ellipsis */
.lefevre-posts-grid__excerpt {
	margin: 0 0 0.5rem;
	font-size: 0.9375rem;
	line-height: 1.5;
	color: rgba(255, 255, 255, 0.95);
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Post meta (Por autor, fecha, categoría) debajo del excerpt */
.lefevre-posts-grid__post-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem 0.75rem;
	margin: 0 0 0.75rem;
	font-size: 0.75rem;
	line-height: 1.3;
	color: rgba(255, 255, 255, 0.8);
}

.lefevre-posts-grid__meta-item + .lefevre-posts-grid__meta-item::before {
	content: ' · ';
	opacity: 0.9;
}

/* Leer más (texto + flecha) */
.lefevre-posts-grid__link {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	font-size: 0.9375rem;
	font-weight: 500;
	color: #fff;
	transition: opacity 0.2s ease;
}

.lefevre-posts-grid__card-link:hover .lefevre-posts-grid__link {
	opacity: 0.9;
}

.lefevre-posts-grid__link .eicon {
	font-size: 0.85em;
}

/* Mensaje cuando no hay posts */
.lefevre-posts-grid__empty {
	text-align: center;
	padding: 2rem;
	color: #6b7280;
}
