/* ─── Projects Grid ──────────────────────────────────────────────────────── */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  padding: 2.5rem 0 4rem;
}

@media (max-width: 900px) {
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 580px) {
  .projects-grid { grid-template-columns: 1fr; }
}

/* ─── Kachel ─────────────────────────────────────────────────────────────── */

.project-card {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  outline: none !important;
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  opacity: 0;
  animation: cardIn 0.4s ease forwards;
  box-shadow: none !important;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.18) !important;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5) !important;
}

/* ─── Bild ───────────────────────────────────────────────────────────────── */

.project-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  border: none !important;
  outline: none !important;
}

.project-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border: none !important;
  outline: none !important;
  transition: transform 0.35s ease;
}

.project-card:hover .project-img-wrap img {
  transform: scale(1.04);
}

/* Fallback wenn Bild fehlt */
.project-img-wrap.img-error {
  display: flex;
  align-items: center;
  justify-content: center;
}
.project-img-wrap.img-error::after {
  content: '🖼';
  font-size: 2.5rem;
  opacity: 0.2;
}

/* ─── Hover Overlay ──────────────────────────────────────────────────────── */

.project-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  opacity: 0;
  transition: opacity 0.25s ease;
  backdrop-filter: blur(3px);
}

.project-card:hover .project-overlay {
  opacity: 1;
}

/* ─── Text-Bereich ───────────────────────────────────────────────────────── */

.project-info {
  padding: 1rem 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  border: none !important;
}

.project-name {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-desc {
  margin: 0;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.45);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ─── Fehlermeldung ──────────────────────────────────────────────────────── */

.no-projects {
  grid-column: 1 / -1;
  text-align: center;
  color: rgba(255, 255, 255, 0.3);
  padding: 4rem 0;
  font-size: 0.9rem;
  line-height: 1.8;
}

/* ─── Loading Skeleton ───────────────────────────────────────────────────── */

.project-card.skeleton {
  pointer-events: none;
  animation: none;
  opacity: 1;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
}

.skeleton-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: rgba(255, 255, 255, 0.05);
}

.skeleton-line {
  height: 11px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  animation: shimmer 1.5s ease infinite;
}

.skeleton-title { height: 14px; width: 55%; }
.skeleton-line.short { width: 35%; }

@keyframes shimmer {
  0%, 100% { opacity: 0.4; }
  50%       { opacity: 0.9; }
}
