/* =========================================================
   ENERBIM — hoja de estilos principal
   Dirección visual: ingeniería de precisión. Paleta petróleo
   profundo + cobre señalizador; retícula tipo plano eléctrico
   en el hero; tipografía de sistema (rendimiento / CWV).
   ========================================================= */

:root {
	--c-tinta: #10202e;        /* texto principal */
	--c-petroleo: #123b57;     /* marca */
	--c-petroleo-osc: #0b2a40; /* fondos oscuros */
	--c-cobre: #c65a1e;        /* acento / CTA */
	--c-cobre-osc: #a54815;
	--c-humo: #f4f6f8;         /* fondos claros */
	--c-linea: #d5dde3;
	--c-blanco: #ffffff;
	--c-whatsapp: #1f9e54;

	--fuente: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--ancho: 1140px;
	--radio: 6px;
	--sombra: 0 2px 14px rgba(16, 32, 46, 0.08);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
	margin: 0;
	font-family: var(--fuente);
	font-size: 1.0625rem;
	line-height: 1.65;
	color: var(--c-tinta);
	background: var(--c-blanco);
	-webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--c-petroleo); }
a:hover { color: var(--c-cobre); }
:focus-visible { outline: 3px solid var(--c-cobre); outline-offset: 2px; }

h1, h2, h3 { line-height: 1.2; color: var(--c-petroleo-osc); font-weight: 800; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.9rem, 4.5vw, 2.9rem); }
h2 { font-size: clamp(1.45rem, 3vw, 2rem); margin-top: 0; }
h3 { font-size: 1.15rem; }

.contenedor { max-width: var(--ancho); margin: 0 auto; padding: 0 1.25rem; }
.lector { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.salto-contenido {
	position: absolute; left: -999px; top: 0; background: var(--c-petroleo-osc);
	color: #fff; padding: 0.6rem 1rem; z-index: 1000;
}
.salto-contenido:focus { left: 0; }

/* Firma visual: regla "conductor" bajo los H2 de sección */
.seccion > .contenedor > h2::after,
.pagina-encabezado h1::after {
	content: "";
	display: block;
	width: 64px; height: 4px;
	margin-top: 0.55rem;
	background: linear-gradient(90deg, var(--c-cobre) 0 40px, var(--c-petroleo) 40px);
}

/* ---------- Botones ---------- */
.btn {
	display: inline-block;
	padding: 0.78rem 1.5rem;
	border-radius: var(--radio);
	font-weight: 700;
	text-decoration: none;
	border: 2px solid transparent;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn-primario { background: var(--c-cobre); color: #fff; }
.btn-primario:hover { background: var(--c-cobre-osc); color: #fff; }
.btn-secundario { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.65); }
.btn-secundario:hover { border-color: #fff; color: #fff; }
.btn-whatsapp { background: var(--c-whatsapp); color: #fff; }
.btn-whatsapp:hover { background: #177a40; color: #fff; }

/* ---------- Encabezado ---------- */
.sitio-header {
	position: sticky; top: 0; z-index: 100;
	background: var(--c-blanco);
	border-bottom: 1px solid var(--c-linea);
}
.sitio-header-fila {
	display: flex; align-items: center; justify-content: space-between;
	gap: 1rem; min-height: 72px;
}
.sitio-nombre {
	font-weight: 800; font-size: 1.3rem; letter-spacing: 0.04em;
	color: var(--c-petroleo-osc); text-decoration: none;
}
.custom-logo { max-height: 52px; width: auto; }

.sitio-nav { display: flex; align-items: center; gap: 1.25rem; }
.nav-lista { list-style: none; display: flex; gap: 1.25rem; margin: 0; padding: 0; }
.nav-lista a {
	text-decoration: none; font-weight: 600; color: var(--c-tinta);
	padding: 0.4rem 0; border-bottom: 2px solid transparent;
}
.nav-lista a:hover,
.nav-lista .current-menu-item > a { color: var(--c-petroleo); border-bottom-color: var(--c-cobre); }
.nav-cta { padding: 0.55rem 1.1rem; }

.menu-boton { display: none; background: none; border: 0; padding: 0.6rem; cursor: pointer; }
.menu-boton-lineas,
.menu-boton-lineas::before,
.menu-boton-lineas::after {
	content: ""; display: block; width: 26px; height: 3px;
	background: var(--c-petroleo-osc); border-radius: 2px;
}
.menu-boton-lineas { position: relative; }
.menu-boton-lineas::before { position: absolute; top: -8px; }
.menu-boton-lineas::after { position: absolute; top: 8px; }

/* ---------- Migas ---------- */
.migas {
	max-width: var(--ancho); margin: 0 auto; padding: 0.9rem 1.25rem 0;
	font-size: 0.85rem; color: #5a6a76;
}
.migas a { color: #5a6a76; text-decoration: none; }
.migas a:hover { color: var(--c-cobre); }

/* ---------- Hero (retícula tipo plano) ---------- */
.hero {
	background:
		linear-gradient(rgba(11, 42, 64, 0.94), rgba(11, 42, 64, 0.94)),
		repeating-linear-gradient(0deg, transparent 0 39px, rgba(255,255,255,0.35) 39px 40px),
		repeating-linear-gradient(90deg, transparent 0 39px, rgba(255,255,255,0.35) 39px 40px),
		var(--c-petroleo-osc);
	color: #fff;
	padding: 4.5rem 0 4rem;
}
.hero-interior { padding: 3rem 0 2.5rem; }
.hero-titulo { color: #fff; margin: 0 0 0.8rem; max-width: 22ch; }
.hero-bajada { font-size: 1.15rem; max-width: 62ch; margin: 0 0 1.6rem; color: #dbe6ee; }
.hero-botones { display: flex; flex-wrap: wrap; gap: 0.8rem; margin: 0; }

/* ---------- Secciones y grillas ---------- */
.seccion { padding: 3.5rem 0; }
.seccion:nth-of-type(even) { background: var(--c-humo); }
.grilla { display: grid; gap: 1.4rem; margin-top: 1.6rem; }
.grilla-3 { grid-template-columns: repeat(3, 1fr); }
.grilla-4 { grid-template-columns: repeat(4, 1fr); }

.tarjeta-sector {
	background: var(--c-blanco); border: 1px solid var(--c-linea);
	border-top: 4px solid var(--c-petroleo);
	border-radius: var(--radio); padding: 1.2rem 1.2rem 1rem;
}
.tarjeta-sector h3 { margin: 0 0 0.4rem; }
.tarjeta-sector p { margin: 0; font-size: 0.95rem; color: #455662; }

.card {
	background: var(--c-blanco); border: 1px solid var(--c-linea);
	border-radius: var(--radio); overflow: hidden; box-shadow: var(--sombra);
	display: flex; flex-direction: column;
}
.card-img img { aspect-ratio: 16 / 10; object-fit: cover; width: 100%; }
.card-cuerpo { padding: 1.1rem 1.2rem 1.3rem; display: flex; flex-direction: column; gap: 0.5rem; }
.card-titulo { margin: 0; font-size: 1.08rem; }
.card-titulo a { text-decoration: none; color: var(--c-petroleo-osc); }
.card-titulo a:hover { color: var(--c-cobre); }
.card-texto { margin: 0; font-size: 0.95rem; color: #455662; }
.card-meta { margin: 0; font-size: 0.85rem; color: #5a6a76; display: flex; gap: 0.6rem; flex-wrap: wrap; }
.card-enlace { margin-top: auto; font-weight: 700; text-decoration: none; }

.enlace-mas { font-weight: 700; text-decoration: none; }

/* ---------- Contenido editorial ---------- */
.contenido-editorial { max-width: 780px; padding-top: 1.2rem; padding-bottom: 2.5rem; }
.contenido-editorial h2 { margin-top: 2.2rem; }
.contenido-editorial ul { padding-left: 1.3rem; }
.contenido-editorial blockquote {
	margin: 1.5rem 0; padding: 0.8rem 1.2rem;
	border-left: 4px solid var(--c-cobre); background: var(--c-humo);
}
.entrada-imagen { margin: 0 0 1.5rem; }
.entrada-imagen img { border-radius: var(--radio); }
.entrada-meta { color: #5a6a76; font-size: 0.9rem; }
.pagina-encabezado { padding-top: 1.6rem; }

/* Bloque de fuentes oficiales de los posts */
.fuente-oficial {
	margin-top: 2.5rem; padding: 1.1rem 1.3rem;
	background: var(--c-humo); border: 1px solid var(--c-linea);
	border-left: 5px solid var(--c-petroleo); border-radius: var(--radio);
	font-size: 0.92rem;
}
.fuente-oficial h2, .fuente-oficial h3 { margin-top: 0; font-size: 1rem; }

/* ---------- Proyecto: cuerpo + ficha ---------- */
.proyecto-cuerpo { display: grid; grid-template-columns: 1fr 300px; gap: 2rem; }
.proyecto-ficha {
	background: var(--c-humo); border: 1px solid var(--c-linea);
	border-radius: var(--radio); padding: 1.2rem; align-self: start;
}
.proyecto-ficha h2 { font-size: 1.05rem; margin-top: 0; }
.proyecto-ficha dt { font-weight: 700; margin-top: 0.7rem; }
.proyecto-ficha dd { margin: 0.1rem 0 0; color: #455662; }
.filtro-sectores { display: flex; gap: 0.9rem; flex-wrap: wrap; margin: 1rem 0 0.4rem; }
.filtro-sectores a {
	text-decoration: none; font-weight: 600; font-size: 0.95rem;
	padding: 0.3rem 0.85rem; border: 1px solid var(--c-linea); border-radius: 999px;
}
.filtro-sectores a:hover { border-color: var(--c-cobre); }

/* ---------- FAQ ---------- */
.enerbim-faq { margin-top: 1.2rem; }
.enerbim-faq-item {
	border: 1px solid var(--c-linea); border-radius: var(--radio);
	margin-bottom: 0.7rem; background: var(--c-blanco);
}
.enerbim-faq-item summary {
	cursor: pointer; font-weight: 700; padding: 0.9rem 1.1rem;
	list-style: none; position: relative; padding-right: 2.4rem;
}
.enerbim-faq-item summary::-webkit-details-marker { display: none; }
.enerbim-faq-item summary::after {
	content: "+"; position: absolute; right: 1.1rem; top: 50%;
	transform: translateY(-50%); color: var(--c-cobre); font-size: 1.3rem; font-weight: 800;
}
.enerbim-faq-item[open] summary::after { content: "\2013"; }
.enerbim-faq-respuesta { padding: 0 1.1rem 1rem; color: #455662; }

/* ---------- Bloque de conversión ---------- */
.bloque-conversion {
	background: var(--c-petroleo-osc); color: #fff;
	padding: 3.2rem 1.25rem; text-align: center;
}
.bloque-conversion h2 { color: #fff; }
.bloque-conversion h2::after { display: none; }
.bloque-conversion p { max-width: 56ch; margin: 0.6rem auto 0; color: #dbe6ee; }
.bloque-conversion-botones { display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; margin-top: 1.4rem !important; }

/* ---------- Formulario ---------- */
.enerbim-form { max-width: 640px; }
.enerbim-form p { margin: 0 0 1rem; }
.enerbim-form label { display: block; font-weight: 600; }
.enerbim-form input[type="text"],
.enerbim-form input[type="email"],
.enerbim-form input[type="tel"],
.enerbim-form select,
.enerbim-form textarea {
	width: 100%; margin-top: 0.3rem; padding: 0.65rem 0.75rem;
	border: 1px solid var(--c-linea); border-radius: var(--radio);
	font: inherit; background: var(--c-blanco);
}
.enerbim-form input:focus,
.enerbim-form select:focus,
.enerbim-form textarea:focus { border-color: var(--c-petroleo); outline: 2px solid rgba(18, 59, 87, 0.25); }
.enerbim-form input[type="checkbox"] { margin-right: 0.45rem; }
.enerbim-hp { position: absolute; left: -9999px; }
.enerbim-form-aviso { padding: 0.9rem 1.1rem; border-radius: var(--radio); margin: 0 0 1.2rem; font-weight: 600; }
.enerbim-form-ok { background: #e7f5ec; border: 1px solid #9fd4b2; color: #175a33; }
.enerbim-form-error { background: #fdeeee; border: 1px solid #e6a4a4; color: #7a1f1f; }

/* ---------- WhatsApp flotante ---------- */
.enerbim-wsp-float {
	position: fixed; right: 18px; bottom: 18px; z-index: 999;
	background: var(--c-whatsapp); color: #fff; text-decoration: none;
	font-weight: 700; padding: 0.75rem 1.25rem; border-radius: 999px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}
.enerbim-wsp-float:hover { background: #177a40; color: #fff; }

/* ---------- Pie de página ---------- */
.sitio-footer { background: var(--c-petroleo-osc); color: #cdd9e2; margin-top: 0; }
.footer-columnas {
	display: grid; grid-template-columns: 2fr 1fr 1fr;
	gap: 2rem; padding: 3rem 1.25rem 2rem;
}
.sitio-footer a { color: #eaf1f6; }
.sitio-footer a:hover { color: var(--c-cobre); }
.footer-widget-titulo { color: #fff; font-size: 1.05rem; margin: 0 0 0.6rem; }
.footer-datos { font-style: normal; line-height: 1.9; }
.footer-nav-lista { list-style: none; margin: 0; padding: 0; }
.footer-nav-lista a { text-decoration: none; display: inline-block; padding: 0.2rem 0; }
.footer-legal {
	border-top: 1px solid rgba(255, 255, 255, 0.14);
	padding: 1rem 1.25rem; font-size: 0.85rem;
}

/* ---------- Paginación ---------- */
.paginacion { margin: 2rem 0 3rem; }
.paginacion .nav-links { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.paginacion a, .paginacion span {
	padding: 0.4rem 0.85rem; border: 1px solid var(--c-linea);
	border-radius: var(--radio); text-decoration: none;
}
.paginacion .current { background: var(--c-petroleo); color: #fff; border-color: var(--c-petroleo); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
	.grilla-3 { grid-template-columns: repeat(2, 1fr); }
	.grilla-4 { grid-template-columns: repeat(2, 1fr); }
	.proyecto-cuerpo { grid-template-columns: 1fr; }
	.footer-columnas { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
	.grilla-3, .grilla-4 { grid-template-columns: 1fr; }
	.footer-columnas { grid-template-columns: 1fr; }

	.menu-boton { display: block; }
	.sitio-nav {
		display: none; position: absolute; left: 0; right: 0; top: 72px;
		background: var(--c-blanco); border-bottom: 1px solid var(--c-linea);
		flex-direction: column; align-items: flex-start;
		padding: 1rem 1.25rem 1.4rem; gap: 0.8rem;
	}
	.sitio-nav.abierto { display: flex; }
	.nav-lista { flex-direction: column; gap: 0.4rem; width: 100%; }
}

/* ---------- Accesibilidad de movimiento ---------- */
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.btn { transition: none; }
}
