/* Multilingual support: language switcher, right-to-left layout, script fonts. */

/* ---------- Header tools + switcher ---------- */
.sm-header__tools { display: flex; align-items: center; gap: 24px; }
.sm-lang { position: relative; }
.sm-lang > summary { list-style: none; display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: .88rem; line-height: 1; padding: 8px 12px; border: 1px solid #e2e2e2; border-radius: 999px; color: #404040; background: #fff; user-select: none; transition: border-color .2s, color .2s; }
.sm-lang > summary::-webkit-details-marker { display: none; }
.sm-lang > summary:hover, .sm-lang[open] > summary { border-color: #e96656; color: #e96656; }
.sm-lang > summary:focus-visible { outline: 3px solid rgba(233,102,86,.4); outline-offset: 2px; }
.sm-lang > summary svg { width: 16px; height: 16px; flex: none; }
.sm-lang ul { position: absolute; top: calc(100% + 10px); inset-inline-end: 0; z-index: 70; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; min-width: 240px; margin: 0; padding: 6px; list-style: none; background: #fff; border-radius: 10px; box-shadow: 0 16px 40px rgba(0,0,0,.16); }
.sm-lang a { display: block; padding: 9px 12px; border-radius: 6px; font-size: .95rem; line-height: 1.5; color: #404040; text-decoration: none; white-space: nowrap; text-align: start; }
.sm-lang a:hover { background: #f5f5f5; }
.sm-lang a[aria-current] { background: #fdf0ee; color: #e96656; font-weight: 700; }
.sm-lang a[lang="ur"] { font-family: "Noto Nastaliq Urdu", "Noto Naskh Arabic", serif; }

@media (max-width: 1100px) { .sm-nav ul { gap: 18px; } .sm-header__tools { gap: 14px; } }
@media (max-width: 960px) {
	.sm-lang > summary { padding: 8px; }
	.sm-lang > summary span { display: none; }
}
@media (max-width: 420px) { .sm-brand__place { display: none; } }

/* Numbers, emails and phone numbers stay left-to-right inside RTL text. */
.sm-ltr { direction: ltr; unicode-bidi: isolate; }

/* ---------- Non-Latin scripts ---------- */
body.sm-nonlatin * { letter-spacing: 0 !important; }
body.sm-nonlatin .sm-heading,
body.sm-nonlatin .sm-hero__title { line-height: 1.45; }
body.sm-nonlatin .sm-prayer__time,
body.sm-nonlatin .sm-ltr { font-family: "Lato", "Helvetica Neue", Arial, sans-serif; }

body.sm-lang-ur { --font-sans: "Noto Nastaliq Urdu", "Lato", serif; --font-display: "Noto Nastaliq Urdu", "Lato", serif; line-height: 2.2; }
body.sm-lang-ur .sm-hero__title { font-size: clamp(2rem, 6vw, 3.6rem); line-height: 1.9; }
body.sm-lang-ur .sm-heading { line-height: 1.9; font-size: clamp(1.6rem, 3.6vw, 2.2rem); }
body.sm-lang-ur .sm-about__quote { line-height: 2.1; font-size: clamp(1.5rem, 3.4vw, 2.3rem); }
body.sm-lang-ur .sm-nav a { font-size: .9rem; }
body.sm-lang-ur .sm-prayer__name,
body.sm-lang-ur .sm-visit__label,
body.sm-lang-ur .sm-footer__label { line-height: 2; }
body.sm-lang-ur.sm-nonlatin .sm-brand__name { line-height: 1.7; font-size: 1rem; }
body.sm-lang-ur.sm-nonlatin .sm-brand__place { line-height: 1.9; font-size: .7rem; margin-top: 2px; }
body.sm-lang-ur .sm-prayer__item { padding-top: 16px; padding-bottom: 12px; }
body.sm-lang-ur .sm-prayer__name { font-size: .85rem; line-height: 2.3; }
body.sm-lang-ur .sm-pillar__title { line-height: 2.2; padding-bottom: 14px; }
body.sm-lang-ar .sm-brand__name, body.sm-nonlatin .sm-brand__name { line-height: 1.5; }
body.sm-lang-ar .sm-brand__place, body.sm-nonlatin .sm-brand__place { line-height: 1.6; }
body.sm-lang-ar .sm-pillar__title { line-height: 1.8; padding-bottom: 12px; }

body.sm-lang-ar { --font-sans: "Noto Naskh Arabic", "Lato", serif; --font-display: "Noto Naskh Arabic", "Lato", serif; line-height: 1.9; }
body.sm-lang-ar .sm-hero__title { line-height: 1.5; }
body.sm-lang-ar .sm-about__quote { line-height: 1.6; }

body.sm-lang-hi { --font-sans: "Noto Sans Devanagari", "Lato", sans-serif; --font-display: "Noto Sans Devanagari", "Montserrat", sans-serif; line-height: 1.8; }
body.sm-lang-pa { --font-sans: "Noto Sans Gurmukhi", "Lato", sans-serif; --font-display: "Noto Sans Gurmukhi", "Montserrat", sans-serif; line-height: 1.8; }
body.sm-lang-zh { --font-sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif; --font-display: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif; line-height: 1.8; }
body.sm-lang-ja { --font-sans: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", sans-serif; --font-display: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", sans-serif; line-height: 1.8; }
body.sm-lang-hi .sm-about__quote, body.sm-lang-pa .sm-about__quote,
body.sm-lang-zh .sm-about__quote, body.sm-lang-ja .sm-about__quote { line-height: 1.5; }

body.sm-lang-de, body.sm-lang-fr { -webkit-hyphens: auto; hyphens: auto; }
body.sm-lang-de .sm-hero__title, body.sm-lang-fr .sm-hero__title, body.sm-lang-es .sm-hero__title { font-size: clamp(2.1rem, 6vw, 4rem); }
body.sm-lang-de .sm-prayer__name { letter-spacing: .04em; }

/* ---------- Right-to-left layout ---------- */
body.sm-rtl .sm-about__quote { text-align: right; }
@media (min-width: 860px) { body.sm-rtl .sm-about__quote { text-align: left; } }
body.sm-rtl .sm-pillar__text,
body.sm-rtl .sm-subheading { unicode-bidi: plaintext; }
body.sm-rtl .sm-form input, body.sm-rtl .sm-form textarea { text-align: right; }
body.sm-rtl .sm-form input[type=email] { direction: ltr; text-align: right; }
