@import "tailwindcss";
@import "tw-animate-css";
@import "shadcn/tailwind.css";
@import "@multica/ui/styles/tokens.css";
@import "@multica/ui/styles/base.css";

@custom-variant dark (&:is(.dark *));

/* Font stack: Inter for Latin UI text + system CJK fonts for localized content.
   Web app uses the same stack via next/font/google in apps/web/app/layout.tsx —
   keep the CJK fallback tail in sync across both files. The Inter primary family
   differs by design: next/font produces `__Inter_xxx` (with a synthetic size-adjusted
   fallback face to prevent FOUT layout shift); desktop uses fontsource's "Inter Variable".
   Both resolve to Inter glyphs, so rendering is identical in practice.
   Per-character fallback: Latin chars render with Inter, CJK chars render with
   the platform-native Chinese/Korean fallback when needed. Chinese fonts must stay
   before Korean fonts so zh users do not receive Korean Hanja glyph shapes.

   Mono font has no explicit CJK fallback: CJK chars in code blocks are inherently
   non-aligned with a mono grid (Chinese is proportional), so listing CJK fonts
   would falsely signal alignment guarantees. Browser default fallback handles
   the rare mixed case correctly. */
:root {
  --font-sans: "Inter Variable", "Inter", -apple-system, BlinkMacSystemFont,
               "Segoe UI", "PingFang SC", "Microsoft YaHei",
               "Noto Sans CJK SC", "Apple SD Gothic Neo", "Malgun Gothic",
               "Noto Sans CJK KR", sans-serif;
  --font-serif: "Source Serif 4 Variable", "Source Serif 4", "Iowan Old Style",
                "Apple Garamond", Baskerville, "Times New Roman", serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas,
               monospace;
}

/* Japanese-scoped CJK override. Japanese Kanji share the Han Unicode block
   with Chinese, and CSS font-fallback order is not changed by <html lang> —
   so the global Chinese-first stack above would give Japanese users Chinese
   glyph shapes for shared ideographs. We keep the global stack Chinese-first
   (no regression for zh users) and promote Japanese fonts ahead of the
   Chinese/Korean families only when the locale is Japanese. App.tsx syncs
   document.documentElement.lang to the active locale so this selector
   matches. Mirrors the lang-scoped override in apps/web/app/layout.tsx.
   `[lang|="ja"]` is the BCP-47 language-range selector: it matches exactly
   `ja` or `ja-<region>` (App.tsx sets `ja-JP`), never unrelated subtags
   such as `jam`. */
html[lang|="ja"] {
  --font-sans: "Inter Variable", "Inter", "Hiragino Sans",
               "Hiragino Kaku Gothic ProN", "Yu Gothic", "YuGothic", "Meiryo",
               "Noto Sans CJK JP", "Noto Sans JP", -apple-system,
               BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei",
               "Noto Sans CJK SC", "Apple SD Gothic Neo", "Malgun Gothic",
               "Noto Sans CJK KR", sans-serif;
}

@source "../../../../../packages/ui/**/*.tsx";
@source "../../../../../packages/core/**/*.{ts,tsx}";
@source "../../../../../packages/views/**/*.{ts,tsx}";
@source "./**/*.tsx";

/* Desktop-specific: override sidebar container padding for traffic light layout */
[data-slot="sidebar-container"] {
  padding: 0 !important;
}
