/* Compact MORTEX carousel inside the original projects grid. */
.mortex-project-item {
  min-height: 280px;
  cursor: default;
}

.mortex-projects-carousel {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 280px;
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius-lg, 24px);
  outline: none;
}

.mortex-projects-carousel:focus-visible {
  outline: 3px solid rgba(247, 147, 30, .9);
  outline-offset: -3px;
}

.mortex-projects-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 280px;
  overflow: hidden;
  border-radius: inherit;
  background: #171717;
  touch-action: pan-y;
}

.mortex-projects-track,
.mortex-project-slide {
  position: absolute;
  inset: 0;
}

.mortex-project-slide {
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transform: scale(1.015);
  transition: opacity .42s ease, transform .6s cubic-bezier(.22, 1, .36, 1), visibility .42s;
}

.mortex-project-slide.active {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
  z-index: 1;
}

.mortex-project-slide img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 280px;
  object-fit: cover;
  object-position: center;
}

.mortex-project-item:hover .mortex-project-slide img {
  transform: none;
}

.mortex-project-slide-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 58%, rgba(0, 0, 0, .72) 100%);
  pointer-events: none;
}

.mortex-project-slide-title {
  position: absolute;
  left: 20px;
  bottom: 20px;
  z-index: 2;
  color: #ff983e;
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .08em;
  line-height: 1;
  text-transform: uppercase;
}

.resinas-project-item .mortex-project-slide-title {
  max-width: calc(100% - 170px);
  line-height: 1.2;
}

.mortex-projects-controls {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mortex-projects-button {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 50%;
  background: rgba(20, 20, 20, .62);
  color: #fff;
  cursor: pointer;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

.mortex-projects-button:hover,
.mortex-projects-button:focus-visible {
  background: #f7931e;
  border-color: #f7931e;
  transform: translateY(-1px);
  outline: none;
}

.mortex-projects-counter {
  min-width: 54px;
  height: 36px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(20, 20, 20, .62);
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .05em;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

@media (max-width: 640px) {
  .mortex-projects-carousel,
  .mortex-projects-viewport { min-height: 280px; }
  .mortex-project-slide-title { left: 18px; bottom: 18px; }
  .mortex-projects-controls { right: 10px; bottom: 10px; gap: 5px; }
  .mortex-projects-button { width: 34px; height: 34px; }
  .mortex-projects-counter { min-width: 50px; height: 34px; padding: 0 7px; }
}

@media (prefers-reduced-motion: reduce) {
  .mortex-project-slide,
  .mortex-projects-button { transition: none; }
}
