/* ES / IT shares the existing navigation face and leaves the artwork grid intact. */
html.i18n-pending body { visibility: hidden; }
.language-switch {
  position: absolute;
  top: 24px;
  left: calc(var(--sidebar) + 18px);
  right: auto;
  display: flex;
  align-items: center;
  gap: 2px;
  color: var(--ink);
  font: 100 12px / 1 var(--navigation);
}
.language-switch a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  min-height: 30px;
  text-decoration: none;
}
.language-switch a[aria-current="true"], .language-switch a:hover {
  text-decoration: underline;
  text-decoration-color: rgba(0, 0, 0, .5);
  text-decoration-thickness: .5px;
  text-underline-offset: 4px;
}
.language-switch-separator { opacity: .5; }
@media (max-width: 1024px), (max-width: 1366px) and (hover: none) and (pointer: coarse) {
  .site-header .wordmark { min-width: 0; }
  .language-switch {
    position: static;
    flex: none;
    gap: 0;
    margin: 0 12px 0 14px;
  }
  .language-switch a { min-height: 44px; min-width: 28px; }
}
/* The opening artwork stays unchanged; only the language choice remains available. */
.intro-mode .site-header { display: block; position: static; height: 0; padding: 0; background: none; }
.intro-mode .site-header > :not(.language-switch) { display: none; }
.intro-mode .language-switch { position: absolute; top: 20px; right: var(--gutter); margin: 0; }

/* Preserve the author’s deliberate line break in the supplied Italian quotation. */
html[lang="it"] .imaginada-editorial-project .vacia-quote p { white-space: pre-line; }

/* Bosque only: match the other quotations' justified column and right-aligned last line.
   Avoid a lone final word without balancing every line to the same length. */
.bosque-editorial-project .bosque-quote p {
  text-wrap: pretty;
  text-align: justify;
  text-align-last: right;
}

/* Emphasize “fare casa” only in the Italian text of Il bosco addomesticato. */
.bosque-fare-casa { font-style: normal; }
html[lang="it"] .bosque-fare-casa { font-style: italic; }

/* The last two Italian paragraphs render inline to avoid an artificial break.
   Their own paragraph alignment no longer applies while inline, so align the
   containing text column exactly like the preceding justified paragraphs. */
html[lang="it"] .migra-editorial-project .vacia-story-copy {
  text-align: justify;
  text-align-last: left;
}

/* La casa che migra: in Italian, continue “La leggerezza” on the same
   text flow after “nello spazio.”; retain Spanish paragraphing. */
html[lang="it"] .migra-editorial-project .vacia-story-copy p:nth-child(3),
html[lang="it"] .migra-editorial-project .vacia-story-copy p:nth-child(4) {
  display: inline;
}
html[lang="it"] .migra-editorial-project .vacia-story-copy p:nth-child(4)::before {
  content: " ";
  white-space: pre;
}

/* Sei passato di qui?: retain continuous prose through “stampa.” /
   “impresión.”, then start a new paragraph only for the artist's book.
   The Spanish opening paragraph keeps its existing break. */
html[lang="it"] .pdf-project[data-project="sei-passato-di-qui"] :is(.pdf-flow-body, .pdf-mobile-copy) > p:nth-of-type(-n+4),
html[lang="es"] .pdf-project[data-project="sei-passato-di-qui"] :is(.pdf-flow-body, .pdf-mobile-copy) > p:nth-of-type(n+2):nth-of-type(-n+4) {
  display: inline;
  margin: 0;
}
html[lang="it"] .pdf-project[data-project="sei-passato-di-qui"] :is(.pdf-flow-body, .pdf-mobile-copy) > p:nth-of-type(n+2):nth-of-type(-n+4)::before,
html[lang="es"] .pdf-project[data-project="sei-passato-di-qui"] :is(.pdf-flow-body, .pdf-mobile-copy) > p:nth-of-type(n+3):nth-of-type(-n+4)::before {
  content: " ";
  white-space: pre;
}

/* Sei passato di qui?: one full empty line after “osservazione.” /
   “observación.” before the artist-book paragraph, on both layouts. */
.pdf-project[data-project="sei-passato-di-qui"] :is(.pdf-flow-body, .pdf-mobile-copy) > p:nth-of-type(5) {
  margin-top: 1.3em;
}
