/**
 * Doctors Grid & Profiles frontend styles.
 * All selectors are scoped with the dgp prefix.
 */

:root {
	--dgp-primary: #173f56;
	--dgp-button: #256285;
	--dgp-text: #293944;
	--dgp-font-family: inherit;
	--dgp-radius: 14px;
	--dgp-soft-blue: #f1f7fa;
	--dgp-border: #d4e4eb;
	--dgp-white: #ffffff;
	--dgp-muted: #5c7280;
	--dgp-shadow: 0 12px 34px rgba(37, 98, 133, 0.1);
}

.dgp-page,
.dgp-grid,
.dgp-profile,
.dgp-empty {
	box-sizing: border-box;
	color: var(--dgp-text);
	font-family: var(--dgp-font-family);
}

.dgp-page *,
.dgp-grid *,
.dgp-profile *,
.dgp-empty * {
	box-sizing: border-box;
}

.dgp-page {
	background: var(--dgp-white);
	padding: clamp(42px, 6vw, 88px) 20px;
}

.dgp-page__inner {
	margin: 0 auto;
	max-width: 1180px;
}

.dgp-grid {
	display: grid;
	grid-template-columns: repeat(var(--dgp-columns, 3), minmax(0, 1fr));
	gap: clamp(20px, 2.5vw, 32px);
	margin: 0;
	width: 100%;
}

.dgp-card {
	background: var(--dgp-white);
	border: 1px solid var(--dgp-border);
	border-radius: var(--dgp-radius);
	box-shadow: 0 6px 20px rgba(37, 98, 133, 0.065);
	display: flex;
	flex-direction: column;
	margin: 0;
	min-width: 0;
	overflow: hidden;
	transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.dgp-card:hover,
.dgp-card:focus-within {
	border-color: rgba(37, 98, 133, 0.42);
	box-shadow: var(--dgp-shadow);
	transform: translateY(-4px);
}

.dgp-card__image-link {
	background: var(--dgp-soft-blue);
	display: block;
	overflow: hidden;
}

.dgp-card__image {
	aspect-ratio: 4 / 5;
	display: block;
	height: auto;
	margin: 0;
	object-fit: cover;
	object-position: center center;
	transition: transform 280ms ease;
	width: 100%;
}

.dgp-card:hover .dgp-card__image,
.dgp-card:focus-within .dgp-card__image {
	transform: scale(1.025);
}

.dgp-card__content {
	display: flex;
	flex: 1;
	flex-direction: column;
	padding: clamp(22px, 2.3vw, 28px);
}

.dgp-card__title {
	color: var(--dgp-primary);
	font-size: clamp(1.2rem, 1.5vw, 1.42rem);
	font-weight: 700;
	letter-spacing: -0.018em;
	line-height: 1.25;
	margin: 0;
}

.dgp-card__title a {
	color: inherit;
	text-decoration: none;
}

.dgp-card__specialty {
	color: var(--dgp-muted);
	font-size: 0.96rem;
	line-height: 1.55;
	margin: 9px 0 0;
}

.dgp-button {
	align-items: center;
	background: var(--dgp-button);
	border: 1px solid var(--dgp-button);
	border-radius: var(--dgp-radius);
	box-shadow: none;
	color: var(--dgp-white) !important;
	cursor: pointer;
	display: inline-flex;
	font-size: 0.94rem;
	font-weight: 650;
	gap: 7px;
	justify-content: center;
	line-height: 1.2;
	min-height: 46px;
	padding: 12px 19px;
	text-align: center;
	text-decoration: none !important;
	transition: filter 170ms ease, box-shadow 170ms ease, transform 170ms ease;
}

.dgp-button:hover,
.dgp-button:focus-visible {
	box-shadow: 0 8px 20px rgba(37, 98, 133, 0.2);
	color: var(--dgp-white) !important;
	filter: brightness(0.93);
	transform: translateY(-1px);
}

.dgp-button:focus-visible,
.dgp-card a:focus-visible {
	outline: 3px solid rgba(37, 98, 133, 0.28);
	outline-offset: 3px;
}

.dgp-card__button {
	align-self: flex-start;
	margin-top: 23px;
}

.dgp-grid--compact .dgp-card {
	box-shadow: none;
}

.dgp-grid--compact .dgp-card__content {
	padding: 20px;
}

.dgp-grid--compact .dgp-card__title {
	font-size: clamp(1.1rem, 1.35vw, 1.28rem);
}

.dgp-grid--compact .dgp-card__button {
	background: transparent;
	box-shadow: none;
	color: var(--dgp-button) !important;
	min-height: 42px;
	padding: 10px 15px;
}

.dgp-grid--compact .dgp-card__button:hover,
.dgp-grid--compact .dgp-card__button:focus-visible {
	background: var(--dgp-button);
	color: var(--dgp-white) !important;
}

.dgp-grid--editorial .dgp-card {
	background: var(--dgp-soft-blue);
	border-color: transparent;
	box-shadow: none;
	padding: 12px;
}

.dgp-grid--editorial .dgp-card__image-link {
	border-radius: var(--dgp-radius);
}

.dgp-grid--editorial .dgp-card__content {
	padding: 24px 10px 12px;
}

.dgp-grid--editorial .dgp-card__title {
	font-size: clamp(1.3rem, 1.7vw, 1.58rem);
}

.dgp-grid--editorial .dgp-card__button {
	align-self: stretch;
}

.dgp-empty {
	background: var(--dgp-soft-blue);
	border: 1px solid var(--dgp-border);
	border-radius: var(--dgp-radius);
	color: var(--dgp-primary);
	font-size: 1rem;
	line-height: 1.6;
	padding: 22px 25px;
	text-align: center;
}

.dgp-profile {
	margin: 0 auto;
	max-width: 1180px;
	width: 100%;
}

.dgp-profile__hero {
	align-items: start;
	display: grid;
	grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.65fr);
	gap: clamp(38px, 5vw, 72px);
}

.dgp-profile__aside {
	align-self: start;
	min-width: 0;
	position: sticky;
	top: 32px;
}

.dgp-profile__photo-wrap {
	aspect-ratio: 4 / 5;
	background: var(--dgp-soft-blue);
	border: 1px solid var(--dgp-border);
	border-radius: var(--dgp-radius);
	box-shadow: var(--dgp-shadow);
	overflow: hidden;
	position: relative;
}

.dgp-profile__photo {
	display: block;
	height: 100%;
	margin: 0;
	object-fit: cover;
	object-position: center center;
	width: 100%;
}

.dgp-profile__reviews {
	background: var(--dgp-white);
	border: 1px solid var(--dgp-border);
	border-radius: var(--dgp-radius);
	box-shadow: 0 8px 24px rgba(18, 58, 99, 0.06);
	margin-top: 18px;
	min-width: 0;
	overflow: hidden;
	padding: 12px;
	position: relative;
}

.dgp-profile__reviews > :first-child {
	margin-top: 0;
}

.dgp-profile__reviews > :last-child {
	margin-bottom: 0;
}

.dgp-profile__reviews-loading {
	align-items: center;
	color: var(--dgp-text);
	display: flex;
	font-size: 0.9rem;
	gap: 10px;
	justify-content: center;
	min-height: 108px;
	opacity: 0.7;
	transition: opacity 180ms ease, visibility 180ms ease;
}

.dgp-profile__reviews-spinner {
	animation: dgp-reviews-spin 750ms linear infinite;
	border: 2px solid var(--dgp-border);
	border-radius: 50%;
	border-top-color: var(--dgp-button);
	height: 20px;
	width: 20px;
}

.dgp-profile__reviews--loaded .dgp-profile__reviews-loading {
	height: 0;
	min-height: 0;
	opacity: 0;
	overflow: hidden;
	visibility: hidden;
}

@keyframes dgp-reviews-spin {
	to {
		transform: rotate(360deg);
	}
}

.dgp-profile__main {
	min-width: 0;
	padding: clamp(6px, 1vw, 14px) 0;
}

.dgp-profile__title {
	color: var(--dgp-primary);
	font-size: clamp(2.05rem, 4vw, 3.65rem);
	font-weight: 720;
	letter-spacing: -0.035em;
	line-height: 1.08;
	margin: 0;
	overflow-wrap: anywhere;
}

.dgp-profile__specialty {
	color: var(--dgp-button);
	font-size: clamp(1.04rem, 1.7vw, 1.3rem);
	font-weight: 650;
	letter-spacing: 0.005em;
	line-height: 1.45;
	margin: 17px 0 0;
}

.dgp-profile__bio {
	border-top: 1px solid var(--dgp-border);
	color: var(--dgp-text);
	font-size: clamp(1rem, 1.25vw, 1.075rem);
	line-height: 1.8;
	margin-top: 31px;
	padding-top: 29px;
}

.dgp-profile__bio > :first-child,
.dgp-office__extra > :first-child {
	margin-top: 0;
}

.dgp-profile__bio > :last-child,
.dgp-office__extra > :last-child {
	margin-bottom: 0;
}

.dgp-profile__bio h2,
.dgp-profile__bio h3,
.dgp-profile__bio h4 {
	color: var(--dgp-primary);
	line-height: 1.25;
	margin: 1.5em 0 0.55em;
}

.dgp-profile__bio a,
.dgp-office a:not(.dgp-button) {
	color: var(--dgp-button);
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

.dgp-office {
	background: var(--dgp-soft-blue);
	border: 1px solid var(--dgp-border);
	border-radius: var(--dgp-radius);
	margin-top: clamp(48px, 7vw, 84px);
	padding: clamp(26px, 4vw, 48px);
}

.dgp-office__header {
	margin-bottom: 29px;
}

.dgp-office__title {
	color: var(--dgp-primary);
	font-size: clamp(1.55rem, 2.4vw, 2.15rem);
	font-weight: 710;
	letter-spacing: -0.025em;
	line-height: 1.2;
	margin: 0;
}

.dgp-office__details {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
	margin: 0;
}

.dgp-office__item {
	background: var(--dgp-white);
	border: 1px solid rgba(18, 58, 99, 0.1);
	border-radius: var(--dgp-radius);
	margin: 0;
	min-width: 0;
	padding: 19px 21px;
}

.dgp-office__item dt {
	color: var(--dgp-primary);
	font-size: 0.79rem;
	font-weight: 750;
	letter-spacing: 0.075em;
	line-height: 1.3;
	margin: 0 0 7px;
	text-transform: uppercase;
}

.dgp-office__item dd {
	color: var(--dgp-text);
	font-size: 0.98rem;
	line-height: 1.62;
	margin: 0;
	overflow-wrap: anywhere;
}

.dgp-office__extra {
	border-top: 1px solid var(--dgp-border);
	font-size: 0.98rem;
	line-height: 1.7;
	margin-top: 26px;
	padding-top: 25px;
}

.dgp-office__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 28px;
}

.dgp-button--secondary {
	background: var(--dgp-white);
	color: var(--dgp-button) !important;
}

.dgp-button--secondary:hover,
.dgp-button--secondary:focus-visible {
	background: var(--dgp-button);
	color: var(--dgp-white) !important;
}

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

	.dgp-profile__hero {
		grid-template-columns: minmax(230px, 0.72fr) minmax(0, 1.28fr);
		gap: 34px;
	}

	.dgp-profile__aside {
		position: static;
	}
}

@media (max-width: 680px) {
	.dgp-page {
		padding: 32px 16px 48px;
	}

	.dgp-grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.dgp-profile__hero {
		grid-template-columns: minmax(0, 1fr);
		gap: 30px;
	}

	.dgp-profile__photo {
		height: 100%;
	}

	.dgp-profile__main {
		padding: 0;
	}

	.dgp-office {
		margin-top: 43px;
	}

	.dgp-office__details {
		grid-template-columns: minmax(0, 1fr);
	}

	.dgp-office__actions,
	.dgp-office__actions .dgp-button {
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.dgp-card,
	.dgp-card__image,
	.dgp-button,
	.dgp-profile__reviews-loading {
		transition: none;
	}

	.dgp-profile__reviews-spinner {
		animation: none;
	}
}
