/*
 * Minimum font size on Gravity Forms controls.
 *
 * Loaded only when the tweak is switched on. The size arrives as one custom
 * property in a small inline block:
 *   --igg-cfs-size  the minimum font size for form controls
 *
 * The 16px fallback is the iOS zoom threshold, so the file behaves correctly on
 * its own if the inline block is ever missing.
 *
 * Buttons, labels and field descriptions are not touched: focusing a button
 * does not zoom, so resizing one would be a design change rather than a fix.
 */

/*
 * The Orbital theme, which is the Gravity Forms default. One property covers
 * the control, its placeholder and its read-only text, because Gravity Forms
 * defines --gf-ctrl-placeholder-font-size and --gf-ctrl-readonly-font-size as
 * var( --gf-ctrl-font-size ).
 *
 * Two classes here against the one Gravity Forms uses to set the same property
 * (.gform-theme--framework), so this wins on specificity and not on which
 * stylesheet happens to print second.
 */
.gform_wrapper.gform-theme {
	--gf-ctrl-font-size: var( --igg-cfs-size, 16px );
}

/*
 * The gravity-theme and legacy markup, which have no such property, plus any
 * control a site theme is sizing itself.
 *
 * The repeated class is deliberate, not a typo. The rule this has to outrank is
 *
 *   .gform_wrapper.gravity-theme input[type=text] { font-size: 15px }
 *
 * in Gravity Forms' theme.min.css, which scores three classes and an element
 * (an attribute selector counts as a class). Three .gform_wrapper plus the
 * :is() list, whose specificity is that of its heaviest argument, scores four
 * and an element, so this wins wherever the two meet.
 *
 * Where the Orbital theme is in play both rules resolve to the same size, so
 * the tie there is harmless.
 *
 * Only controls that accept typed input are listed. Checkboxes, radios, file
 * pickers, ranges, color swatches and buttons never trigger the zoom.
 */
.gform_wrapper.gform_wrapper.gform_wrapper input:is(
		[type="date"],
		[type="datetime-local"],
		[type="email"],
		[type="month"],
		[type="number"],
		[type="password"],
		[type="search"],
		[type="tel"],
		[type="text"],
		[type="time"],
		[type="url"],
		[type="week"],
		:not( [type] )
	),
.gform_wrapper.gform_wrapper.gform_wrapper textarea,
.gform_wrapper.gform_wrapper.gform_wrapper select {
	font-size: var( --igg-cfs-size, 16px );
}
