/*
 * [gsd_region_schedule] card grid — the region (newsletter-)schedule pages.
 * Enqueued by includes/gsd/gsd-region-schedule.php when the shortcode is present.
 */

.gsd-region-schedule {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
	gap: 2rem;
	margin: 2.5rem 0;
}

.gsd-region-schedule__location {
	display: flex;
	flex-direction: column;
	background: var(--wp--preset--color--white, #fff);
	border: 1px solid rgba(0, 21, 67, 0.1);
	overflow: hidden;
	box-shadow: 0 2px 12px rgba(0, 21, 67, 0.07);
}

.gsd-region-schedule__photo {
	margin: 0;
}

.gsd-region-schedule__photo img {
	display: block;
	width: 100%;
	height: 210px;
	object-fit: cover;
}

.gsd-region-schedule__body {
	display: flex;
	flex-direction: column;
	flex-grow: 1;
	gap: 0.75rem;
	padding: 1.25rem 1.25rem 1.5rem;
}

h2.gsd-region-schedule__title {
	margin: 0;
	font-size: 1.3rem;
	line-height: 1.25;
	color: var(--wp--preset--color--gsd-royal, #002d72);
}

p.gsd-region-schedule__address {
	margin: 0;
}

/* Button stack pinned to the card bottom so cards in a row align. */
.gsd-region-schedule__actions {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	margin-top: auto;
	padding-top: 0.5rem;
}

.gsd-region-schedule__actions .wp-block-button {
	width: 100%;
}

.gsd-region-schedule__actions .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5em;
	width: 100%;
	text-align: center;
}

.gsd-region-schedule__icon {
	width: 1.05em;
	height: 1.05em;
	flex: none;
}

/* ---------------------------------------------------------------------------
 * layout="compact" — the same-day appointment row
 * (/east-bay-same-day-appointments/ and friends). No photo, no Text Us:
 * name + address + phone + More Info, with Book Online promoted to a big
 * full-width primary. `cols` sets the row width via --gsd-rs-cols.
 * ------------------------------------------------------------------------ */
.gsd-region-schedule--compact {
	grid-template-columns: repeat(var(--gsd-rs-cols, 4), minmax(0, 1fr));
	gap: 1.25rem;
}

.gsd-region-schedule--compact .gsd-region-schedule__body {
	gap: 0.5rem;
	padding: 1.25rem 1rem 1.25rem;
	text-align: center;
}

.gsd-region-schedule--compact h2.gsd-region-schedule__title {
	font-size: 1.15rem;
}

.gsd-region-schedule--compact p.gsd-region-schedule__address {
	font-size: 0.9rem;
	line-height: 1.4;
}

/* The big one. Filled navy, larger type, sits last in the stack. */
.gsd-region-schedule--compact .gsd-region-schedule__book .wp-block-button__link {
	background: var(--color-2, #001543);
	color: #fff;
	border-color: var(--color-2, #001543);
	font-size: 1.05rem;
	padding: 0.85em 1em;
}

.gsd-region-schedule--compact .gsd-region-schedule__book .wp-block-button__link:hover {
	background: var(--color-6, #d29f13);
	border-color: var(--color-6, #d29f13);
	color: var(--color-2, #001543);
	transform: none;
}

/* The other two read as secondary next to it. */
.gsd-region-schedule--compact .wp-block-button:not(.gsd-region-schedule__book) .wp-block-button__link {
	font-size: 0.95rem;
	padding: 0.55em 0.75em;
}

@media (max-width: 1200px) {
	.gsd-region-schedule--compact {
		grid-template-columns: repeat(min(var(--gsd-rs-cols, 4), 3), minmax(0, 1fr));
	}
}

@media (max-width: 900px) {
	.gsd-region-schedule--compact {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 600px) {
	.gsd-region-schedule--compact {
		grid-template-columns: 1fr;
	}
}

/* ---------------------------------------------------------------------------
 * ZIP distance sort on the scheduling pages.
 *
 * The control markup is the service pages' (styled in style.css under
 * "Provided at These Locations"); only the spacing needs adjusting, because
 * .gsd-region-schedule carries its own 2.5rem top margin and would otherwise
 * float the tools away from the grid they act on.
 * ------------------------------------------------------------------------ */
.gsd-schedule-zip {
	margin-top: 2.5rem;
}

.gsd-schedule-zip .gsd-region-schedule {
	margin-top: 1rem;
}

/* Sits under the office name once a ZIP has been entered. */
.gsd-region-schedule .gsd-zip__distance {
	margin-top: -0.25rem;
}
