/**
 * Estilos del componente Destacados
 * 
 * @package Puerto_Sostenible
 */

.destacados {
  background: #1D70B7;
  padding: 5rem 5rem;
  position: relative;
  overflow: hidden;
}

/* Destacados en front-page con fondo blanco */
.page-template-front-page .destacados,
.home .destacados {
  background: white;
}

.waves-decoration {
  position: absolute;
  top: 6rem;
  right: 6rem;
  z-index: 10;
  pointer-events: none;
}

.destacados-container {
  max-width: 1600px;
  margin: 0 auto;
}

.destacados-title {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', system-ui, sans-serif;
  font-size: 62px;
  font-weight: 700;
  color: white;
  margin: 0 0 4rem 0;
  line-height: 1.2;
}

/* Título centrado y azul oscuro en front-page */
.page-template-front-page .destacados-title,
.home .destacados-title {
  text-align: center;
  color: var(--color-dark);
}

.cards-grid {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1.5rem, 1.3vw, 2.5rem);
  padding-top: 2rem;
  padding-bottom: 2rem;
  justify-content: center;
}

.card-wrapper {
  display: flex;
  flex-direction: column;
  gap: clamp(1rem, 0.78vw, 1.5rem);
  flex: 0 1 calc(20% - 2rem);
  min-width: clamp(240px, 14.58vw, 280px);
  max-width: clamp(280px, 16.67vw, 320px);
  perspective: 1000px;
  animation: float 4s ease-in-out infinite;
}

.card-wrapper:nth-child(2) {
  animation-delay: 0.5s;
}

.card-wrapper:nth-child(3) {
  animation-delay: 1s;
}

.card-wrapper:nth-child(4) {
  animation-delay: 1.5s;
}

.card-wrapper:nth-child(5) {
  animation-delay: 2s;
}

@keyframes float {
  0%, 100% { 
    transform: translateY(0px);
  }
  50% { 
    transform: translateY(-8px);
  }
}

.card {
  background: #E5EFF7;
  border-radius: clamp(40px, 2.66vw, 51px);
  width: 100%;
  min-height: clamp(190px, 11.56vw, 222px);
  position: relative;
  transition: transform 0.6s ease-out, box-shadow 0.6s ease-out;
  display: flex;
  align-items: start;
  flex-direction: column;
  padding: clamp(1.5em, 1.04vw, 2em);
  transform-style: preserve-3d;
  cursor: pointer;
  overflow: visible;
  transform: translateY(-20px) rotateX(5deg) rotateY(5deg);
}

.card.card-in-view {
  transform: translateY(0) rotateX(0deg) rotateY(0deg); 
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(29, 112, 183, 0.1), rgba(15, 56, 92, 0.1));
  opacity: 0;
  transition: opacity 0.5s;
  border-radius: 51px;
  z-index: 1;
  pointer-events: none;
}

.card-icon {
  width: clamp(50px, 3.13vw, 60px);
  height: clamp(50px, 3.13vw, 60px);
  transition: transform 0.3s ease-out;
  transform-style: preserve-3d;
  position: relative;
  z-index: 2;
  transform: translate3d(0, 0, 50px);
}

.card.card-in-view .card-icon {
  transform: translate3d(0, 0, 0px);
}

.card-icon svg {
  width: 100%;
  height: 100%;
}

.card-content {
  display: flex;
  flex-direction: column;
  gap: clamp(0.3rem, 0.26vw, 0.5rem);
  margin-inline: 0.2rem;
}

.card-title {
  font-family: "Montserrat", sans-serif;
  font-size: clamp(22px, 1.56vw, 30px);
  font-weight: 900;
  color: #09253D;
  margin: 0;
  line-height: 1.2;
  text-align: left;
  margin-top: 2rem;
  position: relative;
  z-index: 2;
}

.card-subtitle {
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: clamp(24px, 1.67vw, 32px);
  font-weight: 600;
  color: #E5EFF7;
  margin: 0;
  line-height: 1.2;
  position: relative;
  z-index: 1;
}

/* Textos en azul oscuro en front-page */
.page-template-front-page .card-subtitle,
.home .card-subtitle {
  color: var(--color-dark);
}

.card-description {
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: clamp(16px, 1.04vw, 20px);
  font-weight: 300;
  color: #E5EFF7;
  line-height: 1.4;
  margin: 0;
  position: relative;
  z-index: 1;
}

.page-template-front-page .card-description,
.home .card-description {
  color: var(--color-dark);
}

@media (max-width: 1400px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .destacados {
    padding: 3rem 1.5rem;
  }

  .destacados-title {
    font-size: 36px;
    margin-bottom: 1.5rem;
  }

  .cards-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .waves-decoration {
    top: 2rem;
    right: 2rem;
    width: 150px;
  }
}
