/* Languages (includes/i18n.php).
   Part 1: the language switcher and the "English only" notice, for every language.
   Part 2: type settings for the Indic scripts, applied only when <html lang> is not English. */

/* ── 1. Switcher ─────────────────────────────────────────────────────────── */
.lang-switch { position: relative; display: inline-block; font-size: 12px; font-weight: 600; line-height: 1.2; }
.lang-switch > summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px; border-radius: 6px; color: rgba(255,255,255,.92); user-select: none;
  font-family: 'Nirmala UI', 'Noto Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
.lang-switch > summary::-webkit-details-marker { display: none; }
.lang-switch > summary::after {
  content: ""; width: 5px; height: 5px; margin-left: 2px; border: solid currentColor; border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg) translateY(-2px); opacity: .8;
}
.lang-switch > summary:hover,
.lang-switch[open] > summary { background: rgba(255,255,255,.14); color: #fff; }
.lang-switch > summary:focus-visible { outline: 2px solid #ffae54; outline-offset: 2px; }
.lang-switch ul {
  list-style: none; margin: 6px 0 0; padding: 6px; position: absolute; right: 0; top: 100%; z-index: 1200;
  min-width: 150px; background: #fff; border: 1px solid #e5e0d8; border-radius: 12px;
  box-shadow: 0 14px 34px rgba(0,0,0,.18);
}
.lang-switch li { margin: 0; }
.lang-switch li a {
  display: block; padding: 8px 12px; border-radius: 8px; color: #1f2937; text-decoration: none; font-size: 14px; font-weight: 600; white-space: nowrap;
  font-family: 'Nirmala UI', 'Noto Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
.lang-switch li a:hover { background: #f3f8f3; color: #2c5f2d; }
.lang-switch li a[aria-current="true"] { background: #2c5f2d; color: #fff; }

/* In the mobile menu the picker sits in the list of links and opens inline.
   The top bar (and its picker) is hidden at 860px, which is where this one appears. */
.lang-switch--menu { display: none; margin: 10px 0 4px; font-size: 14px; }
@media (max-width: 860px) { .lang-switch--menu { display: block; } }
.lang-switch--menu > summary { color: inherit; padding: 10px 14px; border: 1px solid rgba(0,0,0,.12); border-radius: 10px; width: 100%; box-sizing: border-box; justify-content: flex-start; }
.lang-switch--menu > summary:hover, .lang-switch--menu[open] > summary { background: rgba(44,95,45,.08); color: inherit; }
.lang-switch--menu ul { position: static; margin: 6px 0 0; box-shadow: none; border-radius: 10px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px; }

/* Pages without the site header (sign-in, password reset) carry the picker in the corner. */
.lang-corner { position: absolute; top: 14px; right: 16px; z-index: 1200; }
.lang-switch--auth > summary { color: #1f2a1f; background: #fff; border: 1px solid rgba(0,0,0,.14); padding: 6px 10px; font-size: 13px; }
.lang-switch--auth > summary:hover, .lang-switch--auth[open] > summary { background: #f3f8f3; color: #2c5f2d; }

.lang-notice {
  background: #fff8e6; border-bottom: 1px solid #f3dca3; color: #6b4a00; text-align: center;
  padding: 9px 16px; font-size: 14px; line-height: 1.5;
}
.lang-notice a { color: #2c5f2d; font-weight: 700; margin-left: 6px; }

/* ── 2. Indic scripts ────────────────────────────────────────────────────── */
/* These rules follow :lang() per element, not the <html> tag, so the translated
   header and footer on a page whose body is still English (lang="en" on <html>,
   lang="hi" on the header) get the right font and spacing too. */
[lang="hi"], [lang="mr"] { --i18n-font: 'Noto Sans Devanagari', 'Nirmala UI', 'Mangal'; }
[lang="te"] { --i18n-font: 'Noto Sans Telugu', 'Nirmala UI', 'Gautami'; }
[lang="ta"] { --i18n-font: 'Noto Sans Tamil', 'Nirmala UI', 'Latha'; }
[lang="kn"] { --i18n-font: 'Noto Sans Kannada', 'Nirmala UI', 'Tunga'; }
[lang="bn"] { --i18n-font: 'Noto Sans Bengali', 'Nirmala UI', 'Vrinda'; }
[lang="ml"] { --i18n-font: 'Noto Sans Malayalam', 'Nirmala UI', 'Kartika'; }

/* The pages set Latin display fonts (Fraunces, Archivo, DM Sans) that have no
   Indic glyphs; browsers would fall back unpredictably. Put the script's font
   first. Font Awesome icons keep their own family. */
:where(body, h1, h2, h3, h4, h5, h6, p, a, li, span, div, td, th, label, input, button, select, textarea, small, strong, b, em, summary, legend, figcaption, blockquote, option):not(:lang(en)):not([class*="fa-"]):not(.fa):not(.fas):not(.far):not(.fab) {
  font-family: var(--i18n-font), system-ui, -apple-system, 'Segoe UI', sans-serif;
}
/* Letter-spacing pulls Indic conjunct letters apart, and these scripts have no capitals. */
:not(:lang(en)) { letter-spacing: normal !important; text-transform: none !important; }
/* Indic scripts are taller than Latin: tight lines clip the marks above and below. */
body:not(:lang(en)) { line-height: 1.7; }
h1:not(:lang(en)), h2:not(:lang(en)), h3:not(:lang(en)),
.hero-title:not(:lang(en)), .section-title:not(:lang(en)) { line-height: 1.4 !important; }
h4:not(:lang(en)), h5:not(:lang(en)) { line-height: 1.5; }
