country_decisions = {

	italian_nation = {
		major = yes
		potential = {
			normal_or_historical_nations = yes
			OR = {
				ai = no
				is_playing_custom_nation = no
			}
			NOT = { exists = ITA }
			NOT = { tag = PAP }
			NOT = { tag = HLR }
			culture_group = latin
			OR = {
				ai = no
				AND = {
					ai = yes
					num_of_cities = 15
				}
			}
			is_colonial_nation = no
			OR = {
				is_former_colonial_nation = no
				AND = {
					is_former_colonial_nation = yes
					ai = no
				}
			}
		}
		allow = {
			adm_tech = 15
			is_subject = no
			is_at_war = no
			owns_core_province = 101	# Genoa
			owns_core_province = 104	# Milan
			owns_core_province = 106	# Modena
			owns_core_province = 108	# Verona
			owns_core_province = 109	# Mantua
			owns_core_province = 116	# Firenze
			owns_core_province = 117	# Siena
			owns_core_province = 118	# Roma
			owns_core_province = 119	# Ancona
		}
		effect = {
			if = {
				limit = {
					is_part_of_hre = yes
					is_elector = no
					is_emperor = no
				}
				emperor = {
					add_opinion = {
						who = root
						modifier = opinion_left_empire
					}
				}
				set_in_empire = no
				emperor = {
					country_event = { id = hre_event.5 }
				}
			}
			if = {
				limit = {
					NOT = { government_rank = 2 }
				}
				set_government_rank = 2
			}
			#if = {
			#	limit = {
			#		government = republic
			#	}
			#	change_government = despotic_monarchy
			#}
			change_tag = ITA
			italy_region = {
				limit = {
					NOT = { owned_by = ROOT }
				}
				add_permanent_claim = ITA
			}
			add_prestige = 25
			ITA = {
				set_capital = 118
			}
			if = {
				limit = { has_custom_ideas = no }
				country_event = { id = ideagroups.1 } #Swap Ideas
			}
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0
				government = republic
			}
		}
	}
	
	gods_kingdom = {
		major = yes
		potential = {
			normal_or_historical_nations = yes
			OR = {
				ai = no
				is_playing_custom_nation = no
			}
			NOT = { exists = ITA }
			tag = PAP
			NOT = { has_country_modifier = kingdom_of_god }
			OR = {
				ai = no
				AND = {
					ai = yes
					num_of_cities = 15
				}
			}
		}
		allow = {
			is_subject = no
			is_nomad = no
			is_at_war = no
			#Ecclesiastical provinces of Northern Italy
			owns_core_province = 101	# Genoa
			owns_core_province = 103	# Torino
			owns_core_province = 104	# Milano
			owns_core_province = 106	# Modena
			owns_core_province = 110	# Trento
			owns_core_province = 111	# Udine / Aquileia
			owns_core_province = 112	# Venice
			owns_core_province = 114	# Bologna + Ravenna
			owns_core_province = 116	# Firenze
			owns_core_province = 115	# Pisa
			owns_core_province = 119	# Ancona + Fermo
			owns_core_province = 2976	# Perugia
			owns_core_province = 2977	# Pesaro
		}
		effect = {
			add_country_modifier = {
				name = "kingdom_of_god"
				duration = -1
			}
			country_event  = { id = catholic_flavor.2 }
			every_province = {
				limit = {
					region = italy_region
					NOT = { owned_by = ROOT }
				}
				add_permanent_claim = ROOT
			}
		}
		ai_will_do = {
			factor = 1
		}
	}

}