/* ==========================================================================
   HOJA DE ESTILOS PRINCIPALES DEL SITIO (custom-styles.css)
   Aprovecha directamente las variables globales y sombras declaradas en layout.css.
   ========================================================================== */

/* ==========================================================================
   MÓDULO 1: VISTA INICIAL / HOME (index.php)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1.1 COMPONENTE: HERO SECTION
   -------------------------------------------------------------------------- */

/* Contenedor general de la sección Hero */
.hero-section {
	flex: 1 0 auto;
	padding-top: 3.5rem;
	padding-bottom: 4.5rem;
	background-color: var(--bg-site-light);
	display: flex;
	align-items: center;
}

/* Título principal tipográfico (primer elemento del hero) */
.text-dark-hero {
	text-wrap: balance; /* reparte las palabras en líneas de largo parejo */
	color: var(--text-primary);
	font-size: var(--fs-h1);
	font-weight: 800;
	line-height: 1.15;
	letter-spacing: -0.01em;
}

/* Contenedor inline para el efecto órbita */
.orbit-container {
	position: relative;
	display: inline-block;
}

/* Palabras destacadas del título (wire): "estratégica" en azul, "inteligente" en morado */
.text-hero-blue {
	color: var(--text-navy);
}

.text-hero-purple {
	color: var(--color-primary);
}

/* Esfera flotante decorativa */
.orbit-floating-sphere {
	position: absolute;
	right: -25px;
	top: -15px;
	width: 18px;
	height: 18px;
	background-color: rgba(var(--color-primary-rgb), 0.18);
	border-radius: 50%;
	display: block;
	z-index: 1;
	filter: blur(1px);
}

/* Párrafo descriptivo del Hero */
.text-muted-hero {
	color: var(--text-secondary);
	font-size: var(--fs-lg);
	line-height: 1.6;
	max-width: 520px;
}

/* Texto secundario en bloques de métricas */
.hero-metric-text {
	font-size: var(--fs-sm);
	color: var(--text-muted);
	line-height: 1.3;
}

/* Iconos vectoriales de métricas */
.figma-metric-icon {
	width: 32px;
	height: 32px;
	object-fit: contain;
	flex-shrink: 0;
}

/* Contenedor marco del video o ilustración */
.hero-video-wrapper,
.hero-illustration-wrapper {
	position: relative;
	width: 100%;
	max-width: 580px;
	margin-left: auto;
	margin-right: 0;
	overflow: hidden;
	transform: translate3d(0, 0, 0);
}

/* Elemento de renderizado del video HTML5 o Imagen */
.hero-video-render,
.hero-illustration-render {
	width: 100%;
	height: auto;
	display: block;
	object-fit: cover;
}

/* --------------------------------------------------------------------------
   1.2 COMPONENTE: CARDS DE SERVICIOS (Flip Effect 3D)
   -------------------------------------------------------------------------- */

.services-title {
	font-size: var(--fs-h2);
	font-weight: 800;
	line-height: 1.25;
	letter-spacing: -0.01em;
	color: var(--text-primary);
}

.services-title .text-accent {
	color: var(--color-primary);
	font-weight: 800;
}

.card-flip-container {
	perspective: 1500px;
	height: 380px;
	cursor: pointer;
	border-radius: 30px;
	box-shadow: var(--shadow-card-soft);
	transition:
		transform 0.3s ease,
		box-shadow 0.3s ease;
}

.card-flip-container:hover {
	transform: translateY(-4px);
	box-shadow: var(--shadow-card-hover);
}

.card-flip {
	position: relative;
	width: 100%;
	height: 100%;
	transform-style: preserve-3d;
	transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
	border-radius: 28px;
}

.card-flip-container.is-flipped .card-flip {
	transform: rotateY(180deg);
}

.card-front,
.card-back {
	position: absolute;
	width: 100%;
	height: 100%;
	backface-visibility: hidden;
	-webkit-backface-visibility: hidden;
	border-radius: 28px;
	background-color: var(--bg-site-light);
	border: 1px solid var(--border-soft);
	overflow: hidden;
}

.card-front {
	z-index: 2;
	transform: rotateY(0deg);
	padding: 2.5rem 1.5rem;
}

.icon-wrapper {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	margin-bottom: 1.8rem;
}

.icon-wrapper img {
	height: 190px;
	width: auto;
	max-width: 100%;
	object-fit: contain;
}

.card-title-sc {
	font-size: var(--fs-h3);
	font-weight: 800;
	color: var(--color-primary);
	letter-spacing: 0.02em;
	text-transform: uppercase;
	line-height: 1.2;
	max-width: 260px;
	margin: 0 auto;
}

.card-back {
	transform: rotateY(180deg);
	z-index: 1;
	padding: 2.5rem 1.5rem;
}

.card-description {
	font-size: var(--fs-lg);
	line-height: 1.6;
	max-width: 90%;
	color: var(--text-secondary) !important;
	font-weight: 600;
}

.btn-explore-sc {
	background-color: var(--color-primary);
	color: var(--text-light) !important;
	border-radius: 50px;
	font-weight: 700;
	font-size: var(--fs-sm);
	letter-spacing: 0.03em;
	padding: 0.6rem 1.8rem;
	box-shadow: var(--shadow-btn-cta);
	transition: all 0.25s ease-in-out;
}

.btn-explore-sc:hover {
	background-color: var(--color-primary-dark);
	transform: translateY(-2px);
	box-shadow: var(--shadow-btn-social);
}

/* --------------------------------------------------------------------------
   1.3 COMPONENTE: ÚNETE A NUESTRO EQUIPO (CTA Vacantes)
   -------------------------------------------------------------------------- */

.join-team-card {
	background-color: var(--bg-site-light);
	border: 2px solid var(--color-primary);
	border-radius: 28px;
	box-shadow: var(--shadow-card-soft);
}

.join-team-img-wrapper {
	width: 100%;
	height: 100%;
	min-height: 380px;
	position: relative;
	overflow: hidden;
}

.join-team-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.join-team-icon-badge {
	width: 48px;
	height: 48px;
	background-color: rgba(var(--color-primary-rgb), 0.12);
	color: var(--color-primary);
	border-radius: 50%;
	font-size: 1.25rem;
}

.join-team-title {
	color: var(--text-primary);
	font-size: var(--fs-h2);
	font-weight: 800;
	line-height: 1.15;
	letter-spacing: 0.01em;
}

.join-team-description {
	color: var(--text-secondary);
	font-size: var(--fs-base);
	line-height: 1.65;
}

.btn-outline-join-team {
	color: var(--color-primary);
	border: 1.5px solid var(--color-primary);
	border-radius: 50px;
	padding: 0.65rem 1.8rem;
	font-weight: 600;
	font-size: var(--fs-sm);
	background-color: transparent;
	transition: all 0.3s ease;
}

.btn-outline-join-team:hover {
	background-color: var(--color-primary);
	color: var(--text-light);
	transform: translateX(3px);
	box-shadow: var(--shadow-btn-cta);
}

/* --------------------------------------------------------------------------
   1.4 COMPONENTE: TESTIMONIOS (Carrusel 3D en Desktop)
   -------------------------------------------------------------------------- */

.testimonials-title {
	color: var(--text-primary);
	font-size: var(--fs-h2);
	font-weight: 800;
	line-height: 1.25;
	letter-spacing: 0.02em;
}

.testimonials-title .text-accent {
	color: var(--color-primary);
	font-weight: 800;
}

.testimonials-carousel-wrapper {
	padding: 2rem 1rem;
	position: relative;
}

.testimonial-card {
	background-color: var(--bg-site-light);
	border-radius: 28px;
	transition:
		transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1),
		box-shadow 0.5s ease,
		opacity 0.5s ease;
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: space-between;
	min-height: 460px;
	height: 100%;
}

.testimonial-card.side-card {
	border: 1px solid rgba(var(--color-primary-rgb), 0.15);
	box-shadow: var(--shadow-card);
	transform: scale(0.88);
	opacity: 0.75;
}

.testimonial-card.active-card {
	border: 2px solid var(--color-primary);
	box-shadow: var(--shadow-card-hover), var(--shadow-primary-glow);
	transform: scale(1.05);
	opacity: 1;
	z-index: 3;
}

.author-avatar-wrapper {
	width: 100px;
	height: 100px;
	border-radius: 50%;
	overflow: hidden;
	background-color: var(--bg-section-soft);
	border: 3px solid var(--bg-site-light);
	box-shadow: var(--shadow-card);
	display: flex;
	align-items: center;
	justify-content: center;
}

.author-avatar-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.quote-divider-wrapper {
	width: 100%;
	max-width: 180px;
}

.quote-line {
	flex: 1;
	height: 1px;
	background-color: rgba(var(--color-primary-rgb), 0.2);
}

.quote-icon {
	font-size: 2.2rem;
	color: var(--color-primary);
	line-height: 1;
}

.testimonial-text {
	color: var(--text-secondary);
	font-size: var(--fs-base);
	line-height: 1.65;
	text-align: center;
}

.author-name {
	color: var(--color-primary);
	font-size: var(--fs-lg);
	letter-spacing: 0.01em;
}

.carousel-control-custom {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background-color: var(--bg-site-light);
	border: 1.5px solid var(--border-light-subtle);
	color: var(--text-primary);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.2rem;
	cursor: pointer;
	box-shadow: var(--shadow-card);
	transition: all 0.3s ease;
	z-index: 10;
}

.carousel-control-custom:hover {
	background-color: var(--color-primary);
	color: var(--text-light);
	border-color: var(--color-primary);
	transform: translateY(-50%) scale(1.1);
}

.prev-btn {
	left: -20px;
}
.next-btn {
	right: -20px;
}

/* --------------------------------------------------------------------------
   1.5 COMPONENTE: PERSPECTIVAS Y ACTUALIDAD FISCAL (Preview Blog)
   -------------------------------------------------------------------------- */

.blog-section-title {
	color: var(--text-primary);
	font-size: var(--fs-h2);
	letter-spacing: -0.01em;
}

.btn-link-all {
	flex-shrink: 0;
	color: var(--color-primary);
	font-size: var(--fs-sm);
	transition:
		color 0.25s ease,
		transform 0.25s ease;
}

.btn-link-all:hover {
	color: var(--color-primary-dark);
	transform: translateX(3px);
}

.blog-card-horizontal {
	position: relative;
	display: grid;
	grid-template-columns: 40% 1fr;
	min-height: 250px;
	overflow: hidden;
	background-color: var(--bg-site-light);
	border: 1px solid var(--border-light-subtle);
	border-radius: 20px;
	box-shadow: var(--shadow-card);
	transition:
		transform 0.35s ease,
		box-shadow 0.35s ease,
		border-color 0.35s ease;
}

.blog-card-horizontal:hover {
	transform: translateY(-4px);
	box-shadow: var(--shadow-card-hover);
	border-color: rgba(var(--color-primary-rgb), 0.2);
}

/* La imagen llena toda la altura de la tarjeta */
.blog-card-horizontal .blog-card-img-wrapper {
	position: relative;
	height: 100%;
	overflow: hidden;
	background-color: var(--bg-neutral-dark);
}

.blog-card-horizontal .blog-card-img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.5s ease;
}

.blog-card-horizontal:hover .blog-card-img {
	transform: scale(1.06);
}

.blog-card-horizontal .blog-card-content {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	padding: 26px 28px;
}

/* Categoría en azul, sin fondo (wire) */
.blog-card-horizontal .blog-card-category {
	margin-bottom: 8px;
	color: var(--text-navy);
	font-size: var(--fs-xs);
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

/* Título y resumen con número fijo de líneas para que ambas tarjetas midan lo mismo */
.blog-card-horizontal .blog-card-title {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin-bottom: 10px;
	font-size: var(--fs-lg);
	font-weight: 700;
	line-height: 1.35;
}

.blog-card-horizontal .blog-card-title a {
	color: var(--text-primary);
	text-decoration: none;
	transition: color 0.25s ease;
}

.blog-card-horizontal:hover .blog-card-title a {
	color: var(--color-primary);
}

.blog-card-horizontal .blog-card-summary {
	display: -webkit-box;
	-webkit-line-clamp: 3;
	line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin-bottom: 16px;
	color: var(--text-secondary);
	font-size: var(--fs-sm);
	line-height: 1.6;
}

.blog-card-horizontal .btn-read-more {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-top: auto;
	color: var(--text-primary);
	font-size: var(--fs-sm);
	font-weight: 700;
	transition:
		color 0.25s ease,
		gap 0.25s ease;
}

.blog-card-horizontal:hover .btn-read-more {
	color: var(--color-primary);
	gap: 12px;
}

/* La fecha solo se muestra en móvil (wire) */
.blog-card-horizontal .blog-card-date {
	display: none;
	margin-top: auto;
	color: var(--text-muted);
	font-size: var(--fs-sm);
}

/* ==========================================================================
   SECCIÓN 2: AJUSTES RESPONSIVOS EXACTOS (MÓVIL Y TABLET)
   ========================================================================== */

/* TABLETS Y PANTALLAS MEDIANAS (< 992px) */
@media (max-width: 991.98px) {
	.hero-section {
		padding-top: 2.5rem;
		padding-bottom: 3rem;
		text-align: center;
	}

	.hero-section .text-start {
		text-align: center !important;
	}

	.text-muted-hero {
		margin-left: auto;
		margin-right: auto;
	}

	.hero-video-wrapper,
	.hero-illustration-wrapper {
		margin: 2rem auto 0 auto;
		max-width: 480px;
	}

	/* Métricas centradas (wire): dos arriba y la tercera centrada abajo */
	.hero-metrics {
		justify-content: center;
	}

	.hero-metrics > div > .d-flex {
		justify-content: center;
		text-align: left;
	}

	.join-team-img-wrapper {
		min-height: 280px;
		height: 280px;
	}

	.prev-btn {
		left: 5px;
	}
	.next-btn {
		right: 5px;
	}
}

/* SMARTPHONES Y MÓVILES (< 768px - Exacto a Figma y sin encimar texto) */
@media (max-width: 767.98px) {
	/* 1. HERO */
	.text-dark-hero {
		line-height: 1.2;
	}

	/* Esfera decorativa: al costado de "inteligente" (que baja a su propia línea),
	   no arriba, para que no invada la línea de "crecimiento" */
	.orbit-floating-sphere {
		top: 50%;
		right: -20px;
		width: 12px;
		height: 12px;
		margin-top: -6px;
	}

	.text-muted-hero {
		line-height: 1.55;
	}

	.figma-metric-icon {
		width: 26px;
		height: 26px;
	}

	.hero-metric-text {
		font-size: var(--fs-xs);
	}

	/* 2. SERVICIOS */

	.card-flip-container {
		height: 330px;
	}

	.icon-wrapper img {
		height: 140px;
	}

	.card-description {
		font-size: var(--fs-base);
	}

	/* 3. ÚNETE A NUESTRO EQUIPO */
	.join-team-card {
		border-radius: 22px;
	}

	.join-team-img-wrapper {
		min-height: 230px;
		height: 230px;
	}

	/* Alineado a la izquierda como en el wire, botón a todo lo ancho */
	.join-team-content {
		padding: 1.8rem 1.4rem !important;
		text-align: left !important;
	}

	/* Tarjeta más ligera en móvil: sombra suave en lugar del borde morado grueso (wire) */
	.join-team-card {
		border: 1px solid var(--border-light-subtle);
		box-shadow: var(--shadow-card-soft);
	}

	/* Sin latido en móvil: el título ocupa casi todo el ancho y al crecer se desalinea */
	.join-team-title.animate-join-title-infinite {
		animation: none;
	}

	.btn-outline-join-team {
		width: 100%;
		justify-content: center;
		border-radius: 10px;
		padding: 0.8rem 1.2rem;
		font-size: var(--fs-base);
		font-weight: 700;
	}

	.btn-outline-join-team:hover {
		transform: none;
	}

	/* ==========================================================================
       4. TESTIMONIOS: 1 A LA VEZ CON CARRILES LATERALES LIBRES (NO ENCIMA TEXTO)
       ========================================================================== */

	.testimonials-carousel-wrapper {
		padding: 0.5rem 0 1.5rem 0;
		position: relative;
	}

	/* Contenedor horizontal con scroll y tope suave por tarjeta */
	#testimonials-container.row {
		display: flex !important;
		flex-wrap: nowrap !important;
		overflow-x: auto !important;
		scroll-snap-type: x mandatory !important;
		-webkit-overflow-scrolling: touch !important;
		scroll-behavior: smooth;
		gap: 0 !important;
		margin: 0 !important;
		padding: 10px 0 !important;
		/* Todas las tarjetas a la misma altura (la de la más alta) */
		align-items: stretch !important;
		/* Alinear al inicio: con "center" (clase de Bootstrap en la fila) la primera
		   tarjeta queda fuera de la pantalla a la izquierda y no se puede alcanzar */
		justify-content: flex-start !important;
	}

	#testimonials-container::-webkit-scrollbar {
		display: none;
	}
	#testimonials-container {
		-ms-overflow-style: none;
		scrollbar-width: none;
	}

	/* Cada tarjeta ocupa el 100% de la pantalla */
	.testimonial-card-col {
		flex: 0 0 100% !important;
		max-width: 100% !important;
		width: 100% !important;
		scroll-snap-align: center !important;
		scroll-snap-stop: always !important;
		padding: 0 6px !important;
		box-sizing: border-box;
		display: flex !important;
	}

	.testimonial-card {
		flex: 1;
		height: auto;
		min-height: 430px;
		transform: none !important;
		border: 2px solid var(--color-primary) !important;
		box-shadow: var(--shadow-card) !important;
		/* Padding lateral amplio (44px) para dejar espacio total a los botones */
		padding: 30px 44px !important;
		opacity: 1 !important;
	}

	/* Párrafo centrado dentro de su zona segura */
	.testimonial-text {
		flex: 1;
		display: flex;
		align-items: center;
		justify-content: center;
		line-height: 1.6;
		padding: 0 4px !important;
		margin: 0.75rem 0 !important;
	}

	/* Botones compactos pegados a los bordes exteriores */
	.carousel-control-custom {
		width: 34px !important;
		height: 34px !important;
		top: 50% !important;
		transform: translateY(-50%) !important;
		font-size: 0.95rem !important;
		background-color: var(--bg-site-light) !important;
		box-shadow: var(--shadow-card) !important;
		z-index: 5;
	}

	.prev-btn {
		left: 2px !important;
	}

	.next-btn {
		right: 2px !important;
	}

	/* 5. PERSPECTIVAS (wire móvil): imagen a la izquierda, categoría, título y fecha */
	.blog-card-horizontal {
		grid-template-columns: 42% 1fr;
		min-height: 180px;
		border-radius: 16px;
	}

	.blog-card-horizontal .blog-card-content {
		padding: 16px 18px;
	}

	.blog-card-horizontal .blog-card-title {
		-webkit-line-clamp: 3;
		line-clamp: 3;
		margin-bottom: 8px;
		font-size: var(--fs-base);
	}

	.blog-card-horizontal .blog-card-summary,
	.blog-card-horizontal .btn-read-more {
		display: none;
	}

	.blog-card-horizontal .blog-card-date {
		display: block;
	}

	.blog-card-horizontal:hover {
		transform: none;
	}
}

/* SMARTPHONES MUY PEQUEÑOS (< 420px) */
@media (max-width: 419.98px) {

	.card-flip-container {
		height: 310px;
	}

	.testimonial-card {
		padding: 28px 38px !important;
	}
}
