<?php
/**
 * Gravity Forms — site-matching form styling.
 *
 * Loads assets/bw-gf-form.css wherever a Gravity Form renders. Kept separate
 * from inc/bw-gf-review.php (which owns the review step and the progress dots)
 * because this applies to EVERY form on the site, not to one form's behaviour.
 *
 * See the stylesheet for what it changes and why.
 *
 * @package Kadence-Child
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

add_action(
	'gform_enqueue_scripts',
	function () {
		$dir = get_stylesheet_directory();
		$css = $dir . '/assets/bw-gf-form.css';
		if ( ! file_exists( $css ) ) {
			return;
		}
		wp_enqueue_style(
			'bw-gf-form',
			get_stylesheet_directory_uri() . '/assets/bw-gf-form.css',
			// After the review-step styles, so the shared border colour is
			// declared once here and inherited rather than fought over.
			array( 'bw-gf-review' ),
			filemtime( $css )
		);
	}
);
