/* casama.ai in other languages (docs/LOCALIZATION-PLAN.md §4.7): the language menu, the
   suggestion bar, the note on pages that aren't translated, fonts, and room for longer text.
   site/build.mjs links this once a language is published. English pages only use the first part. */

/* ---------------------------------------------------------------- the menu */
.lang-menu { position: relative; }
.lang-menu summary { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; font: 700 var(--fs-small, 15px)/1 var(--font-sans); white-space: nowrap; cursor: pointer; list-style: none; }
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary svg { flex: none; }
.lang-menu ul { position: absolute; top: calc(100% + 8px); right: 0; z-index: 60; min-width: 210px; max-height: min(70vh, 520px); overflow: auto; margin: 0; padding: 6px; list-style: none; background: var(--bg); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 12px 32px rgba(20, 10, 30, .16); }
.lang-menu ul a { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 40px; padding: 0 12px; border-radius: 10px; font-size: var(--fs-small, 15px); text-decoration: none; }
.lang-menu ul a:hover, .lang-menu ul a:focus-visible { background: var(--bg-2); }
.lang-menu a[aria-current], .lang-row a[aria-current] { font-weight: 700; }
.lang-done { color: var(--good, #1f7a4d); font-size: 13px; }
/* The header has one button more: it closes up so the links stay on one line, and on smaller
   screens "Get Casama" stays on screen. */
.site-header .header-inner { gap: 18px; }
.site-header .site-nav { gap: 18px; }
.site-header .site-nav a { white-space: nowrap; }
.site-header .header-cta { gap: 12px; }
/* With site.js the header measures what fits (site.css, .is-tight / .is-compact); without it the
   links hide below this width. */
@media (max-width: 1180px) {
  .site-header:not(.has-menu) .site-nav { display: none; }
  .site-header:not(.has-menu) .header-inner > .header-cta { margin-left: auto; }
}
@media (max-width: 860px) {
  .site-header:not(.has-menu) .header-gh-label { display: none; }
  .site-header:not(.has-menu) .header-gh { padding: 6px 9px; }
}
@media (max-width: 480px) {
  .site-header .header-inner { gap: 12px; }
  .site-header .header-cta { gap: 8px; }
  .site-header .brand-word { display: none; }
}
@media (max-width: 360px) { .site-header .header-gh { display: none; } }
.lang-row { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 20px; }
.lang-row a { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; font-size: var(--fs-small, 15px); }
@media (max-width: 600px) {
  .lang-menu summary { padding: 0 9px; }
  .lang-menu .lang-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}
/* On a narrow phone the menu opens from the screen's edge, not from its button. */
@media (max-width: 480px) { .lang-menu { position: static; } .lang-menu ul { top: calc(var(--header-h, 68px) - 6px); right: 16px; } .header-inner { position: relative; } }

/* ---------------------------------------------------------------- the bar and the note */
.lang-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 16px; padding: 10px 56px 10px 16px; position: relative; background: var(--accent-soft); border-bottom: 1px solid var(--line); font-size: var(--fs-small, 15px); }
.lang-bar p { margin: 0; }
.lang-bar-close { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: inherit; font-size: 22px; line-height: 1; cursor: pointer; }
.lang-note { margin-top: 16px; color: var(--ink-2, var(--muted)); font-size: var(--fs-small, 15px); }

/* ---------------------------------------------------------------- letters the main fonts lack */
@font-face { font-family: "Google Sans"; src: url("/assets/fonts/GoogleSans-Regular-ext.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0100-024F, U+0259, U+0300-036F, U+1E00-1EFF, U+20A0-20C0, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Google Sans"; src: url("/assets/fonts/GoogleSans-Medium-ext.woff2") format("woff2"); font-weight: 500 600; font-display: swap; unicode-range: U+0100-024F, U+0259, U+0300-036F, U+1E00-1EFF, U+20A0-20C0, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Google Sans"; src: url("/assets/fonts/GoogleSans-Bold-ext.woff2") format("woff2"); font-weight: 700; font-display: swap; unicode-range: U+0100-024F, U+0259, U+0300-036F, U+1E00-1EFF, U+20A0-20C0, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Libre Baskerville"; src: url("/assets/fonts/LibreBaskerville-Regular-ext.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0100-024F, U+0259, U+0300-036F, U+1E00-1EFF, U+20A0-20C0, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Libre Baskerville"; src: url("/assets/fonts/LibreBaskerville-Bold-ext.woff2") format("woff2"); font-weight: 700; font-display: swap; unicode-range: U+0100-024F, U+0259, U+0300-036F, U+1E00-1EFF, U+20A0-20C0, U+2C60-2C7F, U+A720-A7FF; }

/* Libre Baskerville has no Vietnamese, and JetBrains Mono here has neither Vietnamese nor Turkish:
   a system face draws the whole word instead of single letters. The wordmark stays. */
:lang(vi) { --font-serif: Georgia, "Times New Roman", serif; --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
:lang(tr) { --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
/* Chinese, Japanese and Korean: the system's own faces, each language its own so shared characters
   are drawn the way its readers expect. Headings use the sans face. */
:lang(ja) { --font-sans: "Google Sans", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", Meiryo, "Noto Sans CJK JP", "Noto Sans JP", system-ui, sans-serif; }
:lang(ko) { --font-sans: "Google Sans", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans CJK KR", "Noto Sans KR", system-ui, sans-serif; }
:lang(zh-Hans) { --font-sans: "Google Sans", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", "Noto Sans SC", system-ui, sans-serif; }
:lang(zh-Hant) { --font-sans: "Google Sans", "PingFang TC", "Microsoft JhengHei UI", "Microsoft JhengHei", "Noto Sans CJK TC", "Noto Sans TC", system-ui, sans-serif; }
:lang(ja), :lang(ko), :lang(zh) { --font-serif: var(--font-sans); --font-mono: var(--font-sans); }
[lang="ja"], [lang="ko"], [lang|="zh"] { font-family: var(--font-sans); }
/* The font shorthand on body and headings is worked out where it is set, so say the family again. */
:root:lang(ja) body, :root:lang(ko) body, :root:lang(zh) body { font-family: var(--font-sans); }
.brand, .brand-word { --font-serif: "Libre Baskerville", Georgia, serif; }
/* Tight Latin tracking squeezes CJK characters together. */
:root:lang(ja) :is(h1, h2, h3, .price, .btn), :root:lang(ko) :is(h1, h2, h3, .price, .btn), :root:lang(zh) :is(h1, h2, h3, .price, .btn) { letter-spacing: normal; }
:root:lang(ja) .hero h1, :root:lang(ko) .hero h1, :root:lang(zh) .hero h1 { line-height: 1.2; }
:root:lang(ja) body { line-break: strict; }
:root:lang(ko) body { word-break: keep-all; overflow-wrap: break-word; }

/* ---------------------------------------------------------------- room for longer text */
html[data-i18n] :is(h1, h2, h3, h4, p, li, dt, dd, th, td, figcaption, summary, label) { overflow-wrap: break-word; }
/* Buttons wrap instead of pushing the page wider. */
html[data-i18n] .btn { white-space: normal; text-align: center; line-height: 1.25; padding-block: 8px; }
html[data-i18n] :is(.store-text b, .wl-inline .btn, .header-gh, .reel figcaption .text-link) { white-space: normal; }
html[data-i18n] .store-text { min-width: 0; }
html[data-i18n] .header-cta .btn { white-space: nowrap; }
/* Without site.js, longer link names take a second line in the header instead of pushing the
   buttons off it. With it, the header measures and folds the links into its menu (site.css). */
html[data-i18n] .site-header:not(.has-menu) .header-inner { height: auto; min-height: var(--header-h); padding-block: 6px; }
html[data-i18n] .site-header:not(.has-menu) .site-nav { flex: 1 1 0; min-width: 0; flex-wrap: wrap; justify-content: flex-end; gap: 0 16px; }
html[data-i18n] .site-header:not(.has-menu) .site-nav a { padding: 4px 0; }
html[data-i18n] .site-header:not(.has-menu) .header-cta { flex: none; margin-left: auto; }
html[data-i18n] .header-gh-label { display: none; }
html[data-i18n] .header-gh { padding: 6px 9px; }
html[data-i18n] .qa summary { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 1180px) { html[data-i18n] .site-header:not(.has-menu) .site-nav { display: none; } }
/* The headline's phrases may break anywhere between words. */
html[data-i18n] .hero h1 .ph { display: inline; }
html[data-i18n] .hero h1 { hyphens: auto; }
@media (max-width: 600px) {
  html[data-i18n] .hero h1 { font-size: clamp(30px, 10vw, 44px); }
  html[data-i18n] .site-header .brand-word { display: none; }
}
@media (max-width: 480px) {
  html[data-i18n] .header-cta .btn { white-space: normal; padding-inline: 14px; max-width: 46vw; }
}
