/* ==========================================================================
   Content Search Grid — estilos
   ========================================================================== */

.csg-wrapper {
	--csg-border: #e4e4e7;
	--csg-radius: 10px;
	--csg-text: #18181b;
	--csg-text-muted: #71717a;
	--csg-badge-bg: #fef2f2;
	--csg-badge-text: #dc2626;
	--csg-badge-border: #fecaca;
	--csg-accent: #16a34a;
	--csg-accent-text: #ffffff;
	--csg-gap: 20px;
	box-sizing: border-box;
	max-width: 1200px;
	margin: 0 auto;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.csg-wrapper *,
.csg-wrapper *::before,
.csg-wrapper *::after {
	box-sizing: border-box;
}

/* ------------------------- Barra de búsqueda ------------------------- */

.csg-search-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1rem;
	padding: 12px;
	margin-bottom: 28px;
	background: #fff;
	width: 100%;
}

.csg-dropdown {
	flex: 0 0 280px;
	display: block;
}

.csg-dropdown-select {
	appearance: none;
	flex: 1;
	-webkit-appearance: none;
	-moz-appearance: none;
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2318181b' stroke-width='1.5' fill='none' fill-rule='evenodd' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center;
	border: 1px solid var(--csg-border);
	border-radius: 8px;
	padding: 11px 36px 11px 14px;
	font-size: 15px;
	font-weight: 500;
	color: var(--csg-text);
	min-width: 160px;
	cursor: pointer;
}

.csg-dropdown-select:focus {
	outline: none;
	border-color: #a1a1aa;
}

.csg-search-input-wrap {
	position: relative;
	flex: 2 1 400px;
	display: flex;
	gap: .5rem;
	align-items: center;
	border: 1px solid var(--csg-border);
	border-radius: 8px;
	background: #fff;
}

.csg-search-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	color: #a1a1aa;
	padding-left: 14px;
}

.csg-search-input {
	flex: 1;
	border: none;
	outline: none;
	background: transparent;
	padding: 11px 10px;
	font-size: 15px;
	color: var(--csg-text);
	min-width: 0;
	width: 100%;
	box-sizing: border-box;
}

.csg-search-submit {
	border: none;
	background: var(--csg-text);
	color: #fff;
	padding: 11px 20px;
	border-radius: 0 7px 7px 0;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	white-space: nowrap;
}

.csg-search-submit:hover {
	background: #27272a;
}

/* ------------------------------- Grid --------------------------------- */

.csg-grid {
	display: grid;
	grid-template-columns: repeat(var(--csg-columns, 5), minmax(0, 1fr));
	gap: var(--csg-gap);
	margin-bottom: 28px;
}

.csg-card {
	display: flex;
	flex-direction: column;
	background: #fff;
}

.csg-card-thumb-link {
	display: block;
}

.csg-card-thumb {
	position: relative;
	width: 100%;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	border-radius: var(--csg-radius);
	background: #f4f4f5;
}

.csg-card-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.25s ease;
}

.csg-card:hover .csg-card-thumb img {
	transform: scale(1.04);
}

.csg-card:hover .csg-card-body .csg-card-title a {
	color: var(--gcid-2w2gbf5aza );
	transition: color 0.25s ease;
}

.csg-card-thumb-placeholder {
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, #e4e4e7, #f4f4f5);
}

.csg-card-body {
	padding-top: 12px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.csg-card-badge {
	display: inline-block;
	align-self: flex-start;
	font-size: 12px;
	font-weight: 600;
	color: var(--csg-badge-text);
	background: var(--csg-badge-bg);
	border: 1px solid var(--csg-badge-border);
	border-radius: 5px;
	padding: 3px 10px;
	text-decoration: none;
	line-height: 1.6;
}

.csg-card-badge:hover {
	background: var(--csg-badge-border);
}

.csg-card-title {
	margin: 0;
	font-size: 17px;
	line-height: 1.35;
	font-weight: 700;
	color: var(--csg-text);
}

.csg-card-title a {
	color: inherit;
	text-decoration: none;
}

.csg-card-author {
	margin: 0;
	font-size: 13px;
	color: var(--csg-text-muted);
}

.csg-no-results {
	padding: 40px 20px;
	text-align: center;
	color: var(--csg-text-muted);
	border: 1px dashed var(--csg-border);
	border-radius: var(--csg-radius);
}

/* ---------------------------- Paginación -------------------------------- */

.csg-pagination {
	display: flex;
	justify-content: center;
}

.csg-pagination ul {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	list-style: none;
	margin: 0;
	padding: 10px;
	border: 1px solid var(--csg-border);
	border-radius: var(--csg-radius);
}

.csg-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 36px;
	padding: 0 12px;
	border: 1px solid var(--csg-border);
	border-radius: 7px;
	color: var(--csg-text);
	text-decoration: none;
	font-size: 14px;
	font-weight: 600;
}

.csg-pagination .page-numbers:hover {
	border-color: #a1a1aa;
}

.csg-pagination .page-numbers.current {
	background: var(--csg-accent);
	border-color: var(--csg-accent);
	color: var(--csg-accent-text);
}

.csg-pagination .page-numbers.dots {
	border: none;
	color: var(--csg-text-muted);
}

.csg-pagination .next,
.csg-pagination .prev {
	padding: 0 16px;
}

/* ---------------------------- Responsive -------------------------------- */

@media (max-width: 1024px) {
	.csg-grid {
		grid-template-columns: repeat(min(var(--csg-columns, 5), 3), minmax(0, 1fr));
	}
}

@media (max-width: 700px) {
	.csg-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 14px;
	}

	.csg-search-bar {
		flex-direction: column;
		align-items: stretch;
	}

	.csg-dropdown,
	.csg-dropdown-select {
		width: 100%;
		max-width: 0%;
		box-sizing: border-box;
	}

	.csg-search-input-wrap {
		width: 100%;
		min-width: 0;
	}

	.csg-card-title {
		font-size: 15px;
	}
}

@media (max-width: 460px) {
	.csg-grid {
		grid-template-columns: 1fr;
	}

	.csg-search-submit {
		padding: 11px 14px;
	}

	.csg-pagination ul {
		width: 100%;
		justify-content: center;
	}
}
