/* NZPHA Club Map
   Colours are variables so they can be matched to the site in Divi
   (Theme Options > Custom CSS), e.g. .nzpha-map { --nzpha-active: #8b2e1f; } */

.nzpha-map,
.nzpha-club-details {
	--nzpha-land: #d9dccb;        /* province with no clubs */
	--nzpha-land-clubs: #9fae84;  /* province with clubs */
	--nzpha-hover: #5f7f45;       /* hover / focus */
	--nzpha-active: #2f4a2c;      /* selected province */
	--nzpha-edge: #ffffff;        /* borders between provinces */
	--nzpha-ink: #26301f;
	--nzpha-muted: #5d6652;
	--nzpha-rule: #d6d9cc;
}

.nzpha-map {
	display: grid;
	grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
	gap: 2.5rem;
	align-items: start;
	color: var(--nzpha-ink);
}

/* Map ------------------------------------------------------------------ */

.nzpha-map__figure {
	position: relative;
	max-width: 520px;
	width: 100%;
	justify-self: center;
}

.nzpha-map__svg {
	display: block;
	width: 100%;
	height: auto;
	overflow: visible;
}

.nzpha-map__province {
	fill: var(--nzpha-land);
	stroke: var(--nzpha-edge);
	stroke-width: 1.4;
	stroke-linejoin: round;
	cursor: pointer;
	transition: fill 0.15s ease;
}

.nzpha-map__province.has-clubs { fill: var(--nzpha-land-clubs); }

.nzpha-map__province.is-hover,
.nzpha-map__province:hover {
	fill: var(--nzpha-hover);
}

.nzpha-map__province.is-selected {
	fill: var(--nzpha-active);
}

.nzpha-map__province:focus { outline: none; }
.nzpha-map__province:focus-visible {
	stroke: var(--nzpha-ink);
	stroke-width: 3;
}

.nzpha-map__tip {
	position: absolute;
	z-index: 5;
	pointer-events: none;
	transform: translate(-50%, calc(-100% - 12px));
	padding: 0.35em 0.7em;
	background: var(--nzpha-ink);
	color: #fff;
	font-size: 0.875rem;
	line-height: 1.35;
	white-space: nowrap;
	border-radius: 3px;
}
.nzpha-map__tip strong { display: block; font-weight: 700; }

/* Side column ---------------------------------------------------------- */

.nzpha-map__intro {
	margin: 0 0 1rem;
	color: var(--nzpha-muted);
}

.nzpha-map__list {
	list-style: none !important;
	margin: 0 0 1.75rem !important;
	padding: 0 !important;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	column-gap: 1.25rem;
	border-top: 1px solid var(--nzpha-rule);
}
.nzpha-map__list li {
	margin: 0 !important;
	padding: 0 !important;
	border-bottom: 1px solid var(--nzpha-rule);
}

.nzpha-map__pick {
	all: unset;
	box-sizing: border-box;
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	width: 100%;
	padding: 0.45rem 0.25rem;
	cursor: pointer;
	color: var(--nzpha-muted);
	font: inherit;
	line-height: 1.4;
}
.nzpha-map__pick.has-clubs { color: var(--nzpha-ink); }

.nzpha-map__pick-count {
	font-size: 0.8em;
	font-variant-numeric: tabular-nums;
	color: var(--nzpha-muted);
}

.nzpha-map__pick.is-hover,
.nzpha-map__pick:hover { color: var(--nzpha-hover); }

.nzpha-map__pick[aria-pressed="true"] {
	color: var(--nzpha-active);
	font-weight: 700;
	box-shadow: inset 3px 0 0 var(--nzpha-active);
	padding-left: 0.6rem;
}

.nzpha-map__pick:focus-visible {
	outline: 2px solid var(--nzpha-ink);
	outline-offset: -2px;
}

/* Results -------------------------------------------------------------- */

.nzpha-map__panel:focus { outline: none; }

.nzpha-map__panel-title {
	margin: 0 0 0.75rem !important;
	padding: 0 !important;
	font-size: 1.35em;
	line-height: 1.25;
}

.nzpha-map__clubs {
	list-style: none !important;
	margin: 0 !important;
	padding: 0 !important;
}

.nzpha-map__club {
	margin: 0 0 0.9rem !important;
	padding: 0 0 0 0.9rem !important;
	border-left: 3px solid var(--nzpha-land-clubs);
}

.nzpha-map__club-name {
	display: block;
	font-weight: 700;
	color: var(--nzpha-active);
	text-decoration: none;
}
.nzpha-map__club-name:hover,
.nzpha-map__club-name:focus-visible { text-decoration: underline; }

.nzpha-map__club-meta {
	display: block;
	font-size: 0.9em;
	color: var(--nzpha-muted);
	overflow-wrap: anywhere;
}

.nzpha-map__empty { color: var(--nzpha-muted); }

/* Single club details ------------------------------------------------- */

.nzpha-club-details {
	margin: 0 0 2rem;
	border-top: 1px solid var(--nzpha-rule);
}
.nzpha-club-details__row {
	display: grid;
	grid-template-columns: 11rem minmax(0, 1fr);
	gap: 1rem;
	padding: 0.6rem 0;
	border-bottom: 1px solid var(--nzpha-rule);
}
.nzpha-club-details dt {
	font-weight: 700;
	color: var(--nzpha-muted);
}
.nzpha-club-details dd {
	margin: 0;
	overflow-wrap: anywhere;
}

/* Small screens -------------------------------------------------------- */

@media (max-width: 780px) {
	.nzpha-map {
		grid-template-columns: 1fr;
		gap: 1.5rem;
	}
	.nzpha-map__figure { max-width: 380px; }
	.nzpha-map__tip { display: none; }
	.nzpha-club-details__row { grid-template-columns: 1fr; gap: 0.15rem; }
}

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