/* Reset mínimo */
* {
  box-sizing: border-box;
}

/* Contenedor principal */
.project-section {
  width: 100%;
  margin: auto;
  position: relative;
  overflow: visible;
  padding: 110px 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: 3;
}

/* Header fijo */
.project-header {
  font-family: var(--font-Monstserrat-ExtraLight);
  font-weight: bold;
  border: none;
  outline: none;
  padding: 20px 30px 20px 45px;
  color: var(--color-text);
  font-size: clamp(18px, 2.5vw, 28px);
  display: flex;
  align-items: center; /* centra verticalmente */
  cursor: pointer;
  text-align: left;
  position: fixed;
  left: 0;
  z-index: 5;
  background-color: rgba(var(--color-bg-rgb), 0.7);
  height: max-content;
}

.project-header {
  top: 110px; /* Ajusta según la altura de tu menú */
  transition: top 0.3s ease;
}

/* Cuando el menú esté oculto */
.menu.is-hidden ~ .project-section .project-header {
  top: 0px; /* Se posiciona más arriba */
}

.project-title {
  font-family: var(--font-paragraph);
  font-weight: 100;
  line-height: 1; /* <-- antes estaba en 1.8 */
  display: inline-flex;
  align-items: center;
}

/* Icono (+) */
.project-header .icon {
  font-size: clamp(30px, 4vw, 44px);
  line-height: 0.5 !important; /* fuerza altura exacta del glifo */
  display: inline-grid;
  place-items: center;
  width: 1em; /* caja cuadrada proporcional al texto del header */
  height: 1em;
  background-color: transparent;
  background: transparent;
}

.project-header.open {
  top: auto;
  padding: 20px 30px 20px 15px;
  border: 1px solid var(--color-text);
  max-width: fit-content;
}

/* Rotación del icono al abrir */
.project-header.open .icon {
  transform: rotate(45deg);
}

.project-header.relative {
  position: relative !important; /* sobreescribe el fixed */
  z-index: auto; /* opcional: deja de estar encima de todo */
  width: 100%; /* para que ocupe el ancho normal */
}

/* --------------------------
   MEDIA GRID: colapsable con fade
   -------------------------- */
.media-grid {
  position: relative;
  padding-top: 0px;
  display: flex;
  flex-direction: column; /* fuerza disposición por columna */
  gap: 8px;
  width: 100%;
  overflow: hidden;
  transition: opacity 400ms ease, max-height 400ms ease;
  opacity: 1;
  height: fit-content;
}

.media-item {
  background: var(--color-text);
  flex: 1 1 100%; /* cada item ocupa el 100% */
  width: 100%; /* asegura ancho completo */
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  aspect-ratio: 16/9;
  background-color: var(--color-text);
  max-height: 90vh;
}

.media-item img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* se recorta pero mantiene proporciones */
  display: block;
}

.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: fade in/out
   -------------------------- */
.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;
}

/* Contenido interno */
.project-info .info-content {
  display: flex;
  flex-direction: column;
  padding: 20px 25px;
  font-family: var(--font-paragraph);
  color: var(--color-text);
}

/* tipografías internas */
.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); /* tamaño del punto */
  margin-right: 2px; /* espacio entre el punto y el texto */
  line-height: 1; /* centrado vertical */
  position: relative;
  top: 5px;
}

.info-box {
  position: relative;
  padding-bottom: 20px;
}

/* --------------------------
   Responsive ajustes
   -------------------------- */
@media (max-width: 768px) {
  .project-section {
    padding: 85px 15px 30px;
  }
  .project-header {
    padding: 10px 20px 10px 20px;
    top: 85px; /* Ajusta según la altura de tu menú */
    transition: top 0.3s ease;
  }

  .project-header.open.relative {
    padding: 10px 20px 10px 5px;
    transition: top 0.3s ease;
  }
  /* Cuando el menú esté oculto */
  .menu.is-hidden ~ .project-section .project-header {
    top: 0px; /* Se posiciona más arriba */
  }

  .media-grid {
    padding-top: 0px;
  }

  .media-item {
    background: var(--color-text);
    flex: 1 1 100%; /* cada item ocupa el 100% */
    width: 100%; /* asegura ancho completo */
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
  }

  .project-info .info-content {
    padding: 10px 10px;
  }

  .project-info h2,
  .project-info h3 {
    padding-bottom: 10px;
  }
}

@media (max-width: 425px) {
  /* Cuando el menú esté oculto */
  .menu.is-hidden ~ .project-section .project-header {
    top: 0px; /* Se posiciona más arriba */
  }

  .media-grid {
    padding-top: 0px;
  }

  .project-header .icon {
    position: relative;
    bottom: 2px;
  }
}
