/* assets/css/projects.css */

/* =========================================
   1. CONFIGURACIÓN GLOBAL
   ========================================= */
body {
  background-color: #fff !important;
  color: #000;
  overflow-x: hidden;
  overflow-y: auto;
}

.main-wrapper {
  perspective: 1000px;
  padding-top: 100px;
  padding-bottom: 100px;
}

/* =========================================
   2. FILA DE PROYECTO (CONTENEDOR)
   ========================================= */
.project-row {
  height: 55vh; /* Altura ideal para ver varios proyectos */
  min-height: 450px; /* Altura mínima de seguridad */
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  overflow: hidden;
  position: relative;
  background: #fff;
  margin-bottom: 0;

  /* Optimización para GSAP */
  transform-origin: center center;
  will-change: transform, opacity;
}

/* =========================================
   3. COLUMNA IZQUIERDA (INFO)
   ========================================= */
.info-col {
  width: 25%;
  min-width: 300px;
  border-right: 1px solid #f0f0f0;
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 10;
  background: #fff;
  flex-shrink: 0;
}

.project-title {
  font-family: "Inter", sans-serif;
  font-weight: 900;
  font-size: 2rem;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  color: #000;
  line-height: 1;
}

.project-meta {
  font-family: "Courier New", monospace;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: #888;
  letter-spacing: 1px;
}

.project-icon {
  width: 50px;
  height: 50px;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.project-icon img {
  width: 24px;
  filter: invert(1);
}

.action-hint {
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: bold;
  letter-spacing: 2px;
  color: #000;
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.action-hint::before {
  content: "";
  display: block;
  width: 30px;
  height: 1px;
  background: #000;
}

/* =========================================
   4. COLUMNA DERECHA (SWIPER PRINCIPAL)
   ========================================= */
.gallery-col {
  flex-grow: 1;
  width: 75%;
  position: relative;
}

/* El Swiper Padre ocupa todo */
.gallery-col > .swiper {
  width: 100%;
  height: 100%;
}

/* Slides del Swiper Padre (Horizontal) */
.gallery-col > .swiper > .swiper-wrapper > .swiper-slide {
  width: auto !important; /* Importante para slidesPerView: auto */
  height: 100%;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.gallery-col img {
  display: block;
  object-fit: cover;
}

/* =========================================
   5. CARRUSEL NATIVO (SIN SWIPER)
   ========================================= */
.simple-fader {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #f0f0f0; /* Color base */
}

.fader-img {
  position: absolute; /* CLAVE: Una encima de la otra */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;

  /* Estado Oculto */
  opacity: 0;
  z-index: 1;

  /* Transición suave de 1.5 segundos */
  transition: opacity 1.5s ease-in-out;
}

/* Estado Visible (Clase controlada por JS) */
.fader-img.active {
  opacity: 1;
  z-index: 2; /* Se pone al frente */
}

/* =========================================
   6. OTROS TIPOS DE SLIDES
   ========================================= */

/* Slide de Texto (Concepto/Detalles) */
.slide-content {
  background: #fff;
  width: 40vw;
  height: 100%;
  padding: 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: #000;
  border-right: 1px solid #f0f0f0;
}

/* Estilos para el Mapa */
.map-technical-wrapper {
  display: flex;
  height: 100%;
  width: 75vw; /* Ancho del slide del mapa */
  min-width: 600px;
  border-left: 1px solid #eee;
}

/* =========================================
   7. BARRA DE PROGRESO
   ========================================= */
.project-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px !important;
  background: transparent !important;
  z-index: 50;
  pointer-events: none;
}
.progress-fill {
  display: block;
  height: 100%;
  background: #000 !important;
  width: 0%;
  transition: width 0.3s ease-out;
}
.swiper-scrollbar {
  display: none !important;
}

/* =========================================
   8. RESPONSIVE (MÓVIL)
   ========================================= */
@media (max-width: 992px) {
  .project-row {
    flex-direction: column;
    height: auto;
  }
  .info-col {
    width: 100%;
    border-right: none;
    padding: 40px 20px;
    min-width: auto;
  }
  .project-title {
    font-size: 2rem;
  }
  .gallery-col {
    width: 100%;
    height: 60vh; /* Altura en móvil */
  }

  /* Ajustes de anchos para slides en móvil */
  .slide-content {
    width: 85vw;
    padding: 40px;
  }
  .map-technical-wrapper {
    width: 90vw;
    flex-direction: column;
  }
}

/* Corrección de altura para evitar pantalla blanca */
.nested-swiper {
  width: 100%;
  height: 100%;
  min-height: 100%; /* Forzar altura */
  position: relative;
  background: #000; /* Fondo negro para detectar si carga */
  z-index: 5;
}

.nested-swiper .swiper-slide {
  width: 100%;
  height: 100%;
}

.nested-swiper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Puntitos blancos visibles */
.swiper-pagination-bullet {
  background: #fff !important;
  opacity: 0.5;
}
.swiper-pagination-bullet-active {
  opacity: 1;
}

/* assets/css/projects.css */

/* --- GALERÍA CLICK-THROUGH (SOLUCIÓN SEGURA) --- */
.click-gallery {
  user-select: none; /* Evita que se seleccione el texto al hacer clic rápido */
  -webkit-tap-highlight-color: transparent;
}

.click-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;

  /* Estado Oculto */
  opacity: 0;
  z-index: 1;
  transform: scale(1.05); /* Un poco de zoom para efecto */
  transition:
    opacity 0.6s ease-out,
    transform 0.6s ease-out;
}

/* Estado Visible */
.click-img.active {
  opacity: 1;
  z-index: 2;
  transform: scale(1); /* Vuelve a tamaño normal */
}

/* Texto del contador */
.gallery-ui {
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  background: rgba(0, 0, 0, 0.3); /* Fondo oscurito sutil */
  padding: 10px 15px;
  border-radius: 4px;
  backdrop-filter: blur(5px);
}

/* --- SLIDE "TRIGGER" (VER GALERÍA) --- */
.gallery-trigger-box {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.trigger-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s ease;
  filter: brightness(0.4); /* Oscurecer foto de fondo */
}

.trigger-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: #fff;
  z-index: 2;
  text-align: center;
}

.trigger-text {
  font-size: 1.2rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 5px;
}

.trigger-count {
  font-size: 0.9rem;
  opacity: 0.8;
  font-family: "Courier New", monospace;
}

/* Efecto Hover */
.gallery-trigger-box:hover .trigger-bg {
  transform: scale(1.1);
  filter: brightness(0.3);
}

/* --- MODAL PANTALLA COMPLETA (CORREGIDO Y MEJORADO) --- */
.project-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;

  /* Z-INDEX SUPREMO: Debe ser mayor que tu Header (que usualmente es 100 o 1000) */
  z-index: 2147483647 !important; /* El número más alto permitido en CSS */

  background: rgba(10, 10, 10, 0.98); /* Fondo casi negro sólido */
  backdrop-filter: blur(10px);

  display: none;
  opacity: 0;
  overflow-y: auto; /* Scroll dentro del modal */
  padding-bottom: 50px; /* Espacio para scrollear al final */
}

.project-modal.open {
  display: block;
  opacity: 1;
}

/* Botón de Cerrar (Estilo Minimalista) */
.modal-close {
  position: fixed; /* Fijo para que siempre se vea al scrollear */
  top: 30px;
  right: 40px;
  background: rgba(255, 255, 255, 0.1); /* Círculo sutil */
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 100000; /* Encima del modal */
  transition: all 0.3s ease;
}
.modal-close:hover {
  background: #fff;
  color: #000;
  transform: rotate(90deg);
}

/* Contenedor interno */
.modal-content-wrapper {
  width: 100%;
  min-height: 100%;
  padding: 100px 5vw; /* Espacio arriba para no chocar con el botón */
}

/* Título dentro del Modal */
.modal-title {
  color: #fff;
  font-family: "Inter", sans-serif;
  font-weight: 300;
  font-size: 2rem;
  text-align: center;
  margin-bottom: 60px;
  letter-spacing: -1px;
  opacity: 0; /* Oculto inicial para animar */
  transform: translateY(20px);
}

/* --- MASONRY GRID (GRID TIPO PINTEREST) --- */
.masonry-grid {
  column-count: 3;
  column-gap: 30px;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

.masonry-item {
  break-inside: avoid;
  margin-bottom: 30px;
  opacity: 0; /* Oculto inicial para animar con GSAP */
  transform: translateY(50px);
}

.masonry-item img {
  width: 100%;
  height: auto;
  display: block;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); /* Sombra elegante */
}

/* MEJORA 3: Efecto Hover en las fotos */
.masonry-item:hover img {
  transform: scale(1.03); /* Zoom sutil */
  filter: brightness(1.1); /* Se iluminan */
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  z-index: 2;
  position: relative;
}

/* Responsive */
@media (max-width: 992px) {
  .masonry-grid {
    column-count: 2;
  }
  .modal-content-wrapper {
    padding: 80px 20px;
  }
}
@media (max-width: 576px) {
  .masonry-grid {
    column-count: 1;
  }
  .modal-title {
    font-size: 1.5rem;
    text-align: left;
  }
  .modal-close {
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
  }
}
/* =========================================
   AJUSTES RESPONSIVOS PARA EL SLIDE DE TEXTO (CONCEPTO)
   ========================================= */

.slide-content {
  /* Aseguramos que el contenedor sea flexible y maneje bien textos largos */
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  padding: 40px 60px;
  white-space: normal; /* Permite que el texto baje a la siguiente línea */
  overflow-y: auto; /* Si el texto es larguísimo, permite hacer scroll vertical */
}

/* Reglas específicas para Celulares y Tablets pequeñas */
@media (max-width: 768px) {
  .slide-content {
    padding: 30px 25px; /* Reducimos los márgenes laterales */
    justify-content: flex-start; /* Alineamos arriba para que no se corte */
    padding-top: 50px;
  }

  /* Achicamos el Título */
  .slide-content h4 {
    font-size: 1.2rem !important;
    margin-bottom: 15px !important;
  }

  /* Achicamos el Párrafo (Sobrescribimos la clase .lead de Bootstrap) */
  .slide-content p.lead {
    font-size: 0.95rem !important; /* Tamaño perfecto para lectura en cel */
    line-height: 1.6 !important; /* Interlineado elegante */
    font-weight: 300 !important;
  }
}
