/* ============================================================
   PORTAFOLIO — Masonry grid de proyectos
   ============================================================ */

.masonry {
  column-count: 3;
  column-gap: 1.5rem;
}
.masonry-item {
  break-inside: avoid;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid rgba(255,255,255,0.05);
  transition: transform 0.4s ease, border-color 0.4s ease;
  cursor: pointer;
}
.masonry-item:hover {
  border-color: var(--color-gold);
  transform: translateY(-5px);
}

/* Aspect ratios */
.ar-16-9 { aspect-ratio: 16 / 9; }
.ar-4-3 { aspect-ratio: 4 / 3; }
.ar-3-4 { aspect-ratio: 3 / 4; }

/* Flechas de navegación */
.portfolio-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(10, 10, 10, 0.7);
  border: 1px solid rgba(200, 169, 107, 0.3);
  color: var(--color-text);
  font-size: 1.1rem;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: background 0.3s, color 0.3s, border-color 0.3s, opacity 0.3s, transform 0.3s;
  opacity: 0;
  pointer-events: auto;
}
.portfolio-arrow:hover {
  background: var(--color-gold);
  color: var(--color-bg);
  border-color: var(--color-gold);
  transform: translateY(-50%) scale(1.1);
}
.masonry-item:hover .portfolio-arrow {
  opacity: 1;
}
.prev-arrow { left: 12px; }
.next-arrow { right: 12px; }

/* Ocultar flechas en celulares/tablets: se usa swipe nativo */
@media (max-width: 1024px) {
  .portfolio-arrow {
    display: none !important;
  }
}

/* Indicadores animados "Desliza" para touch screen */
.swipe-hint-left, .swipe-hint-right {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(10, 10, 10, 0.75);
  border: 1px solid rgba(200, 169, 107, 0.25);
  color: var(--color-gold);
  font-size: clamp(0.55rem, 2vw, 0.65rem);
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 0.35rem 0.6rem;
  border-radius: 20px;
  pointer-events: none;
  z-index: 8;
  display: none;
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
.swipe-hint-left.hidden, .swipe-hint-right.hidden {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
.swipe-hint-left {
  left: 10px;
  animation: swipePulseLeft 2s infinite ease-in-out;
}
.swipe-hint-right {
  right: 10px;
  animation: swipePulseRight 2s infinite ease-in-out;
}
@keyframes swipePulseLeft {
  0%, 100% { transform: translateY(-50%) translateX(0); opacity: 0.4; }
  50%      { transform: translateY(-50%) translateX(-6px); opacity: 0.95; }
}
@keyframes swipePulseRight {
  0%, 100% { transform: translateY(-50%) translateX(0); opacity: 0.4; }
  50%      { transform: translateY(-50%) translateX(6px); opacity: 0.95; }
}
@media (max-width: 1024px) {
  .swipe-hint-left, .swipe-hint-right {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* Overlay de título */
.overlay-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
  padding: 1.5rem;
  transform: translateY(0);
  transition: transform 0.4s ease, opacity 0.4s ease;
  opacity: 1;
  z-index: 6;
}
.overlay-info.hide-title {
  transform: translateY(100%) !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.overlay-info h4 { font-size: 1.2rem; margin-bottom: 0.3rem; }

/* Responsive */
@media (max-width: 900px) { .masonry { column-count: 2; } }
@media (max-width: 600px) { .masonry { column-count: 1; } }
