/* =============================================
   CIEM INGENIERÍA — style-galeria.css
   ============================================= */

/* =============================================
   SECCIÓN GALERÍA
   ============================================= */
.gallery {
  padding: 80px 0 100px;
  background: #f5f7f9;
}
.gallery-wrap {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 48px;
}

/* TAGLINE — scopeado a .gallery para no pisar el global */
.gallery .s-tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--navy);
  margin-bottom: 14px;
}
.gallery .s-bar {
  width: 24px; height: 3px;
  background: var(--navy);
  border-radius: 2px;
  flex-shrink: 0;
}

/* CABECERA */
.gallery-head {
  text-align: center;
  margin-bottom: 48px;
}
.gallery-title {
  font-size: clamp(2rem, 3vw, 2.8rem);
  font-weight: 800;
  color: #0d1b2a;
  letter-spacing: -1px;
  line-height: 1.15;
  margin-bottom: 12px;
}
.gallery-title span { color: var(--navy); }
.gallery-sub {
  font-size: 15px;
  color: #6b7c8f;
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.7;
}

/* FILTROS */
.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 48px;
}
.gfilter {
  padding: 8px 18px;
  border-radius: 100px;
  border: 1.5px solid #dce3ec;
  background: #fff;
  color: #4a6070;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.gfilter:hover {
  border-color: var(--navy);
  color: var(--navy);
}
.gfilter.active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

/* GRID */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* CARD */
.gcard {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(13,30,53,0.07);
  border: 1px solid #e8edf4;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  cursor: pointer;
}
.gcard:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(13,30,53,0.13);
}
.gcard.hidden { display: none; }

/* IMAGEN */
.gcard-img {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gcard-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.gcard:hover .gcard-img img { transform: scale(1.05); }

.gcard-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gcard-count {
  position: absolute;
  top: 12px; right: 12px;
  background: rgba(9,26,42,0.72);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 100px;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

/* HOVER — gradiente en imagen con botón */
.gcard-hover {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(9,26,42,0.78) 0%, rgba(9,26,42,0.2) 55%, transparent 100%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 20px;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.gcard:hover .gcard-hover { opacity: 1; }

.gcard-btn {
  padding: 10px 24px;
  background: var(--green);
  color: #ffffff;
  border: none;
  border-radius: 7px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.gcard-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(120,199,98,0.35);
}

/* INFO */
.gcard-info {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.gcard-cat {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--navy);
}
.gcard-name {
  font-size: 15px;
  font-weight: 800;
  color: #0d1b2a;
  letter-spacing: -0.3px;
  line-height: 1.3;
}
.gcard-location {
  font-size: 12.5px;
  color: #8a9daf;
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}

/* =============================================
   LIGHTBOX
   ============================================= */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(5,12,20,0.95);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.lightbox.active { opacity: 1; visibility: visible; }

.lightbox-inner {
  width: 100%;
  max-width: 900px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 24px;
}
.lightbox-topbar {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 0 16px;
}
.lightbox-project {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.3px;
}
.lightbox-meta {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  margin-top: 3px;
}
.lightbox-close {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 50%;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
}
.lightbox-close:hover { background: rgba(255,255,255,0.15); color: #fff; }

.lightbox-main {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
}
.lightbox-img-wrap {
  flex: 1;
  aspect-ratio: 16/10;
  border-radius: 10px;
  overflow: hidden;
  background: #0d1f30;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-img-wrap img {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
}
.lightbox-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%; height: 100%;
}

.lb-arrow {
  width: 44px; height: 44px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 50%;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
}
.lb-arrow:hover { background: rgba(255,255,255,0.15); color: #fff; }

.lightbox-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  overflow-x: auto;
  padding-bottom: 4px;
  max-width: 100%;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.2) transparent;
}
.lb-thumb {
  flex-shrink: 0;
  width: 56px; height: 40px;
  border-radius: 5px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  background: #0d1f30;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.2s;
}
.lb-thumb.active { border-color: var(--green); }
.lb-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lb-thumb-placeholder {
  width: 100%; height: 100%;
  background: rgba(255,255,255,0.06);
  display: flex; align-items: center; justify-content: center;
}

.lightbox-counter {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  margin-top: 10px;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

/* Info extendida en el lightbox */
.lb-info { display: flex; flex-direction: column; gap: 5px; }
.lb-details {
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: rgba(255,255,255,0.5);
  flex-wrap: wrap;
}
.lb-tag {
  font-size: 10px; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--green);
}
.lb-sep { color: rgba(255,255,255,0.2); }
.lb-descripcion {
  font-size: 13px; color: rgba(255,255,255,0.45);
  line-height: 1.5; max-width: 680px;
  font-style: italic;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 900px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .gallery { padding: 56px 0 72px; }
  .gallery-wrap { padding: 0 20px; }
  .gallery-grid { grid-template-columns: 1fr; gap: 16px; }
  .gallery-filters { gap: 6px; }
  .gfilter { font-size: 12px; padding: 7px 14px; }
  .lb-arrow { width: 36px; height: 36px; }
  .lightbox-project { font-size: 15px; }
  .lightbox-inner { padding: 0 16px; }
}