/*
  Organized (no functional changes) on 2026-01-08
  - Merged consecutive duplicate selectors
  - Removed exact duplicate declarations
*/

/* ==========================
   PROYECTOS – Original Version with Subtle Enhancements
   ========================== */
.projects {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Project Card */
.project-card {
  border: 1px solid var(--border);
  background: rgba(255,255,255,.72);
  border-radius: 22px;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: grid;
  grid-template-columns: 520px 1fr;
  gap: 0;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Hover effect on project cards */
.project-card:hover {
  transform: translateY(-4px);
  /* Slight lift effect */
  box-shadow: 0 14px 30px rgba(0,0,0,0.1);
  /* Stronger shadow */
}

/* Project Media */
.project-media {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 12px;
  align-content: start;
}

.project-media img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid var(--border);
  transition: transform 0.3s ease;
}

/* Hover effect on images */
.project-media img:hover {
  transform: scale(1.05);
  /* Slight zoom effect */
}

/* Project Body */
.project-body {
  padding: 18px;
  text-align: center;
}

.project-body h2 {
  margin-top: 4px;
  font-size: 22px;
  font-weight: 600;
  color: #333;
  letter-spacing: 0.05em;
}

.project-body p {
  font-size: 14px;
  line-height: 1.5;
  color: #555;
  margin-top: 10px;
}

/* Responsive styles */
@media (max-width: 980px) {
  .project-card {
    grid-template-columns: 1fr;
  }

  .project-media {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 520px) {
  .project-media {
    grid-template-columns: 1fr;
  }

  .project-media img {
    height: 220px;
  }
}

/* ==========================
   PROJECT MEDIA SLIDER (3 visible, infinite loop)
   Replaces the old 3-image grid without changing the block size.
   ========================== */
.project-media {
  display: block;
  /* override grid */
  overflow: hidden;
  position: relative;
  border-radius: 16px;
}

.project-track {
  display: flex;
  gap: 10px;
  will-change: transform;
  transition: transform 420ms ease;
  transform: translate3d(0,0,0);
  --slideW: 0px;
}

.project-track.no-anim {
  transition: none !important;
}

.project-slide {
  flex: 0 0 calc(var(--slideW) - 10px);
}

.project-slide img {
  width: 100%;
  height: 180px;
  /* matches the old visual size */
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--border);
}

/* Responsive: 2 visible then 1 visible */
@media (max-width: 980px) {
  .project-media[data-visible="3"] {
    --visible: 2;
  }

  .project-slide img {
    height: 200px;
  }
}

@media (max-width: 520px) {
  .project-slide img {
    height: 220px;
  }
}

/* =====================================
   PROJECT MEDIA SLIDER
   (keeps original sizes)
   ===================================== */
.project-media {
  overflow: hidden;
  /* critical for slider */
  position: relative;
}

/* Sliding row */
.project-track {
  display: flex;
  gap: 12px;
  transition: transform 420ms ease;
  will-change: transform;
  --slideW: 0px;
}

/* Disable animation when jumping */
.project-track.no-anim {
  transition: none !important;
}

/* Each slide takes exactly 1/3 of media width */
.project-slide {
  flex: 0 0 calc(var(--slideW) - 12px);
}

/* Images KEEP previous size rules */
.project-slide img {
  width: 100%;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid var(--border);
}

.project-gallery-link {
  margin-top: 8px;
  text-align: center;
  font-size: 0.9rem;
}

.project-gallery-link a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.project-gallery-link a:hover {
  text-decoration: underline;
}

.project-media {
  overflow: hidden;
  position: relative;
}

.project-track {
  display: flex;
  gap: 12px;
  transition: transform 420ms ease;
  will-change: transform;
  --slideW: 0px;
}

.project-track.no-anim {
  transition: none !important;
}

.project-slide {
  flex: 0 0 calc(var(--slideW) - 12px);
}

/* don’t force height */
.project-slide img {
  width: 100%;
  object-fit: cover;
}

.project-gallery-link {
  margin-top: 8px;
  text-align: center;
  font-size: .9rem;
}

.project-gallery-link a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.project-gallery-link a:hover {
  text-decoration: underline;
}
