/* ─────────────────────────────────────────────────────────────────────────
   Elevación 2027 — marco común de las páginas estáticas.

   Solo actúa en las páginas que llevan <html class="e27">, así que enlazar
   esta hoja no cambia nada hasta que la página se apunta. Cada plantilla
   conserva sus estilos en línea: lo que aquí se fija es lo que el marco
   necesita igual en todas (barra, cabecera y correcciones de contraste).

   Qué iguala con la portada: la barra navy con el logo oficial en pastilla
   clara (mismas medidas que components/Navbar.tsx), la tipografía de
   titulares (Plus Jakarta Sans) y la cabecera de página sobre lienzo navy.
   ───────────────────────────────────────────────────────────────────────── */

@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url('/fonts/plus-jakarta-sans-latin-variable.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
/* Respaldo con las métricas de Plus Jakarta en 700-800: sin él, el cambio de
   fuente mueve el h1, que es el LCP de estas páginas. */
@font-face {
  font-family: 'Jakarta-fallback';
  src: local('Arial Bold'), local('Arial-BoldMT');
  font-weight: 600 800;
  ascent-override: 102.4%;
  descent-override: 21.9%;
  line-gap-override: 0%;
  size-adjust: 101.4%;
}

html.e27 {
  --e27-navy: #20203E;
  --e27-naranja: #F85616;
  --e27-naranja-aa: #C44511;
  --e27-naranja-suave: #FA7B45;
  --e27-papel: #F7F6F3;
  --e27-borde: #E4E2DC;
  --e27-gris-texto: #475569;
  --e27-titulares: 'Plus Jakarta Sans', 'Jakarta-fallback', 'Inter', sans-serif;
  /* Ancho y margen de la barra y del pie: los de la portada (max-w-7xl, px-8) */
  --e27-ancho-marco: 1216px;
}

html.e27 body {
  background: var(--e27-papel);
  /* El lienzo de la cabecera se extiende a todo el ancho con un pseudo-elemento
     de 100vw, que en sistemas con barra de desplazamiento visible sobresale. */
  overflow-x: clip;
}

html.e27 h1,
html.e27 h2,
html.e27 h3,
html.e27 .stat-number {
  font-family: var(--e27-titulares);
}
/* Interletraje negativo solo en los cuerpos grandes y compensado entre
   palabras; en un h3 de 17 px las palabras se leían pegadas. */
html.e27 h1,
html.e27 h2 {
  letter-spacing: -0.015em;
  word-spacing: 0.04em;
}

/* El mismo anillo de foco que la portada */
html.e27 a:focus-visible,
html.e27 button:focus-visible,
html.e27 input:focus-visible,
html.e27 textarea:focus-visible {
  outline: 2px solid var(--e27-naranja);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── Barra ─────────────────────────────────────────────────────────────── */
/* Medidas tomadas de la portada a 1440 px: 77 px de alto, pastilla del logo
   de 48 px y botón de 40 px en Inter 600. */
html.e27 .nav {
  background: rgba(32, 32, 62, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  /* article.css la declara flex; aquí el reparto lo hace .nav-inner */
  display: block;
  padding: 14px 32px;
  text-align: start;
  line-height: 1.7;
}
/* Cada plantilla trae su propia barra en línea (monoespaciada y en mayúsculas
   en las ciudades generadas): aquí se fija todo lo que la portada no hereda. */
html.e27 .nav a {
  font-family: inherit;
  letter-spacing: normal;
  text-transform: none;
}
/* legal.css y el 404 no declaran el reparto de la barra: va completo aquí */
html.e27 .nav-inner {
  display: flex;
  align-items: center;
  margin: 0 auto;
  max-width: var(--e27-ancho-marco);
  justify-content: flex-start;
  gap: 16px;
  padding: 0;
}
html.e27 .nav .nav-logo {
  display: inline-flex;
  align-items: center;
  background: #fff;
  border-radius: 12px;
  padding: 6px 12px;
  box-shadow: 0 8px 20px -12px rgba(0, 0, 0, 0.6);
}
html.e27 .nav .nav-logo img {
  display: block;
  height: 36px;
  width: auto;
}
html.e27 .nav-links {
  display: flex;
  align-items: center;
  gap: 0 24px;
  margin-left: 16px;
  flex-wrap: nowrap;
  justify-content: flex-start;
}
html.e27 .nav-links a {
  color: #fff;
  opacity: 0.85;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 0;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}
html.e27 .nav-links a:hover {
  color: #fff;
  opacity: 1;
}
html.e27 .nav .nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  margin-left: auto;
  padding: 0 20px;
  border-radius: 999px;
  background: var(--e27-naranja-aa);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.25);
  transition: background-color 0.2s ease, color 0.2s ease;
}
html.e27 .nav .nav-cta:hover {
  background: #fff;
  color: var(--e27-navy);
  text-decoration: none;
}
/* El botón va dos veces en el marcado y cada ancho pinta uno: así el orden de
   foco coincide con el visual en los dos sin recurrir a `order`. */
html.e27 .nav .nav-cta-movil {
  display: none;
}
@media (min-width: 901px) {
  html.e27 .nav {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(12px);
  }
  /* Con la barra fija, lo que recibe el foco o un salto de ancla no queda
     debajo de ella (WCAG 2.4.11). */
  html.e27 {
    scroll-padding-top: 90px;
  }
}
/* Hasta 900 px: logo y botón arriba, y los cinco enlaces en una sola fila que
   se desplaza en horizontal si no cabe. Nunca más de dos filas. */
@media (max-width: 900px) {
  html.e27 .nav {
    position: static;
    padding: 12px 16px 4px;
  }
  html.e27 .nav-inner {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
  }
  html.e27 .nav .nav-logo {
    padding: 5px 10px;
  }
  html.e27 .nav .nav-logo img {
    height: 30px;
  }
  html.e27 .nav .nav-cta-movil {
    display: inline-flex;
  }
  html.e27 .nav .nav-cta-escritorio {
    display: none;
  }
  html.e27 .nav .nav-cta {
    padding: 0 16px;
  }
  html.e27 .nav-links {
    width: 100%;
    margin-left: 0;
    gap: 0 20px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  html.e27 .nav-links::-webkit-scrollbar {
    display: none;
  }
  html.e27 .nav-links a {
    padding: 12px 0;
  }
}
/* En móvil los cinco enlaces caben en una fila a 390 px; por debajo, la fila
   se desplaza. */
@media (max-width: 480px) {
  html.e27 .nav-links {
    gap: 0 15px;
    justify-content: space-between;
  }
  html.e27 .nav-links a {
    font-size: 13.5px;
  }
}
@media (max-width: 380px) {
  html.e27 .nav-links {
    gap: 0 9px;
  }
  html.e27 .nav-links a {
    font-size: 13px;
  }
}
/* Por debajo de 360 px el botón no cabe junto al logo: se queda el logo, y la
   reserva sigue en el cuerpo de la página. */
@media (max-width: 359px) {
  html.e27 .nav .nav-cta-movil {
    display: none;
  }
}

/* ── Cabecera de página sobre lienzo navy ──────────────────────────────── */
html.e27 .container {
  max-width: 840px;
  padding-top: 0;
}
/* El índice de ciudades trae su propia cabecera fuera del contenedor, que es
   una rejilla ancha: conserva sus medidas. */
html.e27 .hero + .container {
  max-width: 1060px;
  padding-top: 48px;
}
html.e27 .page-hero {
  position: relative;
  isolation: isolate;
  /* Fondo propio además del lienzo a todo el ancho: el texto blanco nunca
     depende de que el pseudo-elemento se pinte. */
  background-color: var(--e27-navy);
  padding: 36px 0 44px;
  margin-bottom: 48px;
  color: #fff;
}
html.e27 .page-hero::before {
  content: '';
  position: absolute;
  z-index: -1;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  background-color: var(--e27-navy);
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    radial-gradient(ellipse 55% 80% at 82% 70%, rgba(248, 86, 22, 0.14), transparent 62%),
    radial-gradient(ellipse 60% 80% at 10% -10%, rgba(74, 95, 191, 0.24), transparent 60%),
    linear-gradient(180deg, #1B1B36 0%, #20203E 60%);
  background-size: 48px 48px, 48px 48px, auto, auto, auto;
}
html.e27 .page-hero .crumbs {
  margin-bottom: 28px;
  font-size: 13px;
  color: #cbd5e1;
}
html.e27 .page-hero .crumbs a {
  color: #cbd5e1;
  font-weight: 400;
  text-decoration: none;
}
html.e27 .page-hero .crumbs a:hover {
  color: #fff;
  text-decoration: underline;
}
html.e27 .page-hero .crumbs [aria-current] {
  color: #fff;
  font-weight: 500;
}
html.e27 .page-hero .crumbs .sep {
  margin: 0 8px;
}
html.e27 .page-hero h1 {
  color: #fff;
  font-size: clamp(30px, 4.6vw, 46px);
  line-height: 1.1;
  margin-top: 0;
  margin-bottom: 18px;
  text-wrap: balance;
}
html.e27 .page-hero .subtitle {
  color: #dbe1ea;
  font-size: 18px;
  line-height: 1.65;
  border-bottom: 0;
  padding-bottom: 0;
  margin-bottom: 32px;
}
/* Algunas plantillas cierran la entradilla con un filete degradado */
html.e27 .page-hero .subtitle::after {
  content: none;
}
/* Antetítulos y distintivos que algunas páginas llevan sobre el h1: sus
   colores en línea estaban calibrados contra fondo claro. */
html.e27 .page-hero .eyebrow,
html.e27 .page-hero [style*="#C44511"],
html.e27 .page-hero [style*="#F85616"] {
  color: var(--e27-naranja-suave) !important;
  border-color: rgba(250, 123, 69, 0.45) !important;
}
html.e27 .container .page-hero [style*="#64748b"] {
  color: #dbe1ea !important;
}
html.e27 .page-hero .badge-en {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.25);
  color: #dbe1ea;
}
/* Cabeceras de las páginas de article.css y de los índices: etiqueta, firma
   y fecha, entradilla con otro nombre de clase y enlace de vuelta. */
html.e27 .page-hero .article-tag {
  color: var(--e27-naranja-suave);
  border-color: rgba(250, 123, 69, 0.45);
}
html.e27 .page-hero .article-meta,
html.e27 .page-hero .meta {
  color: #cbd5e1;
  border-bottom: 0;
  background-image: none;
  padding-bottom: 0;
}
html.e27 .page-hero .article-meta::after {
  content: none;
}
html.e27 .page-hero .article-meta a,
html.e27 .page-hero .meta a,
html.e27 .page-hero .meta strong {
  color: #fff !important;
}
html.e27 .page-hero .hero-actions .link {
  color: var(--e27-naranja-suave);
}
html.e27 .page-hero .intro,
html.e27 .page-hero .lead {
  color: #dbe1ea;
  font-size: 18px;
  line-height: 1.65;
}
html.e27 .page-hero .back {
  display: flex;
  width: fit-content;
  color: #cbd5e1;
}
html.e27 .page-hero .back:hover {
  color: #fff;
}
html.e27 .page-hero > :last-child {
  margin-bottom: 0 !important;
}
html.e27 .page-hero .stats-bar {
  margin: 0;
  gap: 12px;
}
html.e27 .page-hero .stat {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 18px 12px;
  box-shadow: none;
  transition: none;
}
html.e27 .page-hero .stat:hover {
  transform: none;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: none;
}
html.e27 .page-hero .stat-number {
  color: var(--e27-naranja-suave);
  font-size: 26px;
  line-height: 1.7;
  letter-spacing: -0.015em;
  font-variant-numeric: normal;
}
html.e27 .page-hero .stat-label {
  display: inline;
  color: #dbe1ea;
  font-family: inherit;
  font-size: 12px;
  line-height: 1.7;
  letter-spacing: normal;
  text-transform: none;
}

/* ── Cuerpo ────────────────────────────────────────────────────────────── */
html.e27 .article-body h2 {
  font-size: 29px;
  line-height: 1.2;
  margin-top: 56px;
  margin-bottom: 18px;
  text-wrap: balance;
}
html.e27 .article-body p,
html.e27 .article-body li {
  font-size: 17px;
  /* Medida de lectura: unas 75-80 letras por línea aunque la columna dé más. */
  max-width: 70ch;
}
/* Un enlace dentro de un párrafo se distingue por el subrayado, no solo por
   el color (WCAG 1.4.1). */
html.e27 .article-body p a,
html.e27 .article-body li a,
html.e27 .container p a:not([class]),
html.e27 .container form a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
html.e27 .service-card,
html.e27 .highlight-box,
html.e27 .author-box {
  border-color: var(--e27-borde);
  border-radius: 18px;
  box-shadow: 0 1px 2px rgba(32, 32, 62, 0.04);
}
html.e27 .service-card {
  padding: 26px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
html.e27 .service-card:hover {
  border-color: var(--e27-naranja-aa);
  box-shadow: 0 18px 40px -24px rgba(32, 32, 62, 0.28);
}
html.e27 .service-card h3 {
  font-size: 17px;
}
html.e27 .highlight-box h3,
html.e27 .faq-item h3 {
  font-size: 18px;
  line-height: 1.3;
}
html.e27 .sector-tag {
  background: #fff;
  border: 1px solid var(--e27-borde);
  color: var(--e27-navy);
  padding: 7px 14px;
}
/* La caja del formulario venía en un gris frío pensado para fondo blanco */
html.e27 .lead-capture {
  background: #fff;
  border-color: var(--e27-borde);
  border-radius: 18px;
}
html.e27 .cta-section {
  border-radius: 24px;
  padding: 48px 40px;
  background-color: var(--e27-navy);
  background-image:
    radial-gradient(ellipse 60% 90% at 85% 100%, rgba(248, 86, 22, 0.18), transparent 60%),
    radial-gradient(ellipse 60% 80% at 10% -10%, rgba(74, 95, 191, 0.26), transparent 60%);
}
html.e27 .cta-section h2 {
  font-size: 28px;
  line-height: 1.2;
}
html.e27 .cta-section p {
  color: #dbe1ea;
}
html.e27 .cta-button {
  border-radius: 999px;
  padding: 15px 34px;
}
html.e27 .cta-button:hover {
  background: #fff;
  color: var(--e27-navy);
  box-shadow: none;
  transform: translateY(-1px);
}

/* ── Estilos en línea heredados ────────────────────────────────────────── */
/* Estas páginas llevan colores y anchos escritos en el atributo style. Para
   no retocar ese marcado en cada una, se corrigen aquí; por eso el !important.
   El gris #64748b estaba calibrado contra blanco y sobre el papel cálido se
   queda en 4,4:1. */
html.e27 .container [style*="#64748b"],
html.e27 main [style*="#64748b"],
html.e27 .container [style*="#94a3b8"]:not(.lead-banner *) {
  color: var(--e27-gris-texto) !important;
}
html.e27 .back-bottom,
html.e27 .meta-line,
html.e27 .meta-line a,
html.e27 .section-intro,
html.e27 .content > .card > p,
html.e27 .section-sub,
html.e27 .ranges-note,
html.e27 .sobre dd em,
html.e27 .container > .crumbs,
html.e27 .container > .crumbs a,
html.e27 .lista-cuenta,
html.e27 .pie-guia {
  color: var(--e27-gris-texto);
}
html.e27 body > footer {
  padding-left: 32px !important;
  padding-right: 32px !important;
}
html.e27 body > footer > div {
  max-width: var(--e27-ancho-marco) !important;
}

@media (max-width: 900px) {
  html.e27 body > footer {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
}
@media (max-width: 640px) {
  html.e27 .container {
    padding-left: 16px;
    padding-right: 16px;
  }
  html.e27 .hero + .container {
    padding-top: 32px;
  }
  html.e27 .page-hero {
    padding: 28px 0 32px;
    margin-bottom: 36px;
  }
  html.e27 .page-hero .subtitle {
    font-size: 17px;
  }
  html.e27 .article-body h2 {
    font-size: 25px;
    margin-top: 44px;
  }
  html.e27 .cta-section {
    padding: 36px 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.e27 .service-card,
  html.e27 .cta-button,
  html.e27 .nav .nav-cta {
    transition: none;
  }
  html.e27 .cta-button:hover {
    transform: none;
  }
}

/* Los navegadores no imprimen fondos: la cabecera navy saldría con el texto
   blanco sobre blanco. */
@media print {
  html.e27 .nav {
    display: none;
  }
  html.e27 .page-hero,
  html.e27 .cta-section {
    background: none !important;
    padding: 0;
  }
  html.e27 .page-hero::before {
    display: none;
  }
  html.e27 .page-hero,
  html.e27 .page-hero *,
  html.e27 .cta-section,
  html.e27 .cta-section * {
    color: #20203E !important;
  }
  html.e27 .page-hero .stat {
    background: none;
    border-color: #cbd5e1;
  }
}

/* ── Ritmo de página (html.e27-ritmo) ──────────────────────────────────────
   Solo en las plantillas de lectura (cabecera navy, cuerpo y cierre): las
   páginas se apuntan con la clase e27-ritmo junto a e27. El índice y la barra
   de progreso los monta pages-fx.js. */

/* Secciones numeradas: el filete degradado de article.css deja su sitio al
   número de sección. */
html.e27-ritmo .article-body,
html.e27-ritmo .container {
  counter-reset: sc-seccion;
  position: relative;
}
html.e27-ritmo .article-body > h2,
html.e27-ritmo .container > h2 {
  counter-increment: sc-seccion;
}
html.e27-ritmo .article-body > h2::before,
html.e27-ritmo .container > h2::before {
  content: counter(sc-seccion, decimal-leading-zero);
  display: block;
  position: static;
  width: auto;
  height: auto;
  margin-bottom: 10px;
  background: none;
  color: var(--e27-naranja-aa);
  font-family: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  line-height: 1;
}
html.e27-ritmo .container > h2 {
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--e27-borde);
  font-size: 26px;
  line-height: 1.2;
}

/* Barra de progreso de lectura */
.sc-progreso {
  position: fixed;
  z-index: 60;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #F85616, #FA7B45);
  transform: scaleX(0);
  transform-origin: left;
  pointer-events: none;
}

/* Índice lateral: pages-fx.js le pone .cabe cuando el margen izquierdo da
   para él; si no, no se pinta. */
.sc-indice {
  display: none;
  position: absolute;
  top: 0;
  bottom: 0;
  left: -230px;
  width: 196px;
}
.sc-indice.cabe {
  display: block;
}
.sc-indice__caja {
  position: sticky;
  top: 112px;
  max-height: calc(100vh - 136px);
  overflow-y: auto;
}
html.e27 .sc-indice p {
  margin: 0 0 12px;
  max-width: none;
  /* #64748b no llega a 4,5:1 sobre el papel */
  color: var(--e27-gris-texto);
  font-family: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  line-height: 1.5;
  text-transform: uppercase;
}
html.e27 .sc-indice ol {
  margin: 0;
  padding: 0;
  list-style: none;
  border-left: 1px solid var(--e27-borde);
}
html.e27 .sc-indice li {
  margin: 0;
  max-width: none;
  font-size: 13px;
  line-height: 1.4;
}
html.e27 .sc-indice a {
  display: block;
  margin-left: -1px;
  padding: 6px 0 6px 14px;
  border-left: 2px solid transparent;
  color: var(--e27-gris-texto);
  font-weight: 400;
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease;
}
html.e27 .sc-indice a:hover {
  color: var(--e27-navy);
}
html.e27 .sc-indice a[aria-current] {
  border-left-color: var(--e27-naranja);
  color: var(--e27-navy);
  font-weight: 600;
}

/* Cierre a todo el ancho */
html.e27-ritmo .cta-section,
html.e27-ritmo .cta-box {
  width: 100vw;
  max-width: none;
  margin-left: 50%;
  transform: translateX(-50%);
  border-radius: 0;
  padding: 72px 20px;
}
html.e27-ritmo .cta-section h2,
html.e27-ritmo .cta-box h2 {
  font-size: clamp(26px, 3.4vw, 36px);
  line-height: 1.15;
}
/* Cuando el cierre es lo último de la página, se une al pie */
html.e27-ritmo .container:has(> .cta-box:last-child) {
  padding-bottom: 0;
}
html.e27-ritmo .container:has(> .cta-box:last-child) + footer {
  margin-top: 0 !important;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

@media (prefers-reduced-motion: reduce) {
  .sc-progreso {
    display: none;
  }
  html.e27 .sc-indice a {
    transition: none;
  }
}
@media print {
  .sc-progreso,
  .sc-indice {
    display: none !important;
  }
  html.e27-ritmo .cta-section,
  html.e27-ritmo .cta-box {
    width: auto;
    margin-left: 0;
    transform: none;
  }
}
