@font-face {
  font-family: 'MiFuentePersonalizada';
  src: url('/Fonts/Redaction-Regular.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --blanco: #ffffff;
  --negro: #000000;
  --linea-fina: 1px;
  --linea-mapa: 2px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

html {
  background: var(--negro);
  scroll-behavior: smooth;
}

body {
  background: var(--negro);
  color: var(--blanco);
  font-family: 'MiFuentePersonalizada', sans-serif;
  overflow-x: hidden;
  position: relative;
}

/* =========================================================
   FONDO GENERAL
   ========================================================= */
.background {
  position: absolute;
  inset: 0;
  z-index: 0;

  background-image: url('/images/background3.jpg');
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  filter: saturate(20%) brightness(20%);
}

/* =========================================================
   PANTALLA DE ENTRADA
   ========================================================= */
.gate {
  position: fixed;
  inset: 0;
  z-index: 100;

  display: flex;
  align-items: center;
  justify-content: center;

  background-color: #000;
  background-image: url('/images/gate-bg.gif');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  image-rendering: pixelated;

  transition: transform 0.7s ease-in-out;
}

.gate--leaving {
  transform: translateY(-100%);
}

.gate-btn {
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
}

.gate-img {
  display: block;
  width: min(60vw, 420px);
  height: auto;
  transition: transform 0.2s ease;
}

.gate-btn:hover .gate-img,
.gate-btn:focus-visible .gate-img {
  transform: scale(1.05);
}

.gate-btn:focus-visible {
  outline: 2px solid var(--blanco);
  outline-offset: 6px;
}

/* =========================================================
   SITIO
   ========================================================= */
.site {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.site[hidden],
.reader[hidden] {
  display: none;
}

/* =========================================================
   MAPA PRINCIPAL
   ========================================================= */
.map {
  border: var(--linea-fina) solid var(--blanco);
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 0 120px;
}

/*
  Título + manifiesto: esta zona permanece siempre en la cabecera
  del mapa. Los nuevos artículos NO se insertan antes de ella.
*/
.map-heading {
  position: relative;
  z-index: 5;

  width: min(92vw, 660px);
  margin: 0 auto;

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

.site-title {
  position: relative;
  z-index: 5;
  width: fit-content;
  max-width: calc(100vw - 24px);
  margin: 42px auto 22px;
  padding: 11px 18px 9px;
  border: var(--linea-fina) solid var(--blanco);

  font-size: clamp(2.25rem, 6vw, 4.4rem);
  font-weight: normal;
  line-height: 1;
  letter-spacing: 0.01em;
  text-align: center;
  white-space: nowrap;
}

.intro-node {
  display: block;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  color: var(--blanco);
  cursor: pointer;
}

.intro-box {
  display: flex;
  align-items: center;
  justify-content: center;

  min-width: clamp(230px, 32vw, 370px);
  min-height: 74px;
  padding: 10px 22px 8px;
  border: var(--linea-fina) solid var(--blanco);

  font-size: clamp(1.9rem, 4.3vw, 2.8rem);
  line-height: 1;
  white-space: nowrap;

  transition: transform 0.18s ease, background-color 0.18s ease;
}

.intro-node:hover .intro-box,
.intro-node:focus-visible .intro-box {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.06);
}

.intro-node:focus-visible {
  outline: none;
}

/* =========================================================
   EJE DE ARTÍCULOS
   ========================================================= */
.article-map {
  position: relative;
  width: 100%;
  margin-top: 4px;
}

.article-node {
  position: absolute;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;

  padding: 0;
  border: 0;
  margin: 0;
  background: transparent;
  color: var(--blanco);
  cursor: pointer;
}

.article-left {
  left: clamp(18px, 8vw, 110px);
}

.article-right {
  right: clamp(18px, 8vw, 110px);
}

.node-box {
  display: flex;
  align-items: center;
  justify-content: center;

  width: clamp(220px, 30vw, 340px);
  min-height: 76px;
  padding: 10px 18px 8px;
  border: var(--linea-fina) solid var(--blanco);
  background: rgba(0, 0, 0, 0.24);

  transition: transform 0.18s ease, background-color 0.18s ease;
}

.node-number {
  font-size: clamp(1.55rem, 3.2vw, 2.35rem);
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.article-node:hover .node-box,
.article-node:focus-visible .node-box {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.06);
}

.article-node:focus-visible {
  outline: none;
}

/* =========================================================
   FLECHAS PNG
   =========================================================

   Se usan directamente tus dos imágenes. De esta forma no dependemos
   de clip-path ni de pseudo-elementos y todas las flechas conservan
   exactamente las mismas proporciones.
*/
.node-arrow-img,
.reader-arrow-img {
  display: block;
  flex: 0 0 auto;
  width: 65px;
  height: 84px;
  object-fit: contain;
  transition: transform 0.18s ease;
}

.article-left:hover .node-arrow-img,
.article-left:focus-visible .node-arrow-img {
  transform: translateX(-3px);
}

.article-right:hover .node-arrow-img,
.article-right:focus-visible .node-arrow-img {
  transform: translateX(3px);
}

/* =========================================================
   CONEXIONES
   ========================================================= */
.connections {
  position: absolute;
  inset: 0;
  z-index: 2;

  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.connections path {
  fill: none;
  stroke: var(--blanco);
  stroke-width: var(--linea-mapa);
  stroke-dasharray: 2 7 5 3 8 4 1 6;
  stroke-linecap: round;
  opacity: 0.75;
  filter: url(#linea-inestable);
}

/* =========================================================
   LECTOR
   ========================================================= */
.reader {
  position: fixed;
  inset: 0;
  z-index: 50;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--negro);

  transform: translateX(100%);
  transition: transform 0.65s cubic-bezier(0.77, 0, 0.175, 1);
}

.reader.reader-enter-left {
  transform: translateX(-100%);
}

.reader.reader-enter-right,
.reader.reader-enter-up {
  transform: translateX(100%);
}

.reader.is-open {
  transform: translateX(0);
}

.reader.reader-exit-left {
  transform: translateX(-100%);
}

.reader.reader-exit-right {
  transform: translateX(100%);
}

.reader-inner {
  position: relative;
  min-height: 100vh;
  padding: 40px clamp(48px, 6vw, 100px) 120px;
}

.reader-back {
  position: fixed;
  top: 38px;
  left: clamp(14px, 3vw, 42px);
  z-index: 4;

  width: 52px;
  height: 82px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.reader-back .reader-arrow-img {
  width: 65px;
  height: 84px;
}

.reader-back:hover .reader-arrow-img,
.reader-back:focus-visible .reader-arrow-img {
  transform: translateX(-4px);
}

.reader-back:focus-visible {
  outline: 2px solid var(--blanco);
  outline-offset: 5px;
}

.reader-header {
  width: min(1100px, 100%);
  margin: 0 auto 46px;
  text-align: left;
}

.reader-kicker {
  margin: 0 0 12px;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  opacity: 0.78;
}

.reader-header h2 {
  display: inline-block;
  margin: 0;
  padding: 9px 17px 7px;
  border: var(--linea-fina) solid var(--blanco);

  font-size: clamp(2rem, 5.5vw, 3.8rem);
  font-weight: normal;
  line-height: 1;
}

.reader-content {
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: clamp(24px, 4vw, 46px);
  border: var(--linea-fina) solid var(--blanco);

  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(1.15rem, 1.85vw, 1.5rem);
  line-height: 1.72;
}

.reader-content p {
  margin: 0 0 1.2em;
}

/* =========================================================
   COMENTARIOS
   ========================================================= */
.reader-comments {
  width: min(1100px, 100%);
  margin: 56px auto 0;
  padding: clamp(24px, 4vw, 46px);
  border: var(--linea-fina) solid var(--blanco);
}

.comments-embed {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
}

/* =========================================================
   MODO LECTOR
   ========================================================= */
body.reader-is-open {
  overflow: hidden;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 720px) {
  .map-heading {
    width: calc(100vw - 24px);
  }

  .site-title {
    margin-top: 28px;
    padding-left: 11px;
    padding-right: 11px;
    font-size: clamp(1.65rem, 9vw, 3rem);
  }

  .intro-box {
    min-width: min(68vw, 300px);
    min-height: 62px;
    padding-left: 13px;
    padding-right: 13px;
    font-size: clamp(1.45rem, 7vw, 2rem);
  }

  .article-left {
    left: 10px;
  }

  .article-right {
    right: 10px;
  }

  .article-node {
    gap: 7px;
  }

  .node-box {
    width: clamp(170px, 47vw, 230px);
    min-height: 60px;
    padding: 8px 10px 6px;
  }

  .node-number {
    font-size: clamp(1.05rem, 5.4vw, 1.55rem);
  }

  .node-arrow-img,
  .reader-arrow-img {
    width: 34px;
    height: 56px;
  }

  .reader-inner {
    padding: 28px 48px 90px;
  }

  .reader-back {
    left: 8px;
    top: 24px;
    width: 38px;
    height: 58px;
  }

  .reader-back .reader-arrow-img {
    width: 38px;
    height: 58px;
  }

  .reader-header {
    margin-bottom: 28px;
  }

  .reader-content {
    padding: 20px;
    font-size: 1rem;
  }
}

/* =========================================================
   LAYOUT DE ESCRITORIO (CSS GRID, 3 COLUMNAS)
   =========================================================

   Solo se activa en pantallas anchas. Por debajo de 1025px (tablet /
   móvil) el grid no existe: las columnas laterales quedan ocultas y
   se ve únicamente título + mapa, como antes.

   Estructura:
        ┌───────────┬───────────────┬───────────┐
        │           │     TÍTULO    │           │
        │ izquierda ├───────────────┤  derecha  │
        │           │  MAPA (main)  │           │
        └───────────┴───────────────┴───────────┘
*/
.layout {
  display: block;
}

.col {
  display: none;
}

@media (min-width: 1025px) {
  .layout {
    display: grid;
    grid-template-columns:
      minmax(0, 1fr)
      clamp(560px, 46vw, 760px)
      minmax(0, 1fr);
    grid-template-areas:
      "izq titulo der"
      "izq mapa   der";
    column-gap: 24px;
    row-gap: 24px;
    align-items: start;

    width: 100%;
    max-width: 1700px;
    margin: 0 auto;
    padding: 28px clamp(16px, 2vw, 32px) 80px;
  }

  /* Título centrado sobre la columna del medio */
  .site-title {
    grid-area: titulo;
    justify-self: center;
    margin: 0;
    background: var(--negro);
  }

  /* Columna principal: panel negro donde vive todo el mapa.
     Crece hacia abajo sola a medida que se agregan artículos. */
  .map {
    grid-area: mapa;
    max-width: none;
    margin: 0;
    padding: 56px 0 120px;
    background: var(--negro);
    border-radius: 8px;
  }

  .map-heading {
    width: 100%;
  }

  /* Los artículos se adaptan al ancho de la columna del medio */
  .article-left {
    left: 28px;
  }

  .article-right {
    right: 28px;
  }

  .node-box {
    width: clamp(190px, 17vw, 260px);
  }

  /* Columnas laterales */
  .col {
    display: flex;
    flex-direction: column;
    gap: 24px;
    align-self: start;
    min-height: 80vh;
    padding: 24px;
    background: var(--negro);
    border: var(--linea-fina) solid var(--blanco);
    border-radius: 8px;
    text-align: center;
    font-size: 1.1rem;
  }

  /* Componente genérico: un recuadro con texto, imagen, widget, etc. */
  .col .widget {
    width: 100%;
    padding: 16px;
    border: var(--linea-fina) solid var(--blanco);
  }

  /* Componente menú: lista de links separados por líneas finas.
     "margin-block: auto" lo centra verticalmente en la columna;
     borrá esa línea si preferís que quede pegado arriba. */
  .col-menu {
    width: 100%;
    margin-block: auto;
  }

  .col-menu ul {
    width: 82%;
    margin: 0 auto;
    padding: 0;
    list-style: none;
    border-top: var(--linea-fina) solid var(--blanco);
  }

  .col-menu li {
    border-bottom: var(--linea-fina) solid var(--blanco);
  }

  .col-menu a {
    display: block;
    padding: 24px 8px 20px;
    color: var(--blanco);
    text-decoration: none;
    font-size: clamp(1.6rem, 2.4vw, 2.4rem);
    line-height: 1;
    transition: background-color 0.18s ease;
  }

  .col-menu a:hover,
  .col-menu a:focus-visible {
    background: rgba(255, 255, 255, 0.06);
    outline: none;
  }

  .col-izq { grid-area: izq; }
  .col-der { grid-area: der; }

  /* ---- ¿Qué hacen las columnas laterales al scrollear? ----
     Por defecto: se mueven junto con la página (scroll normal).

     OPCIÓN A — quedarse fijas en pantalla mientras el mapa scrollea:
       .col {
         position: sticky;
         top: 28px;
         height: calc(100vh - 56px);
         min-height: 0;
       }

     OPCIÓN B — estirarse hasta el final del mapa (altura completa):
       .col {
         align-self: stretch;
       }
  */
}

@media (prefers-reduced-motion: reduce) {
  .gate,
  .reader,
  .node-box,
  .node-arrow-img,
  .reader-arrow-img,
  .gate-img,
  .intro-box {
    transition: none;
  }
}