/* ===========================
   iLearn - Internationalisation
   =========================== */

/* Hides the English flash while a stored non-default language loads. */
html.i18n-pending body {
  visibility: hidden;
}

/* ===== LANGUAGE SWITCHER ===== */
.lang-switcher {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--bg-white);
  box-shadow: var(--shadow-sm);
}

.lang-switcher-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 32px;
  padding: 4px 12px;
  border: none;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-muted);
  font-family: 'DM Sans', 'Noto Sans Kannada', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition);
}

.lang-switcher-btn:hover {
  color: var(--primary);
  background: var(--primary-light);
}

.lang-switcher-btn.active {
  background: var(--primary);
  color: #fff;
}

.lang-switcher-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.lang-switcher-short {
  display: none;
}

@media (max-width: 768px) {
  .lang-switcher-full {
    display: none;
  }

  .lang-switcher-short {
    display: inline;
  }

  .lang-switcher-btn {
    min-width: 40px;
    padding: 4px 10px;
    font-size: 0.78rem;
  }
}

/* ===== KANNADA TYPOGRAPHY ===== */
html[lang="kn"] {
  --font-display: 'DM Sans', 'Noto Sans Kannada', sans-serif;
  --font-heading: 'Clash Display', 'Noto Sans Kannada', sans-serif;
  --font-body: 'DM Sans', 'Noto Sans Kannada', sans-serif;
}

html[lang="kn"] body {
  font-family: var(--font-body);
  line-height: 1.75;
}

html[lang="kn"] h1,
html[lang="kn"] h2,
html[lang="kn"] h3,
html[lang="kn"] h4,
html[lang="kn"] p,
html[lang="kn"] li,
html[lang="kn"] a,
html[lang="kn"] button,
html[lang="kn"] label,
html[lang="kn"] span {
  overflow-wrap: break-word;
}

/* Kannada vowel signs and conjuncts sit above and below the line. */
html[lang="kn"] .section-title {
  line-height: 1.4;
  letter-spacing: normal;
}

html[lang="kn"] .hero-title {
  line-height: 1.35;
  letter-spacing: normal;
}

html[lang="kn"] h3,
html[lang="kn"] h4 {
  line-height: 1.45;
}

html[lang="kn"] .section-subtitle,
html[lang="kn"] p {
  line-height: 1.8;
}

/* Tracking and case transforms have no meaning for Kannada script. */
html[lang="kn"] .badge,
html[lang="kn"] .section-label,
html[lang="kn"] .trusted-label,
html[lang="kn"] .roadmap-tag,
html[lang="kn"] .coming-soon-pill,
html[lang="kn"] .footer-col-title,
html[lang="kn"] .pricing-ribbon {
  letter-spacing: normal;
}

html[lang="kn"] .pricing-ribbon {
  font-size: 10px;
  line-height: 1.2;
}

html[lang="kn"] .btn {
  line-height: 1.45;
}

/* Keep the desktop nav on one line with the longer Kannada labels. */
html[lang="kn"] .nav-links a,
html[lang="kn"] .nav-actions .btn {
  white-space: nowrap;
}

/* The switcher shares the desktop nav row, so laptop/tablet widths get a compact layout. */
@media (min-width: 769px) and (max-width: 1200px) {
  .nav-actions {
    gap: 8px;
  }

  .lang-switcher-full {
    display: none;
  }

  .lang-switcher-short {
    display: inline;
  }

  .lang-switcher-btn {
    min-width: 36px;
    padding: 4px 9px;
  }

  .nav-links a {
    padding: 8px 12px;
  }

  html[lang="kn"] .nav-links {
    gap: 2px;
  }

  html[lang="kn"] .nav-links a {
    padding: 8px 10px;
    font-size: 0.85rem;
  }

  html[lang="kn"] .nav-actions .btn {
    padding: 10px 16px;
    font-size: 0.85rem;
  }
}

@media (min-width: 769px) and (max-width: 1080px) {
  .nav-links {
    gap: 0;
  }

  .nav-links a {
    padding: 8px 9px;
    font-size: 0.85rem;
  }

  .nav-actions {
    gap: 6px;
  }

  .nav-actions .btn {
    padding: 9px 14px;
    font-size: 0.82rem;
    white-space: nowrap;
  }

  html[lang="kn"] .nav-links a {
    padding: 6px 7px;
    font-size: 0.8rem;
  }

  html[lang="kn"] .nav-actions .btn {
    padding: 9px 12px;
    font-size: 0.8rem;
  }
}

/* Sign In opens the same URL, so the secondary CTA is dropped where the row cannot fit it. */
@media (min-width: 769px) and (max-width: 980px) {
  .nav-actions [data-i18n="common.cta.startLifetimeFree"] {
    display: none;
  }
}

@media (max-width: 768px) {
  html[lang="kn"] .hero-title {
    line-height: 1.4;
  }

  /* Kannada conjuncts are unreadable at the 10px used for the English hero buttons. */
  html[lang="kn"] .media-btn,
  html[lang="kn"] .media-btn1 {
    font-size: 12px;
    line-height: 1.35;
  }
}

/* The cookie buttons sit three-across on phones; longer labels must wrap instead of clipping. */
@media (max-width: 640px) {
  .cookie-actions .btn {
    white-space: normal;
    padding: 10px 8px;
    line-height: 1.3;
    text-align: center;
  }

  .cookie-actions .cookie-accept {
    flex: 1.5;
  }
}
