/**
 * Asher Exteriors - Project Map It integration (frontend styles).
 *
 * Scoped to the injected .asher-pmi-projects block so it blends into the
 * existing Asher Service Areas widget without touching the theme.
 *
 * Theme palette:
 *   Orange        #E2602E (hover #D3511F)
 *   Light grey bg #EEEBE9
 *   Dark grey     #625F5D
 *   Darker grey   #3D3B3A
 */

.asher-pmi-projects {
	margin-top: 28px;
	padding-top: 28px;
	border-top: 1px solid rgba(61, 59, 58, 0.1);
	opacity: 0;
	transition: opacity 0.35s ease;
}

.asher-pmi-projects.is-visible {
	opacity: 1;
}

.asher-pmi-heading {
	text-align: center;
	color: #3D3B3A;
	font-size: 2.2rem;
	line-height: 1.3;
	font-weight: 800;
	margin: 0 0 20px;
}

.asher-pmi-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 16px;
}

@media (min-width: 576px) {
	.asher-pmi-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 768px) {
	.asher-pmi-grid {
		grid-template-columns: repeat(3, 1fr);
	}

	/* Keep single/two-result layouts centred and consistently sized. */
	.asher-pmi-grid.asher-pmi-count-1 {
		grid-template-columns: minmax(0, 420px);
		justify-content: center;
	}

	.asher-pmi-grid.asher-pmi-count-2 {
		grid-template-columns: repeat(2, minmax(0, 360px));
		justify-content: center;
	}
}

.asher-pmi-card {
	display: block;
	text-decoration: none;
	color: inherit;
	border-radius: 12px;
	overflow: hidden;
	background: #FFFFFF;
	box-shadow: 0 1px 3px rgba(61, 59, 58, 0.08);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

a.asher-pmi-card:hover,
a.asher-pmi-card:focus-visible {
	transform: translateY(-2px);
	box-shadow: 0 6px 18px rgba(61, 59, 58, 0.16);
}

.asher-pmi-image {
	position: relative;
	width: 100%;
	aspect-ratio: 4 / 3;
	background: #EEEBE9;
	overflow: hidden;
}

/* Fallback for browsers without aspect-ratio support. */
@supports not (aspect-ratio: 4 / 3) {
	.asher-pmi-image {
		height: 0;
		padding-bottom: 75%;
	}
}

/*
 * The API returns photos at varying dimensions. Fixing the frame's aspect
 * ratio and cropping the image to cover it (centred) keeps every tile the
 * same size and centres the visible portion of each photo.
 */
.asher-pmi-image img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	display: block;
}

.asher-pmi-viewall.asher-btn {
	display: inline-block;
	width: 50%;
	text-align: center;
	background-color: rgba(226, 96, 46, 0.12);
	border-color: transparent;
	color: #E2602E;
	font-weight: 700;
	margin-top: 0;
}

@media (max-width: 575px) {
	.asher-pmi-viewall.asher-btn {
		width: 100%;
	}
}

.asher-pmi-viewall.asher-btn:hover,
.asher-pmi-viewall.asher-btn:focus-visible {
	background-color: #E2602E;
	color: #FFFFFF;
	border-color: transparent;
}

.asher-pmi-loading {
	text-align: center;
	color: #625F5D;
	font-size: 1.6rem;
	font-weight: 600;
	padding: 8px 0;
	position: relative;
}

.asher-pmi-loading::after {
	content: "";
	display: inline-block;
	width: 14px;
	height: 14px;
	margin-left: 8px;
	vertical-align: middle;
	border: 2px solid rgba(226, 96, 46, 0.35);
	border-top-color: #E2602E;
	border-radius: 50%;
	animation: asher-pmi-spin 0.7s linear infinite;
}

@keyframes asher-pmi-spin {
	to {
		transform: rotate(360deg);
	}
}

.asher-pmi-actions {
	margin-top: 20px;
	text-align: center;
}
