/* ============================================ */
/* 🟩 HERO HISTORIA                            */
/* ============================================ */

.historia-hero {
  background: linear-gradient(135deg, #f0f4f8, #e6eef5);
  padding: 120px 20px 60px 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 50vh;
}

.historia-header {
  background-color: #ffffff;
  border-radius: 18px;
  padding: 40px 50px;
  max-width: 850px;
  text-align: center;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  position: relative;
  overflow: hidden;
}

.historia-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transition: left 0.5s ease;
  pointer-events: none;
}

.historia-header:hover {
  transform: translateY(-8px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.12);
}

.historia-header:hover::before {
  left: 100%;
}

.historia-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f0f4f8, #e0e8f0);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.4s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.historia-header:hover .historia-icon {
  background: linear-gradient(135deg, #08306b, #0a427c);
  transform: rotate(360deg) scale(1.1);
  box-shadow: 0 6px 20px rgba(8, 48, 107, 0.3);
}

.historia-icon img {
  width: 60%;
  height: 60%;
  object-fit: contain;
  transition: filter 0.3s ease;
}

.historia-header:hover .historia-icon img {
  filter: brightness(0) invert(1);
}

.historia-header h1 {
  font-size: 2.6rem;
  color: #08306b;
  margin-bottom: 18px;
  font-weight: 700;
  position: relative;
  padding-bottom: 15px;
}

.historia-header h1::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: linear-gradient(90deg, #FFD700, #08306b);
  border-radius: 2px;
}

.historia-header p {
  font-size: 1.15rem;
  color: #555;
  line-height: 1.7;
  font-weight: 300;
  max-width: 700px;
  margin: 0 auto;
}

/* ============================================ */
/* 🟦 CONTENIDO HISTORIA - REORGANIZADO        */
/* ============================================ */

.historia-contenido-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 20px;
}

/* Cada item historia (texto + imagen) */
.historia-item {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
  margin-bottom: 60px;
}

/* Orden inverso para alternar */
.historia-item.reverse {
  grid-template-columns: 1fr 1fr;
}

.historia-item.reverse .historia-bloque {
  order: 2;
}

.historia-item.reverse .historia-imagen {
  order: 1;
}

/* Bloques de texto */
.historia-bloque {
  padding: 35px;
  background: #ffffff;
  border-radius: 15px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  transition: all 0.4s ease;
  border-left: 4px solid transparent;
  height: 100%;
}

.historia-bloque:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
  border-left-color: #FFD700;
}

.bloque-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
}

.bloque-icon {
  font-size: 2.5rem;
  transition: transform 0.3s ease;
}

.historia-bloque:hover .bloque-icon {
  transform: scale(1.2) rotate(10deg);
}

.historia-bloque h2 {
  font-size: 2rem;
  color: #08306b;
  margin: 0;
  font-weight: 600;
}

.historia-bloque p {
  font-size: 1.05rem;
  line-height: 1.8;
  color: #555;
  margin-bottom: 15px;
  text-align: justify;
}

.historia-bloque p:last-child {
  margin-bottom: 0;
}

/* Imágenes */
.historia-imagen {
  margin: 0;
  position: relative;
  overflow: hidden;
  border-radius: 15px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  transition: all 0.4s ease;
  cursor: pointer;
  height: 100%;
}

.historia-imagen:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.historia-imagen img {
  width: 100%;
  height: 100%;
  min-height: 300px;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.historia-imagen:hover img {
  transform: scale(1.08);
}

.historia-imagen figcaption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent);
  color: white;
  padding: 15px 20px;
  font-size: 1rem;
  font-weight: 500;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.historia-imagen:hover figcaption {
  transform: translateY(0);
}

/* ============================================ */
/* 🏆 SECCIÓN DE LOGROS                        */
/* ============================================ */

.logros-section {
  padding: 70px 20px;
  background: #c9c9c9;
  text-align: center;
  color: white;
  margin-bottom: -60px;
}

.logros-section h2 {
  font-size: 2.5rem;
  margin-bottom: 50px;
  font-weight: 600;
  color: #08306b;
  position: relative;
  display: inline-block;
}

.logros-section h2::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: #FFD700;
  border-radius: 2px;
}

.logros-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 30px;
  max-width: 1000px;
  margin: 0 auto;
}

.logro-item {
  background: #08306bdf;
  backdrop-filter: blur(10px);
  padding: 35px 25px;
  border-radius: 15px;
  border: 2px solid rgba(255, 215, 0, 0.3);
  transition: all 0.4s ease;
}

.logro-item:hover {
  transform: translateY(-10px);
  background: #08306bdf;
  border-color: #FFD700;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.logro-numero {
  font-size: 3rem;
  font-weight: 700;
  color: #FFD700;
  margin-bottom: 10px;
  transition: transform 0.3s ease;
}

.logro-item:hover .logro-numero {
  transform: scale(1.15);
}

.logro-item p {
  font-size: 1.1rem;
  color: white;
  margin: 0;
  font-weight: 300;
}

/* ============================================ */
/* 📱 DISEÑO RESPONSIVO                        */
/* ============================================ */

@media (max-width: 900px) {
  .historia-hero {
    padding: 100px 20px 40px;
    min-height: auto;
  }

  .historia-header {
    padding: 35px 30px;
  }

  .historia-icon {
    width: 70px;
    height: 70px;
  }

  .historia-header h1 {
    font-size: 2.2rem;
  }

  .historia-header p {
    font-size: 1.05rem;
  }

  .historia-contenido-wrapper {
    padding: 40px 20px;
  }

  /* En tablet: una columna */
  .historia-item,
  .historia-item.reverse {
    grid-template-columns: 1fr;
    gap: 25px;
    margin-bottom: 50px;
  }

  /* Resetear orden */
  .historia-item.reverse .historia-bloque,
  .historia-item.reverse .historia-imagen {
    order: 0;
  }

  .historia-bloque {
    padding: 28px;
  }

  .historia-bloque h2 {
    font-size: 1.8rem;
  }

  .historia-imagen img {
    min-height: 250px;
  }

  .logros-section {
    padding: 50px 15px;
  }

  .logros-section h2 {
    font-size: 2rem;
  }

  .logros-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

@media (max-width: 600px) {
  .historia-hero {
    padding: 90px 15px 30px;
  }

  .historia-header {
    padding: 30px 25px;
  }

  .historia-icon {
    width: 60px;
    height: 60px;
  }

  .historia-header h1 {
    font-size: 2rem;
  }

  .historia-header p {
    font-size: 1rem;
  }

  .historia-contenido-wrapper {
    padding: 30px 15px;
  }

  .historia-item {
    margin-bottom: 35px;
  }

  .historia-bloque {
    padding: 25px 20px;
  }

  .bloque-header {
    gap: 12px;
  }

  .bloque-icon {
    font-size: 2rem;
  }

  .historia-bloque h2 {
    font-size: 1.6rem;
  }

  .historia-bloque p {
    font-size: 1rem;
    text-align: left;
  }

  .historia-imagen img {
    min-height: 200px;
  }

  .logros-section {
    padding: 40px 15px;
  }

  .logros-section h2 {
    font-size: 1.8rem;
    margin-bottom: 35px;
  }

  .logros-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .logro-numero {
    font-size: 2.5rem;
  }

  .logro-item p {
    font-size: 1rem;
  }
}

/* ============================================ */
/* ♿ MEJORAS DE ACCESIBILIDAD                 */
/* ============================================ */

.historia-bloque:focus-within,
.historia-imagen:focus-within,
.logro-item:focus-within {
  outline: 3px solid #FFD700;
  outline-offset: 4px;
}

@media (prefers-contrast: high) {
  .historia-header h1,
  .historia-bloque h2,
  .historia-bloque p {
    color: #000;
  }

  .logros-section {
    background: #000;
  }

  .logro-item {
    border-color: #FFD700;
  }
}

@media (prefers-reduced-motion: reduce) {
  .historia-header,
  .historia-icon,
  .historia-bloque,
  .historia-imagen,
  .historia-imagen img,
  .logro-item,
  .logro-numero,
  .bloque-icon {
    transition: none;
  }

  .historia-header::before {
    display: none;
  }
}

/* ============================================ */
/* 🎨 ANIMACIONES DE ENTRADA                   */
/* ============================================ */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .historia-item {
    animation: fadeInUp 0.6s ease-out;
  }

  .historia-item:nth-child(1) { animation-delay: 0.1s; }
  .historia-item:nth-child(2) { animation-delay: 0.3s; }
  .historia-item:nth-child(3) { animation-delay: 0.5s; }
}