/* International edition. The same typographic hierarchy, with room to shape each script. */
.language-menu div {
  inset-inline-end: 0;
  inset-inline-start: auto;
  min-width: 10rem;
  width: max-content;
  max-width: calc(100vw - 2rem);
  max-height: min(29rem, 62dvh);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.language-menu a {
  min-height: 2.4rem;
  display: flex;
  align-items: center;
  font-size: .85rem;
  letter-spacing: .02em;
  line-height: 1.4;
}
.language-menu a[aria-current], .language-menu a:focus-visible { color: var(--card); }
html[data-showbook-layout=facets] body:not(.cyber) .showbook-intro a { color: #f2c230; text-underline-offset: .18em; }
.footer-bottom [lang] { display: inline-block; white-space: nowrap; unicode-bidi: isolate; }
[data-shot-count], [data-shot-page] { direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; }
.cyber .cyber-word.cyber-cjk { display: inline; white-space: normal; }

[lang|=zh] { --script-font: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif; }
[lang|=hi] { --script-font: "Nirmala UI", "Noto Sans Devanagari", "Kohinoor Devanagari", sans-serif; }
[lang|=ar] { --script-font: Tahoma, "Geeza Pro", "Noto Sans Arabic", sans-serif; }
[lang|=he] { --script-font: "Arial Hebrew", "Noto Sans Hebrew", Arial, sans-serif; }
[lang|=ru] { --script-font: "Segoe UI", "Noto Sans", Arial, sans-serif; }
:is(html, #mattia-portfolio-preview):is(:lang(zh), :lang(hi), :lang(ar), :lang(he), :lang(ru)) {
  --layout-display: "Layout Bricolage", var(--script-font);
  --serif-display: var(--layout-display);
  --serif-text: Bricolage, var(--script-font);
  --mono: "IBM Plex Mono", var(--script-font);
  --display: var(--serif-display);
  --body: var(--serif-text);
}
.language-menu a:is(:lang(zh), :lang(hi), :lang(ar), :lang(he), :lang(ru)) { font-family: var(--script-font); }
:is(:lang(hi), :lang(ar), :lang(he)) :is(h1,h2,h3,h4,h5,button,summary,figcaption,.eyebrow,.site-menu a,.showbook-line,.place-kicker,.cv-entry-date) {
  letter-spacing: normal;
}
:is(html,#mattia-portfolio-preview):is(:lang(ar), :lang(hi), :lang(he)) :is(h1,h2,h3,h4,h5) {
  line-height: 1.25;
  font-style: normal;
}
:is(html,#mattia-portfolio-preview):is(:lang(ar), :lang(hi), :lang(zh), :lang(he), :lang(ru)) .site-menu a { line-height: 1.4; }
:is(html,#mattia-portfolio-preview):is(:lang(de), :lang(ru)) :is(h1,h2,h3,h4,p) { overflow-wrap: break-word; hyphens: auto; }
:is(html,#mattia-portfolio-preview):lang(zh) :is(h1,h2,h3,h4) { line-break: strict; letter-spacing: normal; }
:is(html,#mattia-portfolio-preview):lang(hi) :is(#article,#blog).journal-refresh :is(h1,h2,h3) {
  line-height: 1.28;
  letter-spacing: normal;
}
:is(html,#mattia-portfolio-preview)[dir=rtl] :is(.site-header .brand,.showbook h1,.cv-contacts a,code,input[type=email],input[type=tel]) { direction: ltr; unicode-bidi: isolate; }
:is(html,#mattia-portfolio-preview)[dir=rtl] :is(.showbook-copy>*,.showbook-grid,.showbook-line,.showbook-intro,.section-head h2,.community-intro h2,.page-heading,.page-heading h1,.page-heading p,.case-heading,.case-heading h1,.case-meta,.site-footer,.footer-top,.footer-signature,.legacy-content td,.legacy-content th,.cv-dialog,#article .article-title,#blog .proc-inner>h1,#blog .proc-sub) {
  text-align: start;
}
:is(html,#mattia-portfolio-preview)[dir=rtl] :is(.page-heading h1,.page-heading p,.footer-signature,#article .article-title) { margin-inline: 0 auto; }
:is(html,#mattia-portfolio-preview)[dir=rtl] .showbook-line { border-left: 0; border-inline-start: .3rem solid var(--e); }
:is(html,#mattia-portfolio-preview)[dir=rtl] .site-menu { margin-left: 0; margin-inline-start: auto; }
:is(html,#mattia-portfolio-preview)[dir=rtl] .brand { margin-right: 0; }
:is(html,#mattia-portfolio-preview)[dir=rtl] .case-meta { grid-template-columns: fit-content(36%) minmax(0,1fr); }
:is(html,#mattia-portfolio-preview)[dir=rtl] .case-meta dd { margin-inline: 0; }
:is(html,#mattia-portfolio-preview)[dir=rtl] .cv-sheet ul { padding-inline: 1.3rem 0; }
html[data-showbook-layout=facets][dir=rtl] body:not(.cyber) .showbook-copy .showbook-line,
[dir=rtl] .closing { text-align: start; }
/* Mirror artwork only: the photograph itself and live UI keep their original orientation. */
html[data-showbook-layout=facets][dir=rtl] body:not(.cyber) .showbook::before,
[dir=rtl] .service-detail::before { transform: scaleX(-1); }
[dir=rtl] .closing { background-image: none; }
[dir=rtl] .closing::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: url("/assets/media/showbook/closing-cubist-mosaic.webp") center/cover no-repeat;
  transform: scaleX(-1); pointer-events: none;
}
[dir=rtl] .cyber .closing::before { background-image: linear-gradient(#0b0e1447,#0b0e1447),url("/assets/media/showbook/closing-cubist-mosaic.webp"); }
@media (min-width: 761px) {
  html[data-showbook-layout=facets][dir=rtl] body:not(.cyber) .folio-mark { inset-inline: 50% -5%; transform: scaleX(-1); }
}
html[data-showbook-layout=facets][dir=rtl] body:not(.cyber) main:has(.project-filter) .page-heading::before,
html[data-showbook-layout=facets][dir=rtl] body:not(.cyber) main:has(.project-filter) .page-heading::after { inset-inline: auto 4%; }
html[data-showbook-layout=facets][dir=rtl] body:not(.cyber) :is(.case-heading,.sol-inner,.proc-inner)::before { inset-inline: auto 0; }
html[data-showbook-layout=facets][dir=rtl] body:not(.cyber) .portrait-section .portrait-grid::before { inset-inline: auto 1%; }
@media (max-width: 900px) {
  :is(html,#mattia-portfolio-preview)[dir=rtl] .site-header .brand { margin-inline-end: auto; }
}
@media (max-width: 600px) {
  :is(html,#mattia-portfolio-preview):is(:lang(de), :lang(ru)) .legacy-content .service-detail > .article-title {
    font-size: clamp(1.65rem, 7.7vw, 2.35rem);
    line-height: 1.15;
    text-wrap: pretty;
    hyphens: auto;
  }
}
