/* ============================================================
   Páginas de categoría — cada una con su propio mundo
   · Colecciones  → el perchero ilustrado, con las piezas en los ganchos
   · Ilustraciones → polaroids con washi tape sobre papel
   · Audiovisual  → el marco de hierro ilustrado
   ============================================================ */

.categoria-cuerpo {
  min-height: calc(100vh - 52px);
  padding: 0.8rem 6vw 2.2rem;
  overflow-x: clip;
}

.categoria-titulo {
  font-family: "Pinyon Script", cursive;
  font-weight: 400;
  font-size: clamp(2.8rem, 7vw, 4.2rem);
  color: var(--vino);
  text-align: center;
}

.categoria-sub {
  text-align: center;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--marron);
  margin: 0.35rem 0 1.1rem;
}

/* ============================================================
   COLECCIONES y AUDIOVISUAL — las escenas ilustradas
   Capas de la diseñadora: la textura va de fondo (uniforme en toda
   la página) y encima el mueble de hierro con sus fichas.
   ============================================================ */
body.fondo-colecciones,
body.fondo-audiovisual {
  background: url("../assets/tex/cat-fondo.webp") no-repeat center / cover fixed #9a6274;
  --nav-bg: #6d3b4b;
  --nav-ink: #f7e7dd;
  --nav-logo: #f0c27f;
}

.fondo-colecciones .categoria-titulo,
.fondo-audiovisual .categoria-titulo { color: #fbeee3; }

.fondo-colecciones .categoria-sub,
.fondo-audiovisual .categoria-sub { color: rgba(251, 238, 227, 0.75); }

/* el mueble marca la caja: todo lo demás se posiciona en % sobre él */
.escena-cat {
  position: relative;
  margin: 0 auto;
}

.escena-cat.perchero { width: min(720px, 94%); aspect-ratio: 1004 / 1359; }
.escena-cat.marco    { width: min(940px, 94%); aspect-ratio: 997 / 1153; }

.escena-cat > .mueble {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

/* ficha colgada en el mueble */
.ficha {
  position: absolute;
  color: #fbeee3;
  text-align: center;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ficha:hover,
.ficha:focus-visible { transform: translateY(-6px) scale(1.04); }

.ficha img {
  width: 100%;
  display: block;
  filter: drop-shadow(0 10px 20px rgba(38, 14, 24, 0.45));
}

.ficha .nombre {
  display: block;
  margin-top: 0.5em;
  font-family: "Pinyon Script", cursive;
  font-size: clamp(0.95rem, 3.2cqw, 1.65rem);
  line-height: 1.05;
  text-shadow: 0 2px 8px rgba(38, 14, 24, 0.5);
}

.escena-cat { container-type: inline-size; }

/* la lámina va recortada al perchero (sin el aire transparente de arriba y de
   los lados), así que los porcentajes son sobre ese recorte: el hombro de la
   prenda cae en la barra de los ganchos */
.perchero .ficha { width: 32.1%; top: 41.5%; }
.perchero .ficha.uno { left: 17.1%; }
.perchero .ficha.dos { left: 51%; }
.perchero .ficha .nombre { font-size: clamp(0.66rem, 2.1cqw, 1.15rem); }

/* el fotograma va dentro del marco, con el formato de la referencia */
.marco .ficha { left: 17.5%; width: 65%; top: 31%; }
.marco .ficha img {
  aspect-ratio: 1.66;
  object-fit: cover;
  border-radius: 6px;
}
.marco .ficha .nombre { font-size: clamp(0.85rem, 4cqw, 1.7rem); }

/* ============================================================
   ILUSTRACIONES — la pared con los cuadros
   Cada proyecto es uno de los marcos que mandó la diseñadora.
   ============================================================ */
body.fondo-ilustraciones {
  background: url("../assets/tex/cat-fondo.webp") no-repeat center / cover fixed #9a6274;
  --nav-bg: #6d3b4b;
  --nav-ink: #f7e7dd;
  --nav-logo: #f0c27f;
}

.fondo-ilustraciones .categoria-titulo,
.fondo-ilustraciones .categoria-sub { display: none; }

.pared {
  position: relative;
  width: min(1000px, 96%);
  margin: 0 auto;
  aspect-ratio: 1000 / 740;
  container-type: inline-size;
}

.pared > * { position: absolute; }
.pared img { width: 100%; display: block; }

/* el marco central lleva el título de la sección */
.pared .titulo-pared {
  container-type: inline-size;
  left: 35%;
  top: 29%;
  width: 30%;
  text-align: center;
  color: #7c2342;
}

.pared .titulo-pared .letras {
  position: absolute;
  left: 10.4%;
  top: 32.9%;
  width: 77.7%;
  height: 37.4%;
  display: grid;
  place-content: center;
  gap: 0.15em;
}

.pared .titulo-pared h1 {
  font-family: "Pinyon Script", cursive;
  font-weight: 400;
  font-size: 13.2cqw;
  line-height: 1;
}

.pared .titulo-pared p {
  font-size: 4cqw;
  letter-spacing: 0.04em;
}

/* los cuadros que enlazan a cada proyecto */
.cuadro {
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 10px 22px rgba(45, 18, 30, 0.4));
}

.cuadro:hover,
.cuadro:focus-visible { transform: translateY(-7px) scale(1.05); }

.cuadro .nombre {
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  margin-top: 0.45em;
  white-space: nowrap;
  font-family: "Pinyon Script", cursive;
  font-size: 2.1cqw;
  color: #fbeee3;
  text-shadow: 0 2px 8px rgba(45, 18, 30, 0.6);
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* el nombre siempre se ve (antes solo al pasar el cursor) */
.cuadro .nombre { opacity: 1; }

.pared .pista {
  left: 37%;
  top: 74%;
  width: 26%;
  margin: 0;
  text-align: center;
  font-size: max(0.78rem, 1.45cqw);
  letter-spacing: 0.02em;
  color: #fbeee3;
  text-shadow: 0 1px 6px rgba(45, 18, 30, 0.55);
}

/* posiciones medidas sobre la referencia */
.cuadro.joyero { left: 17%; top: 8%;  width: 15%; }
.cuadro.paleta { left: 66%; top: 9%;  width: 18%; }
.cuadro.botas  { left: 18%; top: 62%; width: 14%; }
.cuadro.chica  { left: 66%; top: 55%; width: 14.5%; }

/* En celular la pared deja de ser una composición y se vuelve una columna.
   Los hijos pasan a relative (no static): el rótulo del marco se posiciona
   dentro de él, y con static se escapaba y caía sobre los cuadros. */
@media (max-width: 700px) {
  /* los cuadros de dos en dos */
  .pared {
    aspect-ratio: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    justify-items: center;
    align-items: start;
    column-gap: 1rem;
    row-gap: 1.8rem;
  }

  .pared > * {
    position: relative !important;
    left: auto !important;
    top: auto !important;
  }

  .pared .titulo-pared,
  .pared .pista { grid-column: 1 / -1; }
  .pared .titulo-pared { width: min(300px, 84%); }
  /* cada cuadro tiene su forma: se limita el alto para que el más alargado
     (La Tiendita) no salga gigante al lado de los demás */
  .cuadro { width: auto !important; align-self: center; display: block; text-align: center; }
  .cuadro img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 50vw;
    margin: 0 auto;
  }
  /* el de Boots, un poco más pequeño que los demás */
  .cuadro.botas img { max-width: 84%; max-height: 42vw; }

  .cuadro .nombre {
    position: static;
    transform: none;
    opacity: 1;
    display: block;
    margin-top: 0.45rem;
    font-size: 1.05rem;
    text-align: center;
  }
}

/* Entrada suave (solo opacidad: no pisa los transform propios) */
.ficha, .cuadro {
  animation: entrada-suave 0.8s ease backwards;
}

.ficha:nth-of-type(2), .cuadro:nth-of-type(3) { animation-delay: 0.16s; }
.cuadro:nth-of-type(4) { animation-delay: 0.32s; }

@keyframes entrada-suave {
  from { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .ficha, .cuadro { animation: none; }
}

@media (max-width: 700px) {
  .categoria-cuerpo { padding: 0.8rem 3vw 2.4rem; }
  .categoria-titulo { font-size: clamp(2.4rem, 13vw, 3.4rem); }
  .categoria-sub { font-size: 0.68rem; letter-spacing: 0.1em; margin-bottom: 0.9rem; }
  .escena-cat.perchero { width: 98%; }
  .escena-cat.marco { width: 98%; }
  .ficha .nombre { font-size: clamp(0.85rem, 4.4cqw, 1.3rem); }
}

/* ============================================================
   COLECCIONES y AUDIOVISUAL: página fija
   Majo pidió que se vea todo (título, piezas y nombres) sin tener que
   bajar. En pantallas de computador el cuerpo ocupa exactamente el alto
   de la ventana y la escena se escala a lo que quede libre.
   ============================================================ */
.categoria-pista {
  margin: 0 0 0.6rem;
  text-align: center;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: #fbeee3;
}

.pagina-fija .categoria-titulo {
  font-size: clamp(2rem, 3.4vw, 2.7rem);
  line-height: 1.15;
}

.pagina-fija .categoria-sub {
  margin: 0 0 0.35rem;
  font-size: 0.86rem;
  letter-spacing: 0.03em;
  text-transform: none;
  color: #f0c27f;
}

/* nombres de las colecciones en letra de palo, como en la corrección */
.perchero .ficha .nombre {
  font-family: "Questrial", "Poppins", sans-serif;
  font-size: clamp(0.8rem, 2.5cqw, 1.2rem);
  letter-spacing: 0.02em;
  color: #f0c27f;
}

@media (min-width: 701px) and (min-height: 460px) {
  body.pagina-fija {
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .pagina-fija .nav { flex: none; }

  .pagina-fija .categoria-cuerpo {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 0.7rem 6vw 0;
  }

  .pagina-fija .escena-caja {
    flex: 1;
    min-height: 0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow: hidden;
  }

  .pagina-fija .escena-cat { flex: none; width: auto; max-width: 94vw; }

  /* del perchero basta con ver hasta los nombres (74 % de su alto);
     del marco se ve entero */
  .pagina-fija .escena-cat.perchero { height: calc(100% / 0.8); }
  .pagina-fija .escena-cat.marco { height: calc(100% - 0.8rem); }
}

@media (max-width: 700px) {
  .pagina-fija .categoria-titulo { font-size: 2.1rem; }
  .pagina-fija .categoria-sub { margin-bottom: 0.1rem; font-size: 0.78rem; }
  .categoria-pista { font-size: 0.74rem; margin-bottom: 0.2rem; }
  .pagina-fija .categoria-cuerpo { padding-top: 0.3rem; }
  .perchero .ficha .nombre { font-size: 0.72rem; }
  .pared .pista { font-size: 0.86rem; width: min(300px, 84%) !important; }
}
