/* © 2026 Filip Mráček / Japaneseffect. The Japanese sentence and the romaji switch – the same on every page
   (Guidance, Grammar, City). Uses its own fallbacks so it also works where jfx.css is not loaded. */
.jromaji, .jsent { --j-text: var(--text, #f5f5f7); --j-text2: var(--text-2, #a1a1a6); --j-text3: var(--text-3, #6e6e73); --j-line: var(--line, rgba(255,255,255,.1)); --j-cyan: var(--cyan, #64d2ff); --j-orange: var(--orange, #ff9f0a); --j-blue: var(--blue, #0a84ff); --j-ui: var(--ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, sans-serif); --j-ja: var(--ja, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif); }
.jromaji { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 6px 13px 6px 10px; border-radius: 999px; border: 1px solid var(--j-line); background: rgba(20,22,26,.6); color: var(--j-text2); font: 500 13px var(--j-ui); cursor: pointer; }
.jromaji__dot { width: 22px; height: 13px; border-radius: 99px; background: rgba(255,255,255,.18); position: relative; transition: background .2s; }
.jromaji__dot::after { content: ""; position: absolute; top: 2px; left: 2px; width: 9px; height: 9px; border-radius: 50%; background: #fff; transition: transform .2s; }
.jromaji[aria-pressed="true"] { color: var(--j-text); }
.jromaji[aria-pressed="true"] .jromaji__dot { background: var(--j-blue); }
.jromaji[aria-pressed="true"] .jromaji__dot::after { transform: translateX(9px); }
.jromaji:focus-visible, .jw:focus-visible, .jsay:focus-visible { outline: 2px solid var(--j-blue); outline-offset: 2px; }

/* a Japanese sentence: no gaps between words, furigana above kanji, meaning above the word on hover/tap, romaji under */
.jsent { margin: 10px 0 4px; }
.jsent__line { display: flex; flex-wrap: wrap; align-items: flex-end; row-gap: 6px; }
.jw { display: inline-flex; flex-direction: column; align-items: center; border-radius: 8px; padding: 0 1px; cursor: default; transition: background .15s; }
.jw__g { font: 500 12px/1.2 var(--j-ui); color: var(--j-cyan); white-space: nowrap; min-height: 15px; transition: opacity .15s; }
.jw__j { font: 400 26px/1.45 var(--j-ja); }
.jw__r { font: 400 12.5px/1.2 var(--j-ui); color: var(--j-text3); min-height: 15px; white-space: nowrap; transition: color .15s; }
.jw.is-on { background: rgba(255,255,255,.08); }
.jw.is-on .jw__r { color: var(--j-orange); }
.jw--p .jw__j { color: var(--j-text2); }
.jsent ruby { ruby-align: center; ruby-position: over; }
.jsent rt { letter-spacing: -.04em; white-space: nowrap; font-size: 11px; color: #b7bcc6; font-family: var(--j-ja); }
.no-romaji .jw__r { display: none; }
.jsay { align-self: center; margin-left: 8px; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--j-line); background: rgba(255,255,255,.04); color: var(--j-text2); cursor: pointer; display: grid; place-items: center; }
.jsay:hover { color: var(--j-text); }
.jsent__en { margin: 4px 0 0; color: var(--j-text2); }
@media (max-width: 600px) { .jw__j { font-size: 23px; } }


/* ── the meaning above a word – one rule for the whole site ──
   mouse / trackpad: on hover only · touch: always shown, the "meaning" switch hides them (a tap then shows one) */
@media (hover: hover) and (pointer: fine) {
  .jw__g, .sl__lab { visibility: hidden; opacity: 0; transition: opacity .15s; }
  .jw.is-on .jw__g, .jw:hover .jw__g, .sl:hover .sl__lab, .sl:focus-visible .sl__lab { visibility: visible; opacity: 1; }
  .jmeaning { display: none !important; }
}
@media (hover: none), (pointer: coarse) {
  .jw__g, .sl__lab { visibility: visible; opacity: 1; }
  .no-meaning .jw__g, .no-meaning .sl__lab { visibility: hidden; opacity: 0; }
  .no-meaning .jw.is-on .jw__g, .no-meaning .sl.is-on .sl__lab { visibility: visible; opacity: 1; }
}
.jmeaning { margin-left: 6px; }
