/*
 * Тема SMX: стили, которые нельзя выразить в theme.json.
 * Размеры и цвета сняты с прежнего сайта на Total (вычисленные стили), см. CLAUDE.md.
 */

:root {
	--smx-container-width: var(--wp--custom--container, min(1200px, 90vw));
	--smx-muted: var(--wp--preset--color--smx-muted, #757575);
	--smx-border: var(--wp--preset--color--smx-border, #eee);
	--smx-mobile-breakpoint: 959px;
}

/* ---------- База ---------- */

/* Подвал прижат к низу окна на коротких страницах (fixed_footer в Total) */
.wp-site-blocks {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	min-height: 100dvh;
	overflow-x: clip;
}
.wp-site-blocks > .smx-main {
	flex: 1 0 auto;
}
.admin-bar .wp-site-blocks {
	min-height: calc(100vh - var(--wp-admin--admin-bar--height, 32px));
}
.wp-site-blocks > *,
.smx-main > * {
	margin-block-start: 0;
}
:where(.smx-content, .wpb_text_column, .smx-c-icon-box__content, .smx-c-feature-box__content) :where(p, ul, ol, table, pre, dl, address) {
	margin-top: 0;
	margin-bottom: 20px;
}
:where(.smx-content) :where(h1, h2, h3, h4, h5, h6) {
	margin-top: 30px;
	margin-bottom: 20px;
}
:where(.smx-content) > :where(h1, h2, h3, h4, h5, h6):first-child {
	margin-top: 0;
}
:where(.smx-content) :where(ul, ol) {
	padding-left: 1.5em;
}
/* Ссылки в тексте записей «Пульса» подчёркнуты, на страницах — нет (как в Total) */
:where(.single-post .smx-content, .smx-blog .smx-content) a:where(:not(.wp-element-button):not([class*="vc_btn"]):not([class*="smx-c-"])) {
	text-decoration: underline;
	text-underline-offset: .15em;
}
/* В блоках WPBakery ссылки без подчёркивания (как было в Total) */
:where(.smx-content .wpb_wrapper, .smx-content .wp-block-media-text) a {
	text-decoration: none;
}
:where(.smx-content) img {
	max-width: 100%;
	height: auto;
}
:where(.smx-content) hr {
	height: 1px;
	margin: 30px 0;
	border: 0;
	background: var(--smx-border);
}
:where(.smx-content) table {
	width: 100%;
	border-collapse: collapse;
}
:where(.smx-content) :where(th, td) {
	padding: .4em .6em;
	border: 1px solid var(--smx-border);
}
:where(.smx-content) blockquote:not([class]) {
	margin: 30px 0;
	padding-left: 55px;
	font-size: 20.93px;
	color: #9e9e9e;
}
/* Выравнивание и подписи классического контента */
.aligncenter {
	display: block;
	margin-left: auto;
	margin-right: auto;
}
.alignleft:not(.wp-block-image):not([class*="wp-block-"]) {
	float: left;
	margin: 0 20px 20px 0;
}
.alignright:not(.wp-block-image):not([class*="wp-block-"]) {
	float: right;
	margin: 0 0 20px 20px;
}
.wp-caption {
	max-width: 100%;
	margin-bottom: 20px;
}
.wp-caption img {
	display: block;
	max-width: 100%;
	height: auto;
}
.wp-caption-text {
	margin: 5px 0 0;
	font-size: var(--wp--preset--font-size--smx-meta);
	color: var(--smx-muted);
	text-align: center;
}
:where(.smx-content)::after {
	content: "";
	display: table;
	clear: both;
}
.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
.smx-icon {
	display: inline-block;
	width: 1em;
	height: 1em;
	vertical-align: -.125em;
	flex-shrink: 0;
}

/* ---------- Верхняя панель ---------- */

.smx-topbar {
	border-bottom: 1px solid var(--smx-border);
	font-size: var(--wp--preset--font-size--smx-meta);
	font-weight: 600;
}
.smx-topbar__links {
	display: flex;
	flex-wrap: wrap;
	column-gap: 20px;
	margin: 0;
	padding: 15px 0;
	line-height: 2;
}
.smx-topbar__links a {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	color: #a0a0a0;
	text-decoration: none;
}
.smx-topbar__links a:first-child {
	margin-left: 4px;
}
.smx-topbar__links a:hover {
	color: var(--wp--preset--color--smx-link-hover);
}
@media (max-width: 959px) {
	.smx-topbar {
		display: none;
	}
}

/* ---------- Шапка ---------- */

/* Высота шапки 107px, логотип в 35px от верха, меню по центру строки — как в Total */
.smx-header__inner {
	box-sizing: border-box;
	height: 107px;
	padding: 35px 0 0;
	align-items: flex-start !important;
}
.smx-header__nav {
	position: relative;
	top: -3px;
}
.smx-header__logo {
	margin: 0;
	line-height: 0;
}
.smx-header__logo img {
	width: 116px;
	height: auto;
}
.smx-header__nav {
	gap: 10px;
}
.smx-main-nav {
	font-size: 16px;
	line-height: 1.5;
}
.smx-main-nav .wp-block-navigation__container {
	gap: 8px;
}
.wp-block-navigation.smx-main-nav .wp-block-navigation-item__content {
	padding: 8px 11px;
	color: #616161;
}
.wp-block-navigation.smx-main-nav .wp-block-navigation-item__content:hover,
.wp-block-navigation.smx-main-nav .current-menu-item > .wp-block-navigation-item__content,
.wp-block-navigation.smx-main-nav .wp-block-navigation-item__content[aria-current="page"] {
	color: var(--wp--preset--color--smx-accent);
}
/* Мобильное меню (бургер) */
.smx-main-nav .wp-block-navigation__responsive-container-open,
.smx-main-nav .wp-block-navigation__responsive-container-close {
	color: #616161;
}
.smx-main-nav .wp-block-navigation__responsive-container.is-menu-open {
	padding: 20px 5vw;
	font-size: 20px;
}
.smx-main-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
	gap: 4px;
}

/* Поиск в шапке: значок, по нажатию раскрывается поле */
.smx-header-search .wp-block-search__button {
	margin: 0;
	padding: 8px 11px;
	color: #616161;
	background: none;
	border: 0;
}
.smx-header-search .wp-block-search__button:hover {
	color: var(--wp--preset--color--smx-accent);
}
.smx-header-search .wp-block-search__button svg {
	width: 18px;
	height: 18px;
	fill: currentColor;
}
.smx-header-search .wp-block-search__inside-wrapper {
	border: 0;
	padding: 0;
}
.smx-header-search .wp-block-search__input {
	padding: 6px 12px;
	font-size: 16px;
	border: 1px solid #1e73be;
	border-radius: 0;
}

/* ---------- Шапка страницы ---------- */

.smx-page-header {
	margin-bottom: 40px;
	padding: 20px 0;
	color: #616161;
	background: var(--wp--preset--color--smx-page-header) url("/files/uploads/sky-classic.jpg") repeat;
	border-top: 1px solid #a2c4f2;
	border-bottom: 1px solid #d0dff2;
}
.smx-no-header-margin .smx-page-header {
	margin-bottom: 0;
}
.smx-page-header__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0 20px;
	width: var(--smx-container-width);
	margin: 0 auto;
}
.smx-page-header__title {
	margin: 0;
	font-size: 26px;
	font-weight: 400;
	line-height: 1.375;
	color: var(--wp--preset--color--smx-page-title);
}

/* Баннер с картинкой (wpex_post_title_background_*) */
.smx-page-header.is-hero {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	min-height: 300px;
	color: #fff;
	background-repeat: no-repeat;
	background-position: 50% 0;
	background-size: cover;
	border: 0;
}
.smx-page-header.is-hero .smx-page-header__inner {
	display: block;
	text-align: center;
}
.smx-page-header.is-hero .smx-page-header__title {
	font-size: 54.93px;
	color: #fff;
}
.smx-page-header__subheading {
	margin: 0;
	font-size: 31.38px;
	font-weight: 300;
	line-height: 2;
}
.smx-page-header.is-hero .smx-breadcrumbs,
.smx-page-header.is-hero .smx-breadcrumbs a {
	color: #fff;
}

/* Хлебные крошки */
.smx-breadcrumbs {
	font-size: var(--wp--preset--font-size--smx-meta);
	color: #6b6b6b;
}
.smx-breadcrumbs ol {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0 .35em;
	margin: 0;
	padding: 0;
	list-style: none;
}
.smx-page-header.is-hero .smx-breadcrumbs ol {
	justify-content: center;
}
.smx-breadcrumbs a {
	color: #757575;
	text-decoration: underline;
}
.smx-breadcrumbs a:hover {
	color: var(--wp--preset--color--smx-link-hover);
}
.smx-breadcrumbs__home {
	display: inline-flex;
	text-decoration: none !important;
}
.smx-breadcrumbs__sep {
	margin-right: .1em;
}
@media (max-width: 959px) {
	.smx-breadcrumbs {
		display: none;
	}
	.smx-page-header.is-hero .smx-page-header__title {
		font-size: 36px;
	}
	.smx-page-header__subheading {
		font-size: 22px;
	}
}

/* ---------- Основная область ---------- */

.smx-main {
	padding-bottom: 40px;
}
.smx-layout-full-screen .smx-main {
	padding-bottom: 0;
}
/* Полноэкранный макет: содержимое без контейнера (строки WPBakery сами решают, где центрироваться) */
.smx-layout-full-screen .smx-content-wrap.has-global-padding {
	padding-left: 0;
	padding-right: 0;
}
.smx-layout-full-screen .smx-content-wrap > .smx-content {
	max-width: none;
}
.smx-content > :first-child {
	margin-top: 0;
}

/* Колонка с записями слева, справа пустое место под боковую панель (как в Total) */
.smx-with-sidebar {
	margin-bottom: 0;
}

/* ---------- Мета-данные записи ---------- */

.smx-meta {
	gap: 4px 20px;
	margin-top: 10px;
	margin-bottom: 20px;
	font-size: var(--wp--preset--font-size--smx-meta);
	color: var(--smx-muted);
}
.smx-meta a {
	color: var(--smx-muted);
	text-decoration: none;
}
.smx-meta a:hover {
	color: var(--wp--preset--color--smx-link-hover);
}
:is(.is-style-icon-calendar, .is-style-icon-folder)::before {
	content: "";
	display: inline-block;
	width: 14px;
	height: 14px;
	margin-right: 8px;
	vertical-align: -1px;
	background: currentColor;
	-webkit-mask: var(--smx-icon-calendar) center / contain no-repeat;
	mask: var(--smx-icon-calendar) center / contain no-repeat;
}
.is-style-icon-folder::before {
	width: 16px;
	-webkit-mask-image: var(--smx-icon-folder);
	mask-image: var(--smx-icon-folder);
}

/* ---------- Лента «Пульса» ---------- */

.smx-blog__list {
	margin: 0;
}
.smx-entry {
	padding-bottom: 30px;
}
.smx-blog__list > li + li .smx-entry {
	padding-top: 30px;
	border-top: 1px solid var(--smx-border);
}
.smx-entry__title {
	margin: 0;
	font-size: 22px;
	font-weight: 600;
	line-height: 1.375;
	text-transform: uppercase;
	color: var(--wp--preset--color--smx-title);
}
.smx-entry__title a,
.smx-entry__title a:hover {
	color: inherit;
	text-decoration: none;
}
.smx-entry__media,
.smx-single__media {
	margin: 0 0 20px;
}
.smx-post-media img {
	display: block;
	max-width: 100%;
	height: auto;
}
.smx-post-media__video {
	position: relative;
	aspect-ratio: 16 / 9;
}
.smx-post-media__video iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}
.smx-entry__content > :last-child {
	margin-bottom: 0;
}
.smx-more {
	margin-top: 20px;
}

/* Пагинация */
.smx-pagination {
	gap: 5px;
	margin-top: 40px;
	font-size: var(--wp--preset--font-size--smx-meta);
}
.smx-pagination .page-numbers,
.smx-pagination a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 12px;
	color: var(--smx-muted);
	text-decoration: none;
	border: 1px solid var(--smx-border);
}
.smx-pagination .page-numbers.current,
.smx-pagination a:hover {
	color: #fff;
	background: var(--wp--preset--color--smx-accent);
	border-color: var(--wp--preset--color--smx-accent);
}
.smx-pagination .page-numbers.dots {
	border: 0;
}

/* ---------- Запись ---------- */

.smx-single__title {
	margin: 0;
	font-size: 31.38px;
	font-weight: 600;
	line-height: 1.375;
}
.smx-single .smx-content {
	margin-top: 0;
}
.smx-post-nav {
	margin-top: 40px;
	padding-top: 20px;
	border-top: 1px solid var(--smx-border);
}
.smx-layout-full-screen .smx-post-nav {
	margin-top: 0;
}
.smx-post-nav a {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: var(--smx-muted);
	text-decoration: none;
}
.smx-post-nav a:hover {
	color: var(--wp--preset--color--smx-link-hover);
}
.smx-post-nav__prev a::before,
.smx-post-nav__next a::after {
	content: "";
	width: 8px;
	height: 12px;
	background: currentColor;
	-webkit-mask: var(--smx-icon-chevron-left) center / contain no-repeat;
	mask: var(--smx-icon-chevron-left) center / contain no-repeat;
}
.smx-post-nav__next a::after {
	-webkit-mask-image: var(--smx-icon-chevron-right);
	mask-image: var(--smx-icon-chevron-right);
}

/* ---------- Архив проектов ---------- */

.smx-portfolio-archive .wp-block-post-template {
	gap: 20px;
}
.smx-portfolio-archive .smx-portfolio-card {
	display: flex;
	flex-direction: column;
	height: 100%;
}
.smx-portfolio-archive .smx-portfolio-card > * {
	margin: 0;
}
.smx-portfolio-archive .smx-portfolio-card__media {
	overflow: hidden;
}
.smx-portfolio-archive .smx-portfolio-card__media img {
	display: block;
	transition: transform .3s ease;
}
.smx-portfolio-archive .smx-portfolio-card:hover .smx-portfolio-card__media img {
	transform: scale(1.15);
}
.smx-portfolio-archive .smx-portfolio-card__details {
	flex: 1;
	padding: 20px;
	background: var(--wp--preset--color--smx-surface);
	border: 1px solid var(--smx-border);
	border-top: 0;
}
.smx-portfolio-archive .smx-portfolio-card__details > * {
	margin: 0;
}
.smx-portfolio-archive .smx-portfolio-card__title {
	margin-bottom: 5px;
	font-size: 18.31px;
	color: var(--wp--preset--color--smx-heading);
}
.smx-portfolio-archive .smx-portfolio-card__title a {
	color: inherit;
}
.smx-portfolio-archive .smx-portfolio-card__categories {
	margin-bottom: 5px;
	font-size: 10px;
	line-height: 1.25;
	color: var(--smx-muted);
}
.smx-portfolio-archive .smx-portfolio-card__categories a {
	color: inherit;
}
.smx-portfolio-archive .smx-portfolio-card__excerpt {
	margin-top: 15px;
	font-size: 12px;
}

/* ---------- Подвал ---------- */

.smx-footer {
	padding-top: 40px;
	padding-bottom: 40px;
	color: #999;
}
/* Колонки как в WPBakery: поля по 15px, строка шире контейнера на 30px */
.smx-footer > .smx-footer__columns.wp-block-columns {
	gap: 0;
	max-width: calc(var(--wp--style--global--content-size) + 30px);
}
.smx-footer__columns > .wp-block-column {
	box-sizing: border-box;
	padding: 0 15px;
}
.smx-footer__logo img {
	max-width: 100%;
	height: auto;
}
.smx-footer__about p {
	margin: 0;
	font-weight: 400;
}
.smx-footer__about strong {
	font-weight: 600;
}
.smx-footer__about a,
.smx-footer__about a:hover {
	color: rgba(255, 255, 255, .8);
	text-decoration: none;
}
.smx-footer-nav {
	gap: 0;
}
.wp-block-navigation.smx-footer-nav .wp-block-navigation-item__content,
.wp-block-navigation.smx-footer-nav .wp-block-navigation-item__content:hover {
	color: #fff;
	text-decoration: none;
}

/* Соцкнопки: квадраты фирменных цветов (как в Total до версии 6) */
.smx-social-buttons {
	gap: 5px !important;
}
.smx-social-buttons .wp-social-link {
	width: 46px;
	height: 46px;
	border-radius: 0;
	color: #fff;
	background: #aaa;
	transition: opacity .15s;
}
.smx-social-buttons .wp-social-link a {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	padding: 0;
}
.smx-social-buttons .wp-social-link svg {
	width: 25px;
	height: 25px;
}
.smx-social-buttons .wp-social-link:hover {
	opacity: .6;
	transform: none;
}
.smx-social-buttons .wp-social-link-vk { background: #55779b; }
.smx-social-buttons .wp-social-link-youtube { background: #c4302b; }
.smx-social-buttons .wp-social-link-instagram { background: #305777; }
.smx-social-buttons .wp-social-link-twitter { background: #1da1f2; }
.smx-social-buttons .wp-social-link-facebook { background: #3b5998; }
.smx-social-buttons .wp-social-link-feed { background: #ff7900; }

.smx-footer-bottom {
	padding-top: 20px;
	padding-bottom: 20px;
	font-size: 12px;
	line-height: 1;
	color: #9e9e9e;
}
.smx-footer-bottom p {
	margin: 0;
}
.smx-footer-bottom a,
.smx-footer-bottom a:hover {
	color: #bdbdbd;
	text-decoration: none;
}

@media (max-width: 781px) {
	.smx-footer__columns {
		text-align: center;
	}
	.smx-footer__logo img {
		margin: 0 auto;
	}
	.smx-footer-nav {
		align-items: center;
	}
	.smx-footer-bottom {
		line-height: 1.6;
	}
}

/* ---------- Формы (Contact Form 7 и др.), как в Total ---------- */

:where(.wp-site-blocks) :is(input[type="text"], input[type="email"], input[type="url"], input[type="tel"], input[type="password"], input[type="number"], input[type="search"], textarea, select) {
	box-sizing: border-box;
	max-width: 100%;
	padding: 6px 12px;
	font: inherit;
	font-size: var(--wp--preset--font-size--smx-meta);
	line-height: 1.65;
	color: #191919;
	background: #fff;
	border: 1px solid #1e73be;
	border-radius: 0;
}
:where(.wp-site-blocks) :is(input, textarea, select):focus {
	outline: 2px solid rgba(30, 115, 190, .3);
	outline-offset: 0;
}
:where(.wp-site-blocks) textarea {
	width: 100%;
	min-height: 150px;
}
:where(.wp-site-blocks) :is(.wpcf7 input[type="text"], .wpcf7 input[type="email"], .wpcf7 input[type="url"], .wpcf7 input[type="tel"]) {
	width: 100%;
}
:where(.wp-site-blocks) :is(input[type="submit"], button[type="submit"]:not(.wp-block-search__button), .wpcf7-submit) {
	padding: 7px 37px 6px;
	font: inherit;
	line-height: 1.65;
	color: #fff;
	background: var(--wp--preset--color--smx-button);
	border: 0;
	border-radius: 0;
	cursor: pointer;
}
:where(.wp-site-blocks) :is(input[type="submit"], button[type="submit"], .wpcf7-submit):hover {
	background: var(--wp--preset--color--smx-button-hover);
}

/* ---------- 404 ---------- */

.smx-404__title {
	display: flex;
	align-items: center;
	gap: 20px;
	font-size: 31.38px;
	color: #ff022c;
}
.smx-404__title .smx-icon {
	font-size: 60px;
}
@media (max-width: 600px) {
	.smx-404__title {
		font-size: 26px;
	}
	.smx-404__title .smx-icon {
		font-size: 48px;
	}
}

/* Форма на странице 404: поле и кнопка в одну строку (как было в Total) */
.smx-cf7-row {
	display: grid;
	grid-template-columns: 2fr 1fr;
	gap: 0 30px;
	align-items: start;
}
@media (max-width: 767px) {
	.smx-cf7-row {
		grid-template-columns: 1fr;
		gap: 15px;
	}
}
