/* Базовые стили сайта: сброс, типографика, контейнер, доступность. */
*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
}

/* Плавная прокрутка к якорям — только если посетитель не просил уменьшить анимацию (WCAG 2.3.3). */
@media (prefers-reduced-motion: no-preference) {

	html {
		scroll-behavior: smooth;
	}
}

body {
	margin: 0;
	background: var(--ps-color-base);
	color: var(--ps-color-contrast);
	font-family: var(--ps-font);
	font-size: var(--ps-fs-s);
	line-height: 1.5;
	overflow-wrap: break-word;
}

img,
video,
svg {
	max-width: 100%;
	height: auto;
}

a {
	color: inherit;
}

button {
	font: inherit;
	color: inherit;
}

:focus-visible {
	outline: 2px solid var(--ps-color-gold);
	outline-offset: 3px;
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.ps-skip-link {
	position: absolute;
	top: -100px;
	left: 8px;
	z-index: 1000;
	padding: 8px 16px;
	background: var(--ps-color-contrast);
	color: var(--ps-color-base);
}

.ps-skip-link:focus {
	top: 8px;
}

.ps-container {
	width: 100%;
	max-width: calc(var(--ps-container) + 2 * var(--ps-gutter));
	margin-inline: auto;
	padding-inline: var(--ps-gutter);
}

.ps-main {
	--ps-gutter: 20px;
	display: block;
	min-height: 50vh;
	padding-bottom: 80px;
}

/*
 * Поля контента (задача 4.23, замеры по эталону этапа 0): на телефоне 20 px (у шапки и подвала свои поля, поэтому переменная
 * задаётся на .ps-main, а не в :root), на широком экране от 1025 px — 10 px (контейнер 1140/1200 по центру, на 1025–1240 px
 * поля 10 px, а не 40 px). На планшете (768–1024 px) у главной, архивов блога и кейсов, услуги и обычных страниц (политика, согласие; фиксированные «О нас» и «Контакты» — свои поля) текст на проде
 * стоит в 88 px от края на 768 и в 100 px на 1024 (растёт линейно); у остальных шаблонов — поля из :root (24 px), у кейса и статьи
 * поля подобраны отдельно в single.css.
 */
@media (min-width: 768px) and (max-width: 1024px) {

	.ps-main {
		--ps-gutter: 24px;
	}

	/* stylelint-disable selector-class-pattern */
	.home .ps-main,
	.post-type-archive-blog_cpt .ps-main,
	.tax-blog_tax .ps-main,
	.post-type-archive-projects_cpt .ps-main,
	.tax-projects_tax .ps-main,
	.single-services .ps-main,
	.page-template-default .ps-main:not(:has(.ps-fixed-page)) {
		--ps-gutter: calc(88px + (100vw - 768px) * 0.047);
	}
	/* stylelint-enable selector-class-pattern */
}

@media (min-width: 1025px) {

	.ps-main {
		--ps-gutter: 10px;
	}
}

/* Хлебные крошки (Yoast SEO или запасной вывод темы). */
.ps-breadcrumbs {
	padding-block: 24px;
	font-size: 14px;
	line-height: 20px;
	color: var(--ps-color-muted);
}

.ps-breadcrumbs a {
	color: var(--ps-color-contrast);
	text-decoration: none;
	border-bottom: 1px solid var(--ps-color-gold);
}

/* Плашки (рубрики, отрасль, услуга). */
.ps-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ps-chip {
	display: inline-block;
	padding: 8px 20px;
	border-radius: var(--ps-radius-pill);
	background: var(--ps-color-surface);
	color: var(--ps-color-contrast);
	font-size: 14px;
	line-height: 20px;
	text-decoration: none;
}

a.ps-chip:hover,
a.ps-chip:focus-visible {
	background: var(--ps-color-gold);
	color: #000;
}

/* Тема сохраняет прежнюю нулевую границу; skin и состояния подключаются одним handle. */
:root {
	--ps-button-border: var(--ps-button-preset-borderless);
}

/* Контакты и основной архив блога используют типографику и верхний ритм каталога кейсов.
 * Переменные ограничены этими контейнерами: остальные заголовки и горизонтальные поля сохраняются.
 */
.ps-fixed-page--contacts,
.ps-archive[data-post-type="blog_cpt"][data-numbered="1"] {
	--ps-listing-title-size: var(--ps-fs-3xl, 36px);
	--ps-listing-title-leading: 46px;
	--ps-listing-title-top-gap: 84px;
}

.ps-fixed-page--contacts {
	padding-top: var(--ps-listing-title-top-gap);
}

.ps-archive[data-post-type="blog_cpt"][data-numbered="1"] > .ps-archive__head {
	padding-top: var(--ps-listing-title-top-gap);
}

.ps-fixed-page--contacts > .ps-contacts__title,
.ps-archive[data-post-type="blog_cpt"][data-numbered="1"] > .ps-archive__head > .ps-archive__title {
	font-size: var(--ps-listing-title-size);
	font-weight: 700;
	line-height: var(--ps-listing-title-leading);
}

/* Контакты и общий архив блога отступают от мобильной шапки на 24 px; рубрики не затрагиваются. */
@media (max-width: 767px) {

	.ps-fixed-page--contacts,
	.ps-archive[data-post-type="blog_cpt"][data-numbered="1"] {
		--ps-listing-title-top-gap: 24px;
	}
}

@media (min-width: 1025px) {

	.ps-fixed-page--contacts,
	.ps-archive[data-post-type="blog_cpt"][data-numbered="1"] {
		--ps-listing-title-size: var(--ps-fs-6xl, 110px);
		--ps-listing-title-leading: 115px;
		--ps-listing-title-top-gap: 86px;
	}
}
