/* Droid Arabic Kufi — self-hosted, offline-friendly.
 * Family name verified via fc-query ("Droid Arabic Kufi" Regular/Bold).
 * These woff2 files were previously also registered as 'Kufi'; the
 * canonical name is now 'Droid Arabic Kufi' everywhere (welcome page
 * included) so the browser fetches each file once.
 * Only 400/700 are vendored; 500/600 synthesize from these two faces.
 * Loaded from layouts/base.blade.php after Bootstrap so the RTL rule below
 * wins over Bootstrap's default body font stack. Latin/LTR app pages are
 * intentionally untouched (the body rule is scoped to [dir='rtl']).
 * mPDF receipts intentionally stay on the Cairo stack (config/mpdf.php) —
 * woff2 webfonts cannot be used by mPDF.
 */

@font-face {
    font-family: 'Droid Arabic Kufi';
    src: url('../fonts/Kufi-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Droid Arabic Kufi';
    src: url('../fonts/Kufi-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Full Arabic UI: every tenant/portal/guest page renders dir="rtl". */
html[dir='rtl'] body {
    font-family: 'Droid Arabic Kufi', 'Noto Kufi Arabic', system-ui, Tahoma, Arial, sans-serif;
}

/* Kufi type-scale compensation — Droid Arabic Kufi draws wider/taller than
 * the previous Tahoma/system stack at the same rem size, so every element
 * inheriting the body font balloons (navbar, headings, buttons, badges,
 * tables, mobile cards). This layer scales those back. Untouched on purpose:
 * tap-target minimums (mobile-app.css), 16px mobile inputs (iOS zoom guard),
 * the Kufi-designed welcome hero (.w-title), and form controls.
 * (All app headings carry an .h1–.h6 sizing class; the two bare <h1> tags
 * in the repo live in mPDF receipt views that never load this file.)
 */

html[dir='rtl'] :is(.h1, .h2, .h3, .h4, .h5, .h6) {
    line-height: 1.7;
}

html[dir='rtl'] .h1 { font-size: 2rem; }
html[dir='rtl'] .h2 { font-size: 1.7rem; }
html[dir='rtl'] .h3 { font-size: 1.45rem; }
html[dir='rtl'] .h4 { font-size: 1.25rem; }
html[dir='rtl'] .h5 { font-size: 1.1rem; }
html[dir='rtl'] .h6 { font-size: 0.95rem; }

/* Navbar: smaller brand/links plus no-wrap so items stop spilling to a
 * second row on desktop (brand 1.25rem and 1rem links were Kufi-oversized). */
html[dir='rtl'] .navbar-brand {
    font-size: 1.05rem;
    line-height: 1.6;
}

html[dir='rtl'] .navbar .nav-link {
    font-size: 0.875rem;
    line-height: 1.6;
    white-space: nowrap;
    padding-inline: 0.4rem;
}

html[dir='rtl'] .navbar .dropdown-item {
    font-size: 0.875rem;
    line-height: 1.7;
}

/* Buttons: shrink the label only — heights/tap targets stay intact. */
html[dir='rtl'] .btn { font-size: 0.9rem; }
html[dir='rtl'] .btn-sm { font-size: 0.8rem; }
html[dir='rtl'] .btn-lg { font-size: 1.1rem; }

/* Card headers: keep the title + action button on one row. */
html[dir='rtl'] .card-header .btn {
    white-space: nowrap;
    flex-shrink: 0;
}

/* Dense surfaces: badges, labels, alerts, table cells. */
html[dir='rtl'] .badge {
    font-size: 0.7em;
    line-height: 1.6;
}

html[dir='rtl'] .form-label {
    font-size: 0.9375rem;
    line-height: 1.7;
}

html[dir='rtl'] .alert {
    font-size: 0.9375rem;
    line-height: 1.7;
}

html[dir='rtl'] .table {
    font-size: 0.9375rem;
    line-height: 1.7;
}

/* Reading surface: Kufi needs less air than the Tahoma-tuned defaults. */
html[dir='rtl'] .help-article {
    font-size: 1rem;
    line-height: 1.8;
}

/* Mobile: card titles, in-card action buttons, bottom-nav labels. */
@media (max-width: 767.98px) {
    html[dir='rtl'] .mobile-card-list__item > span > .fw-bold {
        font-size: 0.95rem;
        line-height: 1.7;
    }

    html[dir='rtl'] .mobile-card-list__item .btn {
        font-size: 0.85rem;
        line-height: 1.6;
    }

    html[dir='rtl'] .mobile-back-bar .fw-bold {
        font-size: 1rem;
        line-height: 1.6;
    }

    html[dir='rtl'] .mobile-bottom-nav__item {
        font-size: 0.7rem;
        line-height: 1.3;
    }
}
