/* SF Language Toggle v1.0.0
 * Hide/show the existing .sf-lang-en / .sf-lang-ur blocks. No pill
 * stylesheet for .sf-lang-pill was found in the theme files, the plugin
 * files or the Customizer Additional CSS, so the pill styles below are
 * the only definition (active = blue, inactive = navy) and do not
 * duplicate an existing rule.
 *
  * Font: the real "Jameel Noori Nastaleeq" will be self-hosted in this
 * folder (jameel-noori-nastaleeq-regular.woff2, with the .ttf as a
 * fallback) and loaded with @font-face below, once the files are
 * uploaded. "Noto Nastaliq Urdu" stays in the font stack only as a fallback.
 */
/* Urdu webfont: real Jameel Noori Nastaleeq, self-hosted in this folder. */
@font-face {
	font-family: 'Jameel Noori Nastaleeq';
	src: url('jameel-noori-nastaleeq-regular.woff2') format('woff2'),
		url('jameel-noori-nastaleeq-regular.ttf') format('truetype');
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

/* --- Hide/show: only one language is ever visible. --- */
/* Before any script runs, default to English so both languages
   never flash together. */
html:not(.sf-lang-en):not(.sf-lang-ur) .sf-lang-ur {
    display: none !important;
}
html.sf-lang-en .sf-lang-ur {
    display: none !important;
}
html.sf-lang-ur .sf-lang-en {
    display: none !important;
}

/* --- Urdu (Nastaliq) typography --- */
.sf-lang-ur,
.sf-lang-ur * {
    font-family: 'Jameel Noori Nastaleeq', 'Noto Nastaliq Urdu', 'Noto Nastaliq', serif;
}
/* Nastaliq needs generous line height. */
html.sf-lang-ur .sf-lang-ur {
    line-height: 2.1;
}
/* Urdu blocks read right-to-left; the script also sets lang="ur"
   dir="rtl" on each block, which activates the site's :lang(ur) rules. */
html.sf-lang-ur .sf-lang-ur,
.sf-lang-ur[dir="rtl"] {
    direction: rtl;
    text-align: right;
}
.sf-lang-en[dir="ltr"] {
    direction: ltr;
}

/* --- In-page toggle pills --- */
.sf-lang-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.sf-lang-toggle .sf-lang-pill {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 6px 16px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
    color: #ffffff;
    background: #16324f; /* inactive = navy */
    transition: background-color .2s ease, transform .1s ease;
}
.sf-lang-toggle .sf-lang-pill:hover {
    background: #1d4a73;
}
.sf-lang-toggle .sf-lang-pill.active {
    background: #2563eb; /* active = blue */
}
.sf-lang-toggle .sf-lang-pill:focus-visible {
    outline: 2px solid #93c5fd;
    outline-offset: 2px;
}
/* The Urdu pill renders in Nastaliq. */
.sf-lang-toggle .sf-lang-pill[data-lang="ur"] {
    font-family: 'Jameel Noori Nastaleeq', 'Noto Nastaliq Urdu', serif;
    line-height: 1.9;
    padding-top: 2px;
    padding-bottom: 2px;
}

/* --- Floating toggle: fixed bottom-right, CLEAR of the Astra ---
 * --- Scroll to Top button (bottom ~20-30px, ~44px tall).     ---
 * bottom: 88px leaves a clear gap above it on desktop and mobile. */
.sf-lang-toggle-floating {
    position: fixed;
    right: 20px;
    bottom: 88px;
    z-index: 99999;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #dbe4ee;
    border-radius: 999px;
    padding: 5px;
    box-shadow: 0 6px 24px rgba(15, 35, 60, 0.22);
}
@media (max-width: 768px) {
    .sf-lang-toggle-floating {
        right: 14px;
        bottom: 84px;
    }
    .sf-lang-toggle-floating .sf-lang-pill {
        padding: 5px 12px;
        font-size: 13px;
    }
}

/* The toggle always reads EN | اردو, left to right, in both modes,
   whatever direction the page content uses. */
.sf-lang-toggle {
    direction: ltr;
}