/**
 * Proyectos — estilos unificados usando variables del tema.
 * Compatible con tema claro (Grunge White) y oscuro.
 */

/* Section — diseño compacto */
.projects {
  padding: 40px 5%;
  position: relative;
  background-color: var(--primary-bg);
}

.projects .section-header {
  margin-bottom: 28px;
  text-align: center;
}

.projects .section-title {
  font-size: 28px;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.projects .section-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Filtros */
.project-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 12px;
}

/* Book container */
.book-container {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
}

.book-pages {
  position: relative;
  width: 100%;
  min-height: 300px;
}

/* Página / card de proyecto */
.page {
  display: none;
  width: 100%;
}

.page.active {
  display: block;
}

.page-content {
  padding: 0;
  width: 100%;
}

.project-showcase {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
}

.project-image {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  height: 180px;
  background: var(--secondary-bg);
  border: 1px solid var(--border);
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.project-image:hover img {
  transform: scale(1.05);
}

.project-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  padding: 10px 14px;
  color: #fff;
}

.project-category {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent-1);
  margin-bottom: 2px;
}

.project-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.project-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.25;
}

.project-description {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.45;
  margin: 0;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.projects .tech-tag {
  padding: 5px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.project-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 20px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.project-card-clickable {
  cursor: pointer;
}

.project-link-more {
  border: 1px solid var(--border-strong);
  background: transparent;
  font-family: inherit;
  cursor: pointer;
  color: var(--ink-2);
}

.project-link-more:hover {
  background: rgba(20, 18, 16, 0.06);
  color: var(--ink);
}

/* Loader */
.page-loader .page-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 280px;
}

.page-loader .page-content p {
  color: var(--text-secondary);
  font-size: 13px;
}

/* Navegación del libro */
.book-navigation {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 16px;
}

.view-all-projects {
  text-align: center;
  margin-top: 20px;
}

/* Responsive */
@media (max-width: 768px) {
  .projects {
    padding: 32px 4%;
  }

  .projects .section-header {
    margin-bottom: 20px;
  }

  .project-showcase {
    grid-template-columns: 1fr;
    gap: 14px;
    max-width: 100%;
  }

  .project-image {
    height: 150px;
    border-radius: 10px;
  }

  .project-title {
    font-size: 17px;
  }

  .project-description {
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .projects {
    padding: 24px 3%;
  }

  .project-image {
    height: 140px;
  }

  .project-filters {
    gap: 8px;
  }
}
