/* ========================================================
   PORTFOLIO PAGE STYLES - GGRL GENERAL SERVICES
   ======================================================== */

.container {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.portfolio-section {
  padding: 6rem 5%;
  background: #f8f9fa;
  text-align: center;
}

.portfolio-section h2 {
  font-size: 2.8rem;
  color: var(--primary);
  margin-bottom: 1rem;
}

.section-subtitle {
  font-size: 1.3rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 3rem;
}

/* Cuadrícula principal */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 2.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

.portfolio-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  cursor: pointer;
  height: 380px; 
  background: #fff;
  /* Aceleración de hardware básica y limpia */
  transform: translateZ(0); 
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.portfolio-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

/* ========================================================
   MARCO FACEBOOK (Ultra rápido, sin filtros extra)
   ======================================================== */
.fb-collage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 4px;
  width: 100%;
  height: 100%;
  background-color: #fff; 
}

.fb-collage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.portfolio-item:hover .fb-collage img {
  transform: scale(1.03); /* Zoom muy ligero y rápido */
}

.fb-collage img:nth-child(1) { grid-column: 1 / 2; grid-row: 1 / 3; }
.fb-collage img:nth-child(2) { grid-column: 2 / 3; grid-row: 1 / 2; }
.fb-collage img:nth-child(3) { grid-column: 2 / 3; grid-row: 2 / 3; }

/* ========================================================
   OVERLAY DE TEXTO
   ======================================================== */
.portfolio-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 2rem 1.5rem;
  background: linear-gradient(transparent, rgba(19,72,102,0.95));
  color: white;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  z-index: 10;
}

.portfolio-item:hover .portfolio-overlay {
  transform: translateY(0);
}

.portfolio-overlay h3 { font-size: 1.4rem; margin-bottom: 0.5rem; }
.view-photos { font-size: 1rem; opacity: 0.9; }

/* ========================================================
   MODAL / LIGHTBOX
   ======================================================== */
.portfolio-modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.95); z-index: 9999; align-items: center; justify-content: center; padding: 2rem; }
.portfolio-modal.active { display: flex; }
#modalImage { max-width: 95%; max-height: 85vh; border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,0.6); }
.modal-close { position: absolute; top: 30px; right: 40px; background: none; border: none; color: white; font-size: 3rem; cursor: pointer; z-index: 10; }
.modal-prev, .modal-next { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,0.2); color: white; border: none; width: 60px; height: 60px; font-size: 2.5rem; border-radius: 50%; cursor: pointer; backdrop-filter: blur(10px); transition: all 0.3s; }
.modal-prev { left: 30px; }
.modal-next { right: 30px; }
.modal-prev:hover, .modal-next:hover { background: var(--accent); transform: scale(1.1); }
.modal-counter { position: absolute; bottom: 30px; background: rgba(0,0,0,0.6); color: white; padding: 0.6rem 1.2rem; border-radius: 30px; font-weight: 600; }

/* ========================================================
   RESPONSIVE MÓVIL
   ======================================================== */
@media (max-width: 768px) {
  .portfolio-item { height: 320px; }
  .portfolio-overlay { transform: translateY(0); padding: 1.5rem 1rem; background: linear-gradient(transparent, rgba(19,72,102,0.9)); }
  .portfolio-overlay h3 { font-size: 1.35rem; }
  .portfolio-modal #modalImage { max-height: 78vh; }
}