can_marry_ROOT_trigger = {
	can_marry = ROOT
	religion = ROOT
	fertility >= 0.01
	is_consort = no
	is_ill = no
	is_pregnant = no
	is_incapable = no
	prisoner = no
	is_within_diplo_range = ROOT
	is_inaccessible_trigger = no

	# Don't marry off players' family
	NAND = {
		is_ruler = no

		liege = {
			ai = no
			dynasty = PREV
		}
	}

	# Matrilineal Considerations
	trigger_if = {
		limit = {
			ROOT = {
				wants_matrilineal_marriage_trigger = yes
			}
		}
		can_marry_matrilineally_trigger = yes
	}

	trigger_if = {
		limit = { is_older_than = ROOT }
		age_diff = {
			who = ROOT
			years < 3
		}
	}
	trigger_else_if = {
		limit = {
			ROOT = { is_older_than = PREV }
		}
		age_diff = {
			who = ROOT
			years < 10
		}
	}
	trigger_else_if = {
		limit = { is_female = yes }
		practical_age < 30
	}
	trigger_else = {
		practical_age < 40
	}

	trigger_if = {
		limit = {
			liege = { ai = no }
			is_ruler = no
		}

		liege = {
			NOR = {
				is_close_relative = PREV
				dynasty = PREV
			}
		}
	}
}

can_marry_matrilineally_trigger = {
	NOR = {
		has_law = agnatic_succession
		has_law = status_of_women_0
	}
}

wants_matrilineal_marriage_trigger = {
	is_female = yes

	trigger_if = {
		limit = { is_ruler = yes }

		OR = {
			trait = ambitious
			trait = proud
			trait = brave
			stewardship >= 10
			is_smart_trigger = yes
			is_ruler = yes
		}

		is_incapable = no
		is_dumb_trigger = no

		NOR = {
			trait = humble
			trait = content
		}
	}
	trigger_else = {
		OR = {
			any_heir_title = {
				is_primary_holder_title = yes

				holder_scope = {
					is_close_relative = PREVPREV

					OR = {
						trait = ambitious
						trait = proud
						higher_real_tier_than = COUNT
					}

					is_dumb_trigger = no
					is_incapable = no

					NOR = {
						trait = humble
						trait = content
					}
				}
			}

			any_pretender_title = {
				is_primary_holder_title = yes

				holder_scope = {
					is_close_relative = PREVPREV

					OR = {
						trait = ambitious
						trait = proud
						higher_real_tier_than = COUNT
					}

					is_dumb_trigger = no
					is_incapable = no

					NOR = {
						trait = humble
						trait = content
					}
				}
			}
		}
	}
}

is_pc_marriage_religion_trigger = { # Parent-Child Marriage Religions
	OR = {							# Can be used to check if PC relations are allowed
		true_religion = messalian
		religion_openly_egyptian_or_reformed_trigger = yes
		true_religion = zoroastrian
		has_religion_feature = religion_holy_family
		has_religion_feature = religion_feature_zun
	}
}

is_bs_marriage_religion_trigger = { # Brother-Sister Marriage Religions
	OR = {							# Can be used to check if BS relations are allowed
		true_religion = messalian
		true_religion = egyptian_pagan
		true_religion = zoroastrian
		has_religion_feature = religion_holy_family
		has_religion_feature = religion_feature_zun
		religion_openly_hellenic_or_reformed_trigger = yes
	}
}

is_cousin_marriage_religion_trigger = { # Cousin Marriage Religions
	OR = {
		true_religion_group = jewish_group
		true_religion_group = muslim
		true_religion = arabic_pagan
		true_religion = canaan_pagan
		has_religion_feature = religion_holy_family
		has_religion_feature = religion_feature_zun
		religion_openly_egyptian_or_reformed_trigger = yes
		religion_openly_hellenic_or_reformed_trigger = yes
	}
}

is_psc_marriage_religion_trigger = {
	OR = {
		true_religion = jewish
		has_religion_feature = religion_holy_family
		has_religion_feature = religion_feature_zun
		religion_openly_hellenic_or_reformed_trigger = yes
	}
}

religion_head_divorce_trigger = {
	OR = {
		religion = chalcedonian
		religion = catholic
		religion = fraticelli
		religion = orthodox
		religion = paulician
		religion = nestorian
		religion = monothelite
		religion = iconoclast
		religion = miaphysite
		religion = monophysite
		religion = zoroastrian
		religion = mazdaki
		religion = zurvanist
		religion = manichaean
		religion = mandaean
		religion = jewish
		religion = samaritan
		religion = karaite
		religion = hindu
		religion = buddhist
		religion = jain
	}
}