/* ============================================================
   proyectos.css  —  Vision MX · Página de Proyectos
   ============================================================ */

/* =====================
   HEADER GALERÍA
===================== */
.gallery-root {
  padding: 3.5rem 2rem 2rem;
  background: #ffffff;
}

.gallery-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.gallery-header h1 {
  font-family: 'Poppins-Black', sans-serif;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  font-style: italic;
  text-transform: uppercase;
  color: #000;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}

.gallery-header h1 span {
  color: var(--green-vision);
}

.gallery-header p {
  font-size: 0.82rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #000;
  font-weight: 700;
}

/* =====================
   GRID PRINCIPAL
===================== */
.gallery-grid {
  display: grid;
  gap: 6px;
  max-width: 1100px;
  margin: 0 auto;
}

.row-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.row-mid {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: 6px;
}

.row-bot {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 6px;
}

/* =====================
   CARDS
===================== */
.gallery-item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  border-radius: 3px;
}

.row-top .gallery-item::before         { content: ''; display: block; padding-top: 52%; }
.row-mid .gallery-item-main::before    { content: ''; display: block; padding-top: 66%; }
.row-mid .gallery-item-side::before    { content: ''; display: block; padding-top: 100%; }
.row-bot .gallery-item::before         { content: ''; display: block; padding-top: 82%; }

/* =====================
   FONDO / IMAGEN
===================== */
.gallery-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.gallery-item:hover .gallery-bg {
  transform: scale(1.07);
}

.bg-1 { background-color: #1a3020; background-image: url('../assets/template/instalaciones/proyectos/mexicorifa.webp'); }
.bg-2 { background-color: #1a1a2e; background-image: url('../assets/template/instalaciones/proyectos/lavisiondemexico.webp'); }
.bg-3 { background-color: #2e1a1a; background-image: url('../assets/template/instalaciones/proyectos/visionarios.webp'); }
.bg-4 { background-color: #1a2a2a; background-image: url('../assets/template/instalaciones/proyectos/gajesdeloficio.webp'); }
.bg-5 { background-color: #2a2a1a; background-image: url('../assets/template/instalaciones/proyectos/frasancolors.webp'); }
.bg-6 { background-color: #1e1e2e; background-image: url('../assets/template/instalaciones/proyectos/mente.webp'); }
.bg-7 { background-color: #2a1a2a; background-image: url('../assets/template/instalaciones/proyectos/visionenvivo.webp'); }
.bg-8 { background-color: #1a2e2a; background-image: url('../assets/template/instalaciones/proyectos/caradetaza.webp'); }
.bg-9 { background-color: #2e2a1a; background-image: url('../assets/template/instalaciones/proyectos/pacosantos.webp'); }

/* =====================
   DEGRADADO OVERLAY
===================== */
.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.82) 0%,
    rgba(0,0,0,0.28) 50%,
    rgba(0,0,0,0.05) 100%
  );
  transition: background 0.35s ease;
}

.gallery-item:hover 
.gallery-overlay {
  padding: 10px;
  background-color:rgba(33, 114, 56, 0.6); 
/*  background: linear-gradient(
    to top,
    rgba(0,0,0,0.92) 0%,
    rgba(0,0,0,0.50) 55%,
    rgba(0,0,0,0.18) 100%
  );*/
}

/* =====================
   TEXTO
===================== */
.gallery-text {
  position: absolute;

  bottom: 0; left: 0; right: 0;
  top:0;
  padding: 1rem 1.1rem 0.9rem;
  transform: translateY(4px);
  transition: transform 0.35s ease;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-content: center;
}

.gallery-item:hover .gallery-text {
  transform: translateY(0);
}

.gallery-tag {
  text-align: center;
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #ffffff;
  margin-bottom: 0.28rem;
}

.gallery-title {
  text-align: center;
  font-family: 'Poppins-Medium', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #ffffff;
  line-height: 1.1;
  letter-spacing: 0.03em;
  margin: 0;
  padding: 10px auto;
}

.row-mid .gallery-item-main .gallery-title { font-size: 2rem; text-align: center;}
.row-top .gallery-item .gallery-title       { font-size: 1.6rem; text-align: center;}

.gallery-hover-line {
  width: 0;
  height: 2px;
  background: #fff;
  margin-top: 7px;
  border-radius: 2px;
  transition: width 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
 margin: 0 auto;
}

.gallery-item:hover .gallery-hover-line { 
  
  width: 36px;  
  margin: 0 auto;
    
}

/* Item seleccionado */
.gallery-item.selected::after {
  content: '';
  position: absolute; inset: 0;
  border: 3px solid var(--green-vision);
  pointer-events: none;
  z-index: 5;
}

/* ============================================================
   PANEL DETALLE DE PROYECTO
============================================================ */
.proyecto-detail {
  display: none;
  background: #ffffff;
  /*border-top: 3px solid var(--green-vision);*/
}

.proyecto-detail.open {
  display: block;
  animation: pdFadeUp 0.4s ease forwards;
}

@keyframes pdFadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.detail-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 48px 40px 72px;
}

/* Botón volver */
.detail-close {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Poppins-Regular', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #999;
  margin-bottom: 32px;
  padding: 0;
  transition: color 0.2s;
}

.detail-close:hover { color: var(--green-vision); }
.detail-close svg   { width: 16px; height: 16px; }

/* Encabezado */
.detail-header { margin-bottom: 28px; }

.detail-title {
  font-family: 'Poppins-Black', sans-serif;
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 800;
  /*font-style: italic;*/
  text-align: center;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--green-vision);
  line-height: 1;
  margin-bottom: 10px;
}

.detail-desc {
  font-size: 0.92rem;
  color: #000;
  line-height: 1.75;
  font-weight: 700;
  max-width: 1024px;
  text-align: center;
  text-transform: uppercase;
  margin: 0;
}

/* Video principal */
.detail-video-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: #111;
  margin-bottom: 40px;
  position: relative;
  box-shadow: 0 12px 48px rgba(0,0,0,0.15);
}

.detail-video-placeholder {
  position: absolute; inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.detail-video-bg {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
}

.detail-video-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.45);
}

.detail-play-btn {
  position: relative; z-index: 2;
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--green-vision);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  transition: transform 0.25s, background 0.25s, box-shadow 0.25s;
  box-shadow: 0 8px 32px rgba(46,204,113,0.5);
}

.detail-play-btn:hover {
  transform: scale(1.1);
  background: #27ae60;
}

.detail-play-btn svg { width: 28px; height: 28px; margin-left: 4px; }

#detailVideoFrame {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
}

#detailVideoFrame iframe {
  width: 100%; height: 100%;
}

/* Encabezado sub-galería */
.detail-gallery-header {
  margin-bottom: 24px;
  text-align: center;
}

.detail-gallery-title {
  font-family: 'Poppins-Black', sans-serif;
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800;
  font-style: italic;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--green-vision);
  margin-bottom: 8px;
}

.detail-gallery-sub {
  font-size: 0.92rem;
  color: #444;
  line-height: 1.7;
  max-width: 760px;
  margin: 0 auto;
}

/* Sub-galería 5 imágenes */
.detail-gallery {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

.detail-gallery-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.detail-gallery-item:hover .dg-img-wrap { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(0,0,0,0.2); }

/* Texto ARRIBA de la imagen */
.dg-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 2px;
}

.dg-tag {
  font-family: 'Poppins-Semibold', sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--green-vision);
  display: block;
  text-align: center;
}

.dg-name {
  font-family: 'Poppins-Regular', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #333333;
  display: block;
  line-height: 1.3;
  text-align: center;
}

/* Imagen */
.dg-img-wrap {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 6px;
  overflow: hidden;
  background: #1a1a1a;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.dg-img {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.4s ease;
}

.detail-gallery-item:hover .dg-img { transform: scale(1.05); }

/* Quitar overlay ya que el texto no va encima */
.dg-overlay { display: none; }

/* ============================================================
   TEXTO PROYECTOS
============================================================ */
.proyectos-info {
  max-width: 1024px;
  margin: 0 auto;
  padding: 48px 40px 80px;
}

.proy-section { margin-bottom: 32px; }

.proy-section-title {
  font-family: 'Poppins-Medium', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--green-vision);
  margin-bottom: 8px;
}

.proy-section-text {
  font-size: 0.92rem;
  line-height: 1.8;
  color: #555;
  margin: 0;
}

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 768px) {
  .row-top { grid-template-columns: 1fr; }
  .row-mid { grid-template-columns: 1fr; }
  .row-bot { grid-template-columns: 1fr 1fr; }

  .row-top .gallery-item::before        { padding-top: 56%; }
  .row-mid .gallery-item-main::before   { padding-top: 60%; }
  .row-mid .gallery-item-side::before   { padding-top: 56%; }
  .row-bot .gallery-item::before        { padding-top: 70%; }

  .detail-inner   { padding: 32px 20px 48px; }
  .detail-gallery { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .detail-gallery-item:last-child .dg-img-wrap { aspect-ratio: 16 / 9; }
  .proyectos-info { padding: 36px 20px 56px; }
}

@media (max-width: 480px) {
  .gallery-root { padding: 2rem 1rem 3rem; }
  .row-bot      { grid-template-columns: 1fr; }
  .detail-gallery { grid-template-columns: repeat(2, 1fr); }
}
