/* ============================================================
   EQUIPAMIENTO VISUAL — index.css
   Estilos exclusivos de la página principal (index.html):
   hero · servicios · proyectos integradores
   ============================================================ */


/* ============================================================
   HEADER TRANSPARENTE sólo en index (hero ocupa el área del nav)
   ============================================================ */
.page-index .header {
  background: transparent;
  box-shadow: none;
  border-bottom-color: transparent;
  position: absolute;
  width: 100%;
}





/* ============================================================
   HERO
   ============================================================ */
.hero {
  overflow: hidden;
}

/* Columnas con corte diagonal — el verde sube hasta cubrir el nav */
.hero__inner {
  display: flex;
  align-items: flex-start;      /* imagen no se estira al alto completo */
  min-height: clamp(560px, 78vh, 800px);
}

/* Columna izquierda — texto (se estira al alto completo del hero) */
.hero__content {
  align-self: stretch;
  flex: 0 0 50%;
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  /* padding-top extra para compensar la altura del nav transparente */
  padding: clamp(5rem, 10vh, 8rem)
           clamp(2.5rem, 6vw, 6rem)
           clamp(2.5rem, 5vw, 4rem)
           clamp(1.5rem, 5vw, 4.5rem);
  background: #dde8e2;
  clip-path: polygon(0 0, 100% 0, calc(100% - 140px) 100%, 0 100%);
}

.hero__title {
  font-weight: 700;
  font-size: clamp(1.35rem, 1.9vw, 1.85rem);
  line-height: 1.15;
  color: #111111;
  margin-bottom: 1.1rem;
}

.hero__text {
  font-size: 0.88rem;
  line-height: 1.78;
  color: #444444;
  margin-bottom: 2rem;
  width: 100%;
  text-align: justify;
}

/* Columna derecha — foto (más corta que el verde, centrada verticalmente) */
.hero__image {
  flex: 1 1 0;
  position: relative;
  z-index: 1;
  overflow: hidden;
  margin-left: -140px;
  /* imagen más corta: el verde sobresale arriba y abajo */
  align-self: center;
  height: clamp(320px, 52vh, 560px);
}

/* La imagen cubre su contenedor */
.hero__image img {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: cover;
  object-position: center center;
  display: block;
}

.hero__image .photo-placeholder--hero {
  position: absolute;
  inset: 0;
  border-radius: 0;
}


/* ============================================================
   NUESTRO SERVICIO
   ============================================================ */
.services {
  background: var(--color-bg-light);
  padding: clamp(3rem, 7vw, 5rem) 0;
}

.services__grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.4rem;
}

.service-card {
  flex: 0 0 calc(33.333% - 1rem);
}

.service-card {
  background: var(--color-white);
  border: 1px solid rgba(0, 90, 64, 0.10);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 1.8rem 1.4rem 1.6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: box-shadow var(--transition), transform var(--transition);
  /* Mismo tamaño para todas */
  min-height: 240px;
  width: 100%;
}

.service-card:hover {
  box-shadow: 0 8px 32px rgba(0, 90, 64, 0.16);
  transform: translateY(-3px);
}

.service-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.service-card__icon img {
  width: 90px;
  height: 90px;
  object-fit: contain;
}

/* Placeholder cuadrado para el ícono */
.photo-placeholder--icon {
  width: 90px;
  height: 90px;
  border-radius: 6px;
}

.service-card__title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-primary);
  margin-bottom: 0.6rem;
}

.service-card__link {
  font-size: 0.86rem;
  color: var(--color-primary);
  border-bottom: 1px solid var(--color-primary);
  padding-bottom: 1px;
  transition: color var(--transition), border-color var(--transition);
  margin-top: auto;
}

.service-card__link:hover {
  color: var(--color-lime);
  border-color: var(--color-lime);
}


/* ============================================================
   ESTADÍSTICAS
   ============================================================ */
.stats {
  background: var(--color-teal);
  padding: clamp(2.5rem, 5vw, 3.5rem) 0;
}

.stats__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  text-align: center;
}

.stat {
  padding: 0.5rem 1.5rem;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
}
.stat:last-child { border-right: none; }

.stat__number {
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  font-weight: 700;
  color: var(--color-white);
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.stat__label {
  font-size: 0.83rem;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.4;
  font-weight: 500;
}

@media (max-width: 700px) {
  .stats__grid { grid-template-columns: 1fr; }
  .stat { border-right: none; border-top: 1px solid rgba(255,255,255,0.12); }
  .stat:first-child { border-top: none; }
}


/* ============================================================
   PROYECTOS INTEGRADORES
   ============================================================ */
.projects {
  padding: clamp(3rem, 7vw, 5rem) 0;
  background: var(--color-white);
}

.projects__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
}

.projects__gallery {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Placeholders para las fotos de proyectos */
.photo-placeholder--project-main {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.photo-placeholder--project-secondary {
  width: 100%;
  aspect-ratio: 16 / 7;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.projects__text {
  font-size: 0.91rem;
  line-height: 1.78;
  color: var(--color-text-muted);
  margin-bottom: 1.75rem;
}

.projects__partners {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

/* Placeholder para logos de partners */
.photo-placeholder--partner {
  width: 88px;
  height: 34px;
  border-radius: 4px;
  opacity: 0.75;
}


/* ============================================================
   RESPONSIVE — secciones del index
   ============================================================ */
/* Tablet (≤900px): hero apilado, header sticky, ajuste de tarjetas */
@media (max-width: 900px) {
  /* Restaurar header */
  .page-index .header {
    position: sticky;
    background: var(--color-white);
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.07);
    border-bottom-color: var(--color-border);
  }
  .page-index .nav__link {
    color: #222222;
  }
  .page-index .nav__link:hover,
  .page-index .nav__link--active {
    color: var(--color-primary);
    background: rgba(0, 90, 64, 0.07);
  }

  /* Hero apilado */
  .hero__inner {
    flex-direction: column;
    min-height: auto;
  }
  .hero__content {
    align-self: auto;
    flex: none;
    width: 100%;
    clip-path: none;
    padding: clamp(2rem, 5vw, 3rem) var(--gutter);
  }
  .hero__image {
    align-self: auto;
    width: 100%;
    height: 300px;
    margin-left: 0;
    order: -1;
  }
  
  .projects__inner {
    grid-template-columns: 1fr;
  }
  
  /* En tablet, cambiar a grid normal de 2 columnas */
  .services__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.2rem;
  }
  
  /* Resetear todas las posiciones para tablet */
  .service-card:nth-child(1),
  .service-card:nth-child(2),
  .service-card:nth-child(3),
  .service-card:nth-child(4),
  .service-card:nth-child(5) {
    grid-column: auto;
  }
  
  /* En 2 columnas, la tarjeta 5 ocupa ambas columnas centrada */
  .service-card:nth-child(5) {
    grid-column: 1 / -1;
    max-width: 280px;
    margin: 0 auto;
    width: 100%;
  }
}

/* Móvil (≤600px) */
@media (max-width: 600px) {
  .hero__image {
    height: 220px;
  }
  
  .services__grid {
    grid-template-columns: 1fr;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
  }
  
  /* Reset para móvil */
  .service-card:nth-child(5) {
    grid-column: auto;
    max-width: none;
    margin: 0;
  }
}