/*
archivo.css – Estilos específicos para la página "Archivo de Escenarios" del sitio web Explorador de Escenarios Olvidados
----------------------------------------------------------------------
Estructura base del CSS con:
- Variables personalizadas en :root
- Reset de estilos y mejoras de accesibilidad
- Tipografía base, colores y layout
- Estilos para secciones principales:
  · Header
  · Hero narrativo con imagen, título animado y botón de scroll
  · Sección de escenarios (grid de tarjetas con animaciones progresivas)
  · Footer con coordenadas secretas y enlaces secundarios
  · Animaciones, responsividad y estados interactivos
  · Cursor personalizado, popup secreto y comportamiento responsivo
*/

/* Variables globales (Custom Properties) */
:root {
  /* Tipografía base */
  font-size: 100%;
  font-family: system-ui, sans-serif;
  /* Anclas suaves */
  scroll-behavior: smooth;

  /* Tipografías personalizadas */
  --font-body: "Crimson Text", serif;
  --font-heading: "Bodoni Moda", serif;
  --font-popup: 'Fragment Mono', monospace;

  /* Tamaños de fuente responsivos */
  --font-s-h1: clamp(1.8rem, 4vw, 2.5rem);
  --font-s-h2: clamp(1.1rem, 4vw, 2rem);
  --font-s-h3: clamp(1rem, 4vw, 1.3rem);
  --font-s-p: clamp(1rem, 4vw, 1.1rem);
  --font-s-16: 1rem;
  --font-s-20: 1.25rem;

  /* Sombras para textos */
  --text-shadow: 0 0 0.625rem rgba(234, 227, 210, 0.3),
    0 0 1.25rem rgba(234, 227, 210, 0.2),
    0 0 2.5rem rgba(234, 227, 210, 0.1);


  /* Paleta cromática */
  --color-dark: #1b1b1b;
  --color-light: #eae3d2;
  --color-accent: #132841;
  --color-header: rgba(10, 18, 25, 1);
  --color-background: rgb(23, 49, 82);
  --color-white: white;

  /* Ancho máximo para centrar el contenido en pantallas grandes */
  --max-width-zoom: 2000px;

}

/* Reset y normalización inspirado en Meyer & Andy Bell*/
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  border: 0;
  box-sizing: border-box;
  vertical-align: baseline;
}

/* Reseteamos los before y after */
*::before,
*::after {
  display: block;
}

/* Evitamos problemas con las imagenes y vídeos */
img,
picture,
video,
iframe,
figure,
canvas {
  max-width: 100%;
  display: block;
  /* width : 100%; */
  height: initial;
  /* Ajustamos el tamaño del objeto imagen dentro de img y video */
  object-fit: cover;
  /* Ponemos la posicion del objeto imagen dentro de img y video */
  object-position: center center;
}

/* Reseteamos los enlaces para funcionar como cajas... */
a {
  display: block;
  /* text-decoration: none; */
  color: inherit;
  font: inherit;
}

p a {
  display: inline;
}

/* Quitamos los puntos de los <li> */
li,
menu,
summary {
  list-style-type: none;
}

ol {
  counter-reset: revert;
}

/* Desactivamos estilos por defecto de las principales etiquetas de texto */
h1,
h2,
h3,
h4,
h5,
h6,
p,
span,
a,
strong,
blockquote,
i,
b,
u,
pre,
code,
mark,
del {
  font: inherit;
  text-decoration: none;
  color: inherit;
  overflow-wrap: break-word;
  text-wrap: pretty;
}


mark {
  background-color: transparent;
}

/* Evitamos problemas con los pseudoelementos de quotes */
blockquote::before,
blockquote::after,
q::before,
q::after {
  content: none;
}

/* Nivelamos problemas de tipografías y colocación de formularios */
form,
input,
textarea,
select,
button,
label {
  font: inherit;
  hyphens: auto;
  background-color: transparent;
  color: inherit;
  display: block;
  /* Desactivamos los estilos base */

}

fieldset {
  border: none;
}

::placeholder {
  color: unset;
}

button,
label {
  cursor: pointer;
}

/* Reseteamos las tablas */
table,
tr,
td,
th,
tbody,
thead,
tfoot {
  border-collapse: collapse;
  border-spacing: 0;
  font: inherit;
}

/* Evitamos problemas con los SVG */
svg {
  width: 100%;
  display: block;
  fill: currentColor;
}

/* Ocultamos los svgs definidos para luego llamarlos con symbol */
.svg-definition {
  display: none;
}

/* Configuramos la tipografía para toda la web */
body {
  min-height: 100vh;
  line-height: 1.5;

  font-family: var(--font-body);
  font-weight: 400;
  font-style: normal;
  font-size: var(--font-s-20);
  color: var(--color-light);
  scroll-behavior: smooth;
  /* Configuración para que no se rompan las palabras */
  hyphens: none;
  overflow-wrap: break-word;
  word-break: normal;

  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  /* Ocultamos el cursor para usar el cursor personalizado. Desactivamos luego para el responsive */
  cursor: none;
}

/* Títulos y botones con tipografía especial */
h1,
h2,
h3,
.Archive-card-btn {
  font-family: var(--font-heading);
}

/*-------------------------HEADER----------------------------*/
/* Cabecera con logo, botón de menú y navegación. */
.Header {
  width: 100%;
  max-width: var(--max-width-zoom);
  margin: auto;
  padding: 1rem 5rem;

  display: flex;
  flex-flow: row wrap;
  justify-content: space-between;
  align-items: center;

  background: var(--color-header);

}

.Header-logo {
  width: 6.25rem;
  height: 6.25rem;
}

.Header-btn {
  display: none;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.Header-btn:hover {
  transform: scale(1.05);
}

.Header-btn:active {
  transform: scale(0.95);
}

.Header-nav {
  width: 70%;
}

.Header-ul {
  display: flex;
  flex-flow: row nowrap;
  justify-content: start;
  align-items: center;
  gap: 3rem;
}

.Header-a {
  position: relative;
  padding: 0.2rem 0;
  transition: color 0.3s ease;
  color: var(--color-light);

}

/* Línea decorativa al hacer hover sobre enlaces */
.Header-a::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0.125rem;
  background-color: currentColor;
  transition: width 0.3s ease;

}

.Header-a:hover::before,
.Header-a--selected::before {
  width: 100%;
}

/*-------------------------MAIN----------------------------*/
/* Establece la estructura principal de contenido. Define tipografía, colores de fondo y layout con max-width y padding. */
.Main {
  width: 100%;
  max-width: var(--max-width-zoom);
  margin: 0 auto;
  padding: 2rem 4rem;

  font-family: "Crimson Text", serif;
  line-height: 1.8;
  font-size: 1.1rem;

  color: var(--color-light);
  background: var(--color-background);
  background: linear-gradient(0deg, rgba(23, 49, 82, 1) 0%, rgba(10, 18, 25, 1) 100%);

}

/*-------------------------HERO DE ARCHIVO----------------------------*/
/* Contiene el título, subtítulo y una imagen ilustrativa del archivo.  */
.Archive-hero {
  width: 80%;
  min-height: 80vh;
  margin: 0 auto;

  display: flex;
  flex-flow: column nowrap;
  justify-content: start;
  align-items: center;
  gap: 1rem;

  text-align: center;
}

.Archive-h1 {
  font-size: var(--font-s-h1);
  text-transform: uppercase;
  letter-spacing: 0.1875rem;
  text-shadow: var(--text-shadow);
  text-align: center;

  animation: fromBelowScale 1s ease-out both;
  animation-delay: 0.3s;
}

.Archive-p {
  font-size: var(--font-s-p);
  line-height: 1.8;
  margin: 0.5rem auto;

  animation: fromBelowScale 1s ease-out both;
  animation-delay: 0.6s;

}

.Archive-img {
  width: 47rem;
  height: 28rem;
  border-radius: 1.25rem;

  object-fit: cover;
  object-position: top;

  animation: fromBelowScale 1s ease-out both;
  animation-delay: 0.9s;

}

.Archive-p-intro {

  font-size: var(--font-s-p);

  /* opacity: 0;
  transform: translateY(1.25rem);
  transition: opacity 1.5s ease, transform 1.5s ease; */
  animation: fromBelowScale 1s ease-out both;
  animation-delay: 1.2s;
}

.Archive-scroll-btn {
  animation: floatDown 3s ease-in-out infinite;

  color: var(--color-light);
  text-align: center;
  transition: transform 0.3s ease;
}


.Archive-scroll-svg {
  width: 2rem;
  height: 4rem;
  stroke: var(--color-white);
  stroke-width: 0.2;

  animation: fromBelowScale 1s ease-out both;
  animation-delay: 1.5s;
}



/*-------------------------SECCIÓN DE ESCENARIOS----------------------------*/
/* Sección que introduce el listado de escenarios. Incluye título y párrafos explicativos que se revelan al hacer scroll (con isVisible y IntersectionObserver en JS). */

.Archive-scenarios {
  width: 90%;
  min-height: 100vh;
  margin: 2rem auto;

  text-align: center;
}

.Archive-scenarios-h2 {
  font-size: var(--font-s-h2);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin: 2rem 0;
  color: var(--color-light);
  text-shadow: var(--text-shadow);

  opacity: 0;
  transition: opacity 5s ease;


}

.Archive-scenarios-h2.isVisible {
  opacity: 1;
}

.Archive-scenarios-p {
  font-size: var(--font-s-p);
  line-height: 1.8;
  max-width: 1200px;
  margin: 0.5rem auto;

  opacity: 0;
  transform: translateY(3.125rem);
  transition: opacity 1s ease, transform 1s ease;

}

.Archive-scenarios-p.isVisible {
  opacity: 1;
  transform: translateY(0);
}




/*-------------------------Tarjeras de escenarios----------------------------*/
/* Usa CSS Grid para distribuir las tarjetas (.Archive-card) de forma responsive. Se ajusta automáticamente a diferentes tamaños de pantalla. */
.Archive-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr));
  gap: 2.5rem;
  max-width: 1200px;
  margin: 3rem auto;
}

/* Estilo visual de cada tarjeta. Usa box-shadow, border-radius y hover con transformación suave. Incluye imagen, título, descripción y botón. */
.Archive-card {
  background-color: rgba(255, 255, 255, 0.05);
  border: 0.063rem solid rgba(234, 227, 210, 0.3);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 0 1rem rgba(234, 227, 210, 0.1);

  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.Archive-card:hover {
  transform: translateY(-0.125rem) scale(1.05);
  box-shadow: 0 0 1rem rgba(234, 227, 210, 0.4);
}

.Archive-card-wrapper {
  opacity: 0;
  transform: translateY(3.125rem);
  transition: opacity 1.5s ease, transform 1.5s ease;
}

.Archive-card-wrapper.isVisible {
  opacity: 1;
  transform: translateY(0);
}

/* Animación escalonada de aparición para las tarjetas usando delay progresivo */
.Archive-card-wrapper:nth-child(1) {
  transition-delay: 0.5s;
}

.Archive-card-wrapper:nth-child(2) {
  transition-delay: 1s;
}

.Archive-card-wrapper:nth-child(3) {
  transition-delay: 1.5s;
}

.Archive-card-wrapper:nth-child(4) {
  transition-delay: 2s;
}

.Archive-card-wrapper:nth-child(5) {
  transition-delay: 2.5s;
}

.Archive-card-wrapper:nth-child(6) {
  transition-delay: 3s;
}

/*Imagen del escenario. Se adapta con object-fit: cover y asegura que se muestre correctamente en cualquier tamaño. */
.Archive-card-img {
  width: 100%;
  height: 15rem;
  object-fit: cover;
  object-position: center;
  background-color: var(--color-dark);
}

.Archive-card-text {
  padding: 1.5rem;
}

.Archive-card-h3 {
  font-size: var(--font-s-h3);
  text-transform: uppercase;
  margin-bottom: 0.8rem;
  color: var(--color-light);
}

.Archive-card-p {
  font-size: var(--font-s-16);
  color: #eae3d2cc;
  line-height: 1.6;
}

/* Botón para explorar cada escenario */
.Archive-card-btn {
  margin: 1rem 0 0 0;
  background-color: var(--color-light);
  color: var(--color-dark);
  border: 0.1rem solid var(--color-light);
  border-radius: 1.25rem;
  padding: 0.5rem 1rem;
  font-size: var(--font-s-16);

  box-shadow: 0 0 0.625rem rgba(234, 227, 210, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.Archive-card-btn:hover {
  transform: translateY(-0.125rem) scale(1.05);
  box-shadow: 0 0 1rem rgba(234, 227, 210, 0.4);
}

.Archive-card-btn:active {
  transform: scale(0.97);
  box-shadow: 0 0 0.5rem rgba(234, 227, 210, 0.3);
}

/* Frases del final */
.Archive-scenarios-final {
  font-size: var(--font-s-p);
  line-height: 1.8;
  max-width: 1200px;
  margin: 1.5rem auto;
  text-align: center;

  opacity: 0;
  transform: translateY(3.125rem);
  transition: opacity 2s ease, transform 2s ease;
}

.Archive-scenarios-final.isVisible {
  opacity: 1;
  transform: translateY(0);
}

/*-------------------------FOOTER----------------------------*/
/* Pie de página con tres columnas: logo, info y enlaces. */
.Footer {
  width: 100%;
  min-height: 20vh;
  max-width: var(--max-width-zoom);
  background-color: var(--color-light);
  margin: 0 auto;
  padding: 2rem;

  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: 2rem;
  color: var(--color-dark);


}

/* Columna izquierda con el botón para volver arriba */
.Footer-column--logo {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Columna central con coordenadas, frase final y copyright */
.Footer-column--info {
  display: flex;
  flex-flow: column nowrap;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  text-align: center;
}

/* Columna derecha con enlaces */
.Footer-column--links {
  text-align: left;
}

/* Frase final en cursiva */
.Footer-quote {
  font-style: italic;
  text-align: center;
  font-size: var(--font-s-p);
}

/* Título de la sección de enlaces */
.Footer-h4 {
  font-weight: 600;
  font-size: var(--font-s-h3);
  text-transform: uppercase;
  letter-spacing: 0.063rem;
  margin: 0 0 1rem 0;
}

/* Coordenadas con efecto especial */
.Footer-coordinates {
  font-weight: 600;
}

/* Coordenadas clicables (disparan el popup) */
.Footer-coordinates--trigger {
  transition: box-shadow 0.3s ease, color 0.3s ease;
  cursor: pointer;
  box-shadow: 0 0 0.625rem rgba(234, 227, 210, 0.2);
}

.Footer-coordinates--trigger:hover {
  box-shadow: 0 0 1.25rem rgba(234, 227, 210, 0.4);
  color: var(--color-accent);
}

/* Flecha "volver arriba" */
.Footer-up {
  width: 8rem;
  height: auto;

}

/* Enlaces en el footer */
.Footer-links a {
  transition: color 0.3s ease;
}

.Footer-links a:hover {
  color: var(--color-accent);
}

/*-------------------------Cursor personalizado----------------------------*/
/* Círculo blanco que sigue al puntero y reacciona al hacer click o pasar sobre botones. */
.Cursor {
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  position: fixed;
  top: -1.25rem;
  left: -1.25rem;

  background-color: rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 1rem rgba(255, 255, 255, 0.5);
  transition: transform 0.3s ease;

  mix-blend-mode: difference;
  /* Para contraste dinámico sobre fondos */
  pointer-events: none;
  /* No interfiere con clics del usuario */
}

/* Estado: cuando haces click */
.Cursor.isClicked {
  transform: scale(0.3);
  box-shadow: 0 0 1.6rem rgba(255, 255, 255, 0.7);
}

/* Estado: cuando pasa sobre un botón */
.Cursor.isHover {
  transform: scale(2);

}

/*-------------------------POP UP----------------------------*/
/* Ventana modal superpuesta que se muestra al hacer clic en coordenadas especiales.
   Incluye fondo difuminado, animación, y mensaje tipo máquina de escribir. */
.Popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 2rem;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.75);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1;
  backdrop-filter: blur(0.25rem);
  /* Efecto de desenfoque del fondo */
  cursor: auto;
  /*Por el efecto de desenfoque del fondo, vuelvo a activar el ratón */
}

.Popup-wrapper {
  width: 100%;
  max-width: 650px;
  background: #0e0e0e;
  color: var(--color-light);
  padding: 2rem;
  border-radius: 1rem;

  text-align: center;
  position: relative;
  box-shadow: 0 0 1.25rem rgba(234, 227, 210, 0.4);
  animation: popupFade 0.5s ease-out;
}

/* Botón de cierre del popup */
.Popup-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: var(--font-s-20);
  color: var(--color-light);
  cursor: pointer;
}

/* Texto del popup con efecto "máquina de escribir" */
.Popup-typewriter {
  font-family: var(--font-popup);
  color: var(--color-light);
  white-space: pre-line;
  font-size: var(--font-s-16);
  padding: 1rem;
  line-height: 1.5;
}

/*------------------------- Animaciones Clave----------------------------*/
/* Animaciones reutilizadas para efectos visuales envolventes. */

/* Movimiento oscilante vertical.
   - Mueve el elemento suavemente hacia abajo y vuelve a subir.*/

@keyframes floatDown {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(0.625rem);
  }
}
/* Aparece desde abajo con un leve escalado.
   - Empieza con opacidad 0, ligeramente desplazado hacia abajo y escalado al 80%.
   - Termina con opacidad 1, posición original y escala normal. */

@keyframes fromBelowScale {
  0% {
    opacity: 0;
    transform: translateY(2.5rem) scale(0.8);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}


/*-------------------------MEDIAS QUERIES----------------------------*/

@media (max-width:1120px) {
  /* Ajustes para pantallas tipo tablet y móviles grandes.
Modifica el layout del header (menú responsive) */

  /* Cambia la dirección del header para que el botón hamburguesa quede a la izquierda */
  .Header {
    display: flex;
    flex-direction: row-reverse;
    justify-content: space-between;
  }

  /* Reordena el logo en móviles */
  .Header-logo-wrapper {
    width: auto;
    order: 1;
  }

  /* Icono SVG del menú más grande para accesibilidad */

  .Header-svg {
    width: 2rem;
    height: 2rem;
    color: var(--color-light);
  }

  /* Muestra el botón hamburguesa en móviles */
  .Header-btn {
    display: block;
    cursor: pointer;
    transition: all 0.6s ease;
  }

  /* El nav ocupa todo el ancho en responsive */
  .Header-nav {
    width: 100%;
  }

  /* Menú en columna oculto inicialmente */
  .Header-ul {
    flex-direction: column;
    justify-content: start;
    align-items: start;
    overflow: hidden;
    transition: all 0.5s ease;
    opacity: 0;
    gap: 0.5rem;
    height: 0;
  }

  /* Estilo de enlaces en modo responsive */
  .Header-a {
    width: 100%;
    color: var(--color-white);
  }

  /* Cuando se activa el menú: se muestra */
  .Header-ul.isVisible {
    height: 10rem;
    opacity: 1;
  }
}

@media (max-width:900px) {
    /* Reestructura el footer en una sola columna para pantallas medianas.
    - Centra el contenido de cada columna.
    - Ajusta espaciados y tamaños visuales. */
    
      /* Reestructura el footer a una sola columna en móviles */
      .Footer {
        grid-template-columns: 1fr;    /* Cambia a una sola columna */
        text-align: center;
    }

  /* Centra todos los bloques del footer */
    .Footer-column--logo,
    .Footer-column--info,
    .Footer-column--links {
        justify-content: center;
        align-items: center;
    }

  /* Centra el texto de los enlaces */
    .Footer-column--links {
        text-align: center;
    }

  /* Elimina padding lateral de los enlaces */
    .Footer-links {
        padding: 0;
    }
  /* Menor separación vertical entre enlaces */
    .Footer-links li {
        margin-bottom: 0.5rem;
    }
    
  /* Reduce tamaño del icono de volver arriba */
    .Footer-up {
        width: 6rem;
    }
}

@media (max-width:875px) {

  /* Desactiva el cursor personalizado en móviles/tablets por usabilidad. */
  .Cursor {
    display: none;
  }

  body {
    cursor: auto;
    /* Se restaura el cursor normal */
  }
}

@media (max-width:680px) {
  /* Adaptaciones para móviles medianos (e.g. altura de imagen, padding general) */

  .Main {
    padding: 1.2rem;
  }

  .Archive-hero {
    width: 95%;
  }

  .Archive-img {
    height: 25rem;
  }

  .Archive-card-wrapper {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .Archive-card-btn:hover {
    transform: none;
    box-shadow: none;
  }

  .Archive-card:hover{
    transform: none;
    box-shadow: none;
  }
}

@media (max-width:510px) {

  /* Ajustes para pantallas móviles pequeñas */

  .Archive-list {
    grid-template-columns: 1fr;
  }


  .Header {
    padding: 1rem 3rem;
  }

  .Archive-img {
    height: 18.75rem;
  }
}
