/* =========================================================
CSS ORIGINAL DEL BLOQUE · css/styles.css
========================================================= */

.laeca-el-projects-section {
  --laeca-projects-accent: #1a40ff;
  width: 100%;
  background: white;
  color: #000;
  padding: 4rem 1.5rem;
  overflow: hidden;
}

@media (min-width: 768px) {
  .laeca-el-projects-section {
    padding: 6rem 2.5rem;
  }
}

@media (min-width: 1024px) {
  .laeca-el-projects-section {
    padding: 7rem 4rem;
  }
}

.laeca-el-projects-container {
  width: 100%;
  padding: 0 1.5rem;
}

@media (min-width: 768px) {
  .laeca-el-projects-container {
    padding: 0 2.5rem;
  }
}

@media (min-width: 1024px) {
  .laeca-el-projects-container {
    padding: 0 4rem;
  }
}

/* Header row */

.laeca-el-projects-header {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

@media (min-width: 1024px) {
  .laeca-el-projects-header {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
    gap: 3rem;
    margin-bottom: 3.5rem;
  }
}

.laeca-el-projects-title-wrapper {
  max-width: none;
}

.laeca-el-projects-subtitle-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .laeca-el-projects-subtitle-wrapper {
    flex-direction: row;
    align-items: flex-end;
  }
}

.laeca-el-projects-title {
  font-family: "Barlow Condensed", "Inter", sans-serif;
  font-size: 1.875rem;
  font-weight: 800;
  color: #4b5563;
  text-transform: uppercase;
  margin-bottom: 0;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

@media (min-width: 768px) {
  .laeca-el-projects-title {
    font-size: 2.25rem;
  }
}

@media (min-width: 1024px) {
  .laeca-el-projects-title {
    font-size: 3rem;
  }
}

.laeca-el-projects-subtitle {
  color: #6b7280;
  font-size: 0.875rem;
  line-height: 1.6;
  max-width: 20rem;
}

@media (min-width: 768px) {
  .laeca-el-projects-subtitle {
    font-size: 1rem;
  }
}

/* Carousel track with floating arrows */

.laeca-el-projects-carousel {
  position: relative;
  margin-bottom: 2.5rem;
}

@media (min-width: 768px) {
  .laeca-el-projects-carousel {
    margin-bottom: 3.5rem;
  }
}

.laeca-el-projects-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
}

@media (min-width: 768px) {
  .laeca-el-projects-arrow {
    width: 3rem;
    height: 3rem;
  }
}

.laeca-el-projects-arrow:hover {
  background: var(--laeca-projects-accent, #1a40ff);
  border-color: var(--laeca-projects-accent, #1a40ff);
  color: white;
}

.laeca-el-projects-arrow-left {
  left: 0.5rem;
}

@media (min-width: 768px) {
  .laeca-el-projects-arrow-left {
    left: 1rem;
  }
}

.laeca-el-projects-arrow-right {
  right: 0.5rem;
}

@media (min-width: 768px) {
  .laeca-el-projects-arrow-right {
    right: 1rem;
  }
}

.laeca-el-projects-track {
  display: flex;
  gap: 0.75rem;
  transition: transform 1.3s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (min-width: 768px) {
  .laeca-el-projects-track {
    gap: 1rem;
  }
}

.laeca-el-project-card {
  position: relative;
  flex-shrink: 0;
  width: calc(100% / 1.25);
  border-radius: 1rem;
  overflow: hidden;
  cursor: pointer;
  user-select: none;
  opacity: 1;
  transform: scale(1);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.laeca-el-project-card.active {
  opacity: 1;
  transform: scale(1);
}

.laeca-el-project-clone {
  pointer-events: none;
}

@media (min-width: 768px) {
  .laeca-el-project-card {
    width: calc(100% / 1.4);
  }
}

@media (min-width: 1024px) {
  .laeca-el-project-card {
    width: calc(100% / 1.55);
  }
}

.laeca-el-project-image {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
}

@media (max-width: 767px) {
  .laeca-el-project-image {
    aspect-ratio: 4/5;
  }
}

.laeca-el-project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: all 1.2s ease-out;
  transform: scale(1);
}

.laeca-el-project-card.active .laeca-el-project-image img {
  transform: scale(1.05);
}

.laeca-el-project-card:hover .laeca-el-project-image img {
  transform: scale(1.1);
}

.laeca-el-project-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.9) 0%,
    rgba(0, 0, 0, 0.5) 50%,
    rgba(0, 0, 0, 0.1) 100%
  );
  opacity: 0.8;
  transition: opacity 0.5s ease;
}

.laeca-el-project-card.active .laeca-el-project-overlay {
  opacity: 1;
}

.laeca-el-project-card:hover .laeca-el-project-overlay {
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.95) 0%,
    rgba(0, 0, 0, 0.5) 50%,
    rgba(0, 0, 0, 0.1) 100%
  );
}

.laeca-el-project-accent-line {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--laeca-projects-accent, #1a40ff);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s ease;
}

.laeca-el-project-card:hover .laeca-el-project-accent-line {
  transform: scaleX(1);
}

.laeca-el-project-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem;
  color: white;
  transform: translateY(0);
  transition: transform 0.7s cubic-bezier(0.25, 1, 0.5, 1);
}

@media (min-width: 768px) {
  .laeca-el-project-content {
    padding: 2.5rem;
  }
}

@media (min-width: 1024px) {
  .laeca-el-project-content {
    padding: 3rem;
  }
}

.laeca-el-project-card:hover .laeca-el-project-content,
.laeca-el-project-card.active .laeca-el-project-content {
  transform: translateY(-0.5rem);
}

.laeca-el-project-title {
  font-family: "Barlow Condensed", "Inter", sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: white;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  line-height: 0.95;
  letter-spacing: -0.02em;
}

@media (min-width: 768px) {
  .laeca-el-project-title {
    font-size: 2.25rem;
    margin-bottom: 1rem;
  }
}

@media (min-width: 1024px) {
  .laeca-el-project-title {
    font-size: 3rem;
  }
}

@media (min-width: 1280px) {
  .laeca-el-project-title {
    font-size: 3.75rem;
  }
}

.laeca-el-project-description {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.875rem;
  line-height: 1.6;
  max-width: 18rem;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(1.5rem);
  transition:
    max-height 0.7s cubic-bezier(0.25, 1, 0.5, 1),
    opacity 0.7s cubic-bezier(0.25, 1, 0.5, 1),
    transform 0.7s cubic-bezier(0.25, 1, 0.5, 1);
}

.laeca-el-project-card:hover .laeca-el-project-description,
.laeca-el-project-card.active .laeca-el-project-description {
  max-height: 15rem;
  opacity: 1;
  transform: translateY(0);
}

@media (min-width: 768px) {
  .laeca-el-project-description {
    font-size: 1rem;
    max-width: 20rem;
  }
}

@media (min-width: 1024px) {
  .laeca-el-project-description {
    font-size: 1.125rem;
    max-width: 24rem;
  }
}

.laeca-el-projects-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.laeca-el-projects-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.875rem 1.75rem;
  border: 2px solid var(--laeca-projects-accent, #1a40ff);
  color: var(--laeca-projects-accent, #1a40ff);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 700;
  border-radius: 0.375rem;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.laeca-el-projects-btn:hover {
  background: var(--laeca-projects-accent, #1a40ff);
  color: white;
  transform: scale(1.02);
}

.laeca-el-projects-btn:active {
  transform: scale(0.98);
}

/* Project indicators */

.laeca-el-projects-indicators {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.laeca-el-project-indicator {
  height: 3px;
  border-radius: 9999px;
  background: #e5e7eb;
  transition: all 0.5s ease;
  cursor: pointer;
  appearance: none;
  border: 0;
  padding: 0;
  width: 1.25rem;
}

.laeca-el-project-indicator.active {
  width: 2rem;
  background: var(--laeca-projects-accent, #1a40ff);
}

.laeca-el-project-indicator:hover {
  background: rgba(0, 0, 0, 0.4);
}

.laeca-el-projects-btn i {
  transition: transform 0.3s ease;
}

.laeca-el-projects-btn:hover i {
  transform: translateX(4px);
}

/* =========================================================
CORRECCIÓN TABLET · TEXTO DEL CARRUSEL
SOLO AJUSTA TABLET PARA EVITAR CORTES DEL TÍTULO Y TEXTO
========================================================= */
@media (min-width: 768px) and (max-width: 1023px) {
  .laeca-el-project-card {
    width: calc(100% / 1.28);
  }

  .laeca-el-project-image {
    aspect-ratio: 5 / 4;
  }

  .laeca-el-project-content {
    padding: 2rem 2rem 2.15rem;
  }

  .laeca-el-project-card:hover .laeca-el-project-content,
  .laeca-el-project-card.active .laeca-el-project-content {
    transform: translateY(-0.25rem);
  }

  .laeca-el-project-title {
    max-width: 18rem;
    margin-bottom: 0.85rem;
    font-size: 1.9rem;
    line-height: 0.98;
    letter-spacing: -0.02em;
    text-wrap: balance;
    word-break: normal;
    overflow-wrap: break-word;
  }

  .laeca-el-project-description {
    max-width: 19rem;
    max-height: 18rem;
    font-size: 0.95rem;
    line-height: 1.55;
    text-wrap: pretty;
    transform: translateY(1rem);
  }

  .laeca-el-project-card:hover .laeca-el-project-description,
  .laeca-el-project-card.active .laeca-el-project-description {
    max-height: 18rem;
    transform: translateY(0);
  }
}


/* =========================================================
CORRECCIÓN MÓVIL · TARJETAS MÁS ALTAS
Objetivo: dar más aire al título y descripción sin cambiar
los tamaños tipográficos aprobados.
========================================================= */
@media (max-width: 767px) {

  .laeca-el-project-card {
    width: calc(100% / 1.14);
  }

  .laeca-el-project-image {
    aspect-ratio: 4 / 5.35;
    min-height: 540px;
  }

  .laeca-el-project-content {
    padding: 1.65rem 1.5rem 1.85rem;
  }

  .laeca-el-project-card:hover .laeca-el-project-content,
  .laeca-el-project-card.active .laeca-el-project-content {
    transform: translateY(-0.2rem);
  }

  .laeca-el-project-title {
    max-width: 100%;
    margin-bottom: 1rem;
    line-height: 1;
  }

  .laeca-el-project-description {
    max-width: 100%;
    max-height: 19rem;
    line-height: 1.6;
    transform: translateY(1rem);
  }

  .laeca-el-project-card:hover .laeca-el-project-description,
  .laeca-el-project-card.active .laeca-el-project-description {
    max-height: 19rem;
    transform: translateY(0);
  }

  .laeca-el-projects-carousel {
    margin-bottom: 3rem;
  }
}

/* MÓVILES ANGOSTOS */
@media (max-width: 420px) {
  .laeca-el-project-card {
    width: calc(100% / 1.1);
  }

  .laeca-el-project-image {
    aspect-ratio: 4 / 5.55;
    min-height: 555px;
  }

  .laeca-el-project-content {
    padding: 1.55rem 1.35rem 1.75rem;
  }
}


/* =========================================================
MÓVIL · UNA LÁMINA COMPLETA A LA VEZ
Así se aprecia mejor el diseño, los márgenes y el espacio
interno de cada proyecto sin mostrar media tarjeta siguiente.
========================================================= */
@media (max-width: 767px) {
  .laeca-el-projects-section {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .laeca-el-projects-container {
    padding-left: 0;
    padding-right: 0;
  }

  .laeca-el-projects-track {
    gap: 0.875rem;
  }

  .laeca-el-project-card {
    width: calc(100% - 0.875rem);
  }

  .laeca-el-project-image {
    aspect-ratio: 4 / 5;
    min-height: 0;
  }

  .laeca-el-project-content {
    padding: 1.75rem 1.5rem 2rem;
  }

  .laeca-el-project-title {
    max-width: 100%;
    margin-bottom: 1rem;
  }

  .laeca-el-project-description {
    max-width: 100%;
    line-height: 1.6;
  }

  .laeca-el-projects-arrow-left {
    left: 0.75rem;
  }

  .laeca-el-projects-arrow-right {
    right: 0.75rem;
  }

  .laeca-el-projects-carousel {
    margin-bottom: 2.5rem;
  }
}

/* MÓVIL PEQUEÑO */
@media (max-width: 420px) {
  .laeca-el-projects-section {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .laeca-el-projects-track {
    gap: 0.75rem;
  }

  .laeca-el-project-card {
    width: calc(100% - 0.75rem);
  }

  .laeca-el-project-content {
    padding: 1.5rem 1.25rem 1.75rem;
  }
}


/* =========================================================
MÓVIL · SIN FLECHAS, CON DESLIZAMIENTO TÁCTIL
En móvil se ocultan las flechas y se deja la interacción
por swipe con los dedos.
========================================================= */
@media (max-width: 767px) {
  .laeca-el-projects-arrow-left,
  .laeca-el-projects-arrow-right {
    display: none !important;
  }

  .laeca-el-projects-track {
    touch-action: pan-y;
    cursor: grab;
  }

  .laeca-el-projects-track:active {
    cursor: grabbing;
  }
}


/* =========================================================
MÓVIL · INDICADOR CENTRADO DEBAJO DEL BOTÓN
========================================================= */
@media (max-width: 767px) {
  .laeca-el-projects-cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
  }

  .laeca-el-projects-indicators {
    order: 1;
    width: 100%;
    justify-content: center;
    align-items: center;
    margin-top: 0;
    margin-bottom: 0.7rem;
  }

  .laeca-el-projects-btn {
    order: 2;
  }
}


@media (max-width: 767px) {
  .laeca-el-projects-track {
    touch-action: pan-y;
    -webkit-user-select: none;
    user-select: none;
    will-change: transform;
  }

  .laeca-el-project-card {
    -webkit-user-drag: none;
  }

  .laeca-el-project-image img {
    pointer-events: none;
  }
}


/* =========================================================
ESCRITORIO · INDICADOR Y BOTÓN CENTRADOS
Se centra el conjunto bajo el slider para que quede
alineado correctamente.
========================================================= */
@media (min-width: 1024px) {
  .laeca-el-projects-cta {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-top: -1.05rem;
  }

  .laeca-el-projects-indicators {
    order: 1;
    justify-content: center;
    align-items: center;
    margin: 0 0 1.6rem 0;
  }

  .laeca-el-projects-btn {
    order: 2;
    margin: 0 auto;
  }
}
