/* PROJECT CARD LAYOUT (HORIZONTAL) */
.project-card {
  display: flex;
  flex-direction: row;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 2rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  transition: transform 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.2); /* borde sutil translúcido */
}
.project-card:hover {
  transform: translateY(-4px);
}

.project-thumb {
  width: 40%;
  object-fit: cover;
  height: auto;
  max-height: 260px;
}

.project-info {
  padding: 1.5rem;
  width: 60%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.project-client {
  color: var(--muted-foreground);
  font-weight: 500;
  font-size: 0.9rem;
}
.project-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0.3rem 0 0.6rem;
}
.project-tags {
  margin: 0.5rem 0;
}
.tag-pill {
  display: inline-block;
  background: var(--cruce-teal); /* gris cruce */
  color: white;
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  margin-right: 0.5rem;
}
.project-open {
  font-weight: bold;
  margin-top: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--foreground);
}
.project-open svg {
  width: 1rem;
  height: 1rem;
  stroke: currentColor;
}

/******************************************************************************************************************************************************************* Project Modal */
.project-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  overflow-y: auto;
  padding: 2rem 1rem;
}
.modal-content {
  max-width: 900px;
  margin: 0 auto;
  background-color: var(--background);
  border-radius: var(--radius);
  padding: 2rem;
  position: relative;
}
.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--foreground);
}
.modal-title {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}
.modal-subtitle {
  color: var(--muted-foreground);
  margin-bottom: 2rem;
}
.modal-section {
  margin-bottom: 2.5rem;
}
.modal-section h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--foreground);
}
.modal-section p {
  margin-bottom: 1.5rem;
  color: var(--muted-foreground);
}
.modal-images {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.modal-cta {
  text-align: center;
  margin-top: 2rem;
}


/* MODAL HEADER */
.project-modal-header {
  position: sticky;
  top: 0;
  z-index: 100;
  width: calc(100% + 4rem); /* ocupa todo el ancho + compensa padding horizontal */
  margin-left: -2rem;
  margin-right: -2rem;
  margin-top: -2rem; /* elimina el espacio de padding-top */
  padding: 1.5rem 2rem;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  border-radius: var(--radius);
}
.modal-content {
  position: relative;
  z-index: 1;
}
.project-meta {
  max-width: 80%;
}
.project-modal.visible {
  display: flex;
}
.project-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  justify-content: center;
  align-items: flex-start;
  overflow-y: auto;
  padding: 0 2rem 2rem 2rem; /* sin padding arriba */
  width: 100%;
  height: 100vh; /* fuerza altura de ventana */
  max-width: none;
}

/* ----- Ajustes definitivos para modal media ----- */
.project-modal .modal-content {
  max-width: 100%;
  width: 100%;
  padding: 2rem;
  box-sizing: border-box;
}
@media screen and (min-width: 1440px) {
  .project-modal .modal-content {
    max-width: 1400px;
  }
}
.modal-section {
  width: 100%;
  max-width: 100%;
}
.modal-images {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 1rem;
}
.media-wrapper {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  padding: 0;
  height:100%;
}

.media-wrapper > img,
.media-wrapper > video {
  display: block;
  max-width: 100%;
  margin: 0 auto;
  border: 0;
}
/* En desktop: 2 columnas con espacio más chico entre ellas
@media screen and (min-width: 768px) {
  .media-wrapper {
    flex: 0 1 calc(50% - 0.5rem);
  }
} */


.project-modal .modal-content {
  max-width: 60%;
  width: 60%;
  padding: 2rem; /* TOP padding aumentado */
  box-sizing: border-box;
  position: relative;
}
@media screen and (max-width: 767px) {
  .project-modal .modal-content {
    max-width: 90%;
    width: 90%;
  }
}
.modal-header-spacer {
  height: 2rem;
}

@media (max-width: 767px) {
  .project-card {
    flex-direction: column;
    margin-bottom: 1.25rem;
  }

  .project-thumb {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
    border-top-left-radius: var(--radius);
    border-top-right-radius: var(--radius);
  }

  .project-info {
    width: 100%;
    padding: 1rem 1rem 1.25rem; /* más compacto */
  }

  .project-client {
    font-size: 0.75rem;
    margin-bottom: 0.3rem;
  }

  .project-title {
    font-size: 1.2rem;
    line-height: 1.3;
    margin: 0 0 0.75rem;
    width: 100%;
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
  }

  .project-tags {
    margin: 0.5rem 0 0.75rem;
  }

  .tag-pill {
    margin-right: 0.4rem;
    margin-bottom: 0.3rem;
    padding: 0.2rem 0.6rem;
    font-size: 0.7rem;
  }

  .project-open {
    font-size: 0.85rem;
    margin-top: 0.5rem;
  }
}

.project-modal-header .project-client {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted-foreground);
  margin-bottom: 0.25rem;
}

.project-modal-header .modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
}

@media (max-width: 767px) {
  .project-modal-header .project-client {
    font-size: 0.75rem;
  }

  .project-modal-header .modal-title {
    font-size: 1.2rem;
    line-height: 1.3;
  }
}

.result-block {
  margin-bottom: 2rem;
}

.result-block p {
  margin-bottom: 1rem;
}

.media-images {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem; /* antes estaba en 1rem */
  margin-top: 1rem;
}

.media-images {
  gap: 0.5rem;
}

.media-images .media-wrapper {
  flex: 0 1 auto;
  max-width: 100%;
}

@media (max-width: 767px) {
  .media-images .media-wrapper {
    flex: 1 1 100%;
    max-width: 100%;
  }
}


/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Client Section */

.clients-section {
  margin-bottom: 5rem;
}

.clients-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
}

.client-logo-box {
  width: 240px;               /* ancho fijo */
  aspect-ratio: 4 / 3;        /* proporción rectangular */
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  transition: all 0.3s ease;
  box-shadow: none;
  background-color: transparent;
  transition:
    background-color 0.3s ease,
    box-shadow 0.3s ease,
    backdrop-filter 0.3s ease,
    transform 0.3s ease;
}

.client-logo-box:hover {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transform: scale(1.03);
}

[data-theme="light"] .client-logo-box:hover {
  background-color: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .client-logo-box:hover {
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.client-logo {
  height: 50px; /* fija altura para todos */
  width: auto;
  object-fit: contain;
  max-width: 100%;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.logo-dark { display: block; }
.logo-light { display: none; }

[data-theme="dark"] .logo-dark { display: none; }
[data-theme="dark"] .logo-light { display: block; }

.more-box {
  width: 240px;               /* ancho fijo */
  aspect-ratio: 4 / 3;        /* proporción rectangular */
  background-color: transparent;
  border: 1px dotted var(--muted-foreground);
  font-size: 0.95rem;
  text-align: center;
  color: var(--muted-foreground);
  font-weight: 500;
  padding: 1rem;
  border-radius: var(--radius);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.more-box:hover {
  background: rgba(255, 255, 255, 0.01); /* transparencia */
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.2); /* borde sutil translÃºcido */
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1); /* sombra suave */
}

@media (max-width: 767px) {
  .client-logo-box {
    flex: 0 1 calc(50% - 0.75rem); /* 2 por fila con gap */
  }
}

@media (max-width: 767px) {
  .project-open svg {
    width: 1.25rem;
    height: 1.25rem;
  }
}