/* Modal de galeria: se abre con <dialog> nativo, sin librerias. */
.tgs-galeria a {
	cursor: zoom-in;
	display: block;
	overflow: hidden;
	border-radius: 12px;
}

.tgs-galeria a img {
	transition: transform 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
	will-change: transform;
}

.tgs-galeria a:hover img,
.tgs-galeria a:focus-visible img {
	transform: scale(1.04);
}

.tgs-modal {
	border: 0;
	padding: 0;
	background: transparent;
	max-width: 100vw;
	max-height: 100vh;
	overflow: visible;
	opacity: 0;
	transform: scale(0.96);
	transition: opacity 0.26s ease, transform 0.26s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.tgs-modal[open] {
	opacity: 1;
	transform: scale(1);
}

.tgs-modal::backdrop {
	background: rgba(10, 14, 26, 0.93);
}

.tgs-modal__fig {
	margin: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
}

.tgs-modal__img {
	display: block;
	width: auto;
	height: auto;
	max-width: 92vw;
	max-height: 80vh;
	border-radius: 10px;
	background: #192645;
}

.tgs-modal__cap {
	color: #d6e9ff;
	font-size: 14px;
	line-height: 1.4;
	letter-spacing: 0.02em;
}

.tgs-modal__btn {
	position: fixed;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.14);
	color: #fff;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	transition: background 0.18s ease;
}

.tgs-modal__btn:hover,
.tgs-modal__btn:focus-visible {
	background: rgba(255, 255, 255, 0.3);
	outline: none;
}

.tgs-modal__btn--prev {
	left: 24px;
	top: 50%;
	transform: translateY(-50%);
}

.tgs-modal__btn--next {
	right: 24px;
	top: 50%;
	transform: translateY(-50%);
}

.tgs-modal__btn--close {
	top: 24px;
	right: 24px;
}

@media (max-width: 700px) {
	.tgs-modal__btn {
		width: 44px;
		height: 44px;
		font-size: 22px;
	}

	.tgs-modal__btn--prev {
		left: 8px;
	}

	.tgs-modal__btn--next {
		right: 8px;
	}

	.tgs-modal__btn--close {
		top: 8px;
		right: 8px;
	}

	.tgs-modal__img {
		max-width: 96vw;
		max-height: 74vh;
	}
}

/* Video de proyecto */
.tgs-video {
	margin: 32px 0 8px;
}

.tgs-video video {
	display: block;
	width: 100%;
	max-width: 760px;
	height: auto;
	margin: 0 auto;
	border-radius: 12px;
	background: #192645;
}

/* Cuando el proyecto tiene video, texto y video van en dos columnas */
.tgs-obra-contenido:has(.tgs-video) {
	display: grid;
	grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
	gap: 12px 48px;
	align-items: start;
}

.tgs-obra-contenido:has(.tgs-video) .tgs-video {
	grid-column: 1;
	grid-row: 1 / span 4;
	margin: 0;
}

.tgs-obra-contenido:has(.tgs-video) .tgs-video video {
	max-width: none;
}

.tgs-obra-contenido:has(.tgs-video) > :not(.tgs-video) {
	grid-column: 2;
}

@media (max-width: 900px) {
	.tgs-obra-contenido:has(.tgs-video) {
		grid-template-columns: 1fr;
		gap: 16px;
	}

	.tgs-obra-contenido:has(.tgs-video) .tgs-video {
		grid-column: 1;
		grid-row: auto;
		margin: 0 0 8px;
	}
}

/* Respetar a quien pide menos movimiento */
@media (prefers-reduced-motion: reduce) {
	.tgs-galeria a img,
	.tgs-modal,
	.tgs-modal__btn {
		transition: none;
	}

	.tgs-galeria a:hover img,
	.tgs-galeria a:focus-visible img {
		transform: none;
	}

	.tgs-modal {
		transform: none;
	}
}
