/* ============================================================================
   STYLE.CSS — twinMokakopa (versión RTL espejo)
   Portfolio de proyectos artísticos de Ana López - versión derecha
   ============================================================================ */

/* === RESET Y CONFIGURACIÓN GLOBAL ========================================= */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Times New Roman", Times, serif;
  font-size: 16px;
  line-height: 1.6;
  background-color: #fff;
  color: #000;
  overflow-x: hidden;
  overscroll-behavior-x: none;
  overscroll-behavior-y: auto; /* permite scroll vertical entre proyectos */
}

/* === HEADER: NOMBRE + SELECTOR DE IDIOMAS (arriba DERECHA) ============== */
/*
   mix-blend-mode: difference con color: #fff en el contenedor.
   Sobre fondo blanco se ven negros, sobre imágenes oscuras se ven claros.
   Mismo efecto que el menú de abajo.
*/

#site-header {
  position: fixed;
  top: 20px;
  right: 20px; /* CAMBIADO: de left a right */
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: flex-end; /* AÑADIDO: alinear a la derecha */
  gap: 4px;
  mix-blend-mode: difference;
  color: #fff;
}

/* "ana lópez" — clickable, abre el about */
#site-name {
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  color: inherit;
}

/* === ABOUT OVERLAY (velo blanco semitransparente a pantalla completa) ====== */

#about-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(255, 255, 255, 0.92);
  z-index: 2000;
  overflow-y: auto;
  display: block;
  /* Transición suave de apertura/cierre */
  opacity: 1;
  visibility: visible;
  transition:
    opacity 0.4s ease,
    visibility 0.4s ease;
}

/* Estado oculto del overlay */
#about-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Contenido del about centrado con padding 20dvh arriba y abajo */
#about-content {
  max-width: 560px;
  padding: 20dvh 40px;
  margin: 0 auto;
  text-align: center;
}

#about-content h2 {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 4px;
}

#about-content .about-subtitle {
  font-size: 14px;
  color: #666;
  margin-bottom: 30px;
}

#about-content p {
  margin-bottom: 16px;
  line-height: 1.8;
  font-size: 14px;
}

/* Link pequeño al final del about */
#about-content .about-footer {
  margin-top: 40px;
  font-size: 11px;
  color: #666;
}

#about-content .about-footer a {
  color: #666;
  text-decoration: none;
  transition: color 0.3s ease;
}

#about-content .about-footer a:hover {
  color: #000;
}

/* Botón cerrar (×) arriba IZQUIERDA del overlay */
#close-about {
  position: fixed;
  top: 20px;
  left: 20px; /* CAMBIADO: de right a left */
  font-size: 28px;
  background: none;
  border: none;
  cursor: pointer;
  color: #000;
  z-index: 2001;
  line-height: 1;
}

#close-about:hover {
  color: #666;
}

/* === ABOUT: TEXTO DINÁMICO (statement o CV) ================================ */

#about-text {
  text-align: center;
  transition: opacity 0.3s ease;
}

/* --- Toggle Statement / CV --- */
#about-switch {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 30px;
  font-size: 13px;
}

#about-switch span {
  cursor: pointer;
  color: #999;
  font-weight: normal;
  transition: color 0.2s ease;
}

#about-switch span.active {
  color: #000;
  font-weight: bold;
}

#about-switch span:hover {
  color: #000;
}

/* --- Selector de idioma reutilizable --- */
.lang-switch {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 13px;
}

.lang-switch span {
  cursor: pointer;
  color: #999;
  font-weight: normal;
  transition: color 0.2s ease;
}

.lang-switch span.active {
  color: #000;
  font-weight: bold;
}

.lang-switch span:hover {
  color: #000;
}

/* --- CV: listas de secciones --- */
.cv-section {
  margin-bottom: 24px;
  text-align: left;
}

.cv-section h3 {
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 8px;
}

.cv-section ul {
  list-style: none;
  padding: 0;
}

.cv-section li {
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 4px;
}

.cv-section li .cv-fecha {
  font-weight: bold;
}

/* --- Contacto --- */
#about-contact {
  margin-top: 30px;
  text-align: center;
  font-size: 13px;
  line-height: 1.8;
}

#about-contact a {
  color: #000;
  text-decoration: none;
  transition: color 0.3s ease;
}

#about-contact a:hover {
  color: #666;
}

/* === MENÚ DE PROYECTOS (abajo DERECHA, texto pelao, blend-mode) ========= */
/*
   Sin fondo, sin blur, sin bordes.
   mix-blend-mode: difference con color: #fff en los links
   → sobre fondo blanco se ven negros, sobre imágenes oscuras se ven claros.
*/

/* Capa 1: todos los links con blend mode difference */
#menu {
  position: fixed;
  right: 20px; /* CAMBIADO: de left a right */
  bottom: 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-end; /* AÑADIDO: alinear a la derecha */
  gap: 4px;
  z-index: 1000;
  mix-blend-mode: difference;
  color: #fff;
}

#menu a {
  text-decoration: none;
  color: #fff;
  font-size: 14px;
  font-weight: bold;
  padding: 1px 2px;
}

/* Capa 2: link activo y hovers, sin blend mode, encima */
#menu-active {
  position: fixed;
  right: 20px; /* CAMBIADO: de left a right */
  bottom: 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-end; /* AÑADIDO: alinear a la derecha */
  gap: 4px;
  z-index: 1001;
}

#menu-active a {
  text-decoration: none;
  color: transparent;
  font-size: 14px;
  font-weight: bold;
  padding: 1px 2px;
  background-image: linear-gradient(var(--resaltado, #FFFF00), var(--resaltado, #FFFF00));
  background-repeat: no-repeat;
  background-position: right bottom; /* CAMBIADO: de left a right */
  background-size: 0% 3px;
  transition: background-size 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#menu-active a:hover {
  background-size: 100% 3px;
}

#menu-active a.active {
  color: #000;
  background-size: 100% 100%;
}

#menu-active a.active:hover {
  background-size: 100% 100%;
}

/* === CONTENEDOR DE PROYECTOS ============================================== */

#projects-container {
  width: 100%;
}

/* Cada proyecto ocupa toda la pantalla (scroll vertical entre proyectos) */
.project {
  width: 100dvw;
  height: 100dvh;
  position: relative;
  overflow: hidden;
  overscroll-behavior-x: none;
  overscroll-behavior-y: auto;
}



/* === GALERÍA HORIZONTAL SCROLLEABLE ======================================= */
/*
   Cada proyecto tiene un scroll horizontal con imágenes + texto al final.
   El padding-right se calcula dinámicamente en JS para centrar la primera imagen.
*/

.gallery {
  display: flex;
  align-items: center;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  gap: 4dvw; /* espaciado responsive en viewport width */
  /* Ocultar scrollbar en todos los navegadores */
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.gallery::-webkit-scrollbar {
  display: none;
}

/* === ITEMS DE LA GALERÍA (imágenes y bloque de texto) ===================== */

/* Loader simplificado: cada imagen hace fade-in individual al cargar */
.gallery-item {
  flex-shrink: 0;
  scroll-snap-align: center;
  opacity: 0;
  transition: opacity 0.4s ease;
}

/* Cuando la imagen carga, JS añade .loaded → fade in */
.gallery-item.loaded {
  opacity: 1;
}

/* Las imágenes con tamaño adaptativo */
.gallery-item img {
  max-height: 80dvh;
  max-width: 85dvw; /* evita que imágenes panorámicas se salgan */
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

/* Bloque de texto al final de cada galería — contenedor fullscreen */
.gallery-text {
  flex-shrink: 0;
  width: 100dvw;
  height: 100dvh;
  scroll-snap-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #fff;
}

/* Scroll wrapper con gradientes fade */
.gallery-text-scroll {
  position: relative;
  width: 100%;
  max-width: min(800px, 80dvw);
  height: 60dvh;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding: 0 5dvw;
  text-align: left;
  /* Ocultar scrollbar */
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.gallery-text-scroll::-webkit-scrollbar {
  display: none;
}

/* Gradientes fade arriba y abajo */
.gallery-text-scroll::before,
.gallery-text-scroll::after {
  content: "";
  position: sticky;
  display: block;
  left: 0;
  right: 0;
  height: 3rem;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.4s ease;
  flex-shrink: 0;
}

.gallery-text-scroll::before {
  top: 0;
  background: linear-gradient(to bottom, #fff, transparent);
}

.gallery-text-scroll::after {
  bottom: 0;
  background: linear-gradient(to top, #fff, transparent);
}

.gallery-text-scroll.can-scroll-up::before { opacity: 1; }
.gallery-text-scroll.can-scroll-down::after { opacity: 1; }

.gallery-text h2 {
  font-size: 18px;
  margin-bottom: 16px;
  font-weight: bold;
}

.gallery-text p {
  margin-bottom: 12px;
  line-height: 1.7;
}

.gallery-text a {
  color: #000;
  text-decoration: underline;
}

.gallery-text a:hover {
  color: #666;
}

/* Lang switch debajo del scroll wrapper */
.gallery-text .lang-switch {
  justify-content: center;
  margin-top: 12px;
}

/* === RESPONSIVE (móvil < 768px) =========================================== */

@media (max-width: 768px) {
  #site-header {
    top: 15px;
    right: 15px; /* CAMBIADO: de left a right */
  }

  #site-name {
    font-size: 18px;
  }

  #menu {
    right: 15px; /* CAMBIADO: de left a right */
    bottom: 15px;
    gap: 2px;
  }

  #menu a {
    font-size: 12px;
  }

  #menu-active {
    right: 15px;
    bottom: 15px;
    gap: 2px;
  }

  #menu-active a {
    font-size: 12px;
  }

  .gallery {
    gap: 2dvw; /* espaciado más pequeño en móvil */
  }

  .gallery-item img {
    max-height: 70dvh;
    max-width: 90dvw; /* más espacio horizontal en móvil */
  }

  .gallery-text-scroll {
    height: 80dvh;
    padding: 0 5dvw;
  }

  .gallery-text h2 {
    font-size: 16px;
  }

  #about-content {
    padding: 12dvh 20px; /* menos padding vertical en móvil */
  }
}
