
/* =========================== */
/* ROTACIÓN AUTOMÁTICA DE PORTADAS HERO */
/* =========================== */
@keyframes fadeHeroBg {
  0% { background-image: url("/images/portada.webp"); }
  33% { background-image: url("/images/fondo-hero.jpg"); }
}

.hero {
  animation: fadeHeroBg 15s infinite ease-in-out;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  transition: background-image 1.5s ease-in-out;
}

/* =========================== */
/* HERO PREMIUM (estilo hospitalario simple) */
/* =========================== */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 80px 5%;
  margin-top: 60px;
  height: 50vh;
  color: #fff;
  background: url("/images/portada.webp") no-repeat center center / cover;
  background-attachment: fixed;
  overflow: hidden;
}

/* =========================== */
/* Logo PNG al lado derecho con animación */
.hero::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 5%; /* separación del borde derecho */
  transform: translateY(-50%) translateX(50px); /* empieza desplazada a la derecha */
  width: 400px; /* ajustar tamaño según necesidad */
  height: 400px;
  background: url("images/logo.png") no-repeat center center;
  background-size: contain;
  opacity: 0;
  z-index: 2; /* encima del fondo y overlay */
  animation: fadeSlideRight 1.5s ease forwards;
  animation-delay: 2.2s; /* aparece después del texto y botones */
}

/* Animación de aparición desde la derecha */
@keyframes fadeSlideRight {
  from {
    opacity: 0;
    transform: translateY(-50%) translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }
}

/* Responsive */

/* Animación de aparición desde la derecha */
@keyframes fadeSlideRight {
  from {
    opacity: 0;
    transform: translateY(-50%) translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .hero::after {
    width: 80%;
    height: auto;
    right: 50%;
    transform: translateX(50%) translateY(-50%);
    animation-delay: 2s;
  }
}

/* Overlay */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(79, 21, 58, 0.7) 20%,
    rgba(0, 90, 140, 0.4) 70%
  );
  backdrop-filter: blur(2px);
  z-index: 1;
}

.hero-text, 
.hero-image {
  position: relative;
  z-index: 2;
}

/* Texto */
.hero-text {
  flex: 1;
  padding-right: 40px;
  max-width: 600px;
}

/* Efecto fade + slide up */
.hero-title {
  font-size: 52px;
  font-weight: 800;
  line-height: 1.2;
  color: #e9f6fb; /* tono blanco-azulado hospitalario */
  margin-bottom: 20px;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeSlide 1.5s ease forwards;
}

@keyframes fadeSlide {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Subt¨ªtulo */
.hero-subtitle {
  font-size: 20px;
  line-height: 1.6;
  color: #d0e8f0;
  margin-bottom: 35px;
  opacity: 0;
  animation: fadeUp 1.5s ease forwards;
  animation-delay: 0.8s;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Botones */
.hero-buttons {
  display: flex;
  gap: 20px;
  opacity: 0;
  animation: fadeIn 1.5s ease forwards;
  animation-delay: 1.6s;
}

.btn-hero {
  padding: 14px 28px;
  border-radius: 12px;
  font-weight: bold;
  font-size: 16px;
  text-decoration: none;
  transition: all 0.4s ease;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.25);
  backdrop-filter: blur(6px);
  color: #f5fcff;
  box-shadow: 0 4px 14px rgba(0,0,0,0.2);
}

.btn-hero:hover {
  background: rgba(200,230,255,0.3);
  color: #0077b6; /* azul hospital */
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

/* =========================== */
/* Redes Sociales (alineadas en fila) */
/* =========================== */
.hero-social {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: 25px;
  opacity: 0;
  animation: fadeUp 1.5s ease forwards;
  animation-delay: 2s; /* aparece despu¨¦s de los botones */
}
.hero-social span {
  font-size: 18px;
  color: #d0e8f0; /* tono hospital */
}

.hero-social .social-icons {
  display: flex;
  gap: 12px;
}

.hero-social .social-icons a {
  font-size: 22px;
  color: #fff;
  transition: all 0.3s;
  animation: pulse 2s infinite;
}

.hero-social .social-icons a:hover {
  color: #ffcc00;
  text-shadow: 0 0 12px rgba(255,204,0,0.7);
  transform: scale(1.15);
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}



/* =========================== */
/* ANIMACIONES BASE */
/* =========================== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* =========================== */
/* RESPONSIVE */
/* =========================== */
@media (max-width: 768px) {
  .hero {
    flex-direction: column;
    text-align: center;
    padding: 60px 20px;
    height: auto;
    min-height: 85vh;
    background-attachment: scroll;
  }
  .hero-text {
    padding-right: 0;
    margin-bottom: 20px;
  }
  .hero-title {
    font-size: 34px;
  }
  .hero-subtitle {
    font-size: 18px;
  }
  .hero-buttons {
    justify-content: center;
    flex-wrap: wrap;
  }
  .btn-hero {
    width: 100%;
    max-width: 280px;
  }
  .hero-image img {
    max-width: 100%;
  }
}


@media (max-width: 768px) {
  .hero::after {
    width: 80%;
    height: auto;
    right: 50%;
    transform: translateX(50%) translateY(-50%);
    animation-delay: 2s;
  }
}

/* =========================== */
/* HERO - Ajuste responsivo extra */
/* =========================== */

/* Pantallas medianas como laptops (ej: 1366x768) */
@media (max-width: 1440px) and (min-width: 1025px) {
  .hero {
    padding: 60px 8%; /* más respiro lateral */
    height: 60vh;     /* un poco más alto para compensar */
  }
  .hero-text {
    padding-right: 20px; /* menos pegado */
    max-width: 520px;    /* control de ancho para no extender demasiado */
  }
  .hero-title {
    font-size: 44px; /* ligeramente más pequeño que el de desktop full */
  }
  .hero-subtitle {
    font-size: 18px;
  }
}

/* Laptops pequeñas / pantallas menores a 1024px */
@media (max-width: 1024px) {
  .hero {
    flex-direction: column;
    padding: 60px 40px;
    height: auto;
    min-height: 75vh;
    text-align: center;
  }
  .hero-text {
    max-width: 90%;
    margin: 0 auto 20px auto;
    padding-right: 0;
  }
  .hero-title {
    font-size: 38px;
  }
  .hero-subtitle {
    font-size: 18px;
  }
  .hero-buttons {
    justify-content: center;
    flex-wrap: wrap;
  }
}
