/* Fundación Nova Libertas · referencia: nasa.gov/es (ver ../DESIGN.md) */

@font-face {
  font-family: "Atkinson Next";
  src: url("fuentes/atkinson-next-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --negro: #000;
  --papel: #fff;
  --tinta: #1b1b1b;
  --tinta-suave: #4a4a4a;
  --linea: #d9d9d9;
  --gris-claro: #f2f2f2;
  --oro: #d9b45f;          /* sobre negro */
  --oro-oscuro: #7a5714;   /* sobre blanco */
  --sobre-negro: #fff;
  --sobre-negro-suave: #c4c4c4;
  --foco: #1a5fd0;

  --letra: "Atkinson Next", "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ancho: 76rem;
  --margen: clamp(1rem, 4vw, 2.5rem);
  --aire: clamp(4rem, 9vw, 7.5rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --papel: #121212;
    --tinta: #f1f1f1;
    --tinta-suave: #bdbdbd;
    --linea: #333;
    --gris-claro: #1c1c1c;
    --oro-oscuro: #d9b45f;
    --foco: #8ab4ff;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--papel);
  color: var(--tinta);
  font-family: var(--letra);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; text-underline-offset: 0.2em; }

:focus-visible { outline: 3px solid var(--foco); outline-offset: 3px; border-radius: 3px; }
.portada :focus-visible, .contacto :focus-visible, .pie :focus-visible { outline-color: var(--oro); }

.saltar {
  position: absolute; left: 1rem; top: -4rem; z-index: 10;
  padding: 0.75rem 1rem; background: var(--papel); color: var(--tinta); border-radius: 4px;
}
.saltar:focus { top: 1rem; }

/* Flecha dentro de un círculo dorado: el único acento */
.flecha {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--oro);
  color: var(--negro);
}
.flecha svg { width: 1.1rem; height: 1.1rem; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Portada negra ---------- */

.portada {
  background: var(--negro);
  color: var(--sobre-negro);
  padding: 0 var(--margen);
}

.menu {
  max-width: var(--ancho);
  margin: 0 auto;
  display: flex;
  justify-content: flex-end;
  border-bottom: 1px solid #333;
}
.menu ul { display: flex; flex-wrap: wrap; }
.menu a {
  display: inline-flex;
  align-items: center;
  min-height: 56px;
  padding: 0 0.85rem;
  font-weight: 700;
  font-size: 0.98rem;
  text-decoration: none;
}
.menu a:hover { color: var(--oro); }

.portada-cuerpo {
  max-width: var(--ancho);
  margin: 0 auto;
  display: grid;
  gap: 2.5rem;
  align-items: center;
  padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(3.5rem, 8vw, 6.5rem);
}

.emblema { order: -1; }
.emblema img { width: min(100%, 300px); }

.lema {
  font-size: clamp(2.6rem, 7.5vw, 5.6rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.bajada {
  max-width: 40ch;
  margin-top: 1.5rem;
  color: var(--sobre-negro-suave);
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
}

.redes { display: flex; flex-wrap: wrap; gap: 0.5rem 1.75rem; margin-top: 2rem; }
.redes a {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 48px;
  font-weight: 700;
  text-decoration: none;
}
.redes a::after {
  content: "";
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--oro) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 16 16 8M9 8h7v7'/%3E%3C/svg%3E") center / 1rem no-repeat;
}
.redes a:hover { text-decoration: underline; }

@media (min-width: 52rem) {
  .portada-cuerpo { grid-template-columns: 1.35fr 1fr; min-height: min(72svh, 44rem); }
  .emblema { order: 0; justify-self: end; }
  .emblema img { width: min(100%, 440px); }
}

/* ---------- Cuerpo blanco ---------- */

.seccion,
.noticias,
.contacto {
  padding: var(--aire) max(var(--margen), (100% - var(--ancho)) / 2) 0;
}

h2 {
  font-size: clamp(2rem, 4.5vw, 3.1rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}
h3 { font-size: 1.3rem; font-weight: 700; line-height: 1.25; margin-bottom: 0.6rem; }

.dos { display: grid; gap: 1.5rem clamp(2rem, 6vw, 5rem); }
.dos p { max-width: 62ch; }
.entrada { font-size: clamp(1.3rem, 2.4vw, 1.6rem); font-weight: 600; line-height: 1.35; }
.dos > p:not(.entrada), .mision p { color: var(--tinta-suave); }
.mision { margin-top: clamp(2.5rem, 5vw, 4rem); }
.mision > div { padding-top: 1.25rem; border-top: 3px solid var(--tinta); }

/* Noticias: franja gris con los posts de las redes */
.noticias {
  margin-top: var(--aire);
  padding-bottom: var(--aire);
  background: var(--gris-claro);
}
.noticias-cabeza {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0 2rem;
}
.redes-claras { margin-top: 0; margin-bottom: 1.5rem; }
.posts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 1.5rem;
  align-items: start;
}
.posts .instagram-media,
.posts iframe {
  margin: 0 !important;
  min-width: 0 !important;
  width: 100% !important;
  max-width: 420px !important;
  border: 0;
  background: var(--papel);
}
.posts blockquote > a { display: inline-flex; align-items: center; min-height: 44px; padding: 1rem; font-weight: 700; }

.personas { display: grid; gap: 2.5rem 2rem; }
.personas li { padding-top: 1.25rem; border-top: 1px solid var(--linea); }
.personas .cargo { color: var(--oro-oscuro); font-weight: 700; font-size: 0.95rem; margin-bottom: 0.35rem; }
.personas p:not(.cargo) { color: var(--tinta-suave); margin-bottom: 0.5rem; }
.personas a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

@media (min-width: 46rem) {
  .dos { grid-template-columns: 1fr 1fr; }
  .personas { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 68rem) {
  .personas { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- Contacto y pie, de vuelta al negro ---------- */

.contacto {
  margin-top: var(--aire);
  padding-bottom: var(--aire);
  background: var(--negro);
  color: var(--sobre-negro);
}
.correo {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  min-height: 48px;
  font-size: clamp(1.5rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.correo .flecha { width: 2.6rem; height: 2.6rem; }
.correo:hover span:first-child { text-decoration: underline; }
.registro { margin-top: 1.5rem; color: var(--sobre-negro-suave); max-width: 46ch; }

.pie {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem 2rem;
  padding: 1rem var(--margen);
  background: var(--negro);
  color: var(--sobre-negro-suave);
  border-top: 1px solid #333;
  font-size: 0.95rem;
}
.pie a { display: inline-flex; align-items: center; min-height: 44px; color: var(--sobre-negro); }
