/*
 * Gravity Forms im Aussehen des Themes.
 *
 * Geladen von JD_Theme_Gravity_Forms::enqueue_styles() (inc/gravityforms.php),
 * sobald eine Seite ein Formular enthält. Gravity Forms bleibt im eigenen
 * Theme „Orbital“; hier werden nur dessen CSS-Variablen (--gf-…) auf die
 * Werte aus theme.json gelegt. Dadurch färben sich die Formulare mit jeder
 * Stil-Variante des Themes um.
 *
 * Die Grundfarben, den Radius und zwei Schriftgrößen schreibt Gravity Forms
 * je Formular als Inline-Style mit ID-Selektor. Diese Variablen brauchen
 * deshalb `!important`, alle anderen nicht.
 */

.gform_wrapper.gform-theme.gform-theme--framework {

	/* Kontur der Eingabefelder: gedämpfte Textfarbe, etwas aufgehellt. */
	--jd-field-mix: var(--wp--preset--color--muted) 77%;
	--jd-field-border: color-mix(in srgb, var(--jd-field-mix), #fff);

	/* Von Gravity Forms inline gesetzt. */
	--gf-color-primary: var(--wp--preset--color--primary) !important;
	--gf-color-primary-contrast: var(--wp--preset--color--base) !important;
	--gf-color-primary-darker: var(--wp--preset--color--primary-hover) !important;
	--gf-color-primary-lighter: var(--wp--preset--color--primary-hover) !important;
	--gf-color-in-ctrl: var(--wp--preset--color--base) !important;
	--gf-color-in-ctrl-contrast: var(--wp--preset--color--contrast) !important;
	--gf-color-in-ctrl-primary: var(--wp--preset--color--primary) !important;
	--gf-color-in-ctrl-primary-contrast: var(--wp--preset--color--base) !important;
	--gf-color-in-ctrl-primary-darker: var(--wp--preset--color--primary-hover) !important;
	--gf-color-in-ctrl-primary-lighter: var(--wp--preset--color--primary-hover) !important;
	--gf-color-out-ctrl-dark: var(--wp--preset--color--muted) !important;
	--gf-color-out-ctrl-dark-darker: var(--wp--preset--color--contrast) !important;
	--gf-radius: 10px !important;
	--gf-font-size-secondary: 1rem !important;
	--gf-font-size-tertiary: var(--wp--preset--font-size--small) !important;
	--gf-ctrl-border-color: var(--jd-field-border) !important;
	--gf-ctrl-label-color-primary: var(--wp--preset--color--contrast) !important;
	--gf-ctrl-label-color-secondary: var(--wp--preset--color--muted) !important;

	/*
	 * Größen: Der Inline-Style verweist auf die Stufe „md“ (Standardgröße
	 * im Formular-Block), deshalb werden deren Werte gesetzt.
	 */
	--gf-ctrl-size-md: 3.5rem;
	--gf-ctrl-choice-size-md: 1.375rem;
	--gf-ctrl-btn-size-md: 3.5rem;
	--gf-ctrl-btn-font-size-md: 1.0625rem;
	--gf-ctrl-btn-padding-x-md: 1.625rem;

	/* Abstände zwischen den Feldern. */
	--gf-form-gap-y: 1.125rem;

	/* Eingabefelder. */
	--gf-ctrl-padding-x: 1rem;
	--gf-ctrl-font-family: inherit;
	--gf-ctrl-font-size: 1.0625rem;
	--gf-ctrl-border-width: 2px;
	--gf-ctrl-border-color-hover: var(--wp--preset--color--muted);
	--gf-ctrl-border-color-focus: var(--wp--preset--color--primary);
	--gf-ctrl-placeholder-color: var(--jd-field-border);
	--gf-ctrl-placeholder-opacity: 1;
	--gf-ctrl-shadow: none;
	--jd-focus-mix: var(--wp--preset--color--primary) 45%;
	--gf-ctrl-outline-color-focus: color-mix(in srgb, var(--jd-focus-mix), transparent);
	--gf-ctrl-textarea-height: 11.75rem;
	--gf-ctrl-textarea-padding-y: 0.875rem;

	/* Beschriftungen. */
	--gf-ctrl-label-font-family-primary: inherit;
	--gf-ctrl-label-font-weight-primary: 600;


	/* „Secondary“: Texte neben Kontrollkästchen, z. B. die Einwilligung. */
	--gf-ctrl-label-font-family-secondary: inherit;
	--gf-ctrl-label-font-size-secondary: var(--wp--preset--font-size--small);
	--gf-ctrl-label-line-height-secondary: 1.45;
	--gf-ctrl-label-font-family-tertiary: inherit;
	--gf-ctrl-label-color-tertiary: var(--wp--preset--color--muted);
	--gf-ctrl-label-line-height-tertiary: 1.45;
	--gf-ctrl-desc-font-family: inherit;

	/* Kontrollkästchen und Auswahlfelder. */
	--gf-field-choice-gap: 0.75rem;

	/* Buttons wie die Buttons des Themes. */
	--gf-ctrl-btn-radius: 999px;
	--gf-ctrl-btn-font-family: inherit;
	--gf-ctrl-btn-font-weight: 600;
	--gf-ctrl-btn-shadow: none;
	--gf-ctrl-btn-shadow-hover: none;
	--gf-ctrl-btn-bg-color-hover-primary: var(--wp--preset--color--primary-hover);
	--gf-ctrl-btn-border-color-hover-primary: var(--wp--preset--color--primary-hover);

	font-family: inherit;
}

/* Kontrollkästchen: kleiner Radius statt des Feld-Radius. */
.gform_wrapper.gform-theme.gform-theme--framework input[type="checkbox"] {
	border-radius: 5px;
}

/* Die Pflichtfeld-Legende ist geleert (inc/gravityforms.php). */
.gform_wrapper.gform-theme .gform_required_legend:empty {
	display: none;
}

/* Bestätigung nach dem Absenden. */
.gform_confirmation_wrapper.gform-theme .gform_confirmation_message {
	color: var(--wp--preset--color--contrast);
	font-size: var(--wp--preset--font-size--medium);
	line-height: 1.6;
}
