/* ===========================
   FEATURED PROJECTS / CARDS
   =========================== */

.featured-projects {
  padding: 10vh 8vw;
}

/* Keep default grid for other sections */
.projects-grid {
  display: grid;
  gap: 2rem;
  margin: 0 auto;
  width: 100%;
  grid-template-columns: 1fr; /* mobile */
  justify-content: center;
}

@media (min-width: 768px) {
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .projects-grid {
    width: 75%;
    max-width: 75%;
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Card */
.project-card {
  background: var(--color-secondary);
  border-radius: 12px;
  border: 1px solid var(--color-border);
  box-shadow:
    0 2px 10px rgba(0,0,0,0.08),
    0 1px 0 rgba(255,255,255,0.02) inset;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  transform-style: preserve-3d;
  will-change: transform;
  transition: box-shadow 0.25s ease;
  cursor: default;
}

/* No hover lift */
.project-card:hover {
  box-shadow:
    0 2px 10px rgba(0,0,0,0.08),
    0 1px 0 rgba(255,255,255,0.02) inset;
}

.project-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

.card-content {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex-grow: 1;
  font-size: 0.95rem;
  line-height: 1.45;
}

.card-content h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  line-height: 1.25;
}

.card-content p { margin: 0 0 0.75rem 0; }

.card-content a {
  color: var(--color-accent);
  font-size: 0.9rem;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease, transform 0.2s ease;
  margin-top: auto;
}

.card-content a:hover { color: var(--color-primary); transform: translateX(2px); }

/* ===========================
   CAROUSEL (scoped to #projects)
   =========================== */

#projects { position: relative; }

/* Stage spans full width; no dead zones */
#projects .projects-grid {
  display: block !important;      /* override grid here only */
  position: relative;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0;
  perspective: 1600px;
  height: var(--carousel-h, 540px);
  overflow: visible;               /* keep side cards visible */
}

/* Slides are absolutely positioned; JS sets transforms */
#projects .project-card {
  position: absolute !important;
  top: 50%;
  left: 50%;
  width: var(--card-w, clamp(240px, 34vw, 460px));
  backface-visibility: hidden;
  transform-origin: 50% 50%;
}

/* Mobile tweaks: slightly softer tilt and taller stage */
@media (max-width: 640px) {
  #projects .projects-grid { height: var(--carousel-h, 64vh); }
  /* JS still controls transforms; width clamp already shrinks cards */
}

/* Interaction locks (section-only) */
#projects, #projects * { user-select: none; -webkit-user-select: none; }
#projects img { -webkit-user-drag: none; user-drag: none; }
