/*
 * X Font Awesome - IPS4 compatibility patches
 *
 * Fixes for core markup that assumed Font Awesome 4 glyph shapes and metrics.
 * Kept in its own file so the vendor stylesheets stay byte-identical to the
 * Font Awesome release and a version bump is a straight file swap.
 */

/* Half stars.
 *
 * Core builds a half star from two fa-star-half glyphs, the second flipped, and
 * relies on them landing at the same x. It joins them with margin-right:-1px on
 * the first and margin-left:-1px on the second, which was correct for Font
 * Awesome 4 where the glyph box was the glyph's own advance.
 *
 * Font Awesome 7 breaks that twice. The star-half advance is 1.125em, and the
 * base .fa rule now sets width:1.25em, which Font Awesome 4 never did. So the
 * box is 1.125em where core's own `.ipsRating > ul > li > i.fa { width:auto
 * !important }` applies and 1.25em everywhere else, and core's -1px no longer
 * closes either gap.
 *
 * Pin the box to the glyph advance, then pull the second half back by exactly
 * that width less core's 1px. Both halves then sit at the same x at any font
 * size, which is why this replaces the three per-size margin values the
 * reference app used. Those were measured against Font Awesome 6 at three fixed
 * sizes and were wrong for the small and veryLarge cases here, and wrong by 2px
 * for the ipsList_inline markup nexus uses in the support history table.
 *
 * The width rule loses to core's !important in the `> ul > li >` case, which is
 * fine: auto resolves to the same 1.125em advance there. */
.ipsRating .ipsRating_half .fa-star-half {
	width: 1.125em;
}

.ipsRating .ipsRating_half .fa-star-half.fa-flip-horizontal {
	margin-left: calc(1px - 1.125em);
}

/* Brand icons written in Font Awesome 4 syntax.
 *
 * `<i class="fa fa-bluesky">` puts the icon in the Font Awesome 7 Free family at
 * weight 900, but the glyph lives in the Brands file, so it draws a notdef box.
 * Font Awesome's own v4 shims do not cover these, correctly: they are not Font
 * Awesome 4 names. They are names core and third-party apps adopted later while
 * keeping the old two-class syntax.
 *
 * Under core's Font Awesome 4 these rendered nothing at all, so without this the
 * app turns an invisible icon into a visible broken square. Core ships one of
 * them, in front/sharelinks/bluesky.phtml.
 *
 * To find more after a Font Awesome upgrade, run the class sweep in
 * TEST_RUNTIME.md check FA11. Adding a name here is one selector. */
.fa.fa-bluesky,
.fa.fa-discord,
.fa.fa-mastodon {
	font-family: "Font Awesome 7 Brands";
	font-weight: 400;
}
