/* Fire department card grid — matches the fundyfire.ca /departments layout. */

.spruce-fam-my-departments-search {
	max-width: 1080px;
	margin: 40px auto;
	padding: 0 20px;
}

.spruce-fam-my-departments-search h1 {
	margin: 0 0 16px;
}

.spruce-fam-dept-grid {
	display: grid;
	gap: 20px;
	padding: 10px 0;
}

@media (min-width: 1025px) {
	.spruce-fam-dept-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (min-width: 768px) and (max-width: 1024px) {
	.spruce-fam-dept-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 767px) {
	.spruce-fam-dept-grid {
		grid-template-columns: 1fr;
	}
}

.spruce-fam-dept-grid__card {
	position: relative;
	overflow: hidden;
}

.spruce-fam-dept-grid__link {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	text-decoration: none;
	color: inherit;
	transition: background-color 0.3s ease;
}

.spruce-fam-dept-grid__card:hover .spruce-fam-dept-grid__link,
.spruce-fam-dept-grid__link:hover {
	background-color: #f0f0f0;
}

.spruce-fam-dept-grid__header {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	margin: 0 auto 8px;
}

.spruce-fam-dept-grid__logo {
	flex: 0 0 auto;
	width: 120px;
	height: 120px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.spruce-fam-dept-grid__logo img {
	display: block;
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	border-radius: 4px;
	object-fit: contain;
}

.spruce-fam-dept-grid__details {
	flex: 1;
	min-width: 0;
}

.spruce-fam-dept-grid__title {
	margin: 0;
}

.spruce-fam-dept-grid__meta {
	text-align: center;
}

.spruce-fam-dept-grid__phone {
	margin-top: 0.25em;
}

/* Sit on the link, inside the card padding, so the labels stay on the
   hover color instead of the padding gap around it. */
.spruce-fam-dept-grid__prefix {
	position: absolute;
	top: 0;
	right: 0;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 0.15em;
	max-width: 46%;
	text-align: right;
	line-height: 1.3;
}

.spruce-fam-dept-grid__card--has-prefix .spruce-fam-dept-grid__header {
	margin-top: 1.15em;
}

.spruce-fam-dept-grid__card--has-corner-pair .spruce-fam-dept-grid__header {
	margin-top: 2.6em;
}

.spruce-fam-dept-grid__empty {
	margin: 0;
}
