/* ================================
   INSTALACIONES
   Reutiliza el hero parallax de historia.css,
   el sistema de galería + lightbox y los tokens
   de main.css / home.css.
================================ */

/* ---- Hero: mismo estilo, imagen de maquinaria del plantel ---- */
.history-hero--inst {
  background-image:
    linear-gradient(90deg, rgba(0,0,0,.80), rgba(0,0,0,.46), rgba(0,0,0,.22)),
    linear-gradient(180deg, rgba(0,0,0,.18), rgba(0,0,0,.66)),
    url("/img/nosotros/Constructora-herrera-SC-2.webp");
}

/* ================================
   SECCIONES DE INSTALACIÓN
================================ */

.inst-section {
  padding: 110px 0;
  color: #111;
  overflow: hidden;
}

.inst-section--light {
  background: #fff;
}

.inst-section--gray {
  background: #f7f7f7;
}

.inst-item__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

/* alternar lados: en pares, el mapa va a la izquierda */
.inst-section:nth-of-type(even) .inst-item__map {
  order: -1;
}

/* ---- Bloque de información ---- */
.inst-item__num {
  display: block;
  margin-bottom: 6px;
  color: rgba(211,14,51,.18);
  font-size: 4.4rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -3px;
}

.inst-item__label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--red);
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.inst-item__label i {
  font-size: 1.05rem;
}

.inst-item__info h2 {
  margin: 0 0 20px;
  font-size: clamp(2rem, 4vw, 3.4rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -1px;
  text-transform: uppercase;
}

.inst-item__info h2 span {
  color: var(--red);
}

.inst-item__info p {
  margin: 0 0 26px;
  color: #666;
  font-size: 1.02rem;
  line-height: 1.85;
}

.inst-features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.inst-features li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #333;
  font-size: .96rem;
  line-height: 1.5;
  font-weight: 600;
}

.inst-features i {
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--red);
  font-size: 1.2rem;
}

/* ---- Mapa ---- */
.inst-item__map {
  position: relative;
  min-height: 380px;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 28px 65px rgba(0,0,0,.16);
}

.inst-item__map::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 22px;
  border: 1px solid rgba(0,0,0,.06);
  pointer-events: none;
  z-index: 1;
}

.inst-item__map iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 380px;
  border: 0;
}

/* ================================
   GALERÍA (3 imágenes) + LIGHTBOX
   (mismas clases que sostenibilidad para reutilizar lightbox.js)
================================ */

.inst-gallery-wrap {
  margin-top: 50px;
}

.sus-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.sus-gallery__item {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 18px 45px rgba(0,0,0,.12);
  cursor: zoom-in;
}

.sus-gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: contrast(1.08) saturate(1.06);
  transition: transform .55s ease;
}

.sus-gallery__item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(125,28,36,.55));
  opacity: 0;
  transition: opacity .4s ease;
}

.sus-gallery__item:hover img {
  transform: scale(1.07);
}

.sus-gallery__item:hover::after {
  opacity: 1;
}

/* ---- Pista de lupa "Ampliar" ---- */
.sus-gallery__zoom {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  background: rgba(255,255,255,.94);
  color: var(--red);
  border-radius: 100px;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .5px;
  text-transform: uppercase;
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .35s ease, transform .35s ease;
  pointer-events: none;
}

.sus-gallery__zoom i {
  font-size: 1rem;
  color: var(--red);
}

.sus-gallery__zoom em {
  font-style: normal;
}

.sus-gallery__item:hover .sus-gallery__zoom,
.sus-gallery__item:focus-visible .sus-gallery__zoom {
  opacity: 1;
  transform: translateY(0);
}

@media (hover: none) {
  .sus-gallery__zoom {
    opacity: 1;
    transform: none;
  }
}

/* ---- Lightbox ---- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6vh 5vw;
  background: rgba(7,8,10,.93);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility 0s linear .3s;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity .3s ease;
}

.lightbox__figure {
  margin: 0;
  width: min(820px, 92vw);   /* fuerza un tamaño grande aunque la foto sea pequeña */
  max-width: 92vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.lightbox__img {
  width: 100%;
  height: auto;
  max-height: 86vh;
  border-radius: 10px;
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
  object-fit: contain;
}

.lightbox__caption {
  max-width: 680px;
  color: rgba(255,255,255,.8);
  font-size: .9rem;
  line-height: 1.5;
  text-align: center;
}

.lightbox__close,
.lightbox__nav {
  position: absolute;
  z-index: 2;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid rgba(255,255,255,.25);
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  color: #fff;
  font-size: 1.6rem;
  cursor: pointer;
  transition: .25s ease;
}

.lightbox__close:hover,
.lightbox__nav:hover {
  background: var(--red);
  border-color: var(--red);
}

.lightbox__close {
  top: 22px;
  right: 26px;
}

.lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
}

.lightbox__nav--prev {
  left: 22px;
}

.lightbox__nav--next {
  right: 22px;
}

/* ================================
   RESPONSIVE
================================ */

@media (max-width: 992px) {
  .inst-section {
    padding: 80px 0;
  }

  .inst-item__row {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  /* el mapa siempre debajo de la info en móvil */
  .inst-section:nth-of-type(even) .inst-item__map {
    order: 0;
  }

  .inst-gallery-wrap {
    margin-top: 36px;
  }
}

@media (max-width: 640px) {
  .inst-section {
    padding: 64px 0;
  }

  .inst-features {
    grid-template-columns: 1fr;
  }

  .sus-gallery {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .inst-item__map,
  .inst-item__map iframe {
    min-height: 300px;
  }
}

@media (max-width: 560px) {
  .lightbox__close,
  .lightbox__nav {
    width: 44px;
    height: 44px;
    font-size: 1.3rem;
  }

  .lightbox__nav--prev {
    left: 12px;
  }

  .lightbox__nav--next {
    right: 12px;
  }

  .lightbox__img {
    max-height: 74vh;
  }
}
