/* ==========================================================================
   Zaiglobal Energía · capa de diseño sobre Enfold
   Referencia: mydoup.com (tipografía grande, tarjetas redondeadas, bandas
   oscuras), con la paleta actual de la marca.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
	--zg-green: #00ac4d;
	--zg-green-dark: #008a3e;
	--zg-green-soft: #e6f7ee;
	--zg-ink: #0e1512;
	--zg-ink-2: #17201c;
	--zg-text: #1d2521;
	--zg-muted: #5b6661;
	--zg-surface: #f4f7f5;
	--zg-line: rgba(14, 21, 18, .10);
	--zg-line-dark: rgba(255, 255, 255, .14);
	--zg-radius: 0;
	--zg-radius-sm: 0;
	--zg-shadow: 0 1px 2px rgba(14, 21, 18, .04), 0 12px 32px -12px rgba(14, 21, 18, .18);
	--zg-ease: cubic-bezier(.22, 1, .36, 1);
}

/* ---------- Cabecera ---------- */
#top #header_main {
	border-bottom: 1px solid var(--zg-line);
}
/* «Contacto»: botón píldora en vez de bloque verde a toda altura */
#top #wrap_all #header .av-main-nav > li.av-menu-button-colored > a,
#top #wrap_all #header .av-main-nav > li.av-menu-button-colored > a .avia-menu-fx {
	background: transparent;
}
#top #wrap_all #header .av-main-nav > li.av-menu-button-colored > a .avia-menu-text {
	background: var(--zg-green);
	color: #fff;
	border: 0;
	border-radius: 999px;
	padding: 12px 24px;
	transition: background .25s var(--zg-ease), transform .25s var(--zg-ease);
}
#top #wrap_all #header .av-main-nav > li.av-menu-button-colored > a:hover .avia-menu-text {
	background: var(--zg-green-dark);
	transform: translateY(-1px);
}

/* ---------- Portada (hero) ----------
   Se respeta la portada original (foto clara, titular y subtítulo de siempre);
   solo se añade una entrada suave del texto. */
.zg-motion #top #av_section_1 .av-special-heading,
.zg-motion #top #av_section_1 .hr,
.zg-motion #top #av_section_1 .av_textblock_section {
	opacity: 0;
	transform: translateY(18px);
}
.zg-motion.zg-go #top #av_section_1 .av-special-heading,
.zg-motion.zg-go #top #av_section_1 .hr,
.zg-motion.zg-go #top #av_section_1 .av_textblock_section {
	animation: zg-sube .9s var(--zg-ease) forwards;
}
.zg-motion.zg-go #top #av_section_1 .hr { animation-delay: .15s; }
.zg-motion.zg-go #top #av_section_1 .av_textblock_section { animation-delay: .3s; }
@keyframes zg-sube {
	to { opacity: 1; transform: none; }
}

/* ---------- Persona destacada ---------- */
#top #av_section_2 .avia-image-container-inner,
#top #av_section_2 .avia_image {
	border-radius: var(--zg-radius);
	overflow: hidden;
}
#top #av_section_2 .avia-image-container-inner {
	background: linear-gradient(160deg, var(--zg-green-soft), #fff 70%);
	box-shadow: var(--zg-shadow);
}

/* ---------- Botones ---------- */
#top .avia-button,
#top input[type="submit"],
#top .button {
	border-radius: 999px !important;
	padding-left: 26px;
	padding-right: 26px;
	transition: background-color .25s var(--zg-ease), transform .25s var(--zg-ease), box-shadow .25s var(--zg-ease);
}
#top .avia-button:hover,
#top input[type="submit"]:hover {
	transform: translateY(-2px);
	box-shadow: 0 10px 24px -10px rgba(0, 172, 77, .6);
}

/* ---------- Servicios: tarjetas ---------- */
#top #servicios .iconbox {
	background: #f6fbf8; /* verde casi imperceptible */
	border: 1px solid var(--zg-line);
	border-radius: var(--zg-radius);
	padding: 28px 28px 24px;
	height: 100%;
	box-shadow: none;
	transition: transform .35s var(--zg-ease), box-shadow .35s var(--zg-ease), border-color .35s var(--zg-ease);
}
#top #servicios .iconbox:hover {
	transform: translateY(-6px);
	box-shadow: var(--zg-shadow);
	border-color: rgba(0, 172, 77, .35);
}
#top #servicios .iconbox .iconbox_icon {
	background: var(--zg-green-soft);
	color: var(--zg-green);
	border-radius: 0;
}
#top #servicios .flex_column { display: flex; }
#top #servicios .flex_column > .iconbox { flex: 1; }

/* ---------- Empleo: banner redondeado ---------- */
#top #empleo .container {
	border-radius: var(--zg-radius);
	overflow: hidden;
}

/* ---------- Opiniones ---------- */
#top .avia-testimonial-wrapper .avia-testimonial-content {
	background: var(--zg-surface);
	border-radius: var(--zg-radius);
	border: 1px solid var(--zg-line);
}

/* ---------- Contacto ---------- */
#top #contacto input[type="text"],
#top #contacto input[type="email"],
#top #contacto textarea {
	border-radius: var(--zg-radius-sm);
	border: 1px solid var(--zg-line);
	background: var(--zg-surface);
	padding: 14px 16px;
	transition: border-color .2s, box-shadow .2s, background .2s;
}
#top #contacto input:focus,
#top #contacto textarea:focus {
	border-color: var(--zg-green);
	background: #fff;
	box-shadow: 0 0 0 4px rgba(0, 172, 77, .15);
}

/* ---------- Accesibilidad ---------- */
#top a:focus-visible,
#top button:focus-visible,
#top .avia-button:focus-visible {
	outline: 3px solid var(--zg-green);
	outline-offset: 3px;
}

/* ==========================================================================
   Bloque 3 · animaciones (solo con .zg-motion, que el JS pone si el sistema
   no pide reducir movimiento)
   ========================================================================== */
#top #header_main {
	transition: box-shadow .3s var(--zg-ease), background-color .3s var(--zg-ease);
}
.zg-scrolled #top #header_main {
	box-shadow: 0 8px 24px -16px rgba(14, 21, 18, .35);
}

/* Aparición suave hacia arriba */
.zg-motion #top .zg-reveal {
	opacity: 0;
	transform: translateY(28px);
	transition: opacity .8s var(--zg-ease), transform .8s var(--zg-ease);
	will-change: opacity, transform;
}
.zg-motion #top .zg-reveal.zg-in {
	opacity: 1;
	transform: none;
}

/* Cifras */
#top .zg-count {
	font-variant-numeric: tabular-nums;
	font-weight: 800;
	color: var(--zg-green);
}

/* Iconos de servicios: pequeño giro al pasar el ratón */
.zg-motion #top #servicios .iconbox .iconbox_icon {
	transition: transform .4s var(--zg-ease), background-color .4s var(--zg-ease), color .4s var(--zg-ease);
}
.zg-motion #top #servicios .iconbox:hover .iconbox_icon {
	transform: rotate(-8deg) scale(1.08);
	background: var(--zg-green);
	color: #fff;
}

@media (prefers-reduced-motion: reduce) {
	#top *, #top *::before, #top *::after {
		animation-duration: .01ms !important;
		transition-duration: .01ms !important;
	}
}

/* ==========================================================================
   Bloque 4 · proyectos con galería
   ========================================================================== */
#top .zg-proyectos {
	display: grid;
	grid-template-columns: 1fr;
	gap: 20px;
	margin: 40px 0 10px;
}
#top .zg-proyecto {
	all: unset;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	cursor: pointer;
	background: #fff;
	border: 1px solid var(--zg-line);
	overflow: hidden;
	color: var(--zg-text);
	text-align: left;
	transition: transform .4s var(--zg-ease), border-color .4s var(--zg-ease), box-shadow .4s var(--zg-ease);
}
#top .zg-proyecto:hover {
	transform: translateY(-4px);
	border-color: var(--zg-green);
	box-shadow: var(--zg-shadow);
}
#top .zg-proyecto:focus-visible {
	outline: 3px solid var(--zg-green);
	outline-offset: 3px;
}
#top .zg-proyecto__img {
	display: block;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: var(--zg-surface);
}
#top .zg-proyecto__img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .8s var(--zg-ease);
}
#top .zg-proyecto:hover .zg-proyecto__img img { transform: scale(1.05); }
#top .zg-proyecto__body {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 16px 20px;
	border-top: 3px solid var(--zg-green);
}
#top .zg-proyecto__lugar {
	font-size: 18px;
	font-weight: 700;
	line-height: 1.3;
	color: var(--zg-text);
}
#top .zg-proyecto__tipo { color: var(--zg-green); }
#top .zg-proyecto__lugar .zg-falta { color: var(--zg-muted); font-style: italic; font-weight: 500; }
#top .zg-proyecto__ver {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	flex: none;
	font-size: 14px;
	font-weight: 700;
	color: var(--zg-green);
}
#top .zg-proyecto__ver::after {
	content: "→";
	transition: transform .3s var(--zg-ease);
}
#top .zg-proyecto:hover .zg-proyecto__ver::after { transform: translateX(4px); }

/* Solo en la prueba: marca de dato o foto provisional */
#top .zg-proyecto.zg-revisar { position: relative; }
#top .zg-proyecto.zg-revisar::before {
	content: "Localidad por confirmar";
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 2;
	background: #ffd84d;
	color: #3a2e00;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: .06em;
	text-transform: uppercase;
	padding: 4px 10px;
}

/* Visor */
.zg-visor-abierto { overflow: hidden; }
.zg-visor {
	width: 100vw;
	height: 100vh;
	max-width: none;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: rgba(8, 12, 10, .96);
	color: #fff;
	font-family: inherit;
}
.zg-visor[open] {
	display: grid;
	grid-template-rows: auto 1fr auto;
}
.zg-visor::backdrop { background: rgba(8, 12, 10, .8); }
.zg-visor__top {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 16px 20px;
}
.zg-visor__titulo {
	margin: 0;
	flex: 1;
	font-weight: 700;
	font-size: 16px;
	color: #fff;
}
.zg-visor__cuenta {
	font-variant-numeric: tabular-nums;
	color: rgba(255, 255, 255, .6);
	font-size: 14px;
}
.zg-visor button {
	font-family: inherit;
	cursor: pointer;
}
.zg-visor__cerrar,
.zg-visor__nav {
	background: rgba(255, 255, 255, .08);
	border: 1px solid rgba(255, 255, 255, .14);
	color: #fff;
	border-radius: 999px;
	width: 48px;
	height: 48px;
	font-size: 28px;
	line-height: 1;
	display: grid;
	place-items: center;
	transition: background .2s;
}
.zg-visor__cerrar:hover,
.zg-visor__nav:hover { background: var(--zg-green); border-color: var(--zg-green); }
.zg-visor__fig {
	margin: 0;
	min-height: 0;
	display: grid;
	place-items: center;
	padding: 0 80px;
}
.zg-visor__fig img {
	max-width: 100%;
	max-height: calc(100vh - 170px);
	max-height: calc(100dvh - 170px);
	object-fit: contain;
	border-radius: 0;
	opacity: 0;
	transform: scale(.98);
	transition: opacity .35s var(--zg-ease), transform .35s var(--zg-ease);
}
.zg-visor__fig img.zg-visor__img--in { opacity: 1; transform: none; }
.zg-visor__nav {
	position: fixed;
	top: 50%;
	transform: translateY(-50%);
}
.zg-visor__prev { left: 16px; }
.zg-visor__next { right: 16px; }
.zg-visor--una .zg-visor__nav,
.zg-visor--una .zg-visor__miniaturas { display: none; }
.zg-visor__miniaturas {
	display: flex;
	justify-content: center;
	gap: 8px;
	padding: 14px 16px 18px;
	overflow-x: auto;
}
.zg-visor__miniaturas button {
	padding: 0;
	border: 2px solid transparent;
	border-radius: 0;
	overflow: hidden;
	width: 64px;
	height: 48px;
	flex: none;
	background: none;
	opacity: .55;
	transition: opacity .2s, border-color .2s;
}
.zg-visor__miniaturas button[aria-current="true"] {
	opacity: 1;
	border-color: var(--zg-green);
}
.zg-visor__miniaturas img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
@media (max-width: 767px) {
	.zg-visor__fig { padding: 0 12px; }
	.zg-visor__nav { width: 40px; height: 40px; font-size: 22px; }
	.zg-visor__prev { left: 8px; }
	.zg-visor__next { right: 8px; }
}

/* Rejilla: 2 columnas en tableta; 3 en escritorio con la primera ficha a doble ancho */
@media (min-width: 640px) {
	#top .zg-proyectos { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1000px) {
	#top .zg-proyectos { grid-template-columns: repeat(3, 1fr); }
	#top .zg-proyecto:first-child { grid-column: span 2; }
	#top .zg-proyecto:first-child .zg-proyecto__img { aspect-ratio: auto; flex: 1; min-height: 0; }
	#top .zg-proyecto:first-child .zg-proyecto__img img { position: absolute; inset: 0; }
	#top .zg-proyecto:first-child .zg-proyecto__img { position: relative; }
}

/* ==========================================================================
   Menú: sección activa (la marca el JS con .zg-activo)
   ========================================================================== */
.zg-menu-propio #top #wrap_all #header .av-main-nav > li:not(.av-menu-button) > a {
	color: var(--zg-text);
	transition: color .25s var(--zg-ease);
}
.zg-menu-propio #top #wrap_all #header .av-main-nav > li:not(.av-menu-button) > a .avia-menu-fx {
	opacity: 0;
	transform: scaleX(0);
	transition: opacity .25s var(--zg-ease), transform .35s var(--zg-ease);
}
.zg-menu-propio #top #wrap_all #header .av-main-nav > li.zg-activo:not(.av-menu-button) > a,
.zg-menu-propio #top #wrap_all #header .av-main-nav > li:not(.av-menu-button) > a:hover {
	color: var(--zg-green);
}
.zg-menu-propio #top #wrap_all #header .av-main-nav > li.zg-activo:not(.av-menu-button) > a .avia-menu-fx {
	opacity: 1;
	transform: scaleX(1);
	background-color: var(--zg-green);
}

/* ==========================================================================
   Mapa: puntos con fotos (el JS les pone .zg-punto)
   ========================================================================== */
#top #proyectos .av-image-hotspot.zg-punto {
	cursor: pointer;
	transition: transform .3s var(--zg-ease);
}
#top #proyectos .av-image-hotspot.zg-punto:hover,
#top #proyectos .av-image-hotspot.zg-punto:focus-visible {
	transform: scale(1.25);
	z-index: 5;
}
#top #proyectos .av-image-hotspot.zg-punto::after {
	content: "";
	position: absolute;
	inset: -5px;
	border: 2px solid var(--zg-green);
	border-radius: 50%;
	pointer-events: none;
}

/* ==========================================================================
   «Envíanos tu currículum»: el cielo se funde con el blanco arriba y abajo
   ========================================================================== */
#top #empleo { position: relative; }
#top #empleo::before {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	z-index: 0;
	background: linear-gradient(180deg, #fff 0%, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, 0) 70%, #fff 100%);
}
#top #empleo > .av-section-color-overlay-wrap { position: relative; z-index: 1; }
