/* ==========================================================================
   Zorya — i18n layer
   Loaded AFTER static/css/style.css so the original layout stays untouched;
   everything here is additive (language sheet, RTL mirroring, long-copy fits).
   ========================================================================== */

/* ---- hide the flash of the wrong language until main.js has painted ------
   The CSS animation is a hard safety net: even if every script fails to load
   the page reveals itself after 2.5s instead of staying blank. */
@keyframes zyReveal { to { opacity: 1; } }
html:not(.i18n-ready) body { opacity: 0; animation: zyReveal .01s 2.5s forwards; }
html.i18n-ready body { opacity: 1; animation: none; }
html.i18n-ready .page { animation: zyFade .16s ease-out; }
@keyframes zyFade { from { opacity: .55 } to { opacity: 1 } }

/* ---- better script coverage than the base stack ---- */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans",
    "Noto Sans Arabic", "Noto Naskh Arabic", "Noto Sans Hebrew", "Noto Sans Thai",
    "Noto Sans Devanagari", "Noto Sans Bengali", "Noto Sans Tamil", "Noto Sans Telugu",
    "Noto Sans Sinhala", "Noto Sans Khmer", "Noto Sans Ethiopic", "Noto Sans Georgian",
    "Noto Sans Armenian", "Noto Sans SC", "Noto Sans TC", "Noto Sans JP", "Noto Sans KR",
    "Helvetica Neue", Roboto, sans-serif;
}

/* ---- longer translations: keep the original grid, allow graceful wrap ---- */
.talks { flex-wrap: wrap; row-gap: 6px; }
.talks a, .talks button { flex: 0 1 auto; }
.feats { align-items: start; }
.feat b, .feat small { word-break: break-word; }
.hero h1 { word-break: break-word; overflow-wrap: anywhere; }
.hero .hero-sub, .hero .hero-note { word-break: break-word; }
.war b { word-break: break-word; font-weight: 700; }
.lady-about, .lady-where { word-break: break-word; }
.promo h3, .pitch-card h3 { word-break: break-word; }

/* three card actions in one row: long translations get two shrink steps */
.acts-tight .act { font-size: 10px; letter-spacing: -.2px; padding: 0 1px; }
.acts-clip .act {
  display: block; line-height: 28px; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 3px;
}

/* ---- header language pills ---- */
.lang-sw { align-items: center; }
.lang-sw button { cursor: pointer; font: inherit; }
.lang-globe {
  border: 0; background: #f1f5f9; color: #475569; border-radius: 999px;
  width: 28px; height: 28px; padding: 0; display: inline-flex;
  align-items: center; justify-content: center; flex: 0 0 auto;
}
.lang-globe svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.9; }
.lang-sw button.on { background: var(--pink); color: #fff; }

/* ============================== language sheet ============================ */
.langsheet {
  position: fixed; inset: 0; z-index: 95;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0; background: rgba(15, 23, 42, .62);
}
.langsheet[hidden] { display: none; }
.langsheet-card {
  width: min(480px, 100%); max-height: 84vh;
  display: flex; flex-direction: column;
  background: #fff; border-radius: 22px 22px 0 0;
  box-shadow: 0 -18px 50px rgba(15, 23, 42, .35);
  animation: sheetUp .2s ease-out;
}
@keyframes sheetUp { from { transform: translateY(24px); opacity: .4 } to { transform: none; opacity: 1 } }
.langsheet-top {
  position: relative; display: flex; align-items: center; justify-content: center;
  padding: 16px 44px 8px;
}
.langsheet-top b { font-size: 16px; font-weight: 900; }
.langsheet-top .pitch-x { position: absolute; right: 10px; top: 12px; background: #f1f5f9; color: #0f172a; }
.langsheet-search { padding: 4px 14px 10px; }
.langsheet-search input {
  width: 100%; border: 1px solid #e2e8f0; border-radius: 999px;
  padding: 10px 14px; font: inherit; font-size: 14px; background: #f8fafc; color: #0f172a;
}
.langsheet-search input:focus { outline: 2px solid #ffd0e4; border-color: var(--pink); }
.langsheet-list { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 0 8px 18px; }
.lang-group {
  padding: 12px 8px 6px; color: #94a3b8;
  font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .5px;
}
.lang-item {
  display: flex; align-items: baseline; gap: 8px; width: 100%;
  border: 0; background: transparent; border-radius: 12px;
  padding: 11px 10px; font: inherit; text-align: start; cursor: pointer; color: var(--ink);
}
.lang-item:active { background: #fff1f7; }
.lang-item.on { background: #fff1f7; }
.lang-item.on .li-name { color: var(--pink); }
.li-name { font-weight: 800; font-size: 15px; flex: 0 0 auto; }
.li-en { color: #94a3b8; font-size: 12px; font-weight: 700; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-code { color: #cbd5e1; font-size: 11px; font-weight: 800; flex: 0 0 auto; }
.lang-auto {
  display: flex; align-items: center; gap: 10px; width: 100%;
  border: 1px solid #e2e8f0; background: #fff; border-radius: 14px;
  padding: 10px 12px; margin: 4px 6px 6px; font: inherit; text-align: start; cursor: pointer; color: var(--ink);
}
.lang-auto.on { border-color: var(--pink); background: #fff1f7; }
.lang-auto .la-ico { font-size: 16px; flex: 0 0 auto; }
.lang-auto b { display: block; font-size: 14px; font-weight: 900; }
.lang-auto small { display: block; color: #64748b; font-size: 11px; font-weight: 700; }
.lang-empty { padding: 18px; text-align: center; color: #94a3b8; }

/* ================================= RTL =================================== */
[dir="rtl"] body { direction: rtl; }
[dir="rtl"] .hero-copy { direction: rtl; text-align: right; }
[dir="rtl"] .loc-pill { align-self: flex-end; }
[dir="rtl"] .dist { left: auto; right: 6px; }
[dir="rtl"] .tag { right: auto; left: 6px; }
[dir="rtl"] .gallery-nav.prev { left: auto; right: 8px; }
[dir="rtl"] .gallery-nav.next { right: auto; left: 8px; }
[dir="rtl"] .gallery-x { right: auto; left: 8px; }
[dir="rtl"] .pitch-x { right: auto; left: 10px; }
[dir="rtl"] .langsheet-top .pitch-x { right: auto; left: 10px; }
[dir="rtl"] .more-girls { text-align: right; }
[dir="rtl"] .bubble { border-radius: 16px 16px 4px 16px; }
[dir="rtl"] .faces { direction: ltr; }
[dir="rtl"] .phone-faces { direction: ltr; }
[dir="rtl"] .lang-item { text-align: right; }
[dir="rtl"] .promo li, [dir="rtl"] .pitch-feats li { direction: rtl; }
[dir="rtl"] .langsheet-card { animation: sheetUpR .2s ease-out; }
@keyframes sheetUpR { from { transform: translateY(24px); opacity: .4 } to { transform: none; opacity: 1 } }

/* ---- narrow phones: three action buttons with long words ---- */
@media (max-width: 380px) {
  .act { font-size: 11px; }
  .talks { font-size: 12px; }
  .talks a, .talks button { font-size: 12px; }
}
