/* AMECEA Directory — front end.
   Colours can be changed from your theme, e.g.
   .amd { --amd-accent: #8a1c2b; } */

.amd {
	--amd-accent: #1f4e79;
	--amd-accent-soft: #eaf1f8;
	--amd-border: #d9dde3;
	--amd-muted: #5b6470;
	--amd-bg: #ffffff;
	--amd-radius: 8px;
	font-size: 1rem;
	line-height: 1.5;
	margin: 1.5em 0;
}

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

/* Toolbar */
.amd-toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: center;
	margin-bottom: 1rem;
}
.amd-search-label {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}
.amd-search {
	flex: 1 1 260px;
	min-height: 44px;
	padding: 0.5rem 0.75rem;
	border: 1px solid var(--amd-border);
	border-radius: var(--amd-radius);
	font: inherit;
	background: var(--amd-bg);
}
.amd-search:focus {
	outline: 2px solid var(--amd-accent);
	outline-offset: 1px;
}
.amd-toggle-all {
	min-height: 44px;
	padding: 0.5rem 1rem;
	border: 1px solid var(--amd-accent);
	border-radius: var(--amd-radius);
	background: transparent;
	color: var(--amd-accent);
	font: inherit;
	cursor: pointer;
}
.amd-toggle-all:hover,
.amd-toggle-all:focus-visible {
	background: var(--amd-accent-soft);
}
.amd-no-results {
	padding: 1rem;
	border: 1px dashed var(--amd-border);
	border-radius: var(--amd-radius);
	color: var(--amd-muted);
}
.amd-live {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
}

/* Countries */
.amd-countries {
	list-style: none;
	margin: 0;
	padding: 0;
}
.amd-country {
	margin: 0 0 0.6rem;
	padding: 0;
	border: 1px solid var(--amd-border);
	border-radius: var(--amd-radius);
	background: var(--amd-bg);
	overflow: hidden;
}
.amd-country[hidden] {
	display: none;
}
.amd-country-heading {
	margin: 0;
	padding: 0;
	font-size: inherit;
	line-height: inherit;
}
.amd-country-btn {
	display: flex;
	align-items: center;
	gap: 1rem;
	width: 100%;
	min-height: 56px;
	margin: 0;
	padding: 0.85rem 1rem;
	border: 0;
	border-left: 4px solid transparent;
	background: transparent;
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
}
.amd-country-btn:hover {
	background: var(--amd-accent-soft);
}
.amd-country-btn:focus-visible {
	outline: 2px solid var(--amd-accent);
	outline-offset: -2px;
}
.amd-country-btn[aria-expanded="true"] {
	border-left-color: var(--amd-accent);
	background: var(--amd-accent-soft);
}
.amd-country-text {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-width: 0;
}
.amd-country-name {
	font-size: 1.15em;
	font-weight: 700;
	color: var(--amd-accent);
}
.amd-conf-name {
	font-size: 0.9em;
	color: var(--amd-muted);
}
.amd-count {
	flex: 0 0 auto;
	font-size: 0.85em;
	color: var(--amd-muted);
	white-space: nowrap;
}
.amd-chevron {
	flex: 0 0 auto;
	width: 0.6em;
	height: 0.6em;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
	transition: transform 0.2s ease;
	margin-right: 0.25rem;
}
.amd-country-btn[aria-expanded="true"] .amd-chevron {
	transform: rotate(-135deg);
}

/* Panel */
.amd-panel {
	padding: 0 1rem 1rem;
	border-top: 1px solid var(--amd-border);
}
.amd-panel[hidden] {
	display: none;
}

.amd-conference {
	margin: 1rem 0;
	padding: 0.9rem 1rem;
	border-radius: var(--amd-radius);
	background: var(--amd-accent-soft);
}
.amd-conference-title {
	margin: 0 0 0.5rem;
	font-weight: 700;
}

.amd-dl {
	margin: 0;
}
.amd-dl-row {
	display: grid;
	grid-template-columns: 11rem 1fr;
	gap: 0.15rem 1rem;
	padding: 0.2rem 0;
}
.amd-dl dt {
	font-weight: 600;
	color: var(--amd-muted);
}
.amd-dl dd {
	margin: 0;
	overflow-wrap: anywhere;
}

.amd-province {
	margin-top: 1.1rem;
}
.amd-province[hidden] {
	display: none;
}
.amd-province-title {
	margin: 0 0 0.4rem;
	font-size: 0.8em;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--amd-muted);
}

/* Jurisdictions: native drop-downs */
.amd-jurisdictions {
	list-style: none;
	margin: 0;
	padding: 0;
	border: 1px solid var(--amd-border);
	border-radius: var(--amd-radius);
}
.amd-j {
	margin: 0;
	border-top: 1px solid var(--amd-border);
}
.amd-j:first-child {
	border-top: 0;
}
.amd-j[hidden] {
	display: none;
}
.amd-j summary {
	display: grid;
	grid-template-columns: minmax(9rem, 1fr) 11rem 2fr;
	gap: 0.25rem 1rem;
	align-items: baseline;
	padding: 0.6rem 2rem 0.6rem 0.8rem;
	cursor: pointer;
	list-style: none;
	position: relative;
}
.amd-j summary::-webkit-details-marker {
	display: none;
}
.amd-j summary::after {
	content: "+";
	position: absolute;
	right: 0.8rem;
	top: 0.55rem;
	font-weight: 700;
	color: var(--amd-accent);
}
.amd-j details[open] > summary::after {
	content: "\2212";
}
.amd-j summary:hover {
	background: var(--amd-accent-soft);
}
.amd-j summary:focus-visible {
	outline: 2px solid var(--amd-accent);
	outline-offset: -2px;
}
.amd-j-name {
	font-weight: 600;
}
.amd-j-type {
	font-size: 0.85em;
	color: var(--amd-muted);
}
.amd-j-bishop {
	font-size: 0.95em;
}
.amd-badge {
	display: inline-block;
	padding: 0.05rem 0.5rem;
	border-radius: 999px;
	background: #fdecea;
	color: #8a1c1c;
	font-size: 0.85em;
	font-weight: 600;
}
.amd-j-body {
	padding: 0.3rem 0.8rem 0.8rem;
	font-size: 0.95em;
}
.amd-j-none {
	margin: 0;
	color: var(--amd-muted);
}

.amd-totals {
	margin-top: 1rem;
	font-size: 14px;
	color: #2c17e6;
}

/* Phones and narrow columns */
@media (max-width: 640px) {
	.amd-country-btn {
		flex-wrap: wrap;
		gap: 0.4rem 1rem;
	}
	.amd-count {
		order: 3;
		width: 100%;
	}
	.amd-j summary {
		grid-template-columns: 1fr;
	}
	.amd-dl-row {
		grid-template-columns: 1fr;
	}
}

@media (prefers-reduced-motion: reduce) {
	.amd-chevron {
		transition: none;
	}
}
