/**
 * RM Doctor Sync — grid styles.
 *
 * Everything is namespaced .rmds so it can drop into any theme, and every colour and
 * measure is a custom property so a theme can restyle it without overriding rules.
 */

.rmds {
	--rmds-columns: 3;
	--rmds-gap: 1.75rem;
	--rmds-radius: 8px;
	--rmds-border: #e2e5e9;
	--rmds-text: #1e2a32;
	--rmds-muted: #5a6b78;
	--rmds-accent: #0b6a9e;
	--rmds-surface: #fff;
	--rmds-placeholder: #eef1f4;
	--rmds-photo-height: 260px;

	margin: 0 0 2rem;
}

.rmds__heading {
	margin: 0 0 1.25rem;
}

.rmds__grid {
	display: grid;
	grid-template-columns: repeat(var(--rmds-columns), minmax(0, 1fr));
	gap: var(--rmds-gap);
}

/* Cards ------------------------------------------------------------------- */

.rmds-card {
	display: flex;
	flex-direction: column;
	background: var(--rmds-surface);
	border: 1px solid var(--rmds-border);
	border-radius: var(--rmds-radius);
	overflow: hidden;
	color: var(--rmds-text);
	text-decoration: none;
	height: 100%;
}

.rmds-card--linked {
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.rmds-card--linked:hover,
.rmds-card--linked:focus-visible {
	box-shadow: 0 8px 24px rgba(16, 32, 45, 0.12);
	transform: translateY(-2px);
	text-decoration: none;
}

.rmds-card__media {
	background: var(--rmds-placeholder);
}

.rmds-card__photo {
	display: block;
	width: 100%;
	height: var(--rmds-photo-height);
	object-fit: cover;
	object-position: center top;
}

.rmds-card__photo--placeholder {
	display: block;
	width: 100%;
	height: var(--rmds-photo-height);
	background: var(--rmds-placeholder);
}

.rmds-card__body {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	padding: 1.25rem;
	flex: 1 1 auto;
}

.rmds-card__name {
	margin: 0;
	font-size: 1.125rem;
	line-height: 1.3;
	color: var(--rmds-text);
}

.rmds-card__occupation {
	margin: 0;
	font-size: 0.9375rem;
	color: var(--rmds-muted);
}

.rmds-card__excerpt {
	margin: 0;
	font-size: 0.9375rem;
	line-height: 1.55;
	color: var(--rmds-muted);
}

.rmds-card__bio {
	font-size: 0.9375rem;
	line-height: 1.55;
}

.rmds-card__bio > *:first-child {
	margin-top: 0;
}

.rmds-card__bio > *:last-child {
	margin-bottom: 0;
}

/* Term pills -------------------------------------------------------------- */

.rmds-card__terms {
	display: flex;
	flex-wrap: wrap;
	gap: 0.375rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.rmds-term {
	font-size: 0.75rem;
	line-height: 1.4;
	padding: 0.2rem 0.55rem;
	border: 1px solid var(--rmds-border);
	border-radius: 999px;
	color: var(--rmds-muted);
	background: var(--rmds-placeholder);
}

.rmds-card__cta {
	margin-top: auto;
	padding-top: 0.5rem;
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--rmds-accent);
}

.rmds-card--linked:hover .rmds-card__cta {
	text-decoration: underline;
}

/* Empty state, notices, pagination ---------------------------------------- */

.rmds__empty {
	margin: 0;
	padding: 1.25rem;
	border: 1px dashed var(--rmds-border);
	border-radius: var(--rmds-radius);
	color: var(--rmds-muted);
	text-align: center;
}

.rmds-notice {
	padding: 0.9rem 1.1rem;
	border-radius: 6px;
	font-size: 0.9375rem;
	line-height: 1.5;
}

.rmds-notice--error {
	background: #fdf1f1;
	border: 1px solid #f0c2c2;
	color: #7c2222;
}

.rmds__pagination {
	display: flex;
	flex-wrap: wrap;
	gap: 0.375rem;
	align-items: center;
	justify-content: center;
	margin-top: 1.75rem;
}

.rmds__page {
	display: inline-block;
	min-width: 2.25rem;
	padding: 0.4rem 0.65rem;
	border: 1px solid var(--rmds-border);
	border-radius: 5px;
	text-align: center;
	text-decoration: none;
	color: var(--rmds-accent);
	font-size: 0.9375rem;
}

.rmds__page--current {
	background: var(--rmds-accent);
	border-color: var(--rmds-accent);
	color: #fff;
	font-weight: 600;
}

.rmds__page--gap {
	border-color: transparent;
	color: var(--rmds-muted);
}

/* Responsive -------------------------------------------------------------- */

/* repeat() only takes a literal integer, so the cap cannot be computed from the
   custom property. The wrapper carries the column count as a class instead. */
@media (max-width: 900px) {
	.rmds--cols-3 .rmds__grid,
	.rmds--cols-4 .rmds__grid,
	.rmds--cols-5 .rmds__grid,
	.rmds--cols-6 .rmds__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

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