/* ==========================================================================
   Lex Hub — hoja de estilos principal
   Estructura: 1 tokens · 2 base · 3 tipografía · 4 componentes · 5 cabecera
   6 inicio · 7 páginas interiores · 8 formulario · 9 blog · 10 pie
   11 consentimiento · 12 utilidades · 13 movimiento
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */
@font-face {
	font-family: "Newsreader";
	src: url("../fonts/newsreader.woff2") format("woff2");
	font-weight: 200 800;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "Instrument Sans";
	src: url("../fonts/instrument-sans.woff2") format("woff2");
	font-weight: 400 700;
	font-style: normal;
	font-display: swap;
}

:root {
	/* Color */
	--ink: #0A2A47;          /* azul marino oscuro (derivado del logotipo): títulos y fondos oscuros */
	--brand: #063F68;        /* azul del logotipo: botones */
	--ink-soft: #1D4466;
	--text: #1D2633;
	--paper: #F5F4EF;        /* blanco roto */
	--paper-deep: #ECE9E1;   /* banda gris piedra clara */
	--white: #FFFFFF;
	--stone: #66625A;        /* gris piedra: texto secundario (5,51:1 sobre papel) */
	--rule: #D5D1C6;
	--rule-strong: #B4AEA1;
	--copper: #CC7824;       /* cobre del logotipo: solo detalles gráficos (3,04:1, no apto para texto) */
	--fir: #9C5400;          /* cobre oscuro: acento para texto pequeño (5,18:1 sobre papel) */
	--fir-light: #E0A15E;    /* cobre claro sobre fondo oscuro (6,57:1) */
	--error: #9A2B22;
	--pending-bg: #F2E3BC;
	--pending-text: #4F3B00;

	/* Tipografía */
	--serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
	--sans: "Instrument Sans", "Helvetica Neue", Arial, system-ui, sans-serif;
	--fs-body: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
	--fs-small: 0.875rem;
	--fs-hero: clamp(2.5rem, 1.55rem + 3.9vw, 4.6rem);
	--fs-display: clamp(2rem, 1.45rem + 2.3vw, 3.2rem);
	--fs-section: clamp(1.75rem, 1.35rem + 1.6vw, 2.5rem);
	--fs-h3: clamp(1.35rem, 1.2rem + 0.6vw, 1.7rem);

	/* Espaciado y medidas */
	--wrap: 1240px;
	--gutter: clamp(1rem, 0.4rem + 2.6vw, 2.5rem);
	--section: clamp(4.5rem, 3rem + 6vw, 8.5rem);
	--header-h: 76px;
	--radius: 2px;
	--ease: cubic-bezier(.2, .7, .2, 1);
}

/* 2. Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
	margin: 0;
	background: var(--paper);
	color: var(--text);
	font-family: var(--sans);
	font-size: var(--fs-body);
	line-height: 1.6;
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--fir); }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; }
button { font: inherit; color: inherit; }
main { display: block; }
main:focus { outline: none; }

:focus-visible { outline: 2px solid var(--fir); outline-offset: 3px; border-radius: 1px; }
.cta-band :focus-visible, .consent :focus-visible, .quick-contact :focus-visible, .aside-box :focus-visible { outline-color: var(--fir-light); }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

.skip-link {
	position: absolute; left: 1rem; top: -100px; z-index: 200;
	background: var(--ink); color: var(--paper); padding: .75rem 1rem; text-decoration: none;
}
.skip-link:focus { top: 1rem; color: var(--paper); }

.visually-hidden, .screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* 3. Tipografía ------------------------------------------------------------ */
h1, h2, h3, h4 { margin: 0; color: var(--ink); font-weight: 400; }
.hero-title, .h-display, .h-section, .page-title, .cta-title,
.prose h2, .service-name, .service-row-title, .client-list, .post-card-title, .member-name {
	font-family: var(--serif);
	font-weight: 380;
	letter-spacing: -0.012em;
	font-optical-sizing: auto;
}
.h-display { font-size: var(--fs-display); line-height: 1.1; }
.h-section { font-size: var(--fs-section); line-height: 1.15; }
.h-small { font-family: var(--sans); font-size: 1.0625rem; font-weight: 600; letter-spacing: 0; margin-bottom: 1.25rem; }

/* 4. Componentes ----------------------------------------------------------- */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
	min-height: 48px; padding: .8rem 1.4rem;
	border: 1px solid transparent; border-radius: var(--radius);
	font-family: var(--sans); font-size: .95rem; font-weight: 600; letter-spacing: .01em; line-height: 1.2;
	text-decoration: none; cursor: pointer;
	transition: background-color .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
}
.btn-primary { background: var(--brand); color: var(--white); }
.btn-primary:hover { background: var(--ink); color: var(--white); }
.btn-ghost { border-color: var(--brand); color: var(--brand); background: transparent; }
.btn-ghost:hover { background: var(--brand); color: var(--white); }
.btn-light { background: var(--paper); color: var(--ink); }
.btn-light:hover { background: var(--white); color: var(--brand); }

.text-link {
	font-weight: 600; font-size: .95rem; color: var(--ink);
	text-decoration: underline; text-decoration-color: var(--rule-strong);
	transition: text-decoration-color .2s, color .2s;
}
.text-link:hover { color: var(--fir); text-decoration-color: currentColor; }

.link-button {
	background: none; border: 0; padding: 0; cursor: pointer;
	text-decoration: underline; text-underline-offset: .2em; font-size: inherit;
}

.pending {
	background: var(--pending-bg); color: var(--pending-text);
	padding: .05em .35em; border-radius: var(--radius);
	font-family: var(--sans); font-size: .9em; font-weight: 600;
}

.section { padding-block: var(--section); }
.section-head { max-width: 46rem; margin-bottom: clamp(2.5rem, 2rem + 2vw, 4rem); }
.section-head p { color: var(--stone); margin-top: 1rem; font-size: 1.0625rem; }
.section-head-row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; max-width: none; flex-wrap: wrap; }
.section-foot { margin-top: clamp(2rem, 1.5rem + 2vw, 3.5rem); }

.split {
	display: grid; gap: clamp(2rem, 1rem + 4vw, 6rem);
	grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
	align-items: start;
}

/* 5. Cabecera -------------------------------------------------------------- */
.site-header {
	position: sticky; top: 0; z-index: 100;
	background: var(--paper);
	border-bottom: 1px solid transparent;
	transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--rule); }
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }

.header-inner { display: flex; align-items: center; gap: 2rem; min-height: var(--header-h); }

.brand { display: inline-flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--ink); flex-shrink: 0; }
.brand:hover { color: var(--ink); }
.brand-mark { width: auto; height: 40px; }
.brand-word { font-family: var(--sans); font-weight: 700; font-size: 1.2rem; letter-spacing: .04em; color: var(--brand); line-height: 1; }
.brand-stacked { display: inline-block; }
.brand-stacked img { width: 96px; height: auto; }

.main-nav { margin-left: auto; }
.main-nav .menu { list-style: none; display: flex; align-items: center; gap: clamp(1rem, .4rem + 1.2vw, 2rem); }
.main-nav .menu > li { position: relative; }
.main-nav a { text-decoration: none; font-size: .95rem; font-weight: 500; color: var(--ink); padding-block: .5rem; display: inline-block; }
.main-nav .menu > li > a { background-image: linear-gradient(currentColor, currentColor); background-size: 0 1px; background-repeat: no-repeat; background-position: 0 100%; transition: background-size .3s var(--ease), color .2s; }
.main-nav .menu > li > a:hover,
.main-nav .menu > .current-menu-item > a,
.main-nav .menu > .current-menu-ancestor > a,
.main-nav .menu > .current-menu-parent > a { background-size: 100% 1px; }
.main-nav a:hover { color: var(--fir); }

/* Submenú (Servicios) */
.submenu-toggle {
	background: none; border: 0; padding: .25rem; margin-left: .1rem; cursor: pointer; vertical-align: middle; color: var(--ink);
}
.submenu-toggle svg { width: 12px; height: 12px; transition: transform .25s var(--ease); }
.submenu-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.main-nav .sub-menu {
	list-style: none; position: absolute; top: calc(100% + .6rem); left: -1.25rem; min-width: 270px;
	background: var(--white); border: 1px solid var(--rule); padding: .6rem 0;
	opacity: 0; visibility: hidden; transform: translateY(-4px);
	transition: opacity .2s var(--ease), transform .2s var(--ease), visibility 0s .2s;
}
.main-nav .sub-menu a { display: block; padding: .55rem 1.25rem; font-size: .95rem; }
.main-nav .sub-menu a:hover { background: var(--paper); }
.main-nav li.is-open > .sub-menu,
.no-js .main-nav li:hover > .sub-menu,
.no-js .main-nav li:focus-within > .sub-menu {
	opacity: 1; visibility: visible; transform: none; transition-delay: 0s;
}
@media (hover: hover) and (min-width: 1061px) {
	.main-nav li:hover > .sub-menu { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
}

.header-cta { min-height: 42px; padding: .6rem 1.15rem; }
.main-nav .nav-cta-mobile { display: none; color: var(--white); padding: .8rem 1.4rem; }
.main-nav .nav-cta-mobile:hover { color: var(--white); }

.nav-toggle {
	display: none; margin-left: auto; align-items: center; gap: .6rem;
	background: none; border: 0; padding: .6rem 0; cursor: pointer; font-weight: 600; font-size: .95rem; color: var(--ink);
}
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
	display: block; width: 22px; height: 1.5px; background: currentColor; transition: transform .3s var(--ease), opacity .2s;
}
.nav-toggle-bars { position: relative; }
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -7px; }
.nav-toggle-bars::after { top: 7px; }
.nav-open .nav-toggle-bars { background: transparent; }
.nav-open .nav-toggle-bars::before { transform: translateY(7px) rotate(45deg); }
.nav-open .nav-toggle-bars::after { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 1060px) {
	:root { --header-h: 64px; }
	.header-cta { display: none; }
	.nav-toggle { display: inline-flex; }
	.main-nav {
		position: fixed; inset: var(--header-h) 0 0 0; z-index: 99;
		background: var(--paper); border-top: 1px solid var(--rule);
		padding: 1.5rem var(--gutter) 2.5rem; overflow-y: auto;
		display: flex; flex-direction: column; gap: 2rem;
		opacity: 0; visibility: hidden; transform: translateY(-8px);
		transition: opacity .25s var(--ease), transform .25s var(--ease), visibility 0s .25s;
	}
	.admin-bar .main-nav { top: calc(var(--header-h) + 46px); }
	.nav-open .main-nav { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
	.nav-open { overflow: hidden; }
	.main-nav .menu { flex-direction: column; align-items: stretch; gap: 0; }
	.main-nav .menu > li { border-bottom: 1px solid var(--rule); display: flex; flex-wrap: wrap; align-items: center; }
	.main-nav .menu > li > a { font-family: var(--serif); font-size: 1.75rem; font-weight: 380; padding-block: .85rem; flex: 1; background: none; }
	.submenu-toggle { padding: .9rem; }
	.submenu-toggle svg { width: 16px; height: 16px; }
	.main-nav .sub-menu {
		position: static; width: 100%; min-width: 0; border: 0; background: transparent; padding: 0 0 .9rem;
		opacity: 1; visibility: visible; transform: none; display: none;
	}
	.main-nav li.is-open > .sub-menu { display: block; }
	.main-nav .sub-menu a { padding: .45rem 0; font-size: 1.0625rem; }
	.main-nav .sub-menu a:hover { background: none; }
	.main-nav .nav-cta-mobile { display: inline-flex; align-self: flex-start; }
}

/* 6. Inicio ---------------------------------------------------------------- */
.hero { padding-block: clamp(3.5rem, 2rem + 6vw, 7.5rem) clamp(4rem, 2rem + 6vw, 8rem); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(2rem, 1rem + 4vw, 5rem); align-items: center; }
.hero-title { font-size: var(--fs-hero); line-height: 1.03; max-width: 15ch; text-wrap: balance; }
.hero-lead { font-size: clamp(1.2rem, 1.1rem + .45vw, 1.45rem); color: var(--ink); max-width: 34ch; margin: 1.75rem 0 1rem; line-height: 1.45; }
.hero-text { color: var(--stone); max-width: 52ch; margin: 0 0 2.5rem; font-size: 1.0625rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .85rem; }

.hub { margin: 0; color: var(--rule-strong); justify-self: end; width: 100%; max-width: 440px; }
.hub-svg { width: 100%; overflow: visible; }
.hub-lines path { stroke: var(--stone); }
.hub-ends circle { fill: var(--brand); }
.hub-ring { stroke: var(--rule-strong); }
.hub-core { fill: var(--copper); }
.hub-labels text { font-family: var(--sans); font-size: 15px; font-weight: 500; letter-spacing: .02em; fill: var(--ink); }

.value { border-top: 1px solid var(--rule); }
.value .h-display { max-width: 14ch; position: sticky; top: calc(var(--header-h) + 2rem); }
.value-body p { font-size: 1.125rem; max-width: 60ch; }
.diff { background: var(--paper-deep); }
.diff-intro p { font-size: 1.125rem; margin-top: 1.5rem; max-width: 42ch; }
.principles { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.5rem clamp(1.5rem, 1rem + 2vw, 3rem); }
.principles li { border-top: 1px solid var(--ink); padding-top: 1.25rem; }
.principles h3 { font-family: var(--sans); font-size: 1.0625rem; font-weight: 600; margin-bottom: .6rem; }
.principles p { color: var(--text); margin: 0; }

/* Áreas de servicio en la portada */
.services { background: var(--white); border-block: 1px solid var(--rule); }
.area { padding-block: clamp(3.5rem, 2.5rem + 4vw, 6.5rem); }
.area + .area { border-top: 1px solid var(--rule); }
.area-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(2rem, 1rem + 4vw, 6rem); align-items: start; }
.area-label { display: flex; align-items: baseline; gap: .75rem; font-weight: 600; color: var(--ink); margin-bottom: 1.25rem; }
.area-num { color: var(--fir); font-size: var(--fs-small); font-variant-numeric: tabular-nums; }
.area-title { font-family: var(--serif); font-weight: 380; letter-spacing: -0.012em; font-size: var(--fs-section); line-height: 1.15; max-width: 22ch; margin-bottom: 1.5rem; }
.area-main p { max-width: 58ch; color: var(--text); }
.area-main .btn { margin-top: 1rem; }
.area-list { border-top: 2px solid var(--copper); padding-top: 1.25rem; }
.area-list-title { font-family: var(--sans); font-size: var(--fs-small); font-weight: 600; color: var(--stone); margin-bottom: .75rem; }
.area-list ul { list-style: none; }
.area-list li { padding: .6rem 0; border-bottom: 1px solid var(--rule); }

.kicker { font-weight: 600; color: var(--fir); margin-bottom: 1rem; }
.diff-intro p:not(.kicker) { font-size: 1.125rem; margin-top: 1.25rem; max-width: 42ch; }

.clients .h-section { margin-bottom: clamp(2rem, 1.5rem + 2vw, 3rem); }
.client-grid { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.5rem clamp(1.5rem, 1rem + 2vw, 3rem); }
.client-grid li { border-top: 1px solid var(--ink); padding-top: 1.25rem; }
.client-grid h3 { font-family: var(--serif); font-size: var(--fs-h3); font-weight: 400; margin-bottom: .5rem; }
.client-grid p { color: var(--stone); margin: 0; max-width: 36ch; }

.long { border-top: 1px solid var(--rule); }
.long-body p { font-size: 1.1875rem; max-width: 56ch; }
.long-body p:first-child { font-family: var(--serif); font-size: clamp(1.4rem, 1.2rem + .9vw, 1.9rem); line-height: 1.3; color: var(--ink); }

.method { background: var(--white); border-top: 1px solid var(--rule); }
.method .h-section { margin-bottom: clamp(2.5rem, 2rem + 2vw, 4rem); }
.steps { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; counter-reset: none; }
.step { border-top: 1px solid var(--ink); padding: 1.5rem clamp(1rem, .5rem + 1.5vw, 2rem) 0 0; position: relative; }
.step::before {
	content: ""; position: absolute; top: -5px; left: 0; width: 9px; height: 9px; border-radius: 50%; background: var(--brand);
}
.step:last-child::before { background: var(--copper); }
.step-num { display: block; font-size: var(--fs-small); font-weight: 600; color: var(--fir); margin-bottom: .75rem; font-variant-numeric: tabular-nums; }
.step h3 { font-family: var(--serif); font-size: var(--fs-h3); font-weight: 400; margin-bottom: .6rem; }
.step p { color: var(--stone); margin: 0; max-width: 30ch; }

/* Llamada a la acción final */
.cta-band { border-top: 3px solid var(--copper); background: var(--ink); color: var(--paper); padding-block: clamp(4.5rem, 3rem + 6vw, 8rem); }
.cta-inner { display: grid; justify-items: start; }
.cta-title { color: var(--paper); font-size: var(--fs-display); line-height: 1.08; max-width: 22ch; margin-bottom: 1.25rem; }
.cta-title + .btn { margin-top: 1rem; }
.cta-text { color: #C9D3DD; font-size: 1.125rem; max-width: 46ch; margin: 0 0 2.25rem; }

/* 7. Páginas interiores ---------------------------------------------------- */
.page-hero { padding-block: clamp(2rem, 1.2rem + 3vw, 4rem) clamp(2.5rem, 1.5rem + 3vw, 4.5rem); border-bottom: 1px solid var(--rule); }
.page-title { font-size: clamp(2.2rem, 1.5rem + 3vw, 4rem); line-height: 1.06; max-width: 22ch; text-wrap: balance; }
.page-lead { font-size: clamp(1.125rem, 1.05rem + .35vw, 1.3rem); color: var(--stone); max-width: 56ch; margin: 1.5rem 0 0; line-height: 1.5; }
.page-lead p { margin: 0 0 .6em; }
.page-lead p:last-child { margin-bottom: 0; }
.page-lead p:first-child { color: var(--ink); }

.crumbs { margin-bottom: clamp(1.5rem, 1rem + 2vw, 2.75rem); font-size: var(--fs-small); color: var(--stone); }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .25rem .5rem; }
.crumbs li:not(:last-child)::after { content: "/"; margin-left: .5rem; color: var(--rule-strong); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

.page-body { padding-block: clamp(3rem, 2rem + 4vw, 6rem); }

.prose { max-width: 70ch; }
.prose > *:first-child { margin-top: 0; }
.prose p, .prose li { font-size: 1.0625rem; }
.prose h2 { font-size: clamp(1.6rem, 1.35rem + 1vw, 2.1rem); line-height: 1.2; margin: 3.25rem 0 1.25rem; }
.prose h3 { font-family: var(--sans); font-size: 1.0625rem; font-weight: 600; color: var(--ink); margin: 2rem 0 .5rem; }
.prose ul, .prose ol { padding-left: 1.2em; margin: 0 0 1.25em; }
.prose li { margin-bottom: .45em; }
.prose li::marker { color: var(--copper); }
.prose a { color: var(--ink); text-decoration-color: var(--fir); }
.prose a:hover { color: var(--fir); }
.prose blockquote { margin: 2rem 0; padding-left: 1.5rem; border-left: 2px solid var(--copper); font-family: var(--serif); font-size: 1.35rem; line-height: 1.45; color: var(--ink); }
.prose img { margin-block: 2rem; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.5rem 0 2rem; font-size: .9375rem; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: .75rem 1rem .75rem 0; border-bottom: 1px solid var(--rule); min-width: 9rem; }
.prose th { font-weight: 600; color: var(--ink); border-bottom-color: var(--ink); }
.prose .legal-warning { background: var(--pending-bg); color: var(--pending-text); padding: 1rem 1.25rem; font-weight: 600; font-size: .9375rem; }
.prose .legal-date { margin-top: 3rem; color: var(--stone); font-size: var(--fs-small); }
.prose-intro p { font-size: 1.1875rem; }
.prose-legal { max-width: 74ch; }

/* Índice de servicios */
.service-index { list-style: none; margin-top: clamp(2.5rem, 2rem + 2vw, 4rem); border-top: 1px solid var(--ink); }
.service-row {
	display: grid; grid-template-columns: 4rem minmax(0, 5fr) minmax(0, 6fr); gap: 1.5rem clamp(1.5rem, 1rem + 2vw, 3.5rem);
	padding-block: clamp(2rem, 1.5rem + 2vw, 3.25rem); border-bottom: 1px solid var(--rule);
}
.service-row .service-num { margin: .65rem 0 0; }
.service-row-title { font-size: clamp(1.75rem, 1.45rem + 1.2vw, 2.4rem); line-height: 1.1; margin-bottom: .85rem; }
.service-row-title a { text-decoration: none; }
.service-row-title a:hover { text-decoration: underline; text-decoration-color: var(--fir); }
.service-row-main p { color: var(--stone); max-width: 44ch; margin: 0; }
.topic-list { list-style: none; columns: 2; column-gap: 2rem; font-size: .9375rem; padding-top: .6rem; }
.topic-list li { break-inside: avoid; padding: .35rem 0; border-bottom: 1px solid var(--rule); }

/* Página de servicio */
.service-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: clamp(2.5rem, 1rem + 5vw, 6rem); align-items: start; }
.service-layout .prose h2 { font-size: clamp(1.4rem, 1.25rem + .6vw, 1.75rem); border-top: 1px solid var(--rule); padding-top: 1.75rem; margin-top: 2.5rem; }
.service-layout .prose > p:first-child { font-family: var(--serif); font-size: clamp(1.35rem, 1.2rem + .7vw, 1.7rem); line-height: 1.35; color: var(--ink); }
.service-aside { position: sticky; top: calc(var(--header-h) + 2rem); display: grid; gap: 2.5rem; }
.aside-box { background: var(--ink); color: var(--paper); padding: 1.75rem; border-top: 3px solid var(--copper); }
.aside-box .aside-title { color: var(--paper); }
.aside-box p { color: #C9D3DD; font-size: .9375rem; margin-bottom: 1.5rem; }
.aside-box .btn-primary { background: var(--paper); color: var(--ink); width: 100%; margin-top: 1.5rem; }
.aside-box .btn-primary:hover { background: var(--white); color: var(--brand); }
.aside-list { list-style: none; font-size: .9375rem; }
.aside-list li { padding: .45rem 0; border-bottom: 1px solid rgba(245, 244, 239, .15); color: #DCE3EA; }
.aside-box :focus-visible { outline-color: var(--fir-light); }
.aside-title { font-family: var(--serif); font-size: 1.4rem; font-weight: 400; line-height: 1.2; margin-bottom: .75rem; }
.aside-nav ul { list-style: none; border-top: 1px solid var(--ink); }
.aside-nav li { border-bottom: 1px solid var(--rule); }
.aside-nav a { display: block; padding: .8rem 0; text-decoration: none; font-weight: 500; }
.aside-nav a:hover { color: var(--fir); }

/* Tipos de cliente: títulos a la izquierda, texto a la derecha */
.prose-split { max-width: none; display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); column-gap: clamp(2rem, 1rem + 4vw, 6rem); }
.prose-split > * { grid-column: 2; }
.prose-split > h2 { grid-column: 1; margin: 0; padding-top: 2rem; border-top: 1px solid var(--ink); font-size: clamp(1.5rem, 1.3rem + .8vw, 2rem); }
.prose-split > h2 + p { padding-top: 2rem; border-top: 1px solid var(--rule); margin-top: 0; }
.prose-split > p { max-width: 62ch; }
.prose-split > p:not(h2 ~ p) { font-size: 1.1875rem; grid-column: 1 / -1; max-width: 60ch; }
.prose-split > p:not(h2 ~ p) + h2 { margin-top: 2rem; }
.prose-split > h2 ~ h2 { margin-top: 3rem; }
.prose-split > h2 ~ h2 + p { margin-top: 3rem; }

/* Sobre Lex Hub */
.prose-about > p:first-child { font-family: var(--serif); font-size: clamp(1.5rem, 1.25rem + 1vw, 2rem); line-height: 1.35; color: var(--ink); max-width: 32ch; margin-bottom: 2rem; }
.prose-about ul { list-style: none; padding: 0; border-top: 1px solid var(--ink); margin: 2rem 0; }
.prose-about ul li { padding: .9rem 0; border-bottom: 1px solid var(--rule); font-family: var(--serif); font-size: 1.25rem; color: var(--ink); }

.team { border-top: 1px solid var(--rule); padding-top: clamp(3rem, 2rem + 3vw, 5rem); }
.team .h-section { margin-bottom: 2.5rem; }
.team-grid { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 3rem 2rem; }
.member-photo { aspect-ratio: 4 / 5; background: var(--paper-deep); margin-bottom: 1.25rem; overflow: hidden; display: grid; place-items: center; }
.member-photo img { width: 100%; height: 100%; object-fit: cover; }
.member-placeholder { width: 30%; opacity: .35; }
.member-name { font-size: 1.5rem; line-height: 1.2; }
.member-role { color: var(--fir); font-weight: 600; font-size: .9375rem; margin: .35rem 0 .75rem; }
.member-bio { font-size: .9375rem; }
.member-areas { font-size: var(--fs-small); color: var(--stone); }

.admin-note { border: 1px dashed var(--rule-strong); padding: 1.5rem; background: var(--white); font-size: .9375rem; max-width: 60rem; }

/* 404 */
.not-found { max-width: 40rem; }
.link-list { list-style: none; border-top: 1px solid var(--ink); margin-bottom: 2.5rem; }
.link-list li { border-bottom: 1px solid var(--rule); }
.link-list a { display: block; padding: .85rem 0; text-decoration: none; font-weight: 500; }

/* 8. Formulario ------------------------------------------------------------ */
.contact-layout { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: clamp(2.5rem, 1rem + 5vw, 6rem); align-items: start; }
.contact-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4rem 1.25rem; }
.field { display: grid; gap: .45rem; align-content: start; }
.field-full, .privacy-layer, .form-actions { grid-column: 1 / -1; }
.field label { font-weight: 600; font-size: .9375rem; color: var(--ink); }
.req { color: var(--error); }
.opt { font-weight: 400; color: var(--stone); }
.field input, .field select, .field textarea, .search-row input {
	width: 100%; font: inherit; font-size: 1rem; color: var(--text);
	background: var(--white); border: 1px solid var(--rule-strong); border-radius: var(--radius);
	padding: .8rem .9rem; min-height: 50px;
	transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 160px; line-height: 1.5; }
.field select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%230F1B2D' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 1rem center; padding-right: 2.5rem; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--stone); }
.field input:focus, .field select:focus, .field textarea:focus, .search-row input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(6, 63, 104, .2); }
.has-error input, .has-error select, .has-error textarea { border-color: var(--error); }
.field-error { color: var(--error); font-size: .875rem; font-weight: 600; margin: 0; }
.field-hint { color: var(--stone); font-size: .8125rem; margin: 0; }
.field-check { grid-template-columns: auto 1fr; align-items: start; column-gap: .75rem; }
.field-check input { width: 20px; height: 20px; min-height: 0; margin: .15rem 0 0; accent-color: var(--ink); }
.field-check label { font-weight: 400; }
.field-check .field-error { grid-column: 2; }
.privacy-layer { font-size: .8125rem; color: var(--stone); border-top: 1px solid var(--rule); padding-top: 1rem; line-height: 1.55; }
.privacy-layer p { margin: 0; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; }
.form-note { font-size: .8125rem; color: var(--stone); margin: 0; }
.form-actions .btn[disabled] { opacity: .6; cursor: progress; }

.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.form-status { padding: 1.25rem 1.5rem; margin-bottom: 2rem; border-left: 3px solid; }
.form-status:focus { outline: none; }
.form-status p:last-child { margin: 0; }
.form-status.is-success { background: #E7EEF4; border-color: var(--brand); color: var(--ink); }
.form-status.is-error { background: #F6E7E4; border-color: var(--error); color: #5C1A14; font-weight: 600; }
.form-status-title { font-family: var(--serif); font-size: 1.75rem; margin-bottom: .5rem; }

.contact-details dl { margin: 0; border-top: 1px solid var(--ink); }
.contact-details .office-name { color: var(--brand); }
.contact-details dl > div { padding-block: 1.1rem; border-bottom: 1px solid var(--rule); }
.contact-details dt { font-size: var(--fs-small); color: var(--stone); margin-bottom: .25rem; }
.contact-details dd { margin: 0; font-size: 1.0625rem; color: var(--ink); }
.contact-brand { font-weight: 700; color: var(--brand); letter-spacing: .04em; margin: 0 0 .5rem; }
.offices { display: grid; gap: 1.25rem; margin-bottom: 1.75rem; }
.office-name { font-weight: 600; color: var(--ink); margin: 0 0 .2rem; }
.office address { font-style: normal; line-height: 1.55; }
.contact-list { margin: 0; }
.site-footer .offices { gap: 1rem; margin-bottom: 1.25rem; }
.site-footer .contact-list dt { color: var(--stone); font-size: var(--fs-small); }
.site-footer .contact-list dd { margin: 0 0 .6rem; }

.search-form { max-width: 32rem; }
.search-label { display: block; font-weight: 600; font-size: .9375rem; margin-bottom: .5rem; }
.search-row { display: flex; gap: .5rem; }

/* 9. Blog ------------------------------------------------------------------ */
.cat-filter { margin-bottom: clamp(2rem, 1.5rem + 2vw, 3rem); }
.cat-filter ul { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; }
.cat-filter a { display: inline-block; padding: .45rem .95rem; border: 1px solid var(--rule-strong); border-radius: 999px; text-decoration: none; font-size: .9rem; font-weight: 500; }
.cat-filter a:hover { border-color: var(--ink); color: var(--ink); }
.cat-filter a[aria-current="page"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3rem clamp(1.5rem, 1rem + 2vw, 3rem); }
.post-card { border-top: 1px solid var(--ink); padding-top: 1.25rem; display: flex; flex-direction: column; position: relative; }
.post-card-media { order: -1; margin: -1.25rem 0 1.25rem; aspect-ratio: 3 / 2; overflow: hidden; background: var(--paper-deep); }
.post-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.post-card:hover .post-card-media img { transform: scale(1.03); }
.post-meta { display: flex; flex-wrap: wrap; gap: .25rem 1rem; font-size: var(--fs-small); color: var(--stone); margin-bottom: .75rem; }
.post-cat { color: var(--fir); font-weight: 600; text-decoration: none; position: relative; z-index: 1; }
.post-card-title { font-size: 1.5rem; line-height: 1.22; margin-bottom: .75rem; }
.post-card-title a { text-decoration: none; }
.post-card-title a::after { content: ""; position: absolute; inset: 0; }
.post-card:hover .post-card-title a { color: var(--fir); }
.post-card-excerpt { color: var(--stone); font-size: .9375rem; margin: 0; }
.latest { border-top: 1px solid var(--rule); }

.pagination { margin-top: 4rem; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: .5rem; }
.pagination .page-numbers { display: inline-flex; min-width: 44px; min-height: 44px; align-items: center; justify-content: center; padding: 0 .9rem; border: 1px solid var(--rule-strong); text-decoration: none; }
.pagination .page-numbers.current { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.empty-state { max-width: 40rem; color: var(--stone); }

.article-title { max-width: 24ch; }
.article-hero .post-meta { margin-bottom: 1.25rem; }
.article-media { margin-block: clamp(2rem, 1.5rem + 2vw, 3.5rem) 0; }
.article-media img { width: 100%; }
.article-media figcaption { font-size: var(--fs-small); color: var(--stone); margin-top: .75rem; }
.article-body { margin-inline: auto; }
.article-body p, .article-body li { font-size: 1.125rem; line-height: 1.7; }
.article-foot { margin-top: 3.5rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); font-size: var(--fs-small); color: var(--stone); }
.article-foot p { font-size: var(--fs-small) !important; }

/* 10. Pie ------------------------------------------------------------------ */
.site-footer { background: var(--paper-deep); padding-block: clamp(3.5rem, 2.5rem + 3vw, 5.5rem) 0; font-size: .9375rem; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 4fr) repeat(3, minmax(0, 2.5fr)); gap: 2.5rem clamp(1.5rem, 1rem + 2vw, 3rem); }
.footer-brand p { color: var(--stone); max-width: 32ch; margin: .5rem 0 0; }
.footer-brand .footer-areas { color: var(--ink); font-weight: 600; margin-top: 1.25rem; }
.footer-brand a { text-decoration: none; }
.footer-title { font-family: var(--sans); font-size: var(--fs-small); font-weight: 600; color: var(--stone); margin-bottom: 1rem; }
.footer-col ul { list-style: none; display: grid; gap: .55rem; }
.footer-col a { text-decoration: none; }
.footer-col a:hover { text-decoration: underline; }
.footer-bottom {
	display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem 2rem;
	margin-top: clamp(3rem, 2rem + 3vw, 4.5rem); padding-block: 1.5rem; border-top: 1px solid var(--rule-strong);
	font-size: var(--fs-small); color: var(--stone);
}
.footer-bottom p { margin: 0; }
.footer-bottom nav { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: center; }
.legal-menu { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
.legal-menu a, .footer-bottom .link-button { color: var(--stone); text-decoration: none; }
.legal-menu a:hover, .footer-bottom .link-button:hover { color: var(--ink); text-decoration: underline; }

.quick-contact { display: none; }

/* 11. Consentimiento ------------------------------------------------------- */
.consent {
	position: fixed; z-index: 300; left: 1rem; right: 1rem; bottom: 1rem;
	max-width: 30rem; background: var(--ink); color: var(--paper); padding: 1.5rem;
	box-shadow: 0 18px 40px -18px rgba(10, 42, 71, .55);
}
.consent[hidden] { display: none; }
.consent-title { color: var(--paper); font-family: var(--serif); font-size: 1.4rem; margin-bottom: .6rem; }
.consent p { font-size: .875rem; color: #D2D6DC; }
.consent a { color: var(--paper); }
.consent-prefs { border-top: 1px solid rgba(245, 244, 239, .2); padding-top: 1rem; margin-bottom: 1rem; display: grid; gap: .85rem; }
.consent-prefs[hidden] { display: none; }
.consent-row { display: grid; grid-template-columns: auto 1fr; gap: .6rem; font-size: .875rem; align-items: start; }
.consent-row input { width: 18px; height: 18px; margin-top: .15rem; accent-color: var(--fir-light); }
.consent-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.btn-consent { background: transparent; color: var(--paper); border-color: rgba(245, 244, 239, .7); min-height: 44px; padding: .55rem .5rem; font-size: .875rem; }
.btn-consent:hover { background: var(--paper); color: var(--ink); }
.btn-consent[hidden] { display: none; }

/* 12. Responsive ----------------------------------------------------------- */
@media (max-width: 1060px) {
	.footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.footer-brand { grid-column: 1 / -1; }
	.service-layout { grid-template-columns: minmax(0, 1fr); }
	.service-aside { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem; align-items: start; }
	.service-row { grid-template-columns: 3rem minmax(0, 1fr); }
	.topic-list { grid-column: 2; }
	.post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
	.hero-grid, .split, .contact-layout, .area-grid { grid-template-columns: minmax(0, 1fr); }
	.client-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.hub { display: none; }
	.value .h-display { position: static; }
	.principles { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
	.steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 2.5rem; }
	.prose-split { grid-template-columns: minmax(0, 1fr); }
	.prose-split > *, .prose-split > h2 { grid-column: 1; }
	.prose-split > h2 + p { border-top: 0; padding-top: 1rem; }
	.prose-split > h2 ~ h2 + p { margin-top: 0; }
}

@media (max-width: 680px) {
	body { padding-bottom: 60px; }
	.hero { padding-top: 2.5rem; }
	.hero-actions .btn { width: 100%; }
	.client-grid { grid-template-columns: minmax(0, 1fr); }
	.area-main .btn { width: 100%; }
	.steps { grid-template-columns: minmax(0, 1fr); }
	.step { padding-right: 0; }
	.contact-form { grid-template-columns: minmax(0, 1fr); }
	.form-actions .btn { width: 100%; }
	.service-aside { grid-template-columns: minmax(0, 1fr); }
	.service-row { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
	.service-row .service-num { margin: 0; }
	.topic-list { grid-column: 1; columns: 1; }
	.post-grid { grid-template-columns: minmax(0, 1fr); }
	.footer-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
	.footer-contact { grid-column: 1 / -1; }
	.footer-bottom { flex-direction: column; align-items: flex-start; }
	.consent { left: .5rem; right: .5rem; bottom: calc(60px + .5rem); padding: 1.25rem; }

	.quick-contact {
		display: flex; position: fixed; z-index: 90; left: 0; right: 0; bottom: 0;
		background: var(--ink); border-top: 1px solid var(--ink-soft);
		padding-bottom: env(safe-area-inset-bottom);
	}
	.quick-contact a {
		flex: 1; display: flex; align-items: center; justify-content: center; min-height: 56px;
		color: var(--paper); text-decoration: none; font-weight: 600; font-size: .9375rem;
	}
	.quick-contact a + a { border-left: 1px solid var(--ink-soft); }
	.quick-contact a.is-primary { background: var(--brand); }
	.nav-open .quick-contact { display: none; }
}

/* 13. Movimiento ----------------------------------------------------------- */
/* Un único momento orquestado: el diagrama de la portada se dibuja al cargar. */
.js .hub-lines path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: hub-draw 1.1s var(--ease) forwards; }
.js .hub-lines path:nth-child(2) { animation-delay: .12s; }
.js .hub-lines path:nth-child(3) { animation-delay: .24s; }
.js .hub-lines path:nth-child(4) { animation-delay: .36s; }
.js .hub-core, .js .hub-ring { opacity: 0; transform-origin: 220px 220px; animation: hub-in .6s var(--ease) 1.1s forwards; }
.js .hub-ring { animation-delay: 1.25s; }
@keyframes hub-draw { to { stroke-dashoffset: 0; } }
@keyframes hub-in { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }

/* Aparición suave al hacer scroll, solo en bloques concretos. */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
	.js .hub-lines path { stroke-dashoffset: 0; }
	.js .hub-core, .js .hub-ring { opacity: 1; }
	.js .reveal { opacity: 1; transform: none; }
}

@media print {
	.site-header, .site-footer, .cta-band, .quick-contact, .consent, .service-aside { display: none !important; }
	body { background: #fff; padding: 0; }
}

/* Etiquetas del diagrama legibles en móvil */
@media (max-width: 860px) {
	.hub-labels text { font-size: 22px; }
}
