/* Governance chart (page-templates/governance.php). Scoped to .doc-gov. */

.doc-gov {
	--wine: var(--doc-primary, #670f48);
	--magenta: var(--doc-accent, #ab1b5f);
	--ink: #2b2230;
	--muted: #6e6272;
	--line: #e6d3df;
	--tint: #fbf5f8;
	--soft: #f4e9f0;
	font-family: inherit;
	color: var(--ink);
	max-width: 1120px;
	margin: 0 auto;
	padding: 32px 16px 48px;
	box-sizing: border-box;
}

.doc-gov *,
.doc-gov *::before,
.doc-gov *::after {
	box-sizing: border-box;
}

.dg-tier {
	display: flex;
	justify-content: center;
	position: relative;
}

.dg-link {
	width: 2px;
	height: 34px;
	margin: 0 auto;
	background: var(--line);
}

.dg-link.strong {
	background: var(--magenta);
}

/* Cards */
.dg-card {
	position: relative;
	width: 100%;
	max-width: 520px;
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 14px;
	box-shadow: 0 8px 24px rgba(98, 1, 72, .07);
	transition: box-shadow .25s, transform .25s;
}

.dg-card:hover {
	box-shadow: 0 14px 32px rgba(98, 1, 72, .13);
	transform: translateY(-2px);
}

.dg-card .dg-summary {
	list-style: none;
	cursor: pointer;
	padding: 18px 52px 18px 22px;
	position: relative;
}

.dg-card summary::-webkit-details-marker {
	display: none;
}

.dg-card summary::after {
	content: "+";
	position: absolute;
	right: 18px;
	top: 50%;
	transform: translateY(-50%);
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: var(--soft);
	color: var(--wine);
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	line-height: 1;
	transition: transform .25s;
}

.dg-card[open] summary::after {
	content: "\2212";
}

.dg-card summary:focus-visible {
	outline: 2px solid var(--magenta);
	outline-offset: 3px;
	border-radius: 14px;
}

.dg-tag {
	display: block;
	font-size: 12px;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--magenta);
	font-weight: 600;
	margin-bottom: 4px;
}

.dg-title {
	display: block;
	font-size: 20px;
	line-height: 1.3;
	font-weight: 700;
	color: var(--wine);
}

.dg-sub {
	display: block;
	font-size: 14.5px;
	color: var(--muted);
	margin-top: 4px;
	line-height: 1.5;
}

.dg-body {
	padding: 0 22px 20px;
	font-size: 15.5px;
	line-height: 1.7;
	animation: dgIn .3s ease;
}

.dg-body p {
	margin: 0 0 12px;
}

@keyframes dgIn {
	from {
		opacity: 0;
		transform: translateY(-4px);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

/* Filled cards for the top of each structure */
.dg-card.fill {
	background: var(--wine);
	border-color: var(--wine);
}

.dg-card.fill .dg-tag {
	color: #ffb3df;
}

.dg-card.fill .dg-title {
	color: #fff;
}

.dg-card.fill .dg-sub {
	color: #f1d6e6;
}

.dg-card.fill .dg-body {
	color: #fff;
}

.dg-card.fill summary::after {
	background: rgba(255, 255, 255, .16);
	color: #fff;
}

.dg-card.accent {
	border-top: 4px solid var(--magenta);
}

.dg-people {
	list-style: none;
	margin: 4px 0 0;
	padding: 0;
	display: grid;
	gap: 8px;
}

.dg-people li {
	display: flex;
	flex-direction: column;
	background: var(--tint);
	border-radius: 8px;
	padding: 10px 12px;
}

.dg-card.fill .dg-people li {
	background: rgba(255, 255, 255, .1);
}

.dg-people b {
	font-size: 15px;
	color: var(--ink);
}

/* Zegen colours every <b> in the accent colour, which is unreadable on the filled cards. */
.dg-card.fill .dg-people b {
	color: #fff;
}

.dg-people span {
	font-size: 13px;
	color: var(--muted);
}

.dg-card.fill .dg-people span {
	color: #f1d6e6;
}

.dg-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 4px 0 0;
	padding: 0;
	list-style: none;
}

.dg-card.fill .dg-chips li a {
	background: rgba(255, 255, 255, .16);
	color: #fff;
}

.dg-chips li a,
.dg-chips li span {
	display: inline-block;
	font-size: 13.5px;
	text-decoration: none;
	padding: 6px 12px;
	border-radius: 999px;
	background: var(--soft);
	color: var(--wine);
	border: 1px solid transparent;
	transition: all .2s;
}

.dg-chips li a:hover {
	background: var(--wine);
	color: #fff;
}

/* Outer band for the wider communion */
.dg-band {
	max-width: 640px;
	margin: 0 auto;
	text-align: center;
	border: 1px dashed var(--line);
	border-radius: 999px;
	padding: 12px 22px;
	font-size: 14.5px;
	color: var(--muted);
	background: var(--tint);
}

.dg-band b {
	color: var(--wine);
}

/* Two dioceses side by side */
.dg-split {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 28px;
	max-width: 820px;
	margin: 0 auto;
	position: relative;
	padding-top: 34px;
}

.dg-split::before {
	content: "";
	position: absolute;
	top: 0;
	left: 25%;
	right: 25%;
	height: 2px;
	background: var(--line);
}

.dg-split>div {
	position: relative;
	display: flex;
	justify-content: center;
}

.dg-split>div::before {
	content: "";
	position: absolute;
	top: -34px;
	left: 50%;
	width: 2px;
	height: 34px;
	background: var(--line);
	margin-left: -1px;
}

.dg-ghost {
	width: 100%;
	max-width: 360px;
	border: 1px dashed var(--line);
	border-radius: 14px;
	padding: 18px 22px;
	text-align: left;
	background: #fff;
}

.dg-ghost a {
	color: var(--magenta);
	font-size: 14px;
}

.dg-here {
	width: 100%;
	max-width: 360px;
	border-radius: 14px;
	padding: 18px 22px;
	background: var(--magenta);
	color: #fff;
	box-shadow: 0 10px 26px rgba(171, 27, 95, .25);
}

.dg-here .dg-tag {
	color: #ffe0f1;
}

.dg-here .dg-title {
	color: #fff;
}

.dg-here .dg-sub {
	color: #ffe0f1;
}

/* The Diocese container */
.dg-diocese {
	position: relative;
	margin: 34px auto 0;
	border: 2px solid var(--soft);
	border-radius: 22px;
	padding: 40px 20px 28px;
	background: linear-gradient(180deg, #fdf8fb, #fff);
}

.dg-diocese::before {
	content: "";
	position: absolute;
	top: -36px;
	left: 75%;
	width: 2px;
	height: 34px;
	background: var(--magenta);
}

.dg-diocese-label {
	position: absolute;
	top: -14px;
	left: 50%;
	transform: translateX(-50%);
	background: var(--wine);
	color: #fff;
	font-size: 13px;
	letter-spacing: .14em;
	text-transform: uppercase;
	font-weight: 600;
	padding: 6px 16px;
	border-radius: 999px;
	white-space: nowrap;
}

/* Three branches under the Standing Committee */
.dg-branches {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	align-items: start;
	gap: 20px;
	position: relative;
	padding-top: 34px;
}

.dg-branches::before {
	content: "";
	position: absolute;
	top: 0;
	left: calc((100% - 40px) / 6);
	right: calc((100% - 40px) / 6);
	height: 2px;
	background: var(--line);
}

.dg-branches>.dg-col {
	position: relative;
}

.dg-branches>.dg-col::before {
	content: "";
	position: absolute;
	top: -34px;
	left: 50%;
	width: 2px;
	height: 34px;
	background: var(--line);
	margin-left: -1px;
}

.dg-branches .dg-card {
	max-width: none;
}

.dg-foot {
	text-align: center;
	margin: 26px auto 0;
	max-width: 720px;
	font-size: 14.5px;
	color: var(--muted);
	line-height: 1.7;
}

.dg-foot b {
	color: var(--wine);
}

.dg-hint {
	text-align: center;
	font-size: 13.5px;
	color: var(--muted);
	font-style: italic;
	margin: 0 0 22px;
}

@media (max-width:820px) {

	.dg-split,
	.dg-branches {
		grid-template-columns: 1fr;
		gap: 16px;
	}

	.dg-split::before,
	.dg-branches::before,
	.dg-split>div::before,
	.dg-branches>.dg-col::before {
		display: none;
	}

	.dg-split {
		padding-top: 16px;
	}

	.dg-branches {
		padding-top: 16px;
	}

	.dg-diocese::before {
		left: 50%;
	}

	.dg-diocese {
		padding: 36px 12px 20px;
	}

	.dg-band {
		border-radius: 14px;
	}
}

@media (prefers-reduced-motion:reduce) {
	.doc-gov * {
		transition: none !important;
		animation: none !important;
	}
}

/* Static cards (no expandable content) and the elements that replaced inline styles. */
.doc-gov .dg-card--static .dg-summary {
	padding-right: 22px;
	cursor: default;
}

.doc-gov .dg-card--static:hover {
	box-shadow: 0 8px 24px rgba(98, 1, 72, .07);
	transform: none;
}

.doc-gov .dg-summary .dg-title {
	font-family: "Poppins", sans-serif;
}

.doc-gov .dg-body > *:last-child {
	margin-bottom: 0;
}

.doc-gov .dg-list-intro {
	margin: 14px 0 6px;
}

.doc-gov .dg-people + .dg-chips,
.doc-gov .dg-people + .dg-list-intro {
	margin-top: 14px;
}

.doc-gov .dg-more {
	margin: 12px 0 0;
}

.doc-gov .dg-more a {
	color: var(--magenta);
}

.doc-gov .dg-card.fill .dg-more a {
	color: #fff;
}

.doc-gov .dg-foot p {
	margin: 0 0 8px;
}

/* Connecting lines adapt to the sections that are shown. */
.doc-gov .dg-split--1 {
	grid-template-columns: minmax(0, 360px);
	justify-content: center;
}

.doc-gov .dg-split--1::before,
.doc-gov .dg-branches--1::before {
	display: none;
}

.doc-gov .dg-diocese--centre::before {
	left: 50%;
}

.doc-gov .dg-diocese--no-line::before {
	display: none;
}

.doc-gov .dg-branches--2 {
	grid-template-columns: repeat(2, 1fr);
}

.doc-gov .dg-branches--2::before {
	left: calc((100% - 20px) / 4);
	right: calc((100% - 20px) / 4);
}

.doc-gov .dg-branches--1 {
	grid-template-columns: minmax(0, 520px);
	justify-content: center;
}

/* Stem from the card above down to the branch bar. */
.doc-gov .dg-link--branch {
	height: 30px;
}

.doc-gov .dg-branches--top {
	padding-top: 0;
}

.doc-gov .dg-branches--top::before,
.doc-gov .dg-branches--top > .dg-col::before {
	display: none;
}

@media (max-width: 820px) {
	.doc-gov .dg-link--branch {
		display: none;
	}

	.doc-gov .dg-split--1,
	.doc-gov .dg-branches--1,
	.doc-gov .dg-branches--2 {
		grid-template-columns: 1fr;
	}
}
