@import url('https://fonts.googleapis.com/css?family=Raleway:400,500,800');

/* ============================================
  SECCIÓN MISIÓN Y VISIÓN
   ============================================ */

/* SECCIÓN GENERAL */
.seccion-mision-vision {
  padding: 4rem 2rem;
  background-color: #212121;
}

/* CONTENEDOR FLEXIBLE - Organiza las tarjetas lado a lado */
.contenedor-mision-vision {
  display: flex;
  flex-wrap: wrap;
  gap: 3rem;
  justify-content: center;
  align-items: stretch;
}

/* ============================================
  TARJETA BASE
   ============================================ */
figure.snip1162 {
  font-family: 'Raleway', Arial, sans-serif;
  position: relative;
  overflow: hidden; /* ✅ CRÍTICO: Mantiene el efecto de hover contenido */
  width: min(100%, 320px);
  aspect-ratio: 1 / 1;
  background: #000;
  color: #fff;
  text-align: center;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  transition: all 0.45s ease-in-out;
}

figure.snip1162 * {
  box-sizing: border-box;
  transition: all 0.45s ease-in-out;
}

/* IMAGEN DE FONDO */
figure.snip1162 img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.9;
}

/* ============================================
  CAPTION - Contenedor del contenido
   ============================================ */
figure.snip1162 figcaption {
  position: absolute;
  top: 45%;
  left: 7%;
  right: 7%;
  bottom: 45%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-width: 0 1px 1px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.3);
}

/* ============================================
  TÍTULOS "NUESTRA MISIÓN/VISIÓN"
   ============================================ */

/* Contenedor del encabezado */
figure.snip1162 .heading {
  overflow: visible; /* ✅ IMPORTANTE: Cambiado de hidden a visible para que no se corten los títulos */
  transform: translateY(-50%);
}

/* Estilo del título H2 */
figure.snip1162 h2 {
  margin: 0 auto;
  padding: 0 10px;
  width: auto;
  text-transform: uppercase;
  font-weight: 400;
  color: #fff; /* "Nuestra" en blanco */
  position: relative;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

/* Palabra destacada (Misión/Visión) */
figure.snip1162 h2 span {
  font-weight: 800;
  color: #a91b3d; /* Color distintivo para Misión/Visión */
}

/* ============================================
  LÍNEAS DECORATIVAS HORIZONTALES
   ============================================ */
figure.snip1162 h2::before,
figure.snip1162 h2::after {
  position: absolute;
  display: block;
  width: 1000%;
  height: 1px;
  content: '';
  background: rgba(184, 132, 91, 0.9);
  top: 50%;
  transition: opacity 0.5s ease;
}

figure.snip1162 h2::before {
  left: -1000%;
}
figure.snip1162 h2::after {
  right: -1000%;
}

/* ============================================
  TEXTO DESCRIPTIVO (APARECE EN HOVER)
   ============================================ */
figure.snip1162 p {
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.35;
  transform: translateY(-50%);
  opacity: 0; /* ✅ Oculto por defecto, aparece en hover */
  padding: 0.8rem 1rem;
  margin: 0;
  color: #eee;
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  max-height: 86%; /* ✅ CRÍTICO: Evita que el texto se salga del contenedor */
  overflow-y: auto; /* ✅ Permite scroll si el texto es muy largo */
  transition: opacity 0.45s ease 0.35s;
  text-align: justify; /* ✅ Mejor aprovechamiento del espacio */
}

/* ✅ Scroll personalizado para el texto descriptivo */
figure.snip1162 p::-webkit-scrollbar {
  width: 4px;
}

figure.snip1162 p::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
}

figure.snip1162 p::-webkit-scrollbar-thumb {
  background: rgba(184, 132, 91, 0.6);
  border-radius: 2px;
}

/* ENLACE INVISIBLE - Hace toda la tarjeta clickeable */
figure.snip1162 a {
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* ============================================
  EFECTO HOVER (ESCRITORIO)
   ============================================ */
figure.snip1162:hover img {
  opacity: 0.25; /* Oscurece la imagen */
  transform: scale(1.05); /* Zoom sutil */
}

/* Expande el contenedor al hacer hover */
figure.snip1162:hover figcaption {
  top: 7%;
  bottom: 7%;
}

/* Oculta el título gradualmente */
figure.snip1162:hover h2 {
  opacity: 0;
  transform: translateY(-20%);
}

/* Oculta las líneas decorativas */
figure.snip1162:hover h2::before,
figure.snip1162:hover h2::after {
  opacity: 0;
}

/* Muestra el texto descriptivo */
figure.snip1162:hover p {
  opacity: 1;
  transition-delay: 0.35s;
}

/* ============================================
  EFECTO .activo (MÓVILES CON JAVASCRIPT)
  Similar al hover pero activado por clase
   ============================================ */
figure.snip1162.activo img {
  opacity: 0.25;
  transform: scale(1.05);
}

figure.snip1162.activo figcaption {
  top: 7%;
  bottom: 7%;
}

figure.snip1162.activo h2 {
  opacity: 0;
  transform: translateY(-20%);
}

figure.snip1162.activo h2::before,
figure.snip1162.activo h2::after {
  opacity: 0;
}

figure.snip1162.activo p {
  opacity: 1;
  transition-delay: 0.35s;
}

/* ============================================
  RESPONSIVE - TABLETS
   ============================================ */
@media (max-width: 768px) {
  .contenedor-mision-vision {
    flex-direction: column;
    align-items: center;
    gap: 2rem;
  }
  
  figure.snip1162 {
    width: min(100%, 300px);
  }
  
  figure.snip1162 p {
    font-size: 0.75rem;
    line-height: 1.3;
    padding: 0.7rem 0.9rem;
  }
}

/* ============================================
  RESPONSIVE - MÓVILES
   ============================================ */
@media (max-width: 600px) {
  .seccion-mision-vision {
    padding: 3rem 1rem;
  }
  
  figure.snip1162 p {
    font-size: 0.7rem;
    padding: 0.6rem 0.8rem;
    line-height: 1.25;
  }
}