/* Merorme — the four languages of the home and support pages (B-29).
   The language switcher in the footer, and the type of the Japanese, French and Spanish pages.
   System faces only, as in site.css: nothing is downloaded. */

/* ---- The language switcher (every home and support page) ---- */
.lang-switch { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; margin-top: 18px; }
.lang-switch > svg { width: 18px; height: 18px; flex: none; color: var(--text-2); }
.lang-switch ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 6px; }
.lang-switch a {
  display: inline-block;
  padding: 7px 12px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: var(--fs-small);
  color: var(--text);
}
.lang-switch a:hover { background: var(--surface); }
.lang-switch a[aria-current="page"] { border-color: currentColor; }

/* The footer's links run longer in French, Spanish and Japanese: they wrap in their own column instead of
   squeezing the brand column (site.css sizes that column "auto") */
@media (min-width: 700px) {
  .footer-grid:has(.lang-switch) { grid-template-columns: minmax(22rem, 1fr) auto; }
  html:not([lang="en"]) .footer-grid { grid-template-columns: minmax(22rem, 1fr) minmax(0, 1.5fr); }
}

/* A short phrase kept on one line while it fits (Japanese headings) */
.nw { display: inline-block; max-width: 100%; }

/* ---- Japanese: the system's Japanese faces, strict line breaking, no italics ---- */
html[lang="ja"] {
  --sans: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", system-ui, -apple-system, sans-serif;
  --display: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", system-ui, -apple-system, sans-serif;
  --serif: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
  --rounded: "Hiragino Maru Gothic ProN", "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;
  /* Every kana and kanji is a full em wide: the display sizes come down so a phrase fits its column */
  --fs-hero: clamp(2rem, 1rem + 3vw, 3.4rem);
  --fs-h2: clamp(1.75rem, 1rem + 2.2vw, 2.9rem);
  --fs-h3: clamp(1.15rem, 1.02rem + .45vw, 1.4rem);
  --fs-lede: clamp(1.05rem, 1rem + .3vw, 1.2rem);
}
html[lang="ja"] body { line-break: strict; overflow-wrap: break-word; }
html[lang="ja"] :is(h1, h2, h3, .eyebrow, .lede, .statement-text, .story b, .story span, .tab span, .btn, .store-btn, figcaption, dt, dd) {
  word-break: auto-phrase;
}
html[lang="ja"] .h-hero, html[lang="ja"] .h2 { letter-spacing: .01em; line-height: 1.32; font-feature-settings: "palt"; }
html[lang="ja"] .h3, html[lang="ja"] h3 { letter-spacing: .02em; line-height: 1.5; }
html[lang="ja"] .serif-em { font-style: normal; font-weight: 600; letter-spacing: .02em; }
html[lang="ja"] .h-hero .serif-em { display: block; }
html[lang="ja"] em { font-style: normal; font-weight: 700; }
html[lang="ja"] .eyebrow { letter-spacing: .08em; text-transform: none; }
html[lang="ja"] :is(.lede, .statement-text) { line-height: 1.85; }
html[lang="ja"] .statement-text { letter-spacing: .02em; }
html[lang="ja"] .doc-title { font-size: clamp(1.7rem, 1rem + 2.6vw, 3.1rem); line-height: 1.3; letter-spacing: .01em; }
html[lang="ja"] .doc-eyebrow { letter-spacing: .08em; }

/* ---- Mero's cards: the translated titles run longer than "First grid" ---- */
@supports (font-size: 1cqi) {
  html:is([lang="ja"], [lang="fr"], [lang="es"]) .mcard-top b { font-size: 6cqi; }
}

/* ---- The language menu at the top of every page (a disclosure: keyboard and screen reader work natively) ---- */
.lang-menu { position: relative; }
.lang-menu > summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 12px 0 10px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: 600 var(--fs-small)/1 var(--sans);
  white-space: nowrap;
  cursor: pointer;
}
.lang-menu > summary::-webkit-details-marker { display: none; }
.lang-menu > summary svg { width: 18px; height: 18px; flex: none; }
.lang-menu > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.lang-menu > ul {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 80;
  min-width: 11rem;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 16px;
  box-shadow: var(--shadow-float);
}
.lang-menu a {
  display: block;
  padding: 11px 14px;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}
.lang-menu a:hover, .lang-menu a:focus-visible { background: var(--bg); }
.lang-menu a[aria-current]::after { content: "  ✓"; color: var(--accent); }
@media (max-width: 420px) {
  .lang-menu > summary { padding: 0 10px 0 9px; }
}

/* ---- The app's own note on a translated legal text ("this translation is provided for your convenience…") ---- */
.doc-notice { color: var(--text-2); font-size: var(--fs-small); }
