/* Catalog introduction and search/filter layout. */
.services-intro__content {
	max-width: var(--reuse-content-size);
}

.services-filters {
	padding: var(--reuse-space-m);
	border: 1px solid var(--reuse-color-border);
	border-radius: var(--reuse-radius);
	background: var(--reuse-color-highlight);
}

.services-filters__fields {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--reuse-space-m);
	align-items: start;
}

/* Keep the search above the independent section/category/tag filters. */
.services-filters__search {
	grid-column: 1 / -1;
}

.services-filters__field {
	display: grid;
	min-width: 0;
	gap: 0.5rem;
}

.services-filters__field label {
	font-weight: 700;
}

.services-filters__field input,
.services-filters__field select {
	width: 100%;
	min-width: 0;
	font: inherit;
}

.services-filters__help {
	color: var(--reuse-color-muted);
	font-size: 0.85rem;
}

.services-filters__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	align-items: center;
	margin-block-start: var(--reuse-space-m);
}

/* Result count, service cards and optional contact information. */
.services-results {
	margin-block-start: var(--reuse-space-l);
}

.services-results__count {
	color: var(--reuse-color-muted);
}

.services-list {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--reuse-space-m);
}

.service-card {
	min-width: 0;
	padding: var(--reuse-space-m);
	border: 1px solid var(--reuse-color-border);
	border-radius: var(--reuse-radius);
	background: var(--reuse-color-surface);
	overflow-wrap: anywhere;
}

.service-card__title {
	margin-block: 0 1rem;
	font-size: clamp(1.35rem, 3vw, 1.8rem);
}

.service-card__contacts {
	display: grid;
	gap: 0.75rem;
	margin-block: 1.25rem;
}

.service-card__contacts dt {
	color: var(--reuse-color-muted);
	font-size: 0.875rem;
}

.service-card__contacts dd {
	margin: 0.25rem 0 0;
}

/* Taxonomy links and accessible page navigation. */
.service-card__taxonomy {
	margin-block-start: 1rem;
	font-size: 0.875rem;
}

.service-card__terms,
.services-pagination ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	padding: 0;
	list-style: none;
}

.service-card__terms {
	margin: 0.5rem 0 0;
}

.service-card__terms a {
	display: inline-block;
	padding: 0.35rem 0.75rem;
	border-radius: 999px;
	background: var(--reuse-color-highlight);
	text-decoration: none;
}

.services-pagination {
	margin-block-start: var(--reuse-space-l);
}

.services-pagination a,
.services-pagination__current,
.services-pagination__gap {
	display: inline-flex;
	min-width: 2.75rem;
	min-height: 2.75rem;
	align-items: center;
	justify-content: center;
	padding: 0.35rem 0.75rem;
	border: 1px solid var(--reuse-color-border);
	border-radius: 999px;
	text-decoration: none;
}

.services-pagination__current {
	background: var(--reuse-color-highlight);
	font-weight: 700;
}

.services-pagination__gap {
	border-color: transparent;
}

/* Error visibility and small-screen layout. */
.services-message--error {
	border-style: solid;
}

.services-catalog :focus-visible {
	outline: 3px solid var(--reuse-color-accent-dark);
	outline-offset: 3px;
}

@media (max-width: 760px) {
	.services-filters__fields,
	.services-list {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* Asynchronous loading announcements and recoverable request failures. */
.services-status:not(.screen-reader-text),
.services-feedback {
	margin-block-start: var(--reuse-space-l);
}

.services-status:not(.screen-reader-text) {
	min-block-size: 3rem;
	padding: var(--reuse-space-m);
	border-radius: var(--reuse-radius);
	background: var(--reuse-color-highlight);
}

.services-feedback {
	overflow-wrap: anywhere;
}

/* Compact thumbnails at the bottom of each service card. */
.service-card__images {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-block-start: 1.25rem;
}

.service-card__image {
	display: block;
	width: 5rem;
	height: 5rem;
	overflow: hidden;
	border: 1px solid var(--reuse-color-border);
	border-radius: var(--reuse-radius);
}

.service-card__image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Native modal dialog provides focus containment and Escape handling. */
.services-gallery-open {
	overflow: hidden;
}

.services-gallery {
	box-sizing: border-box;
	width: min(56rem, calc(100vw - 2rem));
	max-height: calc(100vh - 2rem);
	max-height: calc(100dvh - 2rem);
	padding: 1rem;
	border: 1px solid var(--reuse-color-border);
	border-radius: var(--reuse-radius);
	background: var(--reuse-color-surface);
	color: var(--reuse-color-text);
	overflow: auto;
}

.services-gallery::backdrop {
	background: rgb(0 0 0 / 75%);
}

.services-gallery__header {
	display: flex;
	gap: 1rem;
	align-items: start;
	justify-content: space-between;
	margin-block-end: 1rem;
}

.services-gallery__title {
	margin: 0;
	font-size: 1.25rem;
	overflow-wrap: anywhere;
}

/* Bold logo-colored icons with generous touch targets and no button fill. */
.services-gallery__close,
.services-gallery__navigation button {
	width: 2.75rem;
	height: 2.75rem;
	min-width: 2.75rem;
	min-height: 2.75rem;
	padding: 0.5rem;
	flex-shrink: 0;
	border: 0;
	border-radius: 0.25rem;
	background: transparent;
	color: var(--reuse-color-accent);
	box-shadow: none;
	line-height: 0;
}

.services-gallery__close:hover,
.services-gallery__navigation button:hover {
	background: transparent;
	color: var(--reuse-color-accent-dark);
}

.services-gallery__icon {
	display: block;
	width: 100%;
	height: 100%;
	fill: none;
	stroke: currentColor;
	stroke-width: 3.5;
	stroke-linecap: round;
	stroke-linejoin: round;
	pointer-events: none;
}

.services-gallery__image-container {
	display: grid;
	place-items: center;
	min-width: 0;
}

.services-gallery__image {
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 65vh;
	object-fit: contain;
}

.services-gallery__image[hidden] {
	display: none;
}

.services-gallery__navigation {
	display: grid;
	grid-template-columns: 2.75rem minmax(0, 1fr) 2.75rem;
	gap: 0.5rem;
	align-items: center;
	margin-block-start: 1rem;
}

.services-gallery__counter {
	grid-column: 2;
	margin: 0;
	text-align: center;
}

/* Keep the administrator edit link beside the title without overlapping text. */
.service-card__header {
	display: flex;
	gap: 0.75rem;
	align-items: flex-start;
	margin-block-end: 1rem;
}

.service-card__header .service-card__title {
	flex: 1;
	min-width: 0;
	margin: 0;
}

.service-card__edit {
	display: inline-flex;
	box-sizing: border-box;
	width: 2.75rem;
	height: 2.75rem;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	padding: 0.5rem;
	color: var(--reuse-color-accent);
}

.service-card__edit:hover {
	color: var(--reuse-color-accent-dark);
}

.service-card__edit svg {
	width: 100%;
	height: 100%;
	fill: none;
	stroke: currentColor;
	stroke-width: 2.5;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* Select filters remain visible without JavaScript and on desktop screens. */
.services-filters__selects {
	display: grid;
	grid-column: 1 / -1;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--reuse-space-m);
	min-width: 0;
}

.services-filters__selects[hidden],
.services-filters__toggle[hidden] {
	display: none;
}

/* Mobile disclosure looks like a link while retaining button semantics. */
.services-filters__toggle {
	grid-column: 1 / -1;
	justify-self: start;
	min-height: 2.75rem;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: var(--reuse-color-accent-dark);
	font: inherit;
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

.services-filters__toggle:hover {
	background: transparent;
	color: var(--reuse-color-accent-deep);
}

@media (max-width: 760px) {
	.services-filters__selects {
		grid-template-columns: minmax(0, 1fr);
	}
}

.service-card__reviews { margin-top: 1.5rem; }
.service-card__reviews h3 { font-size: 1rem; margin: 0 0 .75rem; }
.service-card__review { margin: 0; padding: 1rem 0 1rem 1rem; border-left: 3px solid #c3dce0; }
.service-card__review + .service-card__review { border-top: 1px solid #dbe6e8; margin-top: .75rem; }
.service-card__review p { margin: 0; }
.service-card__review footer { margin-top: .6rem; font-size: .9rem; color: #627780; }
.service-card__contacts dd > p:first-child { margin-top: 0; }
.service-card__contacts dd > p:last-child { margin-bottom: 0; }

.service-card__actions { display: flex; flex-shrink: 0; gap: .15rem; }
.service-card__delete { display: inline-flex; box-sizing: border-box; width: 2.75rem; height: 2.75rem; flex-shrink: 0; align-items: center; justify-content: center; padding: .5rem; border: 0; border-radius: 4px; background: transparent; color: var(--reuse-color-accent); cursor: pointer; }
.service-card__delete:hover { color: #b32d2e; background: #fcf0f1; }
.service-card__delete:disabled { opacity: .5; cursor: wait; }
.service-card__delete svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; }
