/*
Theme Name:        enervIA
Theme URI:         https://enervia.info
Author:            enervIA
Author URI:        https://enervia.info
Description:       Tema propio de enervIA. Diseño minimalista de estudio tecnológico, sin constructores visuales. Requiere el plugin «enervIA Proyectos» para el portfolio.
Version:           1.0.2
Requires at least: 6.4
Tested up to:      6.8
Requires PHP:      7.4
License:           Propietario
Text Domain:       enervia
Update URI:        false
*/

/* ---------- Fuentes (servidas desde el propio servidor) ---------- */
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 300; font-display: swap; src: url("assets/fonts/jetbrains-mono-latin-300-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("assets/fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("assets/fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2"); }

/* ---------- Variables ---------- */
:root {
	--accent: #19B8C6;
	--accent-text: #0B6A86;
	--cream: #F2EFE8;
	--sand: #E6E2D9;
	--card: #F7F5F0;
	--ink: #141414;
	--dark: #121212;
	--line: #CFCAC0;
	--line-dark: #2A2A2A;
	--muted: #5F5B53;
	--muted-dark: #B9B5AC;
	--faint-dark: #9A968D;
	--radius: 20px;
	--font: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	--max: 1280px;
	--max-narrow: 1100px;
	--ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
	margin: 0;
	background: var(--cream);
	color: var(--ink);
	font-family: var(--font);
	font-size: 15px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}
[hidden] { display: none !important; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ink); }
a:hover { color: var(--accent-text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-weight: 400; margin: 0; }

.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
.skip-link {
	position: absolute; left: 16px; top: -60px; z-index: 100;
	background: var(--ink); color: var(--cream); padding: 10px 16px; border-radius: 8px;
}
.skip-link:focus { top: 16px; color: var(--cream); }

.site { padding: 24px 24px 0; }

/* ---------- Paneles ---------- */
.panel { max-width: var(--max); margin: 0 auto; border-radius: var(--radius); }
.panel--dark { background: var(--dark); color: var(--cream); overflow: hidden; }
.panel--dark a { color: var(--cream); }
.panel--sand { background: var(--sand); padding: 64px clamp(16px, 4vw, 56px) 72px; }

/* ---------- Navegación ---------- */
.nav {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
	padding: 22px 36px; border-bottom: 1px solid var(--line-dark);
}
.logo { font-size: 18px; font-weight: 500; letter-spacing: -0.02em; text-decoration: none; }
.logo span { color: var(--accent); }
.custom-logo-link img { max-height: 32px; width: auto; }
.nav__list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 28px; font-size: 13px; }
.panel--dark .nav__list a { color: var(--muted-dark); text-decoration: none; transition: color .2s; }
.panel--dark .nav__list a:hover,
.panel--dark .nav__list .current-menu-item > a,
.panel--dark .nav__list .current_page_item > a { color: var(--cream); }
.nav__toggle {
	display: none; background: none; border: 1px solid var(--line-dark); color: var(--cream);
	width: 44px; height: 44px; border-radius: 999px; cursor: pointer; align-items: center; justify-content: center;
}

/* ---------- Cabecera (hero) ---------- */
.hero__inner { padding: 64px 36px 0; }
.hero--page .hero__inner { padding-bottom: 48px; }
.hero--compact .hero__inner { padding: 56px 36px 56px; }
.hero__top {
	display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
	font-size: 12px; color: var(--faint-dark); text-transform: uppercase; letter-spacing: 0.08em;
}
.hero__top a { color: var(--faint-dark); text-decoration: none; }
.hero__top a:hover { color: var(--cream); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); vertical-align: 1px; }
.hero__title {
	margin-top: 48px; max-width: 900px;
	font-size: clamp(44px, 7vw, 96px); line-height: 1.02; letter-spacing: -0.045em;
}
.hero__title--project { font-size: clamp(36px, 5.5vw, 72px); max-width: 1000px; }
.hero__title--page { margin-top: 0; font-size: clamp(36px, 5vw, 64px); }
.hero__foot {
	display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 32px; margin-top: 56px;
}
.hero__text { margin: 0; max-width: 520px; font-size: 15px; line-height: 1.7; color: var(--muted-dark); }
.hero__text--page { margin-top: 28px; max-width: 620px; }
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; }
.hero__inner--404 { padding-bottom: 72px; }

/* Cursor del efecto de escritura */
.hero__title.is-typing::after {
	content: ""; display: inline-block; width: .5em; height: .85em; margin-left: .08em;
	background: var(--accent); vertical-align: -0.05em; animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
/* Mientras carga el script, el titular espera oculto; si el script fallase, aparece igualmente a los 2 s. */
.js .hero__title[data-type]:not(.is-typing):not(.is-done) { opacity: 0; animation: show-late 0s 2s forwards; }
@keyframes show-late { to { opacity: 1; } }

/* Pasos / datos bajo la cabecera */
.steps {
	list-style: none; margin: 72px 0 0; padding: 0;
	display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	border-top: 1px solid var(--line-dark);
}
.steps__item { padding: 20px 36px 28px; border-right: 1px solid var(--line-dark); margin: 0; }
.steps__item:last-child { border-right: 0; }
.steps__meta {
	display: flex; justify-content: space-between; gap: 12px;
	font-size: 11px; color: #8A867E; text-transform: uppercase; letter-spacing: 0.06em; margin: 0;
}
.steps__title { margin-top: 22px; font-size: 26px; letter-spacing: -0.03em; }
.steps--meta { margin-top: 0; }
.steps__value { margin: 18px 0 0; font-size: 14px; color: var(--cream); }
.steps--meta .steps__item { padding: 18px 36px 24px; }

/* ---------- Botones y enlaces ---------- */
.btn {
	display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 24px;
	border-radius: 999px; font-family: inherit; font-size: 13px; text-decoration: none;
	transition: transform .25s var(--ease), background .2s, color .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn .arrow { transition: transform .25s var(--ease); }
.btn:hover .arrow { transform: translate(2px, -2px); }
.panel--dark .btn--light, .btn--light { background: var(--cream); color: var(--dark); }
.panel--dark .btn--accent, .btn--accent { background: var(--accent); color: #0B0B0B; font-size: 14px; }
.btn--outline { border: 1px solid var(--ink); color: var(--ink); }
.btn--outline:hover { background: var(--ink); color: var(--cream); }
.link-light { color: var(--cream); font-size: 13px; min-height: 44px; display: inline-flex; align-items: center; gap: 8px; }
.accent-text { color: var(--accent-text); }

/* ---------- Secciones ---------- */
.section { max-width: var(--max-narrow); margin: 0 auto; padding: 140px 16px 0; }
.section--wide { max-width: var(--max); padding-left: 0; padding-right: 0; }
.section--tight { padding-top: 56px; }
.section__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 24px; }
.section__aside { max-width: 340px; font-size: 13px; line-height: 1.7; margin: 0; }
.label { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.label--dark { color: var(--faint-dark); }
.muted { color: var(--muted); }
.h2 { margin-top: 16px; font-size: clamp(36px, 4.5vw, 56px); line-height: 1.05; letter-spacing: -0.04em; }
.center { display: flex; justify-content: center; margin-top: 48px; }

.split { display: flex; flex-wrap: wrap; gap: 32px; }
.split .label { flex: 1 1 220px; padding-top: 10px; }
.statement { flex: 3 1 560px; margin: 0; font-size: clamp(26px, 3.2vw, 40px); line-height: 1.25; letter-spacing: -0.03em; font-weight: 300; }

.cells { display: grid; border-top: 1px solid var(--line); }
.cells--3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-top: 72px; border-bottom: 1px solid var(--line); }
.cells--3 .cell { padding: 18px 16px 26px; border-right: 1px solid var(--line); }
.cells--3 .cell:last-child { border-right: 0; }
.cell__text { margin-top: 36px; font-size: 14px; }
.cells--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cells--2 .cell { padding: 20px 16px 28px 0; border-bottom: 1px solid var(--line); }
.cells--2 .cell:nth-child(2n) { padding: 20px 0 28px 16px; border-left: 1px solid var(--line); }
.cell__text--lg { margin-top: 18px; font-size: 15px; }

/* Servicios */
.services { list-style: none; margin: 56px 0 0; padding: 0; border-top: 1px solid var(--line); }
.services__item {
	display: grid; grid-template-columns: 56px minmax(0, 1fr) minmax(0, 1.2fr); gap: 24px; align-items: baseline;
	padding: 26px 0; border-bottom: 1px solid var(--line); transition: padding .3s var(--ease);
}
.services__item:hover { padding-left: 8px; }
.services__n { font-size: 12px; color: var(--muted); }
.services__title { font-size: clamp(20px, 2.2vw, 28px); letter-spacing: -0.03em; text-decoration: none; }
.services__desc { font-size: 13px; line-height: 1.6; color: var(--muted); }

/* ---------- Filtros ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
	display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 18px;
	border-radius: 999px; border: 1px solid #A9A398; background: transparent; color: var(--ink);
	font-family: inherit; font-size: 12px; text-decoration: none; cursor: pointer; transition: background .2s, color .2s, border-color .2s;
}
.pill:hover { border-color: var(--ink); color: var(--ink); }
.pill.is-active { background: var(--ink); border-color: var(--ink); color: var(--cream); }
.pill__count { opacity: .6; }
.pill--sm { padding: 0 14px; }

/* ---------- Proyectos: cuadrícula ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; margin-top: 48px; }
.card {
	display: flex; flex-direction: column; background: var(--cream); border: 1px solid #D6D1C7;
	border-radius: 14px; overflow: hidden; text-decoration: none; color: var(--ink);
	transition: transform .35s var(--ease), border-color .2s;
}
.view--grid .card { background: var(--card); }
.card:hover { transform: translateY(-3px); border-color: #A9A398; color: var(--ink); }
.card__media { aspect-ratio: 16 / 10.5; background: repeating-linear-gradient(135deg, #DDD8CE 0 1px, #EAE6DE 1px 12px); overflow: hidden; }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.card:hover .card__media img { transform: scale(1.03); }
.placeholder { height: 100%; display: flex; align-items: center; justify-content: center; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.card__body { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 10px; }
.card__meta { display: flex; justify-content: space-between; gap: 12px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.card__title { font-size: 21px; letter-spacing: -0.03em; line-height: 1.2; }
.card__text { margin: 0; font-size: 13px; line-height: 1.6; color: var(--muted); }
.empty-msg { margin-top: 32px; color: var(--muted); }

/* ---------- Proyectos: lista ---------- */
.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.viewswitch { display: flex; align-items: center; gap: 4px; }
.viewswitch .label { margin-right: 8px; }
.rowhead, .row {
	display: grid; grid-template-columns: 56px minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) 40px; gap: 24px;
}
.rowhead { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.row {
	align-items: baseline; padding: 28px 0; border-bottom: 1px solid var(--line);
	text-decoration: none; color: var(--ink); transition: background .25s, padding .3s var(--ease);
}
.row:hover { color: var(--ink); background: rgba(20, 20, 20, .03); padding-left: 8px; }
.row__n { font-size: 12px; color: var(--muted); }
.row__main { display: flex; flex-direction: column; gap: 8px; }
.row__title { font-size: clamp(20px, 2.2vw, 28px); letter-spacing: -0.03em; line-height: 1.15; }
.row__text { font-size: 13px; line-height: 1.6; color: var(--muted); }
.row__tipo, .row__sector { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.row__sector { color: var(--muted); }
.row__go { justify-self: end; transition: transform .25s var(--ease); }
.row:hover .row__go { transform: translate(2px, -2px); }
.crumbs a { text-decoration: none; }

/* ---------- Mantenimiento ---------- */
.maint { display: flex; flex-wrap: wrap; gap: 48px; align-items: flex-start; }
.maint__lead { flex: 1 1 300px; }
.maint__number { margin-top: 20px; font-size: clamp(80px, 12vw, 160px); line-height: .9; letter-spacing: -0.06em; font-weight: 300; }
.maint__text { margin-top: 12px; font-size: 14px; }
.maint__grid { flex: 1.4 1 420px; }

/* ---------- Contacto ---------- */
.cta { padding: 72px clamp(20px, 4vw, 56px); }
.cta__title { margin-top: 20px; max-width: 860px; font-size: clamp(34px, 5vw, 64px); line-height: 1.05; letter-spacing: -0.04em; }
.cta__foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 32px; margin-top: 48px; }
.cta__text { margin: 0; max-width: 460px; font-size: 14px; line-height: 1.7; color: var(--muted-dark); }
.cta--compact { padding: 56px clamp(20px, 4vw, 56px); display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 32px; }
.cta--compact .cta__title { margin: 0; font-size: clamp(28px, 3.5vw, 44px); line-height: 1.1; max-width: 680px; }
.cta--compact .cta__foot { margin: 0; }

/* ---------- Ficha de proyecto ---------- */
.project-cover { padding-top: 24px; margin-top: 0; margin-bottom: 0; }
.project-cover img { width: 100%; border-radius: var(--radius); }
.prose { padding-top: 96px; max-width: 760px; font-size: 16px; line-height: 1.8; }
.prose > * + * { margin-top: 1.2em; }
.prose h2 { font-size: clamp(26px, 3vw, 36px); letter-spacing: -0.03em; line-height: 1.15; margin-top: 2em; }
.prose h3 { font-size: 20px; letter-spacing: -0.02em; margin-top: 1.8em; }
.prose p { margin-bottom: 0; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li + li { margin-top: .4em; }
.prose img, .prose figure img { border-radius: 14px; }
.prose figure { margin-left: 0; margin-right: 0; }
.prose figcaption { font-size: 12px; color: var(--muted); margin-top: 8px; }
.prose .alignwide { max-width: var(--max-narrow); margin-left: 50%; transform: translateX(-50%); width: calc(100vw - 48px); }
.prose .alignfull { max-width: none; width: calc(100vw - 48px); margin-left: 50%; transform: translateX(-50%); }
.prose blockquote { margin: 2em 0; padding-left: 24px; border-left: 2px solid var(--accent); font-size: 20px; letter-spacing: -0.02em; }
.prose code { font-size: .92em; background: var(--sand); padding: 2px 6px; border-radius: 4px; }
.prose a { text-underline-offset: 3px; }
.wp-block-gallery { gap: 16px; }
.prose .wp-block-table { overflow-x: auto; }
.prose table { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 1.5; }
.prose .wp-block-table thead { border-bottom: 0; }
.prose th, .prose td { border: 0; text-align: left; vertical-align: top; padding: 12px 14px 12px 0; border-bottom: 1px solid var(--line); }
.prose th { font-size: 11px; font-weight: 400; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

.pager { display: flex; justify-content: space-between; gap: 24px; padding-top: 96px; border-top: 0; }
.pager__item { display: flex; flex-direction: column; gap: 10px; max-width: 45%; }
.pager__item a { font-size: clamp(18px, 2vw, 24px); letter-spacing: -0.02em; text-decoration: none; }
.pager__item--end { text-align: right; margin-left: auto; }

/* ---------- Pie ---------- */
.footer {
	max-width: var(--max); margin: 0 auto; padding: 40px 8px 48px;
	display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; font-size: 12px; color: var(--muted);
}
.footer__menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 20px; }
.footer__menu a { color: var(--muted); }

/* ---------- Animaciones de aparición ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }
.js .steps__item { opacity: 0; transform: translateY(10px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.js .steps.is-visible .steps__item { opacity: 1; transform: none; }
.js .steps.is-visible .steps__item:nth-child(2) { transition-delay: .1s; }
.js .steps.is-visible .steps__item:nth-child(3) { transition-delay: .2s; }
.js .steps.is-visible .steps__item:nth-child(4) { transition-delay: .3s; }
.js .steps.is-visible .steps__item:nth-child(5) { transition-delay: .4s; }
.js .steps.is-visible .steps__item:nth-child(6) { transition-delay: .5s; }
.is-hidden { display: none !important; }

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { transition: none !important; animation: none !important; }
	.js .reveal, .js .steps__item { opacity: 1; transform: none; }
}

/* ---------- Móvil ---------- */
@media (max-width: 760px) {
	.site { padding: 12px 12px 0; }
	.nav { padding: 16px 20px; }
	.nav__toggle { display: inline-flex; }
	.nav__menu { display: none; width: 100%; }
	.nav.is-open .nav__menu { display: block; }
	.nav__list { flex-direction: column; gap: 0; padding: 8px 0; }
	.nav__list a { display: block; padding: 12px 0; font-size: 15px; }
	.hero__inner { padding: 40px 20px 0; }
	.hero--page .hero__inner, .hero--compact .hero__inner { padding-bottom: 36px; }
	.hero__title { margin-top: 32px; }
	.hero__foot { margin-top: 36px; }
	.steps { margin-top: 48px; }
	.steps__item { padding: 16px 20px 22px; border-right: 0; border-bottom: 1px solid var(--line-dark); }
	.steps__item:last-child { border-bottom: 0; }
	.section { padding-top: 88px; }
	.cells--3 .cell { border-right: 0; border-bottom: 1px solid var(--line); }
	.cells--3 .cell:last-child { border-bottom: 0; }
	.cells--2 { grid-template-columns: 1fr; }
	.cells--2 .cell, .cells--2 .cell:nth-child(2n) { padding: 18px 0 22px; border-left: 0; }
	.services__item { grid-template-columns: 36px minmax(0, 1fr); }
	.services__desc { grid-column: 2; }
	.grid { grid-template-columns: 1fr; }
	.rowhead { display: none; }
	.row { grid-template-columns: 36px minmax(0, 1fr); gap: 8px 16px; }
	.row__tipo, .row__sector { grid-column: 2; }
	.row__go { display: none; }
	.panel--sand { padding-top: 48px; padding-bottom: 56px; }
	.cta { padding-top: 56px; padding-bottom: 56px; }
}
