/* ============================================================
   PROJECT DETAIL — Página de detalle de proyectos
   Diseño unificado para todo el portfolio
=========================================================== */

/* Sobrescribimos el padding del wrap para el detalle */
main.wrap {
  padding-top: calc(var(--header-h, 72px) + 24px) !important;
}

/* ============================
   HERO
============================ */

.detail-hero {
  max-width: var(--maxw);
  margin: 0 auto 36px;
  padding: var(--gap);
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-2);
}

/* ============================
   HERO MEDIA & CONTENT
============================ */

.hero-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 32px;
  align-items: center;
}

.hero-media {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-1);
}

.hero-media img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.hero-media img:hover {
  transform: scale(1.04);
}

.hero-cta {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ============================
   GRID DE CONTENIDO
============================ */

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
  margin-top: 40px;
  align-items: start;
}

.detail-section {
  padding: 0;
}

.detail-section h2 {
  font-size: 32px;
  margin-bottom: 20px;
}

.detail-section h3 {
  font-size: 22px;
  margin-top: 32px;
  margin-bottom: 12px;
}

.detail-section h4 {
  font-size: 18px;
  margin-top: 24px;
  color: var(--text);
}

.detail-section p,
.detail-section ul {
  margin-bottom: 16px;
}

.detail-section ul {
  padding-left: 20px;
}

.detail-section li {
  margin-bottom: 8px;
}

/* ============================
   PANEL LATERAL (CARD)
============================ */

.panel.card {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
}

.panel h3 {
  font-size: 18px;
  margin-bottom: 12px;
}

.panel .btn-repo,
.panel .btn-primary,
.panel .btn-web {
  width: 100%;
  text-align: center;
  justify-content: center;
}

/* ============================
   RESPONSIVE
============================ */

@media (max-width: 980px) {
  .hero-row,
  .detail-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .hero-cta {
    text-align: left !important;
  }

  .hero-cta div {
    text-align: left !important;
  }

  .panel.card {
    position: static;
  }

  .detail-section h2 {
    font-size: 28px;
  }
}

@media (max-width: 600px) {
  .detail-hero {
    padding: 16px;
  }

  .gallery {
    grid-template-columns: 1fr;
  }
}

/* ============================
   LIGHTBOX
============================ */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.lightbox.open {
  display: flex;
}

.lightbox-img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  object-fit: contain;
}

.lightbox button {
  position: absolute;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lightbox button:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.lightbox-close {
  top: 24px;
  right: 24px;
}

.lightbox-prev {
  left: 24px;
}

.lightbox-next {
  right: 24px;
}

@media (max-width: 600px) {
  .lightbox button {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
  .lightbox-prev { left: 10px; }
  .lightbox-next { right: 10px; }
}