/*
 * Arabic for /ar/.
 *
 * The theme was built with Arabic in mind and then left half-wired: assets/dist/css/
 * app-rtl.css styles body, every heading and every form control with
 * `font-family: Frutiger LT Arabic`, and the four weights of that font sit in
 * assets/fonts/frutiger-lt-arabic/ - but nothing ever declared them. The stylesheet
 * shipped beside the font files declares the families as 'Frutiger LT Arabic 55 Roman'
 * and 'Frutiger LT Arabic 45', which are not the name the CSS asks for, and it is not
 * enqueued anywhere either. So Arabic text fell back to whatever the device happened to
 * have.
 *
 * This file declares the faces under the name the theme actually uses, mapping the four
 * cuts onto real weights, and then does the same per-glyph trick as the Devanagari
 * stylesheet: the Latin families are given an extra face restricted by unicode-range to
 * the Arabic blocks, so anything app-rtl.css still styles with Meticula or
 * AvenirNext LT Pro renders Arabic from Frutiger rather than from a system fallback,
 * while Latin inside Arabic copy - PA Global, IFRS, firm names - keeps the brand faces.
 *
 * Paths are root-relative because the fonts belong to the theme and this stylesheet to
 * the plugin. Loaded only when the current language is Arabic.
 */

/* ── The name app-rtl.css asks for, with the four cuts on real weights ───────── */

@font-face {
	font-family: 'Frutiger LT Arabic';
	src: url('/wp-content/themes/paglobal/assets/fonts/frutiger-lt-arabic/FrutigerLTArabic-45Light.woff2') format('woff2'),
		url('/wp-content/themes/paglobal/assets/fonts/frutiger-lt-arabic/FrutigerLTArabic-45Light.woff') format('woff');
	font-weight: 300;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'Frutiger LT Arabic';
	src: url('/wp-content/themes/paglobal/assets/fonts/frutiger-lt-arabic/FrutigerLTArabic-55Roman.woff2') format('woff2'),
		url('/wp-content/themes/paglobal/assets/fonts/frutiger-lt-arabic/FrutigerLTArabic-55Roman.woff') format('woff');
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

/*
 * The theme asks for 600 on every heading and on form controls. There is no semibold
 * cut, so 65Bold answers for both 600 and 700 - better than letting the browser
 * synthesise a bold, which in Arabic thickens the joins and closes up the counters.
 */
@font-face {
	font-family: 'Frutiger LT Arabic';
	src: url('/wp-content/themes/paglobal/assets/fonts/frutiger-lt-arabic/FrutigerLTArabic-65Bold.woff2') format('woff2'),
		url('/wp-content/themes/paglobal/assets/fonts/frutiger-lt-arabic/FrutigerLTArabic-65Bold.woff') format('woff');
	font-weight: 600 700;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'Frutiger LT Arabic';
	src: url('/wp-content/themes/paglobal/assets/fonts/frutiger-lt-arabic/FrutigerLTArabic-75Black.woff2') format('woff2'),
		url('/wp-content/themes/paglobal/assets/fonts/frutiger-lt-arabic/FrutigerLTArabic-75Black.woff') format('woff');
	font-weight: 800 900;
	font-style: normal;
	font-display: swap;
}

/* ── Arabic glyphs for the Latin families, so nothing falls back ─────────────── */

@font-face {
	font-family: 'Meticula';
	src: url('/wp-content/themes/paglobal/assets/fonts/frutiger-lt-arabic/FrutigerLTArabic-65Bold.woff2') format('woff2');
	font-weight: 500 900;
	font-style: normal;
	font-display: swap;
	unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+10E60-10E7E, U+1EE00-1EEFF, U+200C-200F, U+2010-2011, U+204F, U+2E41, U+FD3E-FD3F;
}

@font-face {
	font-family: 'Meticula';
	src: url('/wp-content/themes/paglobal/assets/fonts/frutiger-lt-arabic/FrutigerLTArabic-55Roman.woff2') format('woff2');
	font-weight: 100 400;
	font-style: normal;
	font-display: swap;
	unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+10E60-10E7E, U+1EE00-1EEFF, U+200C-200F, U+2010-2011, U+204F, U+2E41, U+FD3E-FD3F;
}

@font-face {
	font-family: 'AvenirNext LT Pro';
	src: url('/wp-content/themes/paglobal/assets/fonts/frutiger-lt-arabic/FrutigerLTArabic-55Roman.woff2') format('woff2');
	font-weight: 100 500;
	font-style: normal;
	font-display: swap;
	unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+10E60-10E7E, U+1EE00-1EEFF, U+200C-200F, U+2010-2011, U+204F, U+2E41, U+FD3E-FD3F;
}

@font-face {
	font-family: 'AvenirNext LT Pro';
	src: url('/wp-content/themes/paglobal/assets/fonts/frutiger-lt-arabic/FrutigerLTArabic-65Bold.woff2') format('woff2');
	font-weight: 600 900;
	font-style: normal;
	font-display: swap;
	unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+10E60-10E7E, U+1EE00-1EEFF, U+200C-200F, U+2010-2011, U+204F, U+2E41, U+FD3E-FD3F;
}

@font-face {
	font-family: 'Noto Sans';
	src: url('/wp-content/themes/paglobal/assets/fonts/frutiger-lt-arabic/FrutigerLTArabic-55Roman.woff2') format('woff2');
	font-weight: 100 500;
	font-style: normal;
	font-display: swap;
	unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+10E60-10E7E, U+1EE00-1EEFF, U+200C-200F, U+2010-2011, U+204F, U+2E41, U+FD3E-FD3F;
}

@font-face {
	font-family: 'Noto Sans';
	src: url('/wp-content/themes/paglobal/assets/fonts/frutiger-lt-arabic/FrutigerLTArabic-65Bold.woff2') format('woff2');
	font-weight: 600 900;
	font-style: normal;
	font-display: swap;
	unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+10E60-10E7E, U+1EE00-1EEFF, U+200C-200F, U+2010-2011, U+204F, U+2E41, U+FD3E-FD3F;
}

/* ── Typographic corrections for Arabic ──────────────────────────────────────── */

/*
 * app-rtl.css sets line-height 1 on every heading, which is survivable in Latin and
 * clips Arabic: the script carries no ascenders to spare, but it does carry dots below
 * the baseline and hamzas above it.
 */
html[lang="ar"] h1,
html[lang="ar"] h2,
html[lang="ar"] h3,
html[lang="ar"] h4,
html[lang="ar"] h5,
html[lang="ar"] h6,
html[lang="ar"] .h1,
html[lang="ar"] .h2,
html[lang="ar"] .h3,
html[lang="ar"] .h4,
html[lang="ar"] .h5,
html[lang="ar"] .h6 {
	line-height: 1.4;
}

html[lang="ar"] body {
	line-height: 1.8;
}

/* Letter-spacing does not apply to a cursive script: it breaks the joins apart. */
html[lang="ar"] * {
	letter-spacing: normal !important;
}

/*
 * Arabic has no capitals, so an upper-casing rule meant for Latin headings does nothing
 * visible but does disable the font's own shaping decisions in some engines. Turned off
 * where the theme applies it.
 */
html[lang="ar"] [class*="text-uppercase"],
html[lang="ar"] .btn,
html[lang="ar"] .nav-link,
html[lang="ar"] h1,
html[lang="ar"] h2,
html[lang="ar"] h3 {
	text-transform: none;
}

/* Arabic runs longer than English, so fixed-width controls have to be allowed to wrap. */
html[lang="ar"] .btn {
	white-space: normal;
}

/*
 * Numerals stay Western (2026, 50+), which is what Levant and Gulf business writing
 * uses, so they must read left-to-right inside right-to-left copy. Browsers do this by
 * the bidi algorithm on their own; this only stops a stray `unicode-bidi` in the theme
 * from overriding it.
 */
html[lang="ar"] time,
html[lang="ar"] .date,
html[lang="ar"] [class*="count"] {
	unicode-bidi: plaintext;
}

/*
 * Elements parked off-screen at a huge negative offset.
 *
 * The forms carry a spam honeypot rendered with an inline
 * `position:absolute; left:-9999px` - the oldest way of hiding a field from people while
 * leaving it for bots. In a left-to-right page that overflow is off the inline start and
 * browsers do not make it scrollable, so it costs nothing. **In a right-to-left page the
 * inline axis flips and the same element extends the scrollable width by ten thousand
 * pixels**: the document became 11,433px wide against a 1,434px viewport, the page opened
 * scrolled to an empty region, and /ar/about-us/ and /ar/contact-us/ rendered as blank
 * white pages.
 *
 * It is an inline style, so no amount of mirroring app-rtl.css could reach it. Matching
 * the style attribute does, and `!important` outranks an inline declaration that is not
 * itself important. Parking it at the inline start instead keeps it hidden and keeps the
 * overflow unscrollable.
 *
 * Deliberately written against the -9999 pattern rather than `input[name="website"]`, so
 * any other element hidden the same way anywhere on the site is covered too.
 */
html[lang="ar"] [style*="-9999"] {
	left: auto !important;
	right: -9999px !important;
}

/*
 * Mixed Arabic and English copy.
 *
 * In a right-to-left paragraph the bidi algorithm treats a trailing full stop as
 * neutral and pushes it to the left end, so an untranslated English sentence renders as
 * ".with confidence" instead of "with confidence.". The same happens to brackets, colons
 * and quotation marks around Latin runs.
 *
 * `unicode-bidi: plaintext` makes each paragraph take its direction from its own first
 * strong character: Arabic paragraphs stay right-to-left, English ones render
 * left-to-right with their punctuation where it belongs. It affects inline bidi
 * resolution only, never block layout, and it keeps the page readable while copy is
 * still being translated - and afterwards, for the brand names, standards and English
 * citation titles that stay in Latin on purpose.
 */
html[lang="ar"] p,
html[lang="ar"] li,
html[lang="ar"] h1,
html[lang="ar"] h2,
html[lang="ar"] h3,
html[lang="ar"] h4,
html[lang="ar"] h5,
html[lang="ar"] h6,
html[lang="ar"] figcaption,
html[lang="ar"] blockquote,
html[lang="ar"] td,
html[lang="ar"] th,
html[lang="ar"] label,
html[lang="ar"] .title,
html[lang="ar"] .sub-title,
html[lang="ar"] .text,
html[lang="ar"] .sub-title-diagonal {
	unicode-bidi: plaintext;
}

/* ── Mirroring the LTR-only Bootstrap utilities ──────────────────────────────── */

/*
 * vendors.css is a single left-to-right Bootstrap build and is loaded for every
 * language, while app-rtl.css only ever carried the theme's own rules. So the handful of
 * direction-sensitive Bootstrap utilities the templates use still pushed margins and
 * padding to the left-to-right side on /ar/, and `!important` in the vendors build meant
 * nothing in the theme could win against them.
 *
 * These are the six that are actually used, found by scanning every template rather than
 * mirroring the whole of Bootstrap: `ms-*`/`me-*` and `ps-*`/`pe-*` are start/end in
 * name but compile to left/right, and `text-end` compiles to `right`, which is the
 * *start* of a line in Arabic and therefore wrong.
 *
 * `!important` is needed here only to beat the `!important` in the vendors build. If more
 * utilities are added to the templates later, re-run ar/find-ltr-utilities.py, which
 * lists exactly which ones have no mirror.
 */

/* .me-1 - margin-right:.25rem - beside icons in the careers, insight and news listings */
html[lang="ar"] .me-1 {
	margin-right: 0 !important;
	margin-left: .25rem !important;
}

/* .me-3 - margin-right:1rem - the search box, and the insight and news cards */
html[lang="ar"] .me-3 {
	margin-right: 0 !important;
	margin-left: 1rem !important;
}

/* .ms-4 - margin-left:1.5rem - the Locations list */
html[lang="ar"] .ms-4 {
	margin-left: 0 !important;
	margin-right: 1.5rem !important;
}

/* .ps-5 / .pe-5 - padding:3rem - the search results template */
html[lang="ar"] .ps-5 {
	padding-left: 0 !important;
	padding-right: 3rem !important;
}

html[lang="ar"] .pe-5 {
	padding-right: 0 !important;
	padding-left: 3rem !important;
}

/*
 * .text-end - text-align:right - the home page and the Become a Member Firm form. In
 * Arabic the end of a line is the left, so this has to flip or the copy sits against the
 * wrong margin.
 */
html[lang="ar"] .text-end {
	text-align: left !important;
}
