/**
 * Arte Digital — Galería carlosvaccaro.com.ar
 * Estructura base + obras en carpetas
 */

/* ========== RESET & BASE ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont,
               "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: #e2e2ea;
  background: #0a0a0f;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ========== HEADER ========== */
.galeria-header {
  text-align: center;
  padding: 3rem 1.5rem 2rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.galeria-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  margin: 0 0 0.4rem;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #e2e2ea 0%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.galeria-header p {
  color: #8b8b9a;
  font-size: 1rem;
  margin: 0;
}
.badge {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.3rem 0.9rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(99,102,241,0.1);
  color: #6366f1;
  border: 1px solid rgba(99,102,241,0.2);
}

/* ========== GRID ========== */
.galeria-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.4rem;
  padding: 2.5rem 1.5rem 3rem;
  max-width: 1200px;
  margin: 0 auto;
}
.loading {
  grid-column: 1 / -1;
  text-align: center;
  color: #8b8b9a;
  padding: 3rem;
}

/* ========== CARD ========== */
.obra-card {
  background: #13131c;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}
.obra-card:hover {
  transform: translateY(-4px);
  border-color: rgba(99,102,241,0.25);
  box-shadow: 0 12px 40px rgba(0,0,0,0.45);
}
.obra-card:hover .obra-thumb img { transform: scale(1.06); }
.obra-card:hover .obra-play { opacity: 1; }

.obra-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: #000;
}
.obra-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s ease;
}
.obra-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.35);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.obra-play svg {
  width: 52px; height: 52px;
  color: rgba(255,255,255,0.95);
}

.obra-info { padding: 1.1rem 1.2rem 1.3rem; }
.obra-info h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
  color: #e2e2ea;
}
.obra-desc {
  font-size: 0.82rem;
  color: #8b8b9a;
  margin: 0 0 0.7rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.obra-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.obra-tags span {
  font-size: 0.7rem;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  background: rgba(99,102,241,0.1);
  color: #a78bfa;
  font-weight: 500;
}

/* ========== OVERLAY ========== */
.obra-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,10,15,0.97);
  backdrop-filter: blur(16px);
  z-index: 1000;
  display: none;
  flex-direction: column;
  animation: fadeIn 0.25s ease;
}
.obra-overlay.active { display: flex; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.obra-overlay-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.obra-overlay-info h2 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 0.2rem;
  color: #e2e2ea;
}
.obra-overlay-info p {
  font-size: 0.85rem;
  color: #8b8b9a;
  margin: 0 0 0.4rem;
  max-width: 600px;
}
.obra-overlay-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.obra-overlay-tags span {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: rgba(99,102,241,0.12);
  color: #a78bfa;
}

.close-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: #1e1e2a;
  border: 1px solid rgba(255,255,255,0.08);
  color: #e2e2ea;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s ease;
}
.close-btn:hover { background: rgba(255,255,255,0.1); }

/* Viewport: contiene iframe o canvas */
.obra-viewport {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow: auto;
  position: relative;
}
.obra-viewport iframe {
  width: 100%;
  height: 100%;
  max-width: 1000px;
  max-height: 800px;
  border: none;
  border-radius: 8px;
  background: #000;
}
.obra-viewport canvas {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.obra-overlay-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1.5rem 1rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.obra-nav { display: flex; gap: 0.5rem; }
.obra-nav button {
  padding: 0.5rem 1.1rem;
  border-radius: 8px;
  background: #1e1e2a;
  border: 1px solid rgba(255,255,255,0.08);
  color: #e2e2ea;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.obra-nav button:hover {
  background: rgba(99,102,241,0.15);
  border-color: rgba(99,102,241,0.3);
}
.obra-nav button:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}
.obra-counter {
  font-size: 0.8rem;
  color: #8b8b9a;
}

/* ========== FOOTER ========== */
.galeria-footer {
  text-align: center;
  padding: 2rem 1rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  color: #8b8b9a;
  font-size: 0.8rem;
}
.galeria-footer a {
  color: #6366f1;
  text-decoration: none;
}
.galeria-footer a:hover { text-decoration: underline; }

/* ========== RESPONSIVE ========== */
@media (max-width: 600px) {
  .galeria-grid {
    grid-template-columns: 1fr;
    padding: 1.5rem 1rem;
  }
  .obra-overlay-top, .obra-overlay-bottom {
    padding: 0.75rem 1rem;
  }
  .obra-viewport { padding: 0.5rem; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
