/*
 * [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: 170px; /* 210px until 2026-10-12 (client: tighter cards) */
	object-fit: cover;
}

.gsd-region-schedule__body {
	display: flex;
	flex-direction: column;
	flex-grow: 1;
	/* 0.75rem / 1.25rem 1.25rem 1.5rem until 2026-10-12 (client, second pass:
	   "tighter"). */
	gap: 0.5rem;
	padding: 1rem 1.25rem 1.25rem;
}

h2.gsd-region-schedule__title,
h3.gsd-region-schedule__title,
h4.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;
}

/* Action stack pinned to the card bottom so cards in a row align. No padding of
   its own (2026-10-12, client: tighten the gap between the address and Book
   Online) — the body's flex gap is the only space above it on the tallest card.
   Book Online is the one button; everything else is the __links list below. */
.gsd-region-schedule__actions {
	display: flex;
	flex-direction: column;
	gap: 0.625rem;
	margin-top: auto;
}

.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;
	/* The theme's 15px 30px, slimmed with the rest of the card (2026-10-12). */
	padding: 12px 20px;
}

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

/*
 * Phone, Text Us, More Info (and the opt-in Visit Website) as TEXT LINKS, not
 * buttons (2026-10-12, client: "tighter" — every button but Book Online). Three
 * outlined 48px buttons became three ~24px lines.
 *
 * ⚠ Element-qualified on purpose: the schedule pages sit in .entry, whose
 * `.entry li` (10px margin-bottom) and `.entry a` / `.entry a:hover` (underline,
 * gold hover) would otherwise win over bare classes. Gold on white is ~2.4:1
 * (fails 1.4.3), so the hover is an underline in the same navy.
 * min-height 24px is the SC 2.5.8 target floor; the list's gap adds the rest.
 */
.gsd-region-schedule ul.gsd-region-schedule__links {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.125rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.gsd-region-schedule ul.gsd-region-schedule__links > li {
	margin: 0;
	padding: 0;
	line-height: 1.35;
}

.gsd-region-schedule__links a.gsd-region-schedule__link {
	display: inline-flex;
	align-items: center;
	gap: 0.45em;
	min-height: 24px;
	color: var(--color-2, #001543);
	font-size: 1rem;
	font-weight: 500;
	text-decoration: none;
}

.gsd-region-schedule__links a.gsd-region-schedule__link:hover,
.gsd-region-schedule__links a.gsd-region-schedule__link:focus-visible {
	color: var(--color-2, #001543);
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

/* ---------------------------------------------------------------------------
 * layout="compact" — the same-day appointment row
 * (/east-bay-same-day-appointments/ and friends). No photo: name + address +
 * the centred links, 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: 1rem;
	text-align: center;
}

.gsd-region-schedule--compact h2.gsd-region-schedule__title,
.gsd-region-schedule--compact h3.gsd-region-schedule__title,
.gsd-region-schedule--compact h4.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 links sit centred under the centred address, at its size. */
.gsd-region-schedule--compact ul.gsd-region-schedule__links {
	align-items: center;
}

.gsd-region-schedule--compact .gsd-region-schedule__links a.gsd-region-schedule__link {
	font-size: 0.9rem;
}

/* Any additional_buttons (booking CTAs, still buttons) read as secondary to it.
   Empty on every office since 2026-10-08. */
.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;
}

/* ---------------------------------------------------------------------------
 * group="region" — the Same Day Appointment page's stacked region groups.
 *
 * Replaces six hand-built glacial/section blocks with one shortcode, so the
 * spacing those sections used to supply has to be recreated here. The page sits
 * inside ONE .main-service-section .wrap now, and each region is a <section>
 * within it: first group flush to the intro, the rest separated.
 * ------------------------------------------------------------------------- */
.gsd-region-schedule-group__region + .gsd-region-schedule-group__region {
	margin-top: clamp(2.5rem, 5vw, 4.5rem);
}

/*
 * The group heading is the same markup glacial/heading emits with line:true
 * (h2 + .special-line), so it inherits the theme's h2 styling; it only needs
 * its own bottom spacing, because .gsd-region-schedule's 2.5rem top margin sits
 * under the underline rather than under the text.
 */
.gsd-region-schedule-group__region > h2 {
	margin-bottom: 0.25rem;
}

/*
 * The ZIP tools belong to the region they sit in, so the gap above them is the
 * heading's, not the grid's. Without this the underline and the "Find the
 * closest office" field collide at narrow widths.
 */
.gsd-region-schedule-group__region .gsd-schedule-zip {
	margin-top: 1.5rem;
}

/*
 * Affiliate byline in bold (client, 2026-09-23). The paragraph carries no other
 * rule on the card, so this is its only styling; the /locations/ finder's copy
 * of the same byline is bolded in the plugin's map-module.css to match.
 */
.gsd-region-schedule p.location-affiliate {
	font-weight: 700;
	/* webflow.css gives every <p> margin-bottom: 20px, which stacked on the body's
	   flex gap and opened a ~32px hole between the byline and the address (client,
	   2026-10-12: "tighten spacing on location cards"). The flex gap spaces it. */
	margin: 0;
}
