/* Open Source Contributions - Card Grid Styling */

.opensource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
}

.project-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  height: auto;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
  border-color: #2563eb;
}

/* Card Header */
.project-card-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.project-icon {
  font-size: 2.5rem;
  line-height: 1;
  flex-shrink: 0;
}

.project-title-section {
  flex: 1;
  min-width: 0;
}

.project-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 0.25rem 0;
  word-wrap: break-word;
}

.project-category {
  font-size: 0.85rem;
  color: #6b7280;
  margin: 0;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Description */
.project-description {
  color: #4b5563;
  line-height: 1.6;
  margin: 0 0 1rem 0;
  font-size: 0.95rem;
  flex-grow: 1;
}

/* Tags */
.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: #eff6ff;
  color: #1e40af;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid #bfdbfe;
  transition: all 0.2s;
}

.tag:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}

/* Stats */
.project-stats {
  display: flex;
  gap: 1.5rem;
  padding: 1rem 0;
  border-top: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 1rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1;
  gap: 0.25rem;
}

.stat-icon {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

.stat-value {
  font-size: 1rem;
  font-weight: 700;
  color: #1f2937;
}

.stat-label {
  font-size: 0.75rem;
  color: #6b7280;
  line-height: 1.2;
}

/* Links */
.project-links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: auto;
}

.project-link {
  flex: 1;
  min-width: 140px;
  text-decoration: none;
  transition: transform 0.2s, opacity 0.2s;
  display: inline-block;
}

.project-link:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

.project-link img {
  width: 100%;
  height: auto;
  display: block;
}

.project-link.npm img {
  height: 68%;
}

.soft-block {
  background: var(--bg-soft);
  padding: 2rem;
  border-radius: 8px;
  margin: 2rem 0;
  border: 1px solid var(--border);
}


/* Responsive Design */
@media (max-width: 768px) {
  .opensource-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .project-stats {
    flex-direction: column;
    gap: 1rem;
  }
  
  .stat-item {
    flex-direction: row;
    justify-content: flex-start;
    gap: 0.75rem;
  }
  
  .stat-icon {
    font-size: 1.5rem;
    margin-bottom: 0;
  }
  
  .stat-value,
  .stat-label {
    text-align: left;
  }
  
  .project-links {
    flex-direction: column;
  }
  
  .project-link {
    min-width: 100%;
  }
}

@media (min-width: 769px) and (max-width: 1200px) {
  .opensource-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1201px) {
  .opensource-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .project-card {
    background: #1f2937;
    border-color: #374151;
  }
  
  .project-card:hover {
    border-color: #60a5fa;
  }
  
  .project-title {
    color: #f9fafb;
  }
  
  .project-category {
    color: #9ca3af;
  }
  
  .project-description {
    color: #d1d5db;
  }
  
  .tag {
    background: #1e3a8a;
    color: #93c5fd;
    border-color: #1e40af;
  }
  
  .tag:hover {
    background: #1e40af;
    border-color: #3b82f6;
  }
  
  .stat-value {
    color: #f9fafb;
  }
  
  .stat-label {
    color: #9ca3af;
  }
  
  .project-stats {
    border-top-color: #374151;
    border-bottom-color: #374151;
  }
}

/* Accessibility Enhancements */
.project-card:focus-within {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.project-link:focus {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
  border-radius: 4px;
}