/* ==========================================================================
   NAFA–UNPAM · Hoja de estilo 2026
   Reemplaza a Bootstrap 3 + style.css del tema anterior.
   No cargues el CSS viejo junto con este: se pelean.
   ========================================================================== */

/* --- 1. TOKENS ---------------------------------------------------------- */

:root {
  /* Color. Azul institucional dominante; el coral es señal, no decoración. */
  --azul:          #012951;   /* 14.6:1 sobre blanco */
  --azul-profundo: #011529;
  --azul-claro:    #01366a;
  --azul-velo:     #eef2f7;

  --coral:         #ea6645;   /* marca. Solo bloques grandes y gráficos. */
  --coral-texto:   #b8482a;   /* 5.25:1 — versión legible para texto y botones */
  --coral-velo:    #fdf1ee;

  --tinta:         #252525;   /* 15.3:1 */
  --tinta-suave:   #5c6470;   /* 5.98:1 — nunca uses gris más claro para texto */
  --linea:         #d8dce2;
  --linea-suave:   #e9edf1;
  --papel:         #ffffff;
  --papel-alt:     #f6f8fa;

  /* Tipografía. Escala modular 1.25 sobre base 16px. */
  --fuente-ui:    'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --fuente-texto: 'Source Serif 4', Georgia, 'Times New Roman', serif;

  --t-xs:   0.8125rem;
  --t-sm:   0.9375rem;
  --t-base: 1rem;
  --t-md:   1.125rem;
  --t-lg:   1.375rem;
  --t-xl:   1.75rem;
  --t-2xl:  2.25rem;
  --t-3xl:  3rem;

  --e1: 0.25rem;  --e2: 0.5rem;   --e3: 0.75rem;  --e4: 1rem;
  --e5: 1.5rem;   --e6: 2rem;     --e7: 3rem;     --e8: 4rem;

  --ancho:       72rem;
  --ancho-texto: 38rem;
  --radio:       3px;
}

/* --- 2. BASE ------------------------------------------------------------ */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--papel);
  color: var(--tinta);
  font-family: var(--fuente-texto);
  font-size: var(--t-base);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--fuente-texto);
  color: var(--azul);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 var(--e4);
  text-wrap: balance;
}
h1 { font-size: var(--t-2xl); letter-spacing: -0.015em; }
h2 { font-size: var(--t-xl); }
h3 { font-size: var(--t-lg); }
h4 { font-size: var(--t-md); }
@media (min-width: 48rem) {
  h1 { font-size: var(--t-3xl); }
  h2 { font-size: var(--t-2xl); }
}

p { margin: 0 0 var(--e4); max-width: var(--ancho-texto); }

a { color: var(--coral-texto); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--azul); }

img { max-width: 100%; height: auto; display: block; }

:focus-visible { outline: 3px solid var(--coral-texto); outline-offset: 2px; border-radius: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Página aún no publicada: visible, sin enlace. Lo genera nafa_link(). */
[data-pendiente] { opacity: 0.5; cursor: default; }

/* --- 3. ESTRUCTURA ------------------------------------------------------ */

.contenedor { width: 100%; max-width: var(--ancho); margin-inline: auto; padding-inline: var(--e5); }

.seccion { padding-block: var(--e7); }
.seccion--alt  { background: var(--papel-alt); }
.seccion--azul { background: var(--azul); color: #fff; }
.seccion--azul h2, .seccion--azul h3 { color: #fff; }
@media (min-width: 48rem) { .seccion { padding-block: var(--e8); } }

.seccion__entrada { font-size: var(--t-md); color: var(--tinta-suave); margin-bottom: var(--e6); }

.saltar-al-contenido {
  position: absolute; left: -9999px; z-index: 999;
  background: var(--azul); color: #fff; padding: var(--e3) var(--e4);
}
.saltar-al-contenido:focus { left: var(--e4); top: var(--e4); color: #fff; }

/* --- 4. BARRA SUPERIOR -------------------------------------------------- */

.utilidad { background: var(--azul-profundo); font-family: var(--fuente-ui); font-size: var(--t-xs); }
.utilidad__lista {
  list-style: none; margin: 0; padding: var(--e2) 0;
  display: flex; gap: var(--e5);
  overflow-x: auto; white-space: nowrap;
}
@media (min-width: 48rem) { .utilidad__lista { justify-content: flex-end; } }
.utilidad a, .utilidad span { color: #c9d6e5; text-decoration: none; }
.utilidad a:hover { color: #fff; text-decoration: underline; }

/* --- 5. CABECERA Y NAVEGACIÓN ------------------------------------------ */
/* Dos franjas: marca arriba, menú debajo. En escritorio la franja de la
   marca se va al hacer scroll y el menú queda fijo (top negativo).
   En pantallas menores de 75rem (1200px), botón "Menú" y acordeón.       */

.cabecera {
  background: var(--papel); border-bottom: 1px solid var(--linea);
  position: sticky; top: 0; z-index: 100;
}

.cabecera__barra { display: flex; align-items: center; gap: var(--e3); min-height: 4.5rem; }

.marca { display: flex; align-items: center; gap: var(--e3); text-decoration: none; margin-right: auto; min-width: 0; }
.marca img { height: 2.5rem; width: auto; }
.marca__texto  { font-family: var(--fuente-ui); line-height: 1.15; }
.marca__sigla  { display: block; font-size: var(--t-md); font-weight: 700; color: var(--azul); letter-spacing: 0.02em; }
.marca__nombre { display: none; font-size: var(--t-xs); color: var(--tinta-suave); }
@media (min-width: 40rem) { .marca__nombre { display: block; } }

.cabecera__barra .cabecera__cta { display: none; padding: var(--e2) var(--e4); flex-shrink: 0; }
@media (min-width: 22rem) { .cabecera__barra .cabecera__cta { display: inline-block; } }

.nav-boton {
  flex-shrink: 0;
  font-family: var(--fuente-ui); font-size: var(--t-sm); font-weight: 600;
  background: none; border: 1px solid var(--linea); border-radius: var(--radio);
  color: var(--azul); padding: var(--e2) var(--e3); cursor: pointer;
}

.nav { font-family: var(--fuente-ui); }
.nav__lista, .nav__sublista { list-style: none; margin: 0; padding: 0; }
.nav__fila { display: flex; align-items: center; justify-content: space-between; }
.nav__enlace { color: var(--azul); font-weight: 600; text-decoration: none; }
.nav__subenlace { text-decoration: none; }

.nav__abrir {
  flex-shrink: 0; background: none; border: 0; cursor: pointer;
  color: var(--azul); width: 2.75rem; height: 2.75rem;
  display: grid; place-items: center;
}
.nav__abrir::before {
  content: ''; width: 0.45rem; height: 0.45rem;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg); margin-top: -0.2rem;
  transition: transform 0.15s ease;
}
.nav__item[data-abierto="true"] .nav__abrir::before { transform: rotate(225deg); margin-top: 0.2rem; }

/* Móvil y tableta */
@media (max-width: 74.99rem) {
  .nav {
    display: none;
    max-height: calc(100dvh - 5rem); overflow-y: auto;
    border-top: 1px solid var(--linea-suave); padding-bottom: var(--e5);
  }
  .nav[data-abierto="true"] { display: block; }
  .nav__item { border-bottom: 1px solid var(--linea-suave); }
  .nav__enlace { display: block; padding: var(--e3) 0; font-size: var(--t-base); }
  .nav__sublista { display: none; padding: 0 0 var(--e3) var(--e4); }
  .nav__item[data-abierto="true"] .nav__sublista { display: block; }
  .nav__subenlace { display: block; padding: var(--e2) 0; font-size: var(--t-sm); color: var(--tinta-suave); }
}

/* Escritorio */
@media (min-width: 75rem) {
  .cabecera { top: -4.5rem; }                /* la franja de la marca sale; el menú queda */
  .cabecera__barra { height: 4.5rem; }
  .nav-boton { display: none; }

  .nav { border-top: 1px solid var(--linea-suave); }
  .nav__lista { display: flex; justify-content: space-between; }
  .nav__item  { position: relative; }
  .nav__enlace {
    display: block; padding: var(--e3) 0;
    font-size: var(--t-sm); border-bottom: 2px solid transparent;
  }
  .nav__abrir { width: 1.25rem; height: 1.25rem; margin-left: var(--e1); }
  .nav__abrir::before { width: 0.35rem; height: 0.35rem; }

  .nav__item:hover .nav__enlace,
  .nav__item[data-abierto="true"] .nav__enlace,
  .nav__item[data-actual] .nav__enlace { border-bottom-color: var(--coral); }

  .nav__sublista {
    position: absolute; top: 100%; left: calc(-1 * var(--e4));
    min-width: 17rem; padding: var(--e2) 0;
    background: var(--papel); border: 1px solid var(--linea); border-top: 2px solid var(--coral);
    box-shadow: 0 8px 24px rgba(1, 41, 81, 0.1);
    opacity: 0; visibility: hidden; transition: opacity 0.12s ease;
  }
  .nav__item:nth-last-child(-n+2) .nav__sublista { left: auto; right: calc(-1 * var(--e4)); }

  .nav__item:hover .nav__sublista,
  .nav__item:focus-within .nav__sublista,
  .nav__item[data-abierto="true"] .nav__sublista { opacity: 1; visibility: visible; }

  .nav__subenlace { display: block; padding: var(--e2) var(--e4); font-size: var(--t-sm); color: var(--tinta); }
  a.nav__subenlace:hover { background: var(--azul-velo); color: var(--azul); }
}

/* --- 6. PORTADA: EL REGISTRO "EMPIEZA AQUÍ" ---------------------------- */

.portada { background: var(--azul); color: #fff; padding-block: var(--e7) var(--e8); }
.portada__titulo { color: #fff; max-width: 20ch; font-size: var(--t-2xl); letter-spacing: -0.02em; }
@media (min-width: 48rem) { .portada__titulo { font-size: var(--t-3xl); } }
.portada__entrada { font-size: var(--t-md); color: #c9d6e5; max-width: 46ch; margin-bottom: var(--e6); }

.registro { background: var(--papel); border-radius: var(--radio); overflow: hidden; box-shadow: 0 12px 40px rgba(1, 21, 41, 0.25); }
.registro__encabezado {
  font-family: var(--fuente-ui); font-size: var(--t-sm); font-weight: 700; color: var(--azul);
  padding: var(--e4) var(--e5); border-bottom: 2px solid var(--coral); margin: 0; max-width: none;
}
.registro__fila {
  display: flex; align-items: baseline; gap: var(--e4);
  padding: var(--e4) var(--e5); border-bottom: 1px solid var(--linea-suave);
  text-decoration: none; color: inherit;
}
.registro__fila:last-child { border-bottom: 0; }
a.registro__fila:hover { background: var(--azul-velo); }
a.registro__fila:hover .registro__titulo { color: var(--coral-texto); }
.registro__cuerpo { flex: 1; }
.registro__titulo { display: block; font-family: var(--fuente-ui); font-size: var(--t-base); font-weight: 600; color: var(--azul); margin-bottom: var(--e1); }
.registro__pista  { display: block; font-size: var(--t-sm); color: var(--tinta-suave); line-height: 1.45; }
.registro__marca {
  flex-shrink: 0; align-self: center; width: 0.5rem; height: 0.5rem;
  border-right: 2px solid var(--coral-texto); border-top: 2px solid var(--coral-texto);
  transform: rotate(45deg);
}

/* --- 7. LA ESCALERA ----------------------------------------------------- */
/* En escritorio, cada peldaño arranca más alto que el anterior.           */

.escalera { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--e4); }
.peldano { border-left: 3px solid var(--azul); padding: var(--e2) 0 var(--e2) var(--e5); }
.peldano__numero { display: block; font-family: var(--fuente-ui); font-weight: 700; font-size: var(--t-sm); color: var(--coral-texto); margin-bottom: var(--e1); }
.peldano h3 { font-size: var(--t-md); margin-bottom: var(--e2); }
.peldano p  { font-size: var(--t-sm); color: var(--tinta-suave); margin-bottom: var(--e3); }
.peldano .precio { display: block; font-family: var(--fuente-ui); font-weight: 700; color: var(--azul); margin-bottom: var(--e3); }
.peldano .precio small { font-weight: 500; color: var(--tinta-suave); }
.peldano__enlace { font-family: var(--fuente-ui); font-size: var(--t-sm); font-weight: 600; }

@media (min-width: 68rem) {
  .escalera { grid-template-columns: repeat(5, 1fr); gap: var(--e3); align-items: stretch; }
  .peldano { border-left: 0; border-top: 3px solid var(--azul); background: var(--azul-velo); padding: var(--e4); }
  .peldano:nth-child(1) { margin-top: 8rem; }
  .peldano:nth-child(2) { margin-top: 6rem; }
  .peldano:nth-child(3) { margin-top: 4rem; }
  .peldano:nth-child(4) { margin-top: 2rem; }
}

/* --- 8. COMPONENTES ----------------------------------------------------- */

.boton {
  display: inline-block; font-family: var(--fuente-ui); font-size: var(--t-sm); font-weight: 600;
  text-decoration: none; padding: var(--e3) var(--e5);
  border-radius: var(--radio); border: 2px solid transparent; cursor: pointer;
}
.boton--principal { background: var(--coral-texto); color: #fff; }
a.boton--principal:hover { background: #9c3d23; color: #fff; }
.boton--linea { border-color: var(--azul); color: var(--azul); background: transparent; }
a.boton--linea:hover { background: var(--azul); color: #fff; }
.boton--blanco { background: #fff; color: var(--azul); }
a.boton--blanco:hover { background: var(--azul-velo); color: var(--azul); }
.boton--claro { border-color: #fff; color: #fff; background: transparent; }
a.boton--claro:hover { background: #fff; color: var(--azul); }
.botones { display: flex; flex-wrap: wrap; gap: var(--e3); }
.centrado .botones { justify-content: center; }

.rejilla { display: grid; gap: var(--e5); }
@media (min-width: 40rem) { .rejilla--2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 56rem) { .rejilla--3 { grid-template-columns: repeat(3, 1fr); } }

.ficha { border: 1px solid var(--linea); border-top: 3px solid var(--azul); padding: var(--e5); background: var(--papel); display: flex; flex-direction: column; }
.ficha h3 { margin-bottom: var(--e2); }
.ficha p { font-size: var(--t-sm); color: var(--tinta-suave); margin-bottom: var(--e4); }
.ficha .boton { margin-top: auto; align-self: flex-start; }

.tabla { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
.tabla th, .tabla td { text-align: left; padding: var(--e3) var(--e4); border-bottom: 1px solid var(--linea); }
.tabla th { font-family: var(--fuente-ui); color: var(--azul); font-weight: 700; }
.tabla td:last-child, .tabla th:last-child { text-align: right; white-space: nowrap; }
.tabla-envoltura { overflow-x: auto; }

.aviso { border-left: 3px solid var(--coral-texto); background: var(--coral-velo); padding: var(--e4) var(--e5); font-size: var(--t-sm); }
.aviso p { max-width: none; }
.aviso p:last-child { margin-bottom: 0; }

/* --- 9. PIE DE PÁGINA --------------------------------------------------- */

.pie { background: var(--azul-profundo); color: #b8c6d8; padding-block: var(--e7) var(--e5); font-size: var(--t-sm); }
.pie a { color: #dfe7f0; text-decoration: none; }
.pie a:hover { color: #fff; text-decoration: underline; }
.pie h3 { color: #fff; font-family: var(--fuente-ui); font-size: var(--t-sm); font-weight: 700; margin-bottom: var(--e3); }
.pie p { margin-bottom: var(--e3); }
.pie ul { list-style: none; margin: 0; padding: 0; }
.pie li { margin-bottom: var(--e2); }
.pie__rejilla { display: grid; gap: var(--e6); }
@media (min-width: 40rem) { .pie__rejilla { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 62rem) { .pie__rejilla { grid-template-columns: 1.4fr repeat(4, 1fr); } }
.pie__legal { margin-top: var(--e6); padding-top: var(--e4); border-top: 1px solid rgba(255, 255, 255, 0.14); font-size: var(--t-xs); color: #8fa2b8; }
.pie__legal p { max-width: none; margin-bottom: var(--e2); }

/* --- 9b. ESTADOS Y PAÍSES ---------------------------------------------- */

.lista-jurisdicciones { list-style: none; margin: 0 0 var(--e4); padding: 0; columns: 2; column-gap: var(--e5); }
@media (min-width: 48rem) { .lista-jurisdicciones--ancha { columns: 4; } }
.lista-jurisdicciones li { break-inside: avoid; border-bottom: 1px solid var(--linea-suave); }
.lista-jurisdicciones a, .lista-jurisdicciones span {
  display: block; padding: var(--e2) 0;
  font-family: var(--fuente-ui); font-size: var(--t-sm); font-weight: 600;
  color: var(--azul); text-decoration: none;
}
.lista-jurisdicciones a:hover { color: var(--coral-texto); }

.enlace-fuerte { font-family: var(--fuente-ui); font-size: var(--t-sm); font-weight: 600; }

.migas { font-family: var(--fuente-ui); font-size: var(--t-xs); color: var(--tinta-suave); margin-bottom: var(--e4); }
.migas ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--e2); }
.migas li + li::before { content: '/'; margin-right: var(--e2); color: var(--linea); }
.migas a { color: var(--tinta-suave); }

.jurisdiccion__entrada { font-size: var(--t-md); }
.jurisdiccion h2 { margin-top: var(--e7); }
.jurisdiccion h3 { font-size: var(--t-md); margin-top: var(--e5); }
.jurisdiccion ul { max-width: var(--ancho-texto); padding-left: 1.2rem; }
.jurisdiccion li { margin-bottom: var(--e2); }

.datos {
  display: grid; gap: 0; margin: var(--e6) 0 0; max-width: 44rem;
  border: 1px solid var(--linea); border-top: 3px solid var(--azul);
}
.datos div { display: flex; justify-content: space-between; gap: var(--e4); padding: var(--e3) var(--e4); border-bottom: 1px solid var(--linea-suave); }
.datos div:last-child { border-bottom: 0; }
.datos dt { font-family: var(--fuente-ui); font-size: var(--t-sm); color: var(--tinta-suave); }
.datos dd { margin: 0; font-family: var(--fuente-ui); font-size: var(--t-sm); font-weight: 700; color: var(--azul); text-align: right; }

.fuentes { font-size: var(--t-sm); }
.fuentes a { word-break: break-word; }

.cierre-jurisdiccion { margin-top: var(--e7); padding: var(--e5); background: var(--azul-velo); border-left: 3px solid var(--azul); }
.cierre-jurisdiccion h2 { margin-top: 0; font-size: var(--t-lg); }

/* --- 10. UTILIDADES ----------------------------------------------------- */

.solo-lectores {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.centrado { text-align: center; }
.centrado p { margin-inline: auto; }
.sin-margen { margin-bottom: 0; }
