/* ------------------------------------
   Project page layout
------------------------------------ */

.project-page {
  width: 100%;
}

/* ------------------------------------
   Project top info
------------------------------------ */

.project-top {
  padding: 48px var(--page-padding) 135px;
  margin-top: var(--header-spacing);
  align-items: start;
  row-gap: 0;
}

.project-top__label {
  grid-column: 1 / span 4;
}

.project-top__text {
  grid-column: 5 / span 6;
  max-width: 32rem;
}

.project-top__text p {
  font-family: var(--font-serif);
  font-size: var(--fs-serif);
  font-weight: var(--fw-serif);
  line-height: var(--lh-serif);
  letter-spacing: var(--tracking-serif);
}

.project-top__text p + p {
  margin-top: 28px;
}

.project-top__text a {
  font: inherit;
}

.project-top__text a:hover {
  color: var(--color-hover-blue);
}

/* Aside */

.project-top__aside {
  grid-column: 16 / span 3;
  align-self: start;
}

.project-top__cover {
  width: 100%;
  aspect-ratio: 3 / 4;
  margin-bottom: 10px;
  background: var(--color-placeholder);
}

.project-top__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-top__meta {
  width: 100%;
}

/* Filas meta */

.project-top__meta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: start;
}

.project-top__meta-row + .project-top__meta-row {
  margin-top: 4px;
}

.project-top__meta-label {
  font-family: var(--font-sans);
  font-size: var(--fs-sans);
  font-weight: var(--fw-sans);
  line-height: var(--lh-sans);
  letter-spacing: var(--tracking-sans);
}

.project-top__meta-value {
  font-family: var(--font-serif);
  font-size: var(--fs-serif);
  font-weight: var(--fw-serif);
  line-height: var(--lh-serif);
  letter-spacing: var(--tracking-serif);
  text-align: right;
}

/* Créditos */

.project-top__meta-value--credits {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 10px;
  row-gap: 4px;
}

.project-top__meta-value--credits p {
  margin: 0;
}

.project-top__meta-value--credits p:nth-child(odd) {
  font-family: var(--font-sans);
  font-size: var(--fs-sans);
  font-weight: var(--fw-sans);
  line-height: var(--lh-sans);
  letter-spacing: var(--tracking-sans);
  text-align: left;
}

.project-top__meta-value--credits p:nth-child(even) {
  font-family: var(--font-serif);
  font-size: var(--fs-serif);
  font-weight: var(--fw-serif);
  line-height: var(--lh-serif);
  letter-spacing: var(--tracking-serif);
  text-align: right;
}

.project-top__meta-row:last-child {
  margin-top: 12px;
}

/* Créditos: sin salto entre "créditos" y la primera línea */
.project-top__meta-row + .project-top__meta-row.project-top__meta-value--credits {
  margin-top: 1px;
}

/* Separación normal entre líneas de créditos */
.project-top__meta-value--credits + .project-top__meta-value--credits {
  margin-top: 4px;
}

/* ------------------------------------
   Project gallery
------------------------------------ */

.project-gallery {
  padding-bottom: 72px;
}

.gallery-row {
  margin-bottom: 4px;
  padding: 0 var(--page-padding);
}

.gallery-row:last-child {
  margin-bottom: 0;
}

.gallery-item {
  overflow: hidden;
  background: var(--color-placeholder);
}

.gallery-item img,
.gallery-item video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ------------------------------------
   Vertical compositions
------------------------------------ */

/* 3 verticales */
.gallery-row--three-v .col-1 {
  grid-column: 1 / span 6;
  aspect-ratio: 4 / 5;
}

.gallery-row--three-v .col-2 {
  grid-column: 7 / span 6;
  aspect-ratio: 4 / 5;
}

.gallery-row--three-v .col-3 {
  grid-column: 13 / span 6;
  aspect-ratio: 4 / 5;
}

/* 2 verticales en primeras 12 columnas */
.gallery-row--two-v-left .col-1 {
  grid-column: 1 / span 6;
  aspect-ratio: 4 / 5;
}

.gallery-row--two-v-left .col-2 {
  grid-column: 7 / span 6;
  aspect-ratio: 4 / 5;
}

/* 2 verticales en últimas 12 columnas */
.gallery-row--two-v-right .col-1 {
  grid-column: 7 / span 6;
  aspect-ratio: 4 / 5;
}

.gallery-row--two-v-right .col-2 {
  grid-column: 13 / span 6;
  aspect-ratio: 4 / 5;
}

/* 2 verticales en extremos */
.gallery-row--two-v-outer .col-1 {
  grid-column: 1 / span 6;
  aspect-ratio: 4 / 5;
}

.gallery-row--two-v-outer .col-2 {
  grid-column: 13 / span 6;
  aspect-ratio: 4 / 5;
}

/* 1 vertical en primeras 6 */
.gallery-row--one-v-left .col-1 {
  grid-column: 1 / span 6;
  aspect-ratio: 4 / 5;
}

/* 1 vertical en últimas 6 */
.gallery-row--one-v-right .col-1 {
  grid-column: 13 / span 6;
  aspect-ratio: 4 / 5;
}

/* 1 vertical centrada */
.gallery-row--one-v-center .col-1 {
  grid-column: 7 / span 6;
  aspect-ratio: 4 / 5;
}

/* ------------------------------------
   Horizontal compositions
------------------------------------ */

/* 1 horizontal a ancho completo */
.gallery-row--one-h-full .col-1 {
  grid-column: 1 / -1;
  aspect-ratio: 3 / 2;
}

/* 1 horizontal en primeras 12 columnas */
.gallery-row--one-h-left .col-1 {
  grid-column: 1 / span 12;
  aspect-ratio: 3 / 2;
}

/* 1 horizontal en últimas 12 columnas */
.gallery-row--one-h-right .col-1 {
  grid-column: 7 / span 12;
  aspect-ratio: 3 / 2;
}

/* ------------------------------------
   Pagination
------------------------------------ */

.project-pagination {
  padding: 0 var(--page-padding);
}

.project-pagination__prev {
  grid-column: 1 / span 4;
}

.project-pagination__next {
  grid-column: 15 / span 4;
  justify-self: end;
  text-align: right;
}

.project-pagination a:hover {
  color: var(--color-hover-blue);
}

/* ------------------------------------
   Responsive
------------------------------------ */

@media (max-width: 1200px) {
  .project-top {
    padding-bottom: 110px;
  }

  .project-top__text {
    max-width: 36rem;
  }

  .project-top__aside {
    grid-column: 15 / span 4;
  }
}

@media (max-width: 991px) {
  .project-top {
    padding: 32px var(--page-padding) 80px;
    row-gap: 20px;
  }

  .project-top__label {
    grid-column: 1 / span 2;
  }

  .project-top__text {
    grid-column: 5 / span 8;
    max-width: none;
  }

  .project-top__aside {
    grid-column: 14 / span 5;
  }
}

/* ------------------------------------
   MOBILE
------------------------------------ */

@media (max-width: 767px) {
  .project-top {
    padding: 20px var(--page-padding) 56px;
    row-gap: 0;
  }

  .project-top__label {
    grid-column: 1 / -1;
    grid-row: 1;
    margin-bottom: 56px;
  }

  .project-top__aside {
    grid-column: 1 / -1;
    grid-row: 2;
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    column-gap: var(--grid-gap);
    align-items: start;
    margin-bottom: 56px;
  }

  .project-top__text {
    grid-column: 1 / -1;
    grid-row: 3;
    max-width: none;
  }

  .project-top__meta {
    grid-column: 1 / span 6;
    align-self: start;
    order: 1;
  }

  .project-top__cover {
    grid-column: 7 / span 4;
    aspect-ratio: 3 / 4;
    margin-bottom: 0;
    align-self: start;
    order: 2;
  }

  .project-top__meta-row {
    display: block;
  }

  .project-top__meta-row + .project-top__meta-row {
    margin-top: 24px;
  }

  .project-top__meta-row:last-child {
    margin-top: 12px;
  }

  .project-top__meta-label {
    display: block;
    margin-bottom: 4px;
  }

  .project-top__meta-value {
    display: block;
    text-align: left;
  }

  .project-top__meta-value--credits {
    grid-template-columns: 1fr 1fr;
  }

  .project-top__meta-value--credits p:nth-child(even) {
    text-align: left;
  }

  .project-top__text p + p {
    margin-top: 28px;
  }

  /* ------------------------------------
     GALERÍA EN MÓVIL
  ------------------------------------ */

  .project-gallery {
    padding-bottom: 48px;
  }

  .gallery-row {
    margin-bottom: 4px;
    padding: 0 var(--page-padding);
  }

  .gallery-row:last-child {
    margin-bottom: 0;
  }

  .gallery-item {
    overflow: hidden;
  }

  .gallery-item img,
  .gallery-item video {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
  }

  /* Reset general de desktop */
  .gallery-row .gallery-item {
    aspect-ratio: auto !important;
  }

  /* 1. three-v → 10 / 5 / 5 */
  .gallery-row--three-v .col-1 {
    grid-column: 1 / -1;
    margin-bottom: 4px;
  }

  .gallery-row--three-v .col-2 {
    grid-column: 1 / span 5;
  }

  .gallery-row--three-v .col-3 {
    grid-column: 6 / span 5;
  }

  /* 2. two-v-left → 5 / 5 */
  .gallery-row--two-v-left .col-1 {
    grid-column: 1 / span 5;
  }

  .gallery-row--two-v-left .col-2 {
    grid-column: 6 / span 5;
  }

  /* 3. two-v-right → 5 / 5 */
  .gallery-row--two-v-right .col-1 {
    grid-column: 1 / span 5;
  }

  .gallery-row--two-v-right .col-2 {
    grid-column: 6 / span 5;
  }

  /* 4. two-v-outer → 5 / 5 */
  .gallery-row--two-v-outer .col-1 {
    grid-column: 1 / span 5;
  }

  .gallery-row--two-v-outer .col-2 {
    grid-column: 6 / span 5;
  }

  /* 5. one-v-left → 5 izquierda */
  .gallery-row--one-v-left .col-1 {
    grid-column: 1 / span 5;
  }

  /* 6. one-v-right → 5 derecha */
  .gallery-row--one-v-right .col-1 {
    grid-column: 6 / span 5;
  }

  /* 7. one-v-center → 5 centrada */
  .gallery-row--one-v-center .col-1 {
    grid-column: 6 / span 5;
  }

  /* 8. one-h-full → 10 */
  .gallery-row--one-h-full .col-1 {
    grid-column: 1 / -1;
  }

  /* 9. one-h-left → 8 izquierda */
  .gallery-row--one-h-left .col-1 {
    grid-column: 1 / span 8;
  }

  /* 10. one-h-right → 8 derecha */
  .gallery-row--one-h-right .col-1 {
    grid-column: 3 / span 8;
  }

  /* ------------------------------------
     PAGINACIÓN
  ------------------------------------ */

  .project-pagination {
    padding: 0 var(--page-padding);
  }

  .project-pagination__prev {
    grid-column: 1 / span 5;
    text-align: left;
  }

  .project-pagination__next {
    grid-column: 6 / span 5;
    justify-self: end;
    text-align: right;
  }
}