/* ================================
   PROYECTOS
   Reutiliza el hero parallax de historia.css
   y los tokens de main.css / home.css.
   Galería + lightbox con acento rojo.
================================ */

/* ================================
   HERO — imagen de fondo
================================ */

.history-hero--proy {
  background-image:
    linear-gradient(90deg, rgba(0,0,0,.82), rgba(0,0,0,.50), rgba(0,0,0,.26)),
    linear-gradient(180deg, rgba(0,0,0,.18), rgba(0,0,0,.64)),
    url("/img/proyectos/banner-proyectos.webp");
}

/* ================================
   SECCIONES DE PROYECTO
================================ */

.proj-section {
  padding: 110px 0;
  overflow: hidden;
}

.proj-section--light {
  background: #fff;
  color: #111;
}

.proj-section--dark {
  background: linear-gradient(135deg, #101214, #181b1f);
  color: #fff;
}

/* ================================
   CABECERA DE PROYECTO
================================ */

.proj-head {
  max-width: 900px;
  margin: 0 auto 54px;
  text-align: center;
  position: relative;
}

/* Número decorativo de fondo */
.proj-num {
  position: absolute;
  top: -32px;
  left: 50%;
  transform: translateX(-50%);
  font-size: clamp(7rem, 14vw, 13rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -6px;
  color: var(--red);
  opacity: .045;
  user-select: none;
  pointer-events: none;
  z-index: 0;
}

.proj-section--dark .proj-num {
  opacity: .07;
}

.proj-head > *:not(.proj-num) {
  position: relative;
  z-index: 1;
}

.proj-head .section-label {
  display: inline-block;
  margin-bottom: 14px;
}

.proj-head h2 {
  margin: 0 0 22px;
  font-size: clamp(2.1rem, 3.8vw, 3.6rem);
  font-weight: 900;
  line-height: .98;
  letter-spacing: -1.5px;
  text-transform: uppercase;
}

.proj-section--light .proj-head h2 {
  color: #111;
}

.proj-section--dark .proj-head h2 {
  color: #fff;
}

.proj-head h2 span {
  color: var(--red);
}

/* Badges de cliente y ubicación */
.proj-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 26px;
}

.proj-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 16px;
  background: rgba(211,14,51,.08);
  border: 1px solid rgba(211,14,51,.18);
  border-radius: 100px;
  color: var(--red);
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .5px;
  text-transform: uppercase;
}

.proj-badge i {
  font-size: .95rem;
}

.proj-badge--dark {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.14);
  color: rgba(255,255,255,.82);
}

.proj-badge--dark i {
  color: var(--red);
}

.proj-desc {
  margin: 0 auto;
  max-width: 760px;
  font-size: 1.02rem;
  line-height: 1.9;
}

.proj-section--light .proj-desc {
  color: #555;
}

.proj-section--dark .proj-desc {
  color: rgba(255,255,255,.72);
}

/* ================================
   GALERÍA (reutiliza clases de lightbox.js)
================================ */

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

/* Galería de 5 imágenes: primera fila 3 items, segunda fila 2 centrados */
.sus-gallery--5 {
  grid-template-columns: repeat(6, 1fr);
}

.sus-gallery--5 .sus-gallery__item:nth-child(-n+3) {
  grid-column: span 2;
}

.sus-gallery--5 .sus-gallery__item:nth-child(n+4) {
  grid-column: span 3;
}

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

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

.sus-gallery__item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(125,28,36,.52));
  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 */
.sus-gallery__zoom {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  background: rgba(255,255,255,.94);
  color: #111;
  border-radius: 100px;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .5px;
  text-transform: uppercase;
  box-shadow: 0 6px 18px rgba(0,0,0,.2);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .35s ease, transform .35s ease;
  pointer-events: none;
}

.sus-gallery__zoom i {
  font-size: .95rem;
  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);
}

/* En táctil la lupa siempre visible */
@media (hover: none) {
  .sus-gallery__zoom {
    opacity: 1;
    transform: none;
  }
}

/* ================================
   LIGHTBOX (acento rojo)
================================ */

.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);
  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) {
  .proj-section {
    padding: 88px 0;
  }

  .sus-gallery,
  .sus-gallery--5 {
    grid-template-columns: repeat(3, 1fr);
  }

  .sus-gallery--5 .sus-gallery__item:nth-child(-n+3),
  .sus-gallery--5 .sus-gallery__item:nth-child(n+4) {
    grid-column: span 1;
  }
}

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

  .proj-head {
    margin-bottom: 40px;
  }

  .sus-gallery,
  .sus-gallery--5 {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .sus-gallery--5 .sus-gallery__item:nth-child(-n+3),
  .sus-gallery--5 .sus-gallery__item:nth-child(n+4) {
    grid-column: span 1;
  }
}

@media (max-width: 400px) {
  .sus-gallery,
  .sus-gallery--5 {
    grid-template-columns: 1fr;
  }
}

@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;
  }
}
