/* ── Vicuña News Grid ──────────────────────────────────────── */

.vng-widget {
	width: 100%;
}

/* ── Filter Tabs ───────────────────────────────────────────── */

.vng-filter-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: center;
	margin-bottom: 24px;
}

.vng-tab {
	display: inline-block;
	padding: 6px 18px;
	background: transparent;
	color: #333333;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.4;
	transition: background-color 0.2s ease, color 0.2s ease;
	white-space: nowrap;
}

.vng-tab:hover,
.vng-tab.is-active {
	background-color: #c0392b;
	color: #ffffff;
}

/* ── Grid ──────────────────────────────────────────────────── */

.vng-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 12px;
}

/* ── Grid Item ─────────────────────────────────────────────── */

.vng-item {
	display: block;
	position: relative;
	overflow: hidden;
	text-decoration: none;
	border-radius: 8px;
	cursor: pointer;
}

.vng-item.is-hidden {
	display: none;
}

/* ── Image ─────────────────────────────────────────────────── */

.vng-image {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	width: 100%;
	height: 100%;
}

/* Override theme img resets (e.g. "img { height: auto; }") */
.vng-image img,
.vng-image img[src] {
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	max-height: none !important;
	object-fit: cover;
	transition: transform 0.4s ease;
}

.vng-item:hover .vng-image img {
	transform: scale(1.03); /* zoom mínimo, sin más efectos */
}

.vng-no-image {
	position: absolute;
	top: 0; left: 0; right: 0; bottom: 0;
	background-color: #cccccc;
}

/* ── Hover Overlay — caja inferior (default) ───────────────── */

.vng-overlay {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	height: auto;                         /* evita que el tema estire el overlay */
	max-height: 130px;                    /* franja fija: nunca sube más de 130px */
	overflow: hidden;                     /* el contenido se recorta si supera el max-height */
	/* Sin top: el alto viene del contenido */
	background-color: rgba(72, 30, 100, 0.88);
	transform: translateY(100%);          /* empieza abajo, oculto */
	transition: transform 0.3s ease;
	pointer-events: none;
	z-index: 2;
}

/* Overlay solo para la destacada — en hover NO aparece */
/* .vng-item:hover .vng-overlay → eliminado */


/* ── Contenido del overlay ─────────────────────────────────── */

.vng-overlay-inner {
	padding: 20px;
	width: 100%;
}

/* ── Overlay Text ──────────────────────────────────────────── */

.vng-item-badge {
	display: inline-block;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #ffffff;
	background: rgba(255,255,255,0.2);
	padding: 3px 8px;
	border-radius: 4px;
	margin-bottom: 8px;
}

.vng-item-title {
	font-size: 16px;
	font-weight: 700;
	color: #ffffff;
	margin: 0 0 8px;
	line-height: 1.3;
	word-break: break-word;
}

.vng-item-excerpt {
	font-size: 13px;
	color: rgba(255,255,255,0.88);
	margin: 0;
	line-height: 1.5;
}

.vng-item-read-more {
	display: inline-block;
	margin-top: 10px;
	font-size: 12px;
	font-weight: 600;
	color: rgba(255,255,255,0.75);
	text-decoration: underline;
	text-underline-offset: 3px;
	transition: color 0.2s ease;
}

.vng-item:hover .vng-item-read-more { color: #ffffff; }

/* ── No posts ──────────────────────────────────────────────── */

.vng-no-posts {
	grid-column: 1 / -1;
	text-align: center;
	color: #888;
	font-size: 14px;
	padding: 40px 0;
}

/* ── More Button ───────────────────────────────────────────── */

.vng-more-wrap {
	display: flex;
	justify-content: center;
	margin-top: 32px;
}

.vng-more-btn {
	display: inline-block;
	padding: 12px 40px;
	background: transparent;
	color: #333333;
	border: 1px solid #333333;
	border-radius: 4px;
	text-decoration: none;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.vng-more-btn:hover {
	background-color: #333333;
	color: #ffffff;
	transform: translateY(-1px);
}

.vng-more-btn:active {
	transform: translateY(0);
}

/* ── Post Destacado — franja siempre visible (no hover needed) */

.vng-item--featured .vng-overlay {
	transform: translateY(0) !important; /* visible sin hover */
	/* max-height: 130px se hereda del base — solo franja, no card completa */
}

/* ── Masonry Layout ────────────────────────────────────────── */

/* Masonry grid: filas pequeñas, JS calcula el span de cada item */
.vng-widget--masonry .vng-grid {
	grid-template-rows: masonry; /* nativo Firefox flag — JS como fallback */
	align-items: start;
}

/* Item masonry: sin aspect-ratio, fluye con el contenido */
.vng-item--masonry {
	aspect-ratio: unset !important;
	padding-top: 0 !important;
}

/* Imagen masonry: fluye normalmente, no absolute */
.vng-image--masonry {
	position: static !important;
	width: 100%;
	height: auto !important;
}

.vng-image--masonry img,
.vng-image--masonry img[src] {
	width: 100% !important;
	height: auto !important;
	max-height: none !important;
	display: block;
	object-fit: cover;
}

/* Overlay en masonry: siempre al final de la imagen */
.vng-item--masonry .vng-overlay {
	position: absolute;
	bottom: 0; left: 0; right: 0;
	top: auto;
}

.vng-item--masonry {
	/* Necesario para que la overlay sea relativa al item */
	position: relative;
	overflow: hidden;
}

/* ── Filter animation ──────────────────────────────────────── */

.vng-item {
	transition: opacity 0.25s ease, transform 0.25s ease;
}

.vng-item.is-hidden {
	display: none;
}

/* ── Responsive: 1024px ────────────────────────────────────── */

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

/* ── Responsive: 768px ─────────────────────────────────────── */

@media (max-width: 768px) {
	.vng-filter-tabs {
		gap: 6px;
		margin-bottom: 18px;
	}

	.vng-tab {
		font-size: 12px;
		padding: 5px 14px;
	}

	.vng-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 8px;
	}

	.vng-item-title    { font-size: 14px; }
	.vng-item-excerpt  { font-size: 12px; }
	.vng-overlay-inner { padding: 14px; }

	.vng-more-btn { padding: 10px 32px; font-size: 12px; }
}

/* ── Responsive: 480px ─────────────────────────────────────── */

@media (max-width: 480px) {
	.vng-grid {
		grid-template-columns: 1fr;
		gap: 8px;
	}

	.vng-filter-tabs { gap: 4px; }

	.vng-tab { font-size: 11px; padding: 4px 12px; }

	.vng-item-title   { font-size: 14px; }
	.vng-item-excerpt { font-size: 12px; }

	.vng-more-wrap { margin-top: 20px; }
	.vng-more-btn  { padding: 9px 24px; font-size: 11px; }
}
