/* Guide Services: [guide_services] grid. Inherits the theme's fonts and colours. */

/* minmax(0, 1fr) stops the non-wrapping chip row on phones from widening the layout. */
.guide-services {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 1.5rem;
}

.guide-services *,
.guide-services *::before,
.guide-services *::after {
	box-sizing: border-box;
}

.guide-services__sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Category filter: a row of chips above the heading. */
.guide-services__filter-list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.guide-services__filter-button {
	margin: 0;
	padding: 0.45em 1em;
	border: 1px solid currentColor;
	border-radius: 999px;
	background: none;
	color: inherit;
	font: inherit;
	line-height: 1.2;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.guide-services__filter-button:hover {
	background: color-mix(in srgb, currentColor 12%, transparent);
}

.guide-services__filter-button[aria-pressed="true"] {
	border-color: var(--wp--preset--color--primary, currentColor);
	background: var(--wp--preset--color--primary, currentColor);
	color: #fff;
}

.guide-services__filter-button:focus-visible,
.guide-services__button .wp-block-button__link:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* Heading and count */
.guide-services__main {
	min-width: 0;
}

.guide-services__heading {
	margin: 0 0 0.5rem;
	line-height: 1.15;
}

.guide-services__count {
	margin: 0 0 1.5rem;
	opacity: 0.85;
}

/* Grid */
.guide-services__grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 1.5rem 1rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.guide-services__card {
	display: flex;
	flex-direction: column;
	margin: 0;
	text-align: center;
}

.guide-services__card[hidden] {
	display: none;
}

.guide-services__media {
	aspect-ratio: 1;
	margin-bottom: 1rem;
	overflow: hidden;
	border-radius: 8px;
}

.guide-services__image,
.guide-services__placeholder {
	display: block;
	width: 100%;
	height: 100%;
	max-width: 100%;
	object-fit: cover;
}

.guide-services__placeholder {
	background: color-mix(in srgb, currentColor 12%, transparent);
}

.guide-services__title {
	margin: 0 0 0.4rem;
	font-size: 1.2rem;
	line-height: 1.3;
}

.guide-services__meta {
	margin: 0 0 1rem;
	font-weight: 600;
}

.guide-services__separator {
	margin: 0 0.5em;
}

/* Button row ("See details", "Book now"). Each button is wrapped in .wp-block-button so the theme's button block style (radius etc.) applies. */
.guide-services__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.5rem;
	margin-top: auto;
}

/* Slightly smaller than the theme default so both buttons fit on one line in a card.
   The transparent border keeps "Book now" the same height as the outlined button. */
.guide-services__actions .wp-block-button__link {
	padding: 0.6em 0.9em;
	border: 2px solid transparent;
	font-size: 0.9375rem;
	white-space: nowrap;
}

.guide-services__actions .guide-services__details .wp-block-button__link {
	border-color: var(--wp--preset--color--primary, currentColor);
	background: transparent;
	color: var(--wp--preset--color--primary, currentColor);
}

/* Tablets: three columns. */
@media (max-width: 1024px) {
	.guide-services__grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

/* Phones: chips scroll sideways instead of wrapping; two-column grid. */
@media (max-width: 600px) {
	.guide-services__filter-list {
		flex-wrap: nowrap;
		overflow-x: auto;
		padding-bottom: 0.25rem;
		scrollbar-width: thin;
	}

	.guide-services__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 1.25rem 0.75rem;
	}

	.guide-services__title {
		font-size: 1rem;
	}

	.guide-services__meta {
		font-size: 0.9rem;
	}

	.guide-services__separator {
		margin: 0 0.3em;
	}
}
