/* Language menu and Japanese text for every page of apps.gravitatech.com (1 Nov 2026, the Project Director's 6b and 1a).
   The button keeps each app's own .lang look (its class is copied from the link it replaces); this file adds the icon,
   the list and the Japanese font rules. Colours fall back to PDF Tools' own variables (--c-...). */
.lang-menu{position:relative;flex:0 0 auto;display:inline-flex}
.lang-menu button.lang{gap:6px;background:none;color:var(--text,var(--c-text));font:inherit;font-weight:700;cursor:pointer}
.lang-menu .lang svg{width:18px;height:18px;flex:0 0 auto;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.lang-menu .lang .i-chev{width:16px;height:16px;transition:transform .2s}
.lang-menu .lang[aria-expanded="true"] .i-chev{transform:rotate(180deg)}
.lang-menu .lang-list{position:absolute;right:0;top:calc(100% + 8px);z-index:80;display:flex;flex-direction:column;gap:2px;min-width:200px;margin:0;padding:6px;list-style:none;background:var(--bg,var(--c-surface,#fff));border:1px solid var(--line,var(--c-line,#d6dbe6));border-radius:12px;box-shadow:0 10px 28px rgba(12,24,68,.14)}
.lang-menu .lang-list[hidden]{display:none}
.lang-menu .lang-list li{margin:0}
.lang-menu .lang-list a{display:block;padding:10px 12px;border:0;border-radius:8px;font-weight:400;white-space:nowrap;text-decoration:none;color:var(--text,var(--c-text))}
.lang-menu .lang-list a:hover{background:color-mix(in srgb,var(--text,var(--c-text,#0c1844)) 7%,transparent)}
.lang-menu .lang-list a[aria-current="true"]{font-weight:700;background:color-mix(in srgb,var(--text,var(--c-text,#0c1844)) 9%,transparent)}
/* inside a phone menu sheet the list opens in place */
@media (max-width:960px){.nav .lang-menu{flex-direction:column;align-self:flex-start}.nav .lang-menu .lang-list{position:static;margin-top:8px;box-shadow:none}.nav .lang-menu .lang-list a{padding:12px}}
.legal .lang-foot + .lang-foot{margin-left:0}

/* header room (measured 1 Nov 2026). App pages also carry "All apps" in the header row: there the language button shows
   the globe only on wide screens (the current language stays in its label and is marked in the list), in every language. */
.lang-menu .lang .lm-hide,
.site-header:has(.all-apps) .lang-menu .lang span{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
@media (max-width:960px){.site-header:has(.all-apps) .lang-menu .lang span{position:static;width:auto;height:auto;overflow:visible;clip-path:none}}
.site-header:has(.all-apps) .lang-menu button.lang{padding-inline:10px}
/* Japanese menu words are wider: on app pages the theme and Share buttons show their icons only, and on the gallery the
   language button is globe-only from 961 to 1099 px, as on gravitatech.com */
html:lang(ja) .site-header :is(.gtheme-t,.gshare-t){position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
@media (min-width:1100px){html:lang(ja) .site-header:has(.all-apps) .nav ul{gap:10px}}
@media (min-width:961px) and (max-width:1099px){html:lang(ja) .site-header:has(.all-apps) .nav ul{gap:4px}html:lang(ja) .site-header:has(.all-apps) .nav ul a{font-size:16px}}
@media (min-width:961px) and (max-width:1099px){
  html:lang(ja) .lang-menu .lang span{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
  html:lang(ja) .nav .lang-menu button.lang{padding-inline:10px}
}

/* Japanese pages: Latin letters keep Carlito, Japanese characters use the system's Japanese fonts (Japanese-first stack) */
:root:lang(ja){--font:"Carlito","Hiragino Sans","Hiragino Kaku Gothic ProN","Yu Gothic UI","Yu Gothic","Meiryo","Noto Sans JP",sans-serif}
html:lang(ja) body{line-break:strict;text-autospace:normal;word-break:auto-phrase}
html:lang(ja) :is(h1,h2,h3,h4,.btn,button,nav a){word-break:auto-phrase}
html:lang(ja) :is(em,i,cite){font-style:normal}
html:lang(ja) :is(h1,h2,h3,h4){text-wrap:balance}
html:lang(ja) :is(p,li,dd,figcaption){text-wrap:pretty}
html:lang(ja) [lang="en"],html:lang(ja) [lang="id"]{line-break:auto;word-break:normal}
