.portfolio-section {
  padding: 30px 0 60px;
}

/* El header base del tema es flex en fila (space-between): aquí título y
   subtítulo van apilados en 2 filas, centrados y separados. */
#wsus__portfolio .wsus__section_header--titled {
  flex-direction: column !important;
  align-items: center !important;
  gap: 10px;
}

.portfolio-subtitle {
  margin: 0;
  width: 100%;
  text-align: center;
  color: #7a8b9a;
  font-size: 14px;
  line-height: 1.6;
}

.portfolio-grid {
  row-gap: 24px;
  margin-top: 10px;
}

.portfolio-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e8ecf1;
  border-radius: 12px;
  overflow: hidden;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.portfolio-card:hover {
  box-shadow: 0 12px 32px rgba(0, 136, 204, 0.14);
  transform: translateY(-3px);
}

.portfolio-card__media {
  aspect-ratio: 16 / 9;
  background: #f1f5f9;
  overflow: hidden;
}

.portfolio-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.portfolio-card__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  flex: 1;
}

.portfolio-card__title {
  font-size: 16px;
  font-weight: 700;
  color: #1a2b3c;
  margin: 0;
  line-height: 1.35;
}

.portfolio-card__desc {
  font-size: 14px;
  color: #5b6b7a;
  line-height: 1.6;
  margin: 0;
  flex: 1;
}

.portfolio-card__techs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
}

.portfolio-card__tech {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  color: #08c;
  background: #e6f7ff;
  border: 1px solid #d6eef8;
  border-radius: 20px;
  padding: 4px 11px;
  margin: 0;
}

/* Fallback: si `gap` en flex no aplica (cache viejo / navegador antiguo), el margen separa igual */
@supports not (gap: 8px) {
  .portfolio-card__techs {
    margin: -4px;
  }
  .portfolio-card__tech {
    margin: 4px;
  }
}

.portfolio-card__actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 4px;
}

.portfolio-card__actions > .portfolio-btn:only-child {
  grid-column: 1 / -1;
}

.portfolio-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  font-size: 13px;
  font-weight: 700;
  border-radius: 8px;
  padding: 9px 14px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.portfolio-btn--primary {
  background: #08c;
  color: #fff;
  border: 1px solid #08c;
}

.portfolio-btn--primary:hover {
  background: #06a3d9;
  color: #fff;
}

.portfolio-btn--ghost {
  background: #fff;
  color: #1a2b3c;
  border: 1px solid #dbe4ec;
}

.portfolio-btn--ghost:hover {
  border-color: #08c;
  color: #08c;
}

.portfolio-empty {
  text-align: center;
  padding: 50px 20px;
  color: #7a8b9a;
}

.portfolio-empty i {
  font-size: 40px;
  color: #c9d6e2;
  margin-bottom: 12px;
}

.portfolio-dots {
  display: none;
}

@media (max-width: 575px) {
  .portfolio-card__body {
    padding: 16px;
  }

  /* Slider tactil: exactamente 1 card por vista + dots.
     Sin padding lateral ni gutters de Bootstrap: cada slide mide lo mismo
     que el viewport del scroll, asi no se asoma parte del siguiente card. */
  #wsus__portfolio .portfolio-grid {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 0;
    --bs-gutter-x: 0;
    margin-left: 0;
    margin-right: 0;
    padding-bottom: 8px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  #wsus__portfolio .portfolio-grid::-webkit-scrollbar {
    display: none;
  }
  #wsus__portfolio .portfolio-grid > [class*="col-"] {
    flex: 0 0 100%;
    max-width: 100%;
    width: 100%;
    margin: 0;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    padding-left: 0;
    padding-right: 0;
  }

  .portfolio-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
  }
  .portfolio-dots button {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    padding: 0;
    background: #c9d6e2;
    cursor: pointer;
    transition: all 0.3s ease;
  }
  .portfolio-dots button.active {
    background: #08c;
    width: 22px;
    border-radius: 8px;
  }
}
