/* Reset mínimo */
* {
  box-sizing: border-box;
}

.description-section {
  position: relative;
  display: flex;
  align-items: center;
  text-align: left;
  padding: 50px 30px 0px;
  z-index: 3;
}

.description-content {
  position: relative;
  color: var(--color-text);
  font-family: var(--font-paragraph);
}

.description-content h1 {
  position: relative;
  color: var(--color-text);
  font-size: clamp(36px, 6vw, 70px);
  font-weight: 100;
  padding-bottom: 30px;
}

.description-content p {
  position: relative;
  left: 5px;
  color: var(--color-text);
  font-size: clamp(18px, 2.2vw, 35px);
  font-weight: 100;
  padding-bottom: 40px;
}

.description-content a {
  text-decoration: none;
}

@media (max-width: 768px) {
  .description-section {
    padding: 25px 15px 0px;
  }

  .description-content h1 {
    padding-bottom: 10px;
  }

  .description-content p {
    left: 0px;
    padding-bottom: 20px;
  }
}

/* Contenedor principal */
.project-section {
  width: 100%;
  margin: auto;
  position: relative;
  overflow: visible;
  padding: 0px 30px;
  box-sizing: border-box;
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  transition: padding-top 0.3s ease;
  display: flex;
  flex-direction: column;
  z-index: 2; /* ↓ ajustado */
}

/* Header fijo */
.project-header {
  font-family: var(--font-Monstserrat-ExtraLight);
  font-weight: bold;
  border: none;
  outline: none;
  padding: 20px 30px 20px 15px;
  color: var(--color-text);
  font-size: clamp(18px, 2.5vw, 28px);
  display: flex;
  align-items: center;
  cursor: pointer;
  text-align: left;
  position: sticky;
  top: 110px;
  left: 0;
  z-index: 3; /* ↓ antes era 5 */
  background-color: rgba(var(--color-bg-rgb), 0.7);
  height: max-content;
  width: fit-content;
  border: 1px solid var(--color-text);
  margin-bottom: 50px;
}

/* Cuando el menú esté oculto */
.menu.is-hidden ~ .project-section .project-header {
  top: 0px;
}

.project-title {
  font-family: var(--font-paragraph);
  font-weight: 100;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

/* Icono (+) */
.project-header .icon {
  font-size: clamp(30px, 4vw, 44px);
  line-height: 0.5 !important;
  display: inline-grid;
  place-items: center;
  width: 1em;
  height: 1em;
  background-color: transparent;
  background: transparent;
}

.project-header.open {
  padding: 20px 30px 20px 15px;
  border: 1px solid var(--color-text);
  max-width: fit-content;
  margin-bottom: 10px;
}

/* Rotación del icono al abrir */
.project-header.open .icon {
  transform: rotate(45deg);
}

.project-header.relative {
  position: relative !important;
  z-index: auto;
  width: 100%;
}

/* --------------------------
   MEDIA GRID
   -------------------------- */
.media-grid {
  position: relative;
  padding-top: 0px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  overflow: visible;
  opacity: 1;
  height: auto;
  transition:
    opacity 400ms ease,
    max-height 400ms ease;
  z-index: 2; /* ↑ añadido */
}

.media-item {
  background: var(--color-text);
  flex: 1 1 100%;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  aspect-ratio: 16/9;
  background-color: var(--color-text);
}

.media-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-process {
  width: 100%;
  height: 100%;
}
.video-process video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.video-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-color: var(--color-text);
  height: 100vh;
}

.video-background {
  width: 100%;
  height: 100%;
}
.video-background video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-grid.collapsed {
  opacity: 0;
  max-height: 0;
  pointer-events: none;
  display: none;
}

/* --------------------------
   PROJECT-INFO
   -------------------------- */
.project-info {
  position: relative;
  background: var(--color-bg);
  color: var(--color-text);
  box-sizing: border-box;
  opacity: 0;
  visibility: hidden;
  height: 0;
  overflow: hidden;
  transition:
    opacity 400ms ease,
    height 0s linear 400ms,
    visibility 0s linear 400ms;
  z-index: 3;
}

.project-info.open {
  opacity: 1;
  visibility: visible;
  height: auto;
  transition: opacity 400ms ease;
}

.project-info .info-content {
  display: flex;
  flex-direction: column;
  padding: 20px 25px;
  font-family: var(--font-paragraph);
  color: var(--color-text);
}

.project-info h2,
.project-info h3 {
  font-size: clamp(20px, 3vw, 32px);
  margin: 0;
  font-family: var(--font-title);
  color: var(--color-text);
  letter-spacing: 0.2px;
  padding-bottom: 20px;
}

.project-info p {
  font-family: var(--font-paragraph);
  font-size: clamp(18px, 2.8vw, 26px);
  font-weight: 100;
  line-height: 1.3;
  color: var(--color-text);
  position: relative;
}

.project-info p .bullet {
  font-size: clamp(18px, 3.4vw, 34px);
  margin-right: 2px;
  line-height: 1;
  position: relative;
  top: 5px;
}

.info-box {
  position: relative;
  padding-bottom: 20px;
}

/* --------------------------
   Responsive ajustes
   -------------------------- */
@media (max-width: 768px) {
  .video-item {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: var(--color-text);
    aspect-ratio: 1/1;
    height: auto;
  }

  .project-section {
    padding: 0px 15px 30px;
  }
  .project-header {
    padding: 10px 15px 10px 5px;
    top: 85px;
    transition: top 0.3s ease;
    margin-bottom: 25px;
  }

  .project-header.open {
    padding: 10px 15px 10px 5px;
    transition: top 0.3s ease;
  }

  .menu.is-hidden ~ .project-section .project-header {
    top: 0px;
  }

  .media-grid {
    padding-top: 0px;
  }

  .media-item {
    background: var(--color-text);
    flex: 1 1 100%;
    width: 100%;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
  }

  .media-item.process {
    background: var(--color-text);
    flex: 1 1 100%;
    width: 100%;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    aspect-ratio: 2/3;
    background-color: var(--color-text);
    max-height: 90vh;
  }

  .project-info .info-content {
    padding: 10px 10px;
  }

  .project-info h2,
  .project-info h3 {
    padding-bottom: 10px;
  }
}

@media (max-width: 425px) {
  .menu.is-hidden ~ .project-section .project-header {
    top: 0px;
  }

  .media-grid {
    padding-top: 0px;
  }

  .project-header .icon {
    position: relative;
    bottom: 2px;
  }
}
/* CONTENEDOR VERTICAL */
.media-item.vertical,
.media-item[data-orientation="vertical"] {
  aspect-ratio: auto !important;
  height: auto !important;
  /* ESTOS CAMBIOS FUERZAN EL FLUJO NORMAL */
  flex: 0 0 auto !important; /* Fuerza a ignorar flex: 1 1 100% */
  min-height: 0 !important; /* Fuerza a ignorar min-height: 150px */
  max-height: none !important; /* Fuerza a ignorar max-height: 90vh */

  display: flex;
  flex-direction: column;
  background: transparent;
  padding: 0;
}

/* WRAPPER – Desktop: 3 columnas */
.media-item.vertical .vertical-images-wrapper,
.media-item[data-orientation="vertical"] .vertical-images-wrapper {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 24px;
  width: 100%;
}

/* IMÁGENES – 3 columnas */
.media-item.vertical .vertical-images-wrapper img[data-responsive],
.media-item[data-orientation="vertical"]
  .vertical-images-wrapper
  img[data-responsive] {
  width: calc((100% - 48px) / 3);
  flex: 0 0 calc((100% - 48px) / 3);
  height: auto;
  object-fit: cover;
  display: block;
}

/* ================================
 📱 RESPONSIVE < 768px
 ================================ */
@media (max-width: 768px) {
  /* Las imágenes pasan a una columna vertical */
  .media-item.vertical .vertical-images-wrapper,
  .media-item[data-orientation="vertical"] .vertical-images-wrapper {
    flex-direction: column;
    gap: 12px;
  }

  /* Cada imagen ocupa el 100% */
  .media-item.vertical .vertical-images-wrapper img[data-responsive],
  .media-item[data-orientation="vertical"]
    .vertical-images-wrapper
    img[data-responsive] {
    width: 100% !important;
    flex: 0 0 auto !important;
    height: auto;
  }
}
