/**
 * ======================================================
 * ARCHIVO: proyectos.css
 * UBICACIÓN: frontend/public/styles/
 * VERSIÓN: 1.0 — Galería proyectos (HU-05)
 * ÚLTIMA ACTUALIZACIÓN: 2026-04-20 20:00
 *
 * 🎯 PROPÓSITO:
 * Grid uniforme de tarjetas, filtros por categoría y lightbox accesible.
 * ======================================================
 */

.proyectos-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 20px 64px;
}

.proyectos-hero {
  text-align: center;
  margin-bottom: 26px;
}

.proyectos-hero h1 {
  font-size: clamp(1.55rem, 3vw, 2.15rem);
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 10px;
  letter-spacing: -0.02em;
}

.proyectos-hero .proyectos-lead {
  max-width: 700px;
  margin: 0 auto;
  color: #64748b;
  font-size: 1.02rem;
  line-height: 1.55;
}

.proyectos-meta {
  font-size: 0.85rem;
  color: #94a3b8;
  margin-top: 10px;
}

/* ----------------------------------------------------------------- */
/* Filtros por categoría (dinámicos desde datos) */
/* ----------------------------------------------------------------- */
.proyectos-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 22px 0 28px;
}

.proyectos-filter-btn {
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #475569;
  font-weight: 600;
  font-size: 0.82rem;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.proyectos-filter-btn:hover {
  border-color: #94a3b8;
}

.proyectos-filter-btn.is-active {
  background: linear-gradient(135deg, #1f4fd8 0%, #163fc1 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(31, 79, 216, 0.3);
}

.proyectos-status {
  text-align: center;
  color: #64748b;
  min-height: 1.2em;
  margin-bottom: 12px;
}

/* ----------------------------------------------------------------- */
/* Grid galería (uniforme) */
/* ----------------------------------------------------------------- */
.proyectos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
}

.proyecto-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
  transition: transform 0.2s, box-shadow 0.2s;
}

.proyecto-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.1);
}

.proyecto-card-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #f1f5f9;
  cursor: zoom-in;
  border: none;
  padding: 0;
  width: 100%;
  display: block;
}

.proyecto-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.proyecto-card-thumb:focus-visible {
  outline: 3px solid rgba(31, 79, 216, 0.5);
  outline-offset: 2px;
}

.proyecto-card-body {
  padding: 14px 16px 16px;
}

.proyecto-card-cat {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #1f4fd8;
}

.proyecto-card h2 {
  margin: 6px 0 8px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
}

.proyecto-card-desc {
  margin: 0;
  font-size: 0.88rem;
  color: #64748b;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.proyecto-card-date {
  margin-top: 8px;
  font-size: 0.78rem;
  color: #94a3b8;
}

.proyectos-empty {
  text-align: center;
  padding: 48px 16px;
  color: #64748b;
}

/* ----------------------------------------------------------------- */
/* Lightbox */
/* ----------------------------------------------------------------- */
.proyectos-lightbox {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(4px);
}

.proyectos-lightbox[hidden] {
  display: none !important;
}

.proyectos-lightbox-inner {
  max-width: min(1100px, 100%);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.proyectos-lightbox img {
  max-width: 100%;
  max-height: min(78vh, 820px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.proyectos-lightbox-caption {
  color: #e2e8f0;
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
}

.proyectos-lightbox-caption strong {
  display: block;
  font-size: 1.1rem;
  margin-bottom: 6px;
  color: #fff;
}

.proyectos-lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s;
}

.proyectos-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.22);
}

@media (max-width: 600px) {
  .proyectos-filters {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 6px;
  }

  .proyectos-filter-btn {
    flex: 0 0 auto;
  }
}
