/* ==========================================================================
   PROGRAMS CATALOG v2 — imágenes completas + búsqueda moderna
   ========================================================================== */

.prog-catalog {
  background: linear-gradient(165deg, #eef2f8 0%, #f8fafc 40%, #fff 100%);
  padding: var(--space-2xl) 0 var(--space-3xl);
}

.prog-catalog .section__header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto var(--space-lg);
}

.prog-catalog__header {
  position: relative;
}

.prog-catalog__title {
  font-size: clamp(1.35rem, 3.2vw, 2rem);
  line-height: 1.35;
  font-weight: 800;
  color: #133557;
  text-transform: none;
  letter-spacing: -0.02em;
}

.prog-catalog__accent {
  position: relative;
  display: inline-block;
  font-weight: 900;
  padding: 0 0.12em;
  white-space: nowrap;
}

/* Brillo suave que recorre la palabra (sin blanco = sin “huecos”) */
.prog-catalog__accent::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.06em;
  height: 0.2em;
  border-radius: 50px;
  opacity: 0.55;
  z-index: -1;
  transform: scaleX(0.92);
  filter: blur(6px);
}

/* Inglés — navy UK → rojo, brillo lento */
.prog-catalog__accent--uk {
  color: #012169;
  background-image: linear-gradient(
    120deg,
    #012169 0%,
    #1a4082 35%,
    #c8102e 65%,
    #012169 100%
  );
  background-size: 200% auto;
  background-repeat: no-repeat;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: progAccentShine 7s ease-in-out infinite;
}

.prog-catalog__accent--uk::after {
  background: linear-gradient(90deg, #012169, #c8102e);
  animation: progAccentGlow 7s ease-in-out infinite;
}

/* Computación — azul ICO → magenta, mismo ritmo */
.prog-catalog__accent--tech {
  color: #133557;
  background-image: linear-gradient(
    120deg,
    #133557 0%,
    #1a446e 30%,
    #fc2366 60%,
    #fc4d86 85%,
    #133557 100%
  );
  background-size: 200% auto;
  background-repeat: no-repeat;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: progAccentShine 7s ease-in-out infinite;
  animation-delay: -3.5s;
}

.prog-catalog__accent--tech::after {
  background: linear-gradient(90deg, #133557, #fc2366);
  animation: progAccentGlow 7s ease-in-out infinite;
  animation-delay: -3.5s;
}

@keyframes progAccentShine {
  0%, 100% {
    background-position: 0% center;
  }
  50% {
    background-position: 100% center;
  }
}

@keyframes progAccentGlow {
  0%, 100% {
    opacity: 0.35;
    transform: scaleX(0.88);
  }
  50% {
    opacity: 0.7;
    transform: scaleX(1);
  }
}

.prog-catalog__subtitle {
  margin: 0.85rem 0 0;
  color: #6c757d;
  font-size: 0.92rem;
  line-height: 1.55;
}

.prog-catalog__subtitle-line {
  display: block;
}

.prog-catalog__subtitle-line + .prog-catalog__subtitle-line {
  margin-top: 0.25rem;
}

.prog-catalog__subtitle strong {
  color: #fc2366;
  font-weight: 800;
}

/* Command panel */
.prog-catalog__command {
  margin-bottom: 1.5rem;
}

/* Segmented filters */
.prog-catalog__segment {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  padding: 0.2rem 0;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.prog-catalog__segment::-webkit-scrollbar {
  display: none;
}

.prog-catalog__seg {
  flex: 1 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.55rem 0.75rem;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  color: #133557;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(19, 53, 87, 0.05);
}

.prog-catalog__seg .material-icons {
  font-size: 1rem;
  opacity: 0.85;
}

.prog-catalog__seg-count {
  font-size: 0.62rem;
  font-weight: 800;
  padding: 0.1rem 0.35rem;
  border-radius: 50px;
  background: rgba(19, 53, 87, 0.08);
}

.prog-catalog__seg.is-active {
  background: #133557;
  color: #fff;
  box-shadow: 0 8px 20px rgba(19, 53, 87, 0.22);
}

.prog-catalog__seg.is-active .prog-catalog__seg-count {
  background: rgba(255, 255, 255, 0.2);
}

.prog-catalog__meta {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: #6c757d;
  text-align: center;
}

/* Grid */
.prog-catalog__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: stretch;
}

/* Cards — imagen a ancho y alto del bloque superior */
.prog-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.prog-card.is-hidden {
  display: none !important;
}

.prog-card.is-match {
  animation: progPopIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes progPopIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.prog-card__link {
  display: flex;
  flex-direction: column;
  flex: 1;
  width: 100%;
  height: 100%;
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  border: 1px solid rgba(19, 53, 87, 0.07);
  box-shadow: 0 8px 24px rgba(19, 53, 87, 0.06);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease;
}

.prog-card__link:active {
  transform: scale(0.985);
}

.prog-card__media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 11;
  padding: 0;
  overflow: hidden;
  background: #133557;
  flex-shrink: 0;
}

.prog-card__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  transition: transform 0.45s ease;
}

.prog-card__body {
  padding: 1rem 1.1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}

.prog-card__badge {
  display: none;
}

.prog-card--carreras .prog-card__badge {
  background: rgba(252, 35, 102, 0.12);
  color: #fc2366;
}

.prog-card--cursos .prog-card__badge {
  background: rgba(77, 163, 255, 0.15);
  color: #1a6fd4;
}

.prog-card--diplomados .prog-card__badge {
  background: rgba(19, 53, 87, 0.1);
  color: #133557;
}

.prog-card--certificaciones .prog-card__badge {
  background: rgba(255, 152, 0, 0.15);
  color: #c76a00;
}

.prog-card__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.3;
  color: #133557;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  min-height: calc(2 * 1.3em);
}

.prog-card__title mark {
  background: rgba(252, 35, 102, 0.18);
  color: #133557;
  border-radius: 3px;
  padding: 0 2px;
}

.prog-card__desc {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.5;
  color: #6c757d;
  flex: 1;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  min-height: calc(2 * 1.5em);
}

.prog-card__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.prog-card__chip {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 50px;
  background: #f4f7fb;
  color: #133557;
  border: 1px solid #e2e8f0;
}

.prog-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: auto;
  padding-top: 0.35rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #fc2366;
}

.prog-card__cta .material-icons {
  font-size: 1.05rem;
  transition: transform 0.2s ease;
}

.prog-card--spotlight .prog-card__link {
  border-color: rgba(252, 35, 102, 0.2);
  box-shadow: 0 12px 32px rgba(252, 35, 102, 0.1);
}

.prog-catalog__empty {
  text-align: center;
  padding: 2.5rem 1.25rem;
  color: #6c757d;
  font-size: 0.92rem;
  background: #fff;
  border-radius: 18px;
  border: 1px dashed #d0d8e4;
  grid-column: 1 / -1;
}

.prog-catalog__empty[hidden] {
  display: none !important;
}

/* Tablet+ */
@media (min-width: 640px) {
  .prog-catalog__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .prog-catalog__segment {
    flex-wrap: wrap;
    justify-content: center;
    overflow: visible;
  }

  .prog-catalog__seg {
    flex: 0 1 auto;
    padding: 0.6rem 1rem;
    font-size: 0.78rem;
  }

  .prog-card__link:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 40px rgba(19, 53, 87, 0.12);
  }

  .prog-card__link:hover .prog-card__img {
    transform: scale(1.03);
  }

  .prog-card__link:hover .prog-card__cta .material-icons {
    transform: translateX(4px);
  }
}

@media (min-width: 1024px) {
  .prog-catalog__grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .prog-card--spotlight {
    grid-column: span 1;
  }
}

@media (max-width: 767px) {
  .prog-catalog__command {
    position: sticky;
    top: 62px;
    z-index: 40;
    padding-top: 0.25rem;
    margin-left: -0.5rem;
    margin-right: -0.5rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    background: linear-gradient(180deg, #eef2f8 90%, rgba(238, 242, 248, 0));
  }

  .prog-catalog__seg .material-icons {
    display: none;
  }

  .prog-card__media {
    aspect-ratio: 4 / 3;
  }
}

@media (prefers-reduced-motion: reduce) {
  .prog-card,
  .prog-card__link,
  .prog-card__img,
  .prog-card.is-match,
  .prog-catalog__accent--uk,
  .prog-catalog__accent--tech,
  .prog-catalog__accent::after {
    animation: none !important;
    transition: none !important;
  }

  .prog-catalog__accent--uk {
    background: none;
    -webkit-text-fill-color: #012169;
    color: #012169;
  }

  .prog-catalog__accent--tech {
    background: none;
    -webkit-text-fill-color: #fc2366;
    color: #fc2366;
  }

  .prog-catalog__accent::after {
    display: none;
  }
}
