/* =====================================================================
   sparta.training — Home New
   Файл: wp-content/themes/elsey/assets/home-new.css
   Дизайн-токены из макета Figma "Sparta".
   Заголовки — DIN Condensed (если есть в теме), иначе Oswald (condensed).
   Шрифт Oswald подключается через <link> в шаблоне (не @import — тот
   блокирует рендер). font-display: optional + size-adjust устраняют CLS.
   ===================================================================== */

/* Локальный fallback-метрик для Oswald: почти совпадает по ширине,
   чтобы при подмене шрифта не было сдвига (CLS). */
@font-face {
	font-family: "Oswald Fallback";
	src: local("Arial Narrow"), local("Arial");
	size-adjust: 88%;
	ascent-override: 90%;
	descent-override: 22%;
	line-gap-override: 0%;
}

.sh {
	--accent: #FF6A00;
	--black: #010101;
	--white: #FFFFFF;
	--surface: #EEEEEE;
	--border: #9F9FA4;
	--gray: #6F6F74;
	--blue: #0035BF;

	--wrap: 1200px;
	--gap: 24px;
	--radius: 14px;

	--ff-head: "Oswald", "Oswald Fallback", "PT Sans Narrow", "Arial Narrow", sans-serif;
	--ff-body: "Vela Sans", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

	color: var(--black);
	font-family: var(--ff-body);
	line-height: 1.4;
	-webkit-font-smoothing: antialiased;
}

.sh * { box-sizing: border-box; }

/* ------------------------------ layout ------------------------------ */
.sh-wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.sh section { padding: 56px 0; }
.sh section.sh-hero { padding-top: 0; padding-bottom: 0; }
.sh-center { text-align: center; margin-top: 32px; }

.sh-h2 {
	font-family: var(--ff-head);
	font-weight: 600;
	font-stretch: 75%;
	font-size: clamp(34px, 5vw, 60px);
	line-height: 0.95;
	letter-spacing: -0.01em;
	text-transform: uppercase;
	margin: 0 0 28px;
	display: inline-block;
	transform: scaleX(0.88);
	transform-origin: left center;
}
.sh-h3 {
	font-family: var(--ff-head);
	font-weight: 600;
	font-stretch: 75%;
	font-size: clamp(22px, 3vw, 34px);
	line-height: 0.9;
	text-transform: uppercase;
	margin: 0 0 8px;
	display: inline-block;
	transform: scaleX(0.88);
	transform-origin: left center;
}

/* ------------------------------ button ------------------------------ */
.sh-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-family: var(--ff-body);
	font-weight: 600;
	font-size: 16px;
	line-height: 1;
	padding: 16px 26px;
	border-radius: 999px;
	text-decoration: none;
	transition: transform .15s ease, background-color .15s ease, color .15s ease;
	will-change: transform;
}
.sh-btn--accent { background: var(--accent); color: var(--white); }
.sh-btn--accent:hover { background: #e85f00; transform: translateY(-1px); }
.sh-arrow { font-size: 1.05em; line-height: 1; }

/* ---------------------------- hero slider --------------------------- */
.sh-hero {
	position: relative;
	width: 100%;
	max-width: calc(var(--wrap) + 200px);
	margin: 0 auto;
	padding: 0 20px;
	overflow: hidden;
	background: transparent !important;
}
.sh-hero__slides {
	position: relative;
	width: 100%;
	aspect-ratio: 1440 / 566;
	border-radius: var(--radius);
	overflow: hidden;
	background: var(--white);
}
.sh-hero__slide {
	position: absolute; inset: 0;
	opacity: 0;
	transition: opacity .5s ease;
	background: var(--white);
}
.sh-hero__slide.is-active { opacity: 1; }
.sh-hero__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
/* градиент под текстом — только для светлого текста */
.sh-hero__inner[data-color="light"]::before {
	content: "";
	position: absolute;
	left: -20px; top: -40px; bottom: -40px;
	width: 70%;
	background: linear-gradient(90deg, rgba(0,0,0,.5) 0%, rgba(0,0,0,0) 100%);
	z-index: -1;
	pointer-events: none;
}
.sh-hero__inner {
	position: absolute;
	left: 0; top: 50%;
	transform: translateY(-50%);
	z-index: 2;
	max-width: 70%;
	padding: 24px 48px;
	transition: color .4s ease;
}
.sh-hero__inner[data-color="light"] { color: var(--white); }
.sh-hero__inner[data-color="dark"]  { color: var(--black); }
.sh-hero__inner[data-color="light"] .sh-hero__title,
.sh-hero__inner[data-color="light"] .sh-hero__lead { color: var(--white) !important; }
.sh-hero__inner[data-color="dark"] .sh-hero__title,
.sh-hero__inner[data-color="dark"] .sh-hero__lead { color: var(--black) !important; }
.sh-hero__title {
	font-family: var(--ff-head);
	font-weight: 600;
	font-stretch: 75%;
	font-size: clamp(38px, 5.6vw, 88px);
	line-height: 0.9;
	letter-spacing: -0.01em;
	text-transform: uppercase;
	margin: 0 0 10px;
	display: inline-block;
	white-space: nowrap;
	transform: scaleX(0.88);
	transform-origin: left center;
}
.sh-hero__sub {
	font-size: 0.32em;
	vertical-align: baseline;
	letter-spacing: 0.04em;
	margin-left: .35em;
	white-space: nowrap;
}
.sh-hero__lead { font-size: clamp(15px, 1.6vw, 18px); margin: 0 0 20px; }

/* стрелки */
.sh-hero__nav {
	position: absolute;
	right: 24px;
	bottom: 24px;
	z-index: 3;
	display: flex;
	gap: 10px;
}
.sh-hero__arrow {
	flex: 0 0 auto;
	width: 48px !important;
	height: 48px !important;
	min-width: 0 !important;
	padding: 0 !important;
	margin: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	background: rgba(255,255,255,.9);
	color: var(--black);
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: background-color .15s ease, transform .15s ease;
}
.sh-hero__arrow:hover { background: var(--accent); color: var(--white); transform: translateY(-1px); }

/* ----------------------------- who we are --------------------------- */
.sh-who__grid {
	display: grid;
	grid-template-columns: 300px 1fr;
	gap: 48px;
	align-items: start;
}
.sh-who__body p { margin: 0 0 24px; font-size: 18px; color: #222; max-width: 720px; }
.sh-who__btn {
	display: inline-flex;
	margin: 32px auto 0;
}
.sh-who > .sh-wrap {
	text-align: center;
}
.sh-who__grid { text-align: left; }

/* ---------------------------- head + nav ---------------------------- */
.sh-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.sh-head .sh-h2 { margin: 0; }
.sh-nav { display: flex; gap: 10px; }
.sh-nav__btn {
	flex: 0 0 auto;
	width: 44px !important;
	height: 44px !important;
	min-width: 0 !important;
	padding: 0 !important;
	margin: 0 !important;
	border: 1px solid var(--border) !important;
	background: transparent;
	border-radius: 50% !important;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	color: var(--black);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: background-color .15s ease, color .15s ease;
}
.sh-nav__btn:hover { background: var(--black); color: var(--white); }
.sh-nav__btn.is-off { opacity: .35; }

/* ---------------------------- categories ---------------------------- */
/* Трек листается по «страницам». Каждая страница — CSS grid 3×2 = 6 плиток,
   шириной 100% контейнера. Стрелки в JS листают на ширину страницы. */
.sh-cats__track {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: 100%;
	gap: var(--gap);
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}
.sh-cats__track::-webkit-scrollbar { display: none; }
.sh-cats__page {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	grid-template-rows: repeat(2, 1fr);
	gap: var(--gap);
	scroll-snap-align: start;
}
.sh-cat {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	min-height: 170px;
	padding: 22px;
	background: var(--surface);
	border-radius: var(--radius);
	text-decoration: none;
	color: var(--black);
	overflow: hidden;
	transition: transform .15s ease;
}
.sh-cat:hover { transform: translateY(-2px); }
.sh-cat__title {
	font-family: var(--ff-head);
	font-weight: 700;
	font-stretch: 75%;
	font-size: 22px;
	text-transform: uppercase;
	line-height: 1;
	max-width: 55%;
	position: relative; z-index: 2;
}
.sh-cat__go {
	position: relative; z-index: 2;
	width: 40px; height: 40px;
	margin-top: auto;
	display: inline-flex; align-items: center; justify-content: center;
	border: 1px solid var(--border);
	border-radius: 50%;
	font-size: 16px;
}
.sh-cat__sub {
	position: relative; z-index: 2;
	font-family: var(--ff-body);
	font-size: 13px;
	line-height: 1.3;
	color: var(--gray);
	margin-top: 6px;
	max-width: 55%;
}
.sh-cat__img {
	position: absolute;
	right: 12px; top: 50%;
	transform: translateY(-50%);
	width: 46%;
	max-width: 150px;
	height: 78%;
	object-fit: contain;
	object-position: right center;
	z-index: 1;
	pointer-events: none;
}

/* ---------------------------- products grid ------------------------- */
/* Тема Elsey сама рендерит .els-product-* внутри shortcode [products].
   Приводим сетку к 4 колонкам и лёгким карточкам. */
.sh-products__grid ul.products {
	display: grid !important;
	grid-template-columns: repeat(4, 1fr);
	gap: var(--gap);
	margin: 0; padding: 0;
	list-style: none;
}
.sh-products__grid ul.products::before,
.sh-products__grid ul.products::after { content: none !important; }
.sh-products__grid ul.products li.product {
	width: 100% !important;
	margin: 0 !important;
	float: none !important;
	clear: none !important;
}

/* --------------------------- buying process ------------------------- */
.sh-buy { background: var(--white); }
.sh-buy__grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 48px;
	align-items: center;
}
.sh-buy__title { grid-column: 1 / -1; }
.sh-buy__steps { list-style: none; margin: 0; padding: 0; }
.sh-buy__step {
	font-family: var(--ff-head);
	font-weight: 700;
	font-stretch: 75%;
	font-size: clamp(20px, 2.4vw, 30px);
	text-transform: uppercase;
	padding: 18px 20px;
	border-radius: 8px;
	cursor: pointer;
	transition: background-color .15s ease;
	line-height: 1;
}
.sh-buy__step span { display: inline-block; min-width: 46px; }
.sh-buy__step.is-active { background: var(--surface); }
.sh-buy__media { position: relative; aspect-ratio: 655 / 433; border-radius: var(--radius); overflow: hidden; }
.sh-buy__media img {
	position: absolute; inset: 0;
	width: 100%; height: 100%;
	object-fit: cover;
	opacity: 0;
	transition: opacity .3s ease;
}
.sh-buy__media img.is-active { opacity: 1; position: relative; }

/* ----------------------------- benefits ----------------------------- */
.sh-benefits__grid {
	display: grid;
	grid-template-columns: 1fr 1.15fr;
	gap: var(--gap);
	align-items: stretch;
}
.sh-benefits__img img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius); display: block; }
.sh-benefits__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.sh-benefits__list li { background: var(--surface); border-radius: var(--radius); padding: 24px 28px; }
.sh-benefits__list p { margin: 0; color: var(--gray); font-size: 16px; }

/* ----------------------------- partners ----------------------------- */
.sh-partners__lead { max-width: 900px; color: #222; font-size: 16px; margin: 0 0 32px; }
.sh-partners__grid {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 16px;
}
.sh-partner {
	aspect-ratio: 312 / 146;
	border: 1px solid var(--surface);
	border-radius: 8px;
	display: flex; align-items: center; justify-content: center;
	overflow: hidden;
	padding: 4px;
}
.sh-partner img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

/* ----------------------------- articles ----------------------------- */
.sh-articles__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.sh-art__link { text-decoration: none; color: var(--black); display: block; }
.sh-art__thumb { border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; margin-bottom: 14px; }
.sh-art__img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sh-art__date { display: block; color: var(--gray); font-size: 14px; margin-bottom: 6px; }
.sh-art__title { font-size: 18px; font-weight: 700; margin: 0 0 8px; line-height: 1.25; }
.sh-art__excerpt { color: var(--gray); font-size: 15px; margin: 0; }

/* ------------------------------ contact ----------------------------- */
.sh-contact__grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 48px; align-items: start; }
.sh-contact__intro p { color: var(--gray); font-size: 16px; }
.sh-contact__form {
	background: linear-gradient(135deg, #e9ecf6 0%, #dfe3f0 100%);
	border-radius: var(--radius);
	padding: 36px;
}
.sh-contact__form label { display: block; font-size: 14px; margin: 0 0 6px; }
.sh-contact__form input,
.sh-contact__form textarea {
	width: 100%;
	background: var(--white);
	border: 0;
	border-radius: 10px;
	padding: 14px 18px;
	font-size: 15px;
	margin-bottom: 18px;
	font-family: var(--ff-body);
	box-sizing: border-box;
}
/* CF7 оборачивает каждое поле в inline .wpcf7-form-control-wrap —
   делаем обёртки блочными на всю ширину, чтобы все поля были равны */
.sh-contact__form .wpcf7-form-control-wrap {
	display: block;
	width: 100%;
}
/* тема Elsey режет первый label до 50% + float — перебиваем */
.sh-contact__form p label,
.sh-contact__form .wpcf7 form p:nth-child(2) label,
.sh-contact__form form p label {
	width: 100% !important;
	max-width: 100% !important;
	float: none !important;
	padding: 0 !important;
	display: block !important;
}
.sh-contact__form p { margin: 0; }
.sh-contact__form textarea { min-height: 90px; resize: vertical; }
.sh-contact__form input[type="submit"],
.sh-contact__form input.wpcf7-submit,
.sh-contact__form .wpcf7-form-control.wpcf7-submit,
.sh-contact__form button[type="submit"] {
	width: 100% !important;
	background: var(--accent) !important;
	color: var(--white) !important;
	font-weight: 600 !important;
	border: 0 !important;
	border-radius: 999px !important;
	padding: 16px 26px !important;
	cursor: pointer;
	margin-bottom: 0 !important;
}
.sh-contact__form input[type="submit"]:hover,
.sh-contact__form input.wpcf7-submit:hover,
.sh-contact__form .wpcf7-form-control.wpcf7-submit:hover {
	background: #e85f00 !important;
}

/* ================================ RWD ================================ */
@media (max-width: 991px) {
	.sh-who__grid { grid-template-columns: 1fr; gap: 20px; }
	.sh-cats__page { grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(3, 1fr); }
	.sh-products__grid ul.products { grid-template-columns: repeat(2, 1fr); }
	.sh-buy__grid { grid-template-columns: 1fr; gap: 28px; }
	.sh-benefits__grid { grid-template-columns: 1fr; }
	.sh-partners__grid { grid-template-columns: repeat(3, 1fr); }
	.sh-articles__grid { grid-template-columns: 1fr; }
	.sh-contact__grid { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 767px) {
	.sh section { padding: 40px 0; }
	.sh section.sh-hero { padding: 0; }
	.sh-hero { max-width: 100%; }
	.sh-hero__slides { --sh-hero-ar: 3 / 5; aspect-ratio: 3 / 5; border-radius: 0; }
	.sh-hero__img { object-position: center; }
	/* текст вверху, кнопка внизу на всю ширину — как в макете */
	.sh-hero__inner {
		max-width: 100%;
		padding: 28px 20px;
		inset: 0;
		top: 0; bottom: 0;
		transform: none;
		display: flex;
		flex-direction: column;
		justify-content: flex-start;
	}
	.sh-hero__inner[data-color="light"]::before { display: none; }
	.sh-hero__inner[data-color="light"] { color: var(--white); }
	.sh-hero__inner[data-color="dark"] { color: var(--black); }
	.sh-hero__inner[data-color="light"] .sh-hero__title,
	.sh-hero__inner[data-color="light"] .sh-hero__lead { color: var(--white) !important; }
	.sh-hero__inner[data-color="dark"] .sh-hero__title,
	.sh-hero__inner[data-color="dark"] .sh-hero__lead { color: var(--black) !important; }
	.sh-hero__title { font-size: clamp(34px, 11vw, 54px); white-space: normal; line-height: 0.9; }
	.sh-hero__sub { font-size: 0.4em; vertical-align: middle; }
	.sh-hero__inner[data-color="light"] .sh-hero__title,
	.sh-hero__inner[data-color="light"] .sh-hero__lead { text-shadow: 0 1px 8px rgba(0,0,0,.45); }
	.sh-hero__inner[data-color="dark"] .sh-hero__title,
	.sh-hero__inner[data-color="dark"] .sh-hero__lead { text-shadow: 0 1px 8px rgba(255,255,255,.55); }
	.sh-hero__lead { margin: 8px 0 0; font-size: 15px; }
	/* кнопка Shop now — прижата к низу, на всю ширину */
	.sh-hero__inner .sh-btn {
		margin-top: auto;
		width: 100%;
		justify-content: center;
		padding: 16px 26px;
	}
	.sh-hero__nav { display: none; }
	/* На мобайле «страницы» перестают быть 3×2 — плитки идут одной
	   горизонтальной лентой по одной. */
	.sh-cats__page {
		display: contents;
	}
	.sh-cats__track {
		grid-auto-columns: 78%;
	}
	.sh-cat { scroll-snap-align: start; }
	.sh-products__grid ul.products {
		grid-auto-flow: column;
		grid-auto-columns: 70%;
		grid-template-columns: none !important;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		scrollbar-width: none;
	}
	.sh-products__grid ul.products::-webkit-scrollbar { display: none; }
	.sh-products__grid ul.products li.product { scroll-snap-align: start; }
	.sh-partners__grid { grid-template-columns: repeat(2, 1fr); }
}

/* -------------------------- accessibility --------------------------- */
.sh-btn:focus-visible,
.sh-nav__btn:focus-visible,
.sh-cat:focus-visible,
.sh-buy__step:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
	.sh * { transition: none !important; }
}
