/* ==============================================
   bilingual.css  –  RTL/LTR support layer
   Include this AFTER every page's main CSS
   ============================================== */

/* ---------- Language Switcher Button ---------- */
.lang-switch-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 13px;
    border-radius: 20px;
    border: 1.5px solid var(--btn-bg, #1e6b8f);
    color: var(--btn-bg, #1e6b8f);
    background: transparent;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.25s ease;
    white-space: nowrap;
}
.lang-switch-btn:hover {
    background: var(--btn-bg, #1e6b8f);
    color: #fff;
}
body.dark .lang-switch-btn {
    border-color: var(--btn-hover, #2d7f9e);
    color: var(--btn-hover, #2d7f9e);
}
body.dark .lang-switch-btn:hover {
    background: var(--btn-hover, #2d7f9e);
    color: #fff;
}

/* ---------- Active nav link ---------- */
.nav-links a.active {
    color: var(--btn-bg, #1e6b8f) !important;
    font-weight: 700;
    border-bottom: 2px solid var(--btn-bg, #1e6b8f);
}

/* ---------- LTR (English) overrides ---------- */
html[dir="ltr"] body,
body.lang-en {
    font-family: 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
    letter-spacing: 0.01em;
}

html[dir="ltr"] .navbar .nav-container {
    flex-direction: row;
}

html[dir="ltr"] .logo-wrapper {
    flex-direction: row;
    direction: ltr;
}

/* Logo wrapper always row */
.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.navbar .logo-wrapper .site-logo,
.logo-wrapper .site-logo {
    width: 60px;
    height: 60px;
    max-width: 60px;
    max-height: 60px;
    min-width: 60px;
    object-fit: cover;
    display: inline-block;
    border-radius: 12px;
    border: 2px solid rgba(255,255,255,0.4);
    flex-shrink: 0;
}

.navbar .logo-wrapper .logo h2,
.logo h2 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 800;
    line-height: 1.2;
    background: linear-gradient(135deg, #1a4a6e, #2563eb);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    white-space: nowrap;
}

/* In RTL mode logo is already styled; just ensure LTR looks right */
html[dir="ltr"] .footer-container {
    direction: ltr;
    text-align: left;
}

html[dir="ltr"] .nav-links {
    direction: ltr;
}

/* Flip arrow direction for LTR pages */
html[dir="ltr"] .info-btn {
    direction: ltr;
}

/* ---------- Persian font enhancement ---------- */
html[dir="rtl"] body,
body.lang-fa {
    font-family: 'Tahoma', 'Vazirmatn', 'B Nazanin', system-ui, sans-serif;
}

/* ---------- Responsive: language button on mobile ---------- */
@media (max-width: 768px) {
    .lang-switch-btn {
        padding: 4px 10px;
        font-size: 0.78rem;
    }

    .logo-wrapper {
        gap: 10px;
    }

    .navbar .logo-wrapper .site-logo,
    .logo-wrapper .site-logo {
        width: 45px;
        height: 45px;
        max-width: 45px;
        max-height: 45px;
        min-width: 45px;
    }

    .navbar .logo-wrapper .logo h2,
    .logo h2 {
        font-size: 1.1rem;
    }
}

@media (max-width: 520px) {
    .logo-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .navbar .logo-wrapper .site-logo,
    .logo-wrapper .site-logo {
        width: 38px;
        height: 38px;
        max-width: 38px;
        max-height: 38px;
        min-width: 38px;
    }

    .navbar .logo-wrapper .logo h2,
    .logo h2 {
        font-size: 0.9rem;
        white-space: normal;
    }
}
