/*
 * Подвал: одна разметка для всех экранов. До 991 px — один центрированный столбец (меню, награда, соцсети, презентация,
 * контакты, логотип), от 992 px — четыре колонки. Согласованный вид общий для всех типов страниц, шрифт Inter 12 px.
 */

/* Порядок правил «базовый вид → переопределение для ширины» задан намеренно. */
/* stylelint-disable no-descending-specificity */

.ps-footer {
	--ps-color-base: #fff;
	--ps-color-contrast: #0f0f0f;

	color: var(--ps-color-contrast);
	background: var(--ps-color-base);
	font-size: var(--ps-fs-xs);
	line-height: 14px;
}

.ps-footer a {
	color: inherit;
	text-decoration: none;
}

.ps-footer__inner {
	width: 100%;
	max-width: 1270px;
	margin-inline: auto;
	padding: 0 var(--ps-gutter) 160px;
}

/* Узкие экраны: столбец по центру; порядок блоков задаёт order (в разметке — порядок широкого вида). */
.ps-footer__grid {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 40px;
	text-align: center;
}

.ps-footer__nav {
	order: 1;
}

.ps-footer__logo {
	order: 6;
	margin-top: 10px;
}

.ps-footer__logo img {
	display: block;
	width: 190px;
	max-width: 100%;
	height: auto;
}

.ps-footer__logo .ps-logo--dark {
	display: none;
}

:root[data-theme="dark"] .ps-footer__logo .ps-logo--light {
	display: none;
}

:root[data-theme="dark"] .ps-footer__logo .ps-logo--dark {
	display: block;
}

.ps-footer__contacts {
	order: 5;
	display: grid;
	gap: 4px;
}

.ps-footer__address {
	max-width: 100%;
}

/*
 * Телефон и e-mail: область нажатия не меньше 24 px по высоте и без наложения на соседнюю ссылку (WCAG 2.2, 2.5.8).
 * Строка 14 px + поля по 5 px = 24 px; отрицательный внешний отступ -2 px вместе с зазором 4 px даёт нулевое наложение
 * (подвал выше всего на несколько пикселей).
 */
.ps-footer__contacts a {
	display: block;
	padding-block: 5px;
	margin-block: -2px;
}

.ps-footer__menu {
	display: flex;
	flex-direction: column;
	gap: 20px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ps-footer__menu a {
	font-size: var(--ps-fs-xs);
	font-weight: 700;
	line-height: 12px;
}

.ps-footer__menu a:hover {
	text-decoration-line: underline;
	text-decoration-color: var(--ps-color-gold);
}

.ps-footer__award {
	order: 2;
	display: block;
	line-height: 0;
}

.ps-footer__award img {
	width: 91px;
	height: auto;
}

.ps-footer__award-dark,
:root[data-theme="dark"] .ps-footer__award-light {
	display: none;
}

:root[data-theme="dark"] .ps-footer__award-dark {
	display: block;
}

.ps-footer__social {
	order: 3;
	display: flex;
	gap: 16px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ps-footer__social a {
	display: block;
	line-height: 0;
}

.ps-footer__social svg {
	display: block;
	width: 32px;
	height: 32px;
}

.ps-footer__links {
	order: 4;
	display: grid;
	gap: 8px;
}

/* Подчёркивание презентации и служебных ссылок следует цвету текста. */
.ps-footer__links .ps-footer__link {
	text-decoration-line: none;
	text-decoration-thickness: 1px;
	text-underline-offset: 2px;
}

.ps-footer__links .ps-footer__link--presentation {
	text-decoration-line: underline;
	text-decoration-color: currentcolor;
}

.ps-footer__link-wide {
	display: none;
}

/* Нижняя строка: на узких экранах стопкой по центру. */
.ps-footer__bottom {
	margin-top: 24px;
	padding-top: 24px;
	border-top: 1px solid var(--ps-color-line);
	text-align: center;
}

.ps-footer__copyright {
	margin: 0 0 6px;
}

.ps-footer__legal {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	margin: 6px 0 0;
	padding: 0;
	list-style: none;
}

.ps-footer__legal a {
	text-decoration-line: underline;
	text-decoration-color: currentcolor;
}

.ps-footer__legal a:hover,
.ps-footer__links .ps-footer__link:hover {
	text-decoration-line: underline;
	text-decoration-color: var(--ps-color-gold);
	opacity: 0.7;
}

@media (min-width: 768px) {

	.ps-footer__inner {
		padding-inline: var(--ps-gutter);
	}
}

/* Широкий вид: логотип и контакты слева, меню и награда по центру, соцсети и ссылки справа. От 992 px, как на проде (на 1024 px
   подвал многоколоночный; замер 5.18д, П-1). */
@media (min-width: 992px) {

	.ps-footer__inner {
		width: calc(100% - 200px);
		padding-inline: 0;
	}

	/* Колонки 1 : 2 : 1, как у старой темы; награда и соцсети делят третью колонку (слева и справа). */
	.ps-footer__grid {
		display: grid;
		grid-template-columns: 1fr 2fr 1fr;
		align-items: start;
		gap: 26px 24px;
		text-align: left;
	}

	.ps-footer__logo,
	.ps-footer__nav,
	.ps-footer__award,
	.ps-footer__social,
	.ps-footer__links,
	.ps-footer__contacts {
		order: 0;
	}

	.ps-footer__logo {
		grid-area: 1 / 1;
		margin-top: 0;
	}

	.ps-footer__contacts {
		grid-area: 2 / 1;
	}

	.ps-footer__nav {
		grid-area: 1 / 2;
	}

	.ps-footer__menu {
		flex-direction: row;
		flex-wrap: wrap;
		justify-content: center;
		gap: 12px 40px;
	}

	.ps-footer__award {
		grid-area: 1 / 3;
		justify-self: start;
	}

	.ps-footer__social {
		grid-area: 1 / 3;
		justify-self: end;
	}

	.ps-footer__links {
		grid-area: 2 / 3;
		justify-items: end;
	}

	.ps-footer__link-wide {
		display: inline;
	}

	.ps-footer__link-narrow {
		display: none;
	}

	.ps-footer__bottom {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 24px;
		margin-top: 16px;
		padding-top: 16px;
		text-align: left;
	}

	.ps-footer__copyright {
		margin: 0;
	}

	.ps-footer__legal {
		flex-direction: row;
		flex-wrap: wrap;
		margin: 0;
	}
}

/* Общий контейнер подвала совпадает с контейнером шапки. */
@media (min-width: 1025px) {

	.ps-footer__inner {
		width: 100%;
		max-width: 1248px;
		padding-inline: 24px;
	}
}

:root[data-theme="dark"] .ps-footer {
	--ps-color-base: #0f0f0f;
	--ps-color-contrast: #fff;
}

/* Общий мобильный подвал; нижний запас оставлен для плавающего виджета связи. */
@media (max-width: 767px) {

	.ps-footer__inner {
		padding: 50px 24px 210px;
	}

	.ps-footer__grid {
		gap: 24px;
	}

	.ps-footer__logo {
		order: 0;
		margin: 0 0 8px;
	}

	.ps-footer__logo img {
		width: 210px;
		height: 14px;
		object-fit: contain;
	}

	.ps-footer__nav,
	.ps-footer__award {
		margin-bottom: 8px;
	}

	.ps-footer__menu a {
		font-size: 16px;
		font-weight: 600;
		line-height: 20px;
	}

	.ps-footer__social {
		gap: 10px;
	}

	.ps-footer__copyright {
		margin: 0;
	}

	.ps-footer__legal {
		margin-top: 12px;
	}
}
