/* Techsys Portfolio - Frontend styles v1.5.0 */

.tsp-portfolio-wrap {
	--tsp-footer: #071568;
	--tsp-yellow: #fff000;
	--tsp-teal: #168b91;
	--tsp-filter-active: #174c62;
	--tsp-white: #ffffff;
	width: 100%;
	max-width: 1496px;
	margin: 0 auto;
	padding: 24px 0 38px;
	box-sizing: border-box;
	font-family: inherit;
}

.tsp-portfolio-wrap *,
.tsp-portfolio-wrap *::before,
.tsp-portfolio-wrap *::after {
	box-sizing: border-box;
}

@media (max-width: 1530px) {
	.tsp-portfolio-wrap {
		padding-left: 16px;
		padding-right: 16px;
	}
}

/* Filtros / categorías */
.tsp-filters {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 14px;
	margin: 0 0 34px;
}

.tsp-filter-btn {
	min-height: 47px;
	padding: 11px 23px;
	border: 1px solid var(--tsp-teal);
	border-radius: 0;
	background: var(--tsp-white);
	color: var(--tsp-teal);
	font: inherit;
	font-size: 14px;
	line-height: 1.25;
	font-weight: 700;
	text-align: center;
	cursor: pointer;
	box-shadow: none;
	outline: none;
	transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}

.tsp-filter-btn:hover,
.tsp-filter-btn:focus-visible {
	background: #f0f8f8;
	color: var(--tsp-filter-active);
	transform: translateY(-1px);
}

.tsp-filter-btn.active,
.tsp-filter-btn.active:hover,
.tsp-filter-btn.active:focus-visible {
	background: var(--tsp-filter-active);
	color: var(--tsp-white);
	border-color: var(--tsp-filter-active);
	transform: none;
}

/* Grid */
.tsp-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	column-gap: 20px;
	row-gap: 22px;
	width: 100%;
	align-items: start;
}

.tsp-empty {
	grid-column: 1 / -1;
	margin: 20px 0;
	text-align: center;
	color: #666;
}

/* Tarjetas */
.tsp-card {
	min-width: 0;
	margin: 0;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	overflow: hidden;
	background: var(--tsp-footer);
	display: flex;
	flex-direction: column;
	transition: transform .22s ease, box-shadow .22s ease;
}

.tsp-card:hover,
.tsp-card:focus-within {
	transform: translateY(-2px);
	box-shadow: 0 8px 22px rgba(5, 28, 72, .12);
}

.tsp-card.is-hidden {
	display: none;
}

/*
 * Las imágenes fuente son cuadradas (1:1), pero el área visible se hace
 * un poco más horizontal para reducir todavía más el aire superior e inferior.
 * El recorte sigue siendo simétrico y moderado, manteniendo el contenido centrado.
 */
.tsp-card-media {
	position: relative;
	flex: 0 0 auto;
	width: 100%;
	height: auto;
	aspect-ratio: 6 / 5;
	min-height: 0;
	background: #0b526e;
	overflow: hidden;
}

.tsp-portfolio-wrap .tsp-card-media > img {
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	margin: 0 !important;
	border: 0;
	border-radius: 0;
	object-fit: cover !important;
	object-position: center center !important;
}

.tsp-no-thumb {
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
	border: 0;
	border-radius: 0;
	background: linear-gradient(120deg, #0a4059 0%, #0e8195 100%);
}

/* Acciones al pasar el cursor */
.tsp-card-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 14px;
	padding: 16px;
	background: rgba(3, 31, 72, .08);
	opacity: 0;
	transition: opacity .22s ease, background-color .22s ease;
}

.tsp-card:hover .tsp-card-overlay,
.tsp-card:focus-within .tsp-card-overlay {
	opacity: 1;
	background: rgba(3, 31, 72, .27);
}

.tsp-icon-btn {
	width: 48px;
	height: 48px;
	padding: 0;
	border: 2px solid rgba(255, 255, 255, .98);
	border-radius: 50%;
	background: rgba(13, 67, 88, .86);
	color: #fff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
	cursor: pointer;
	box-shadow: 0 5px 14px rgba(0, 0, 0, .16);
	backdrop-filter: blur(2px);
	-webkit-backdrop-filter: blur(2px);
	transform: translateY(7px) scale(.96);
	transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.tsp-icon-btn svg {
	width: 20px;
	height: 20px;
}

.tsp-card:hover .tsp-icon-btn,
.tsp-card:focus-within .tsp-icon-btn {
	transform: translateY(0) scale(1);
}

.tsp-icon-btn:hover,
.tsp-icon-btn:focus-visible {
	background: var(--tsp-white);
	border-color: var(--tsp-white);
	color: var(--tsp-filter-active);
	box-shadow: 0 7px 18px rgba(0, 0, 0, .22);
	transform: translateY(-1px) scale(1.05) !important;
	outline: none;
}

/* Pie de tarjeta */
.tsp-card-footer {
	flex: 0 0 auto;
	min-height: 0;
	padding: 14px 22px 13px;
	background: var(--tsp-footer);
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
}

.tsp-card-title {
	margin: 0 0 6px;
	padding: 0;
	color: var(--tsp-yellow);
	font: inherit;
	font-size: 15px;
	line-height: 1.3;
	font-weight: 700;
	text-align: center;
}

.tsp-card-desc {
	margin: 0;
	padding: 0;
	max-width: 94%;
	color: #fff;
	font: inherit;
	font-size: 12px;
	line-height: 1.45;
	font-weight: 500;
	text-align: center;
}

/* Paginación */
.tsp-pagination {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	margin: 34px 0 4px;
}

.tsp-pagination[hidden] {
	display: none !important;
}

.tsp-page-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 42px;
	height: 42px;
	padding: 0 11px;
	border: 1px solid var(--tsp-teal);
	border-radius: 50%;
	background: var(--tsp-white);
	color: var(--tsp-filter-active);
	font: inherit;
	font-size: 14px;
	line-height: 1;
	font-weight: 700;
	cursor: pointer;
	box-shadow: none;
	transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.tsp-page-btn:hover,
.tsp-page-btn:focus-visible {
	background: #f0f8f8;
	border-color: var(--tsp-filter-active);
	color: var(--tsp-filter-active);
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(5, 28, 72, .1);
	outline: none;
}

.tsp-page-btn.active,
.tsp-page-btn.active:hover,
.tsp-page-btn.active:focus-visible {
	background: var(--tsp-filter-active);
	border-color: var(--tsp-filter-active);
	color: var(--tsp-white);
	transform: none;
	box-shadow: none;
}

.tsp-page-btn:disabled {
	opacity: .38;
	cursor: default;
	transform: none;
	box-shadow: none;
}

.tsp-page-prev,
.tsp-page-next {
	font-size: 23px;
	font-weight: 500;
}

.tsp-page-ellipsis {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 24px;
	height: 42px;
	color: #65717a;
	font-size: 16px;
	line-height: 1;
}

/* Modal / Galería */
.tsp-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.tsp-modal.open {
	display: flex;
}

.tsp-modal-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, .84);
}

.tsp-modal-content {
	position: relative;
	z-index: 1;
	width: min(100%, 980px);
	max-height: 92vh;
	overflow-y: auto;
	padding: 24px;
	border: 0;
	border-radius: 4px;
	background: #fff;
	box-shadow: 0 18px 55px rgba(0, 0, 0, .32);
	outline: none;
}

.tsp-modal-close {
	position: absolute;
	top: 8px;
	right: 12px;
	z-index: 3;
	width: 38px;
	height: 38px;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--tsp-footer);
	font-size: 31px;
	line-height: 1;
	cursor: pointer;
}

.tsp-modal-close:hover,
.tsp-modal-close:focus-visible {
	color: var(--tsp-teal);
	outline: none;
}

.tsp-modal-slider {
	position: relative;
	display: flex;
	align-items: center;
	gap: 12px;
}

.tsp-modal-img-wrap {
	position: relative;
	flex: 1;
	min-width: 0;
	min-height: 220px;
	background: #f4f4f4;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	overflow: hidden;
	overscroll-behavior: contain;
}

.tsp-modal-img-wrap.is-zoomed {
	overflow: auto;
	justify-content: center;
	align-items: center;
	background: #ededed;
}

.tsp-modal-img {
	display: block;
	max-width: 100%;
	max-height: 64vh;
	margin: 0 auto;
	object-fit: contain;
	transform-origin: center center;
	transition: transform .18s ease;
	cursor: zoom-in;
}

.tsp-modal-img-wrap.is-zoomed .tsp-modal-img {
	cursor: zoom-out;
}


.tsp-zoom-controls {
	position: absolute;
	left: 50%;
	bottom: 12px;
	z-index: 5;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
	padding: 5px;
	border: 1px solid rgba(255, 255, 255, .55);
	border-radius: 999px;
	background: rgba(1, 17, 90, .88);
	box-shadow: 0 5px 18px rgba(0, 0, 0, .2);
	transform: translateX(-50%);
	backdrop-filter: blur(5px);
}

.tsp-zoom-controls[hidden] {
	display: none !important;
}

.tsp-zoom-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #fff;
	font: inherit;
	font-size: 21px;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	transition: background-color .18s ease, color .18s ease, opacity .18s ease;
}

.tsp-zoom-btn:hover,
.tsp-zoom-btn:focus-visible {
	background: rgba(255, 255, 255, .18);
	outline: none;
}

.tsp-zoom-btn:disabled {
	opacity: .38;
	cursor: default;
	background: transparent;
}

.tsp-zoom-reset {
	font-size: 16px;
}

.tsp-zoom-level {
	min-width: 48px;
	padding: 0 3px;
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
	text-align: center;
}

.tsp-modal-img[hidden],
.tsp-modal-video[hidden] {
	display: none !important;
}

.tsp-modal-img-wrap.is-video {
	background: #000;
}

.tsp-modal-video {
	display: block;
	width: 100%;
	max-width: 900px;
	aspect-ratio: 16 / 9;
	max-height: 64vh;
	margin: 0 auto;
	border: 0;
	background: #000;
}

.tsp-nav {
	flex-shrink: 0;
	width: 42px;
	height: 42px;
	padding: 0;
	border: 1px solid var(--tsp-filter-active);
	border-radius: 50%;
	background: var(--tsp-filter-active);
	color: #fff;
	font-size: 15px;
	line-height: 1;
	cursor: pointer;
}

.tsp-nav:hover,
.tsp-nav:focus-visible {
	background: var(--tsp-white);
	color: var(--tsp-filter-active);
	outline: none;
}

.tsp-nav[hidden] {
	display: none;
}

.tsp-modal-info {
	margin-top: 16px;
	text-align: center;
}

.tsp-modal-title {
	margin: 0 0 7px;
	color: var(--tsp-footer);
	font: inherit;
	font-size: 19px;
	line-height: 1.35;
	font-weight: 700;
}

.tsp-modal-desc {
	margin: 0 0 7px;
	color: #333;
	font: inherit;
	font-size: 14px;
	line-height: 1.5;
}

.tsp-modal-counter {
	color: #777;
	font-size: 13px;
}

.tsp-gallery-data {
	display: none !important;
}

body.tsp-no-scroll {
	overflow: hidden;
}

/* Responsive */
@media (max-width: 1050px) {
	.tsp-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 700px) {
	.tsp-portfolio-wrap {
		padding-top: 14px;
		padding-left: 12px;
		padding-right: 12px;
	}

	.tsp-filters {
		gap: 8px;
		margin-bottom: 24px;
	}

	.tsp-filter-btn {
		min-height: 41px;
		padding: 9px 14px;
		font-size: 13px;
		flex: 0 1 auto;
	}

	.tsp-grid {
		grid-template-columns: 1fr;
		row-gap: 18px;
	}

	.tsp-card-footer {
		min-height: 0;
		padding: 13px 16px 12px;
	}

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

	.tsp-card-desc {
		max-width: 100%;
		font-size: 12px;
	}

	.tsp-pagination {
		gap: 6px;
		margin-top: 26px;
	}

	.tsp-page-btn {
		min-width: 36px;
		height: 36px;
		padding: 0 9px;
		font-size: 13px;
	}

	.tsp-page-prev,
	.tsp-page-next {
		font-size: 20px;
	}

	.tsp-page-ellipsis {
		min-width: 18px;
		height: 36px;
	}

	.tsp-modal {
		padding: 10px;
	}

	.tsp-modal-content {
		padding: 16px;
	}

	.tsp-modal-slider {
		gap: 6px;
	}

	.tsp-nav {
		width: 36px;
		height: 36px;
	}

	.tsp-zoom-controls {
		bottom: 8px;
		padding: 4px;
	}

	.tsp-zoom-btn {
		width: 32px;
		height: 32px;
	}
}

@media (max-width: 420px) {
	.tsp-filters {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		width: 100%;
	}

	.tsp-filter-btn {
		width: 100%;
		padding-left: 10px;
		padding-right: 10px;
	}

}

/* En dispositivos táctiles las acciones quedan disponibles sin oscurecer la imagen. */
@media (hover: none) {
	.tsp-card-overlay {
		align-items: flex-end;
		justify-content: flex-end;
		opacity: 1;
		background: transparent;
		pointer-events: none;
	}

	.tsp-icon-btn {
		width: 42px;
		height: 42px;
		pointer-events: auto;
		transform: none;
		background: rgba(13, 67, 88, .9);
	}

	.tsp-card:hover,
	.tsp-card:focus-within {
		transform: none;
		box-shadow: none;
	}
}
