/* Эксперты: общая сетка и профиль по макету; палитра переключается токенами темы. */
.ps-experts {
	padding-block: 64px 120px;
}

.ps-experts__title {
	margin: 72px 0 64px;
	font-size: clamp(36px, 6.25vw, 90px);
	font-weight: 700;
	line-height: 1;
	text-transform: uppercase;
}

.ps-experts__grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 72px 48px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ps-expert-card {
	min-width: 0;
}

.ps-expert-card__link {
	display: block;
	text-decoration: none;
}

.ps-expert-card__photo,
.ps-expert__photo {
	display: block;
	aspect-ratio: 1;
	background: var(--ps-color-surface);
}

.ps-expert-card__photo img,
.ps-expert__photo img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ps-expert-card__name {
	margin: 20px 0 8px;
	font-size: 28px;
	font-weight: 700;
	line-height: 1.15;
	overflow-wrap: anywhere;
}

.ps-expert-card__link:hover .ps-expert-card__name,
.ps-expert-card__link:focus-visible .ps-expert-card__name {
	text-decoration: underline;
	text-decoration-color: var(--ps-color-gold);
	text-underline-offset: 0.15em;
}

.ps-expert-card__position {
	margin: 0 0 20px;
	color: var(--ps-color-muted);
	font-size: 20px;
	line-height: 1.25;
	overflow-wrap: anywhere;
}

.ps-expert__placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	padding: 24px;
	color: var(--ps-color-muted);
	font-size: 16px;
	text-align: center;
}

:root[data-theme="dark"] .ps-expert-card__position {
	color: var(--ps-color-gold);
}

.ps-expert-card .ps-chip:focus-visible,
.ps-expert__areas .ps-chip:focus-visible {
	outline: 2px solid currentcolor;
	outline-offset: 3px;
}

.ps-expert__profile {
	display: grid;
	grid-template-columns: 350px minmax(0, 1fr);
	gap: 72px;
}

.ps-expert__details h2 {
	margin: 0 0 24px;
	font-size: 34px;
	line-height: 1.2;
}

.ps-expert__position,
.ps-expert__description,
.ps-expert__areas {
	margin: 0 0 24px;
	font-size: 24px;
	line-height: 1.2;
}

.ps-expert__position > span,
.ps-expert__description > span,
.ps-expert__areas > span {
	color: var(--ps-color-muted);
}

.ps-expert__description,
.ps-expert__areas {
	display: flex;
	align-items: baseline;
	gap: 12px;
}

.ps-expert__description > span,
.ps-expert__areas > span {
	flex-shrink: 0;
}

.ps-expert__description .entry-content > :first-child {
	margin-top: 0;
}

.ps-expert__description .entry-content > :last-child {
	margin-bottom: 0;
}

.ps-expert__articles-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 64px 24px;
}

.ps-expert__articles-grid .ps-card-article:nth-child(4n + 1) .ps-card-article__image,
.ps-expert__articles-grid .ps-card-article:nth-child(4n) .ps-card-article__image {
	aspect-ratio: 1;
}

.ps-expert__more {
	margin-top: 80px;
	text-align: center;
}

/* Отступ сокращён только у обложки с авторством, остальные статьи сохраняют прежний ритм. */
.ps-article__cover:has(+ .ps-article-experts) {
	margin-bottom: 16px;
}

.ps-article-experts {
	margin: 0 0 32px;
	font-size: 16px;
	line-height: 1.5;
}

.ps-article-experts__list {
	--ps-author-gap: 40px;

	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 20px var(--ps-author-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

.ps-article-experts__item {
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
	max-width: 100%;
}

.ps-article-experts__photo {
	flex: 0 0 48px;
	width: 48px;
	height: 48px;
}

.ps-article-experts__photo img {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	object-fit: cover;
}

.ps-article-experts__text {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 2px;
	min-width: 0;
	overflow-wrap: anywhere;
}

.ps-article-experts__name {
	color: inherit;
	font-weight: 700;
	text-decoration: none;
	text-decoration-color: var(--ps-color-gold);
	text-underline-offset: 0.15em;
}

.ps-article-experts__name:hover,
.ps-article-experts__name:focus-visible {
	text-decoration-line: underline;
}

/* Длинная должность переносится внутри карточки, оставляя место другим авторам в ряду. */
@media (min-width: 768px) {

	.ps-article-experts__item:not(:only-child) {
		max-width: calc((100% - var(--ps-author-gap)) / 2);
	}
}

@media (min-width: 1025px) {

	.ps-article-experts__item:not(:only-child) {
		max-width: calc((100% - 2 * var(--ps-author-gap)) / 3);
	}
}

@media (max-width: 767px) {

	.ps-article__cover:has(+ .ps-article-experts) {
		margin-bottom: 12px;
	}

	.ps-article-experts__list {
		flex-direction: column;
		gap: 16px;
	}
}

.ps-expert__articles-grid .ps-card-article__title {
	font-size: 34px;
}

.ps-expert__articles-grid .ps-card-article__title a {
	text-decoration-color: var(--ps-color-gold);
	text-decoration-line: none;
	text-underline-offset: 0.12em;
}

.ps-expert__articles-grid .ps-card-article__title a:focus-visible,
.ps-expert__articles-grid .ps-card-article:hover .ps-card-article__title a {
	text-decoration-line: underline;
}

.ps-expert__articles-grid .ps-card-article__excerpt {
	margin: 0;
	font-size: 22px;
	line-height: 1.25;
}

@media (max-width: 1024px) {

	.ps-experts__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 48px 24px;
	}

	.ps-expert__profile {
		grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
		gap: 32px;
	}

	.ps-expert__description,
	.ps-expert__areas {
		display: block;
	}
}

@media (max-width: 767px) {

	.ps-experts {
		padding-block: 32px 64px;
	}

	.ps-experts__title {
		margin: 40px 0 32px;
	}

	/* В мобильном макете архива крошки идут через 24 px от шапки, заголовок — через 24 px от крошек. */
	.post-type-archive-expert .ps-experts {
		padding-top: 24px;
	}

	.post-type-archive-expert .ps-experts .ps-breadcrumbs {
		padding-block: 0;
		line-height: 16px;
	}

	.post-type-archive-expert .ps-experts__title {
		margin-top: 24px;
	}

	.ps-experts__grid,
	.ps-expert__profile,
	.ps-expert__articles-grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.ps-experts__grid {
		gap: 48px;
	}

	.ps-expert-card__name {
		margin-top: 16px;
		font-size: 24px;
	}

	.ps-expert-card__position,
	.ps-expert__position,
	.ps-expert__description,
	.ps-expert__areas {
		font-size: 16px;
	}

	.ps-expert__details h2 {
		font-size: 24px;
	}

	/* Поля мобильного профиля выровнены по общей колонке подписей из макета. */
	.ps-expert .ps-expert__profile {
		gap: 24px;
		margin-inline: calc(24px - var(--ps-gutter));
	}

	.ps-expert .ps-expert__position,
	.ps-expert .ps-expert__description,
	.ps-expert .ps-expert__areas {
		display: grid;
		grid-template-columns: var(--ps-expert-label-width) minmax(0, 1fr);
		align-items: start;
		gap: 12px;
		margin-bottom: 12px;
		font-size: 16px;
		line-height: 20px;
	}

	:root[data-theme="dark"] .ps-expert .ps-expert__position > span:first-child,
	:root[data-theme="dark"] .ps-expert .ps-expert__description > span:first-child,
	:root[data-theme="dark"] .ps-expert .ps-expert__areas > span:first-child {
		color: var(--ps-color-line);
	}

	.ps-expert .ps-expert__position {
		--ps-expert-label-width: 94px;
	}

	.ps-expert .ps-expert__description {
		--ps-expert-label-width: 82px;
	}

	.ps-expert .ps-expert__areas {
		--ps-expert-label-width: 95px;

		margin-bottom: 0;
	}

	.ps-expert .ps-expert__areas .ps-chips {
		gap: 10px;
		min-width: 0;
	}

	.ps-expert .ps-expert__areas .ps-chips li,
	.ps-expert .ps-expert__areas .ps-chip {
		max-width: 100%;
		overflow-wrap: anywhere;
	}

	.ps-expert .ps-expert__details h2 {
		margin-bottom: 12px;
		font-size: 28px;
		line-height: 40px;
	}

	.ps-expert__articles-grid {
		gap: 48px;
	}

	.ps-expert__articles-grid .ps-card-article__title {
		font-size: 24px;
	}

	.ps-expert__articles-grid .ps-card-article__excerpt {
		font-size: 16px;
	}

	.ps-expert__more {
		margin-top: 48px;
	}
}
