/*
 * СТСН «Рассвет» — базовый слой дизайн-системы.
 * Токены, шрифт, сброс, типографика, формы, кнопки, служебные классы WordPress.
 * Родительский style.css Twenty Fourteen не подключается: вся вёрстка — здесь и в chrome/home/content.css.
 */

@font-face {
	font-family: "Onest";
	font-style: normal;
	font-display: swap;
	font-weight: 100 900;
	src: url("../assets/fonts/onest-cyrillic-wght-normal.woff2") format("woff2-variations");
	unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
	font-family: "Onest";
	font-style: normal;
	font-display: swap;
	font-weight: 100 900;
	src: url("../assets/fonts/onest-latin-ext-wght-normal.woff2") format("woff2-variations");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
	font-family: "Onest";
	font-style: normal;
	font-display: swap;
	font-weight: 100 900;
	src: url("../assets/fonts/onest-latin-wght-normal.woff2") format("woff2-variations");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
	/* Палитра «рассвет над садом»: лесной зелёный + тёплая заря. */
	--stsn-forest: #16382c;
	--stsn-forest-2: #1f4a3a;
	--stsn-forest-3: #2f6b4f;
	--stsn-dawn: #d9692a;
	--stsn-sun: #f6c784;
	--stsn-ink: #13201b;
	--stsn-ink-muted: #45524c;
	--stsn-paper: #fbf9f4;
	--stsn-sand: #f4efe6;
	--stsn-mint: #e9f1ec;
	--stsn-line: #e0d9cc;
	--stsn-line-cool: #d3ddd6;

	/* Семантические токены (используются компонентами всех модулей темы). */
	--stsn-primary: #a3480f;
	--stsn-primary-dark: #8a3c0c;
	--stsn-primary-light: #f3d9c4;
	--stsn-accent: var(--stsn-forest);
	--stsn-text: var(--stsn-ink);
	--stsn-text-muted: var(--stsn-ink-muted);
	--stsn-bg: var(--stsn-paper);
	--stsn-surface: #ffffff;
	--stsn-surface-soft: var(--stsn-mint);
	--stsn-surface-warm: var(--stsn-sand);
	--stsn-border: var(--stsn-line);
	--stsn-success: #2a6b45;
	--stsn-success-bg: #e5f3ea;
	--stsn-warning: #8a5a00;
	--stsn-warning-bg: #fdf3dc;
	--stsn-error: #b3261e;
	--stsn-error-bg: #fdeeee;
	--stsn-focus: #1d6fd6;

	--stsn-font: "Onest", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
	--stsn-display: var(--stsn-font);

	--stsn-radius-xs: 6px;
	--stsn-radius-sm: 10px;
	--stsn-radius: 14px;
	--stsn-radius-lg: 22px;

	--stsn-shadow-sm: 0 1px 2px rgba(19, 32, 27, 0.06), 0 1px 3px rgba(19, 32, 27, 0.05);
	--stsn-shadow: 0 10px 30px -12px rgba(22, 56, 44, 0.22);
	--stsn-shadow-lg: 0 24px 60px -24px rgba(22, 56, 44, 0.35);

	--stsn-space-2xs: 4px;
	--stsn-space-xs: 8px;
	--stsn-space-sm: 12px;
	--stsn-space-md: 16px;
	--stsn-space-lg: 24px;
	--stsn-space-xl: 32px;
	--stsn-space-2xl: 48px;
	--stsn-space-3xl: 72px;

	--stsn-container: 1200px;
	--stsn-container-narrow: 780px;
	--stsn-gutter: clamp(16px, 4vw, 32px);
	--stsn-header-height: 72px;

	--stsn-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* —— Сброс —— */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	font-size: 112.5%; /* 18px: крупный базовый кегль по ТЗ §3 */
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-padding-top: calc(var(--stsn-header-height) + 16px);
}

@media (prefers-reduced-motion: no-preference) {
	html {
		scroll-behavior: smooth;
	}
}

body {
	margin: 0;
	background: var(--stsn-bg);
	color: var(--stsn-text);
	font-family: var(--stsn-font);
	font-size: 1rem;
	font-weight: 400;
	line-height: 1.6;
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

img,
svg,
video,
canvas,
iframe {
	display: block;
	max-width: 100%;
}

img,
video {
	height: auto;
}

svg:not([width]) {
	height: auto;
}

button,
input,
select,
textarea {
	font: inherit;
	color: inherit;
	letter-spacing: inherit;
}

/* —— Типографика —— */

h1,
h2,
h3,
h4,
h5,
h6 {
	margin: 0 0 0.5em;
	color: var(--stsn-ink);
	font-family: var(--stsn-display);
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.015em;
	text-wrap: balance;
}

h1 {
	font-size: clamp(1.9rem, 1.4rem + 2.2vw, 2.9rem);
	letter-spacing: -0.025em;
}

h2 {
	font-size: clamp(1.5rem, 1.2rem + 1.3vw, 2.05rem);
}

h3 {
	font-size: clamp(1.2rem, 1.1rem + 0.5vw, 1.4rem);
	line-height: 1.3;
}

h4 {
	font-size: 1.1rem;
	line-height: 1.35;
}

h5,
h6 {
	font-size: 1rem;
}

p,
ul,
ol,
dl,
blockquote,
figure,
table,
pre {
	margin: 0 0 1em;
}

p {
	text-wrap: pretty;
}

ul,
ol {
	padding-left: 1.4em;
}

li + li {
	margin-top: 0.3em;
}

a {
	color: var(--stsn-primary);
	text-decoration-line: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
	transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

a:hover {
	color: var(--stsn-primary-dark);
	text-decoration-thickness: 2px;
}

strong,
b {
	font-weight: 650;
}

small {
	font-size: 0.875em;
}

hr {
	height: 1px;
	margin: var(--stsn-space-xl) 0;
	border: 0;
	background: var(--stsn-border);
}

blockquote {
	margin-left: 0;
	padding: var(--stsn-space-md) var(--stsn-space-lg);
	border-left: 4px solid var(--stsn-dawn);
	border-radius: 0 var(--stsn-radius-sm) var(--stsn-radius-sm) 0;
	background: var(--stsn-surface-warm);
	color: var(--stsn-ink);
}

blockquote p:last-child {
	margin-bottom: 0;
}

code,
kbd,
pre,
samp {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 0.9em;
}

pre {
	overflow-x: auto;
	padding: var(--stsn-space-md);
	border-radius: var(--stsn-radius-sm);
	background: var(--stsn-mint);
}

table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.95rem;
}

th,
td {
	padding: 10px 12px;
	border-bottom: 1px solid var(--stsn-border);
	text-align: left;
	vertical-align: top;
}

th {
	color: var(--stsn-ink);
	font-weight: 650;
}

::selection {
	background: var(--stsn-primary-light);
	color: var(--stsn-ink);
}

/* —— Фокус: заметный для клавиатуры, без рамок для мыши —— */

:focus {
	outline: none;
}

:focus-visible {
	outline: 3px solid var(--stsn-focus);
	outline-offset: 2px;
	border-radius: 4px;
}

/* —— Кнопки —— */

.stsn-btn,
button,
.button,
input[type="button"],
input[type="reset"],
input[type="submit"] {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5em;
	min-height: 48px;
	padding: 11px 22px;
	border: 2px solid var(--stsn-primary);
	border-radius: var(--stsn-radius-sm);
	background: var(--stsn-primary);
	box-shadow: none;
	color: #fff;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	text-transform: none;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s var(--stsn-ease);
}

.stsn-btn:hover,
button:hover,
.button:hover,
input[type="button"]:hover,
input[type="reset"]:hover,
input[type="submit"]:hover {
	border-color: var(--stsn-primary-dark);
	background: var(--stsn-primary-dark);
	color: #fff;
	text-decoration: none;
}

.stsn-btn:active,
button:active,
input[type="submit"]:active {
	transform: translateY(1px);
}

.stsn-btn[disabled],
button[disabled],
input[type="submit"][disabled] {
	cursor: not-allowed;
	opacity: 0.55;
}

.stsn-btn--primary {
	border-color: var(--stsn-primary);
	background: var(--stsn-primary);
	color: #fff;
}

.stsn-btn--secondary {
	border-color: var(--stsn-forest);
	background: var(--stsn-forest);
	color: #fff;
}

.stsn-btn--secondary:hover {
	border-color: var(--stsn-forest-2);
	background: var(--stsn-forest-2);
}

.stsn-btn--ghost,
.stsn-btn--outline {
	border-color: var(--stsn-line-cool);
	background: var(--stsn-surface);
	color: var(--stsn-ink);
}

.stsn-btn--ghost:hover,
.stsn-btn--outline:hover {
	border-color: var(--stsn-forest);
	background: var(--stsn-surface);
	color: var(--stsn-forest);
}

.stsn-btn--light {
	border-color: #fff;
	background: #fff;
	color: var(--stsn-forest);
}

.stsn-btn--light:hover {
	border-color: var(--stsn-sun);
	background: var(--stsn-sun);
	color: var(--stsn-ink);
}

.stsn-btn--on-dark {
	border-color: rgba(255, 255, 255, 0.55);
	background: transparent;
	color: #fff;
}

.stsn-btn--on-dark:hover {
	border-color: #fff;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
}

.stsn-btn--sm {
	min-height: 40px;
	padding: 7px 14px;
	font-size: 0.9rem;
}

.stsn-btn--block {
	width: 100%;
}

.stsn-btn svg {
	flex: none;
	width: 1.15em;
	height: 1.15em;
}

/* Текстовая ссылка со стрелкой. */
.stsn-link-arrow {
	display: inline-flex;
	align-items: center;
	gap: 0.35em;
	font-weight: 600;
	text-decoration: none;
}

.stsn-link-arrow::after {
	content: "→";
	transition: transform 0.2s var(--stsn-ease);
}

.stsn-link-arrow:hover::after {
	transform: translateX(3px);
}

/* —— Формы —— */

label {
	color: var(--stsn-ink);
	font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="tel"],
input[type="date"],
input[type="datetime-local"],
input[type="month"],
input[type="week"],
input[type="time"],
select,
textarea {
	width: 100%;
	min-height: 48px;
	padding: 10px 14px;
	border: 1.5px solid var(--stsn-line-cool);
	border-radius: var(--stsn-radius-sm);
	background: var(--stsn-surface);
	color: var(--stsn-ink);
	font-size: 1rem;
	line-height: 1.4;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea {
	min-height: 140px;
	resize: vertical;
}

select {
	padding-right: 40px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2345524c' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
	background-position: right 14px center;
	background-repeat: no-repeat;
	appearance: none;
}

input:hover,
select:hover,
textarea:hover {
	border-color: #aebdb4;
}

input:focus,
select:focus,
textarea:focus {
	border-color: var(--stsn-forest-3);
	box-shadow: 0 0 0 4px rgba(47, 107, 79, 0.16);
	outline: none;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
	outline: 3px solid var(--stsn-focus);
	outline-offset: 1px;
}

::placeholder {
	color: #77857e;
	opacity: 1;
}

input[type="checkbox"],
input[type="radio"] {
	width: 20px;
	height: 20px;
	margin: 0;
	accent-color: var(--stsn-forest-3);
	vertical-align: -3px;
}

fieldset {
	margin: 0 0 var(--stsn-space-lg);
	padding: var(--stsn-space-md) var(--stsn-space-lg);
	border: 1px solid var(--stsn-border);
	border-radius: var(--stsn-radius);
}

legend {
	padding: 0 6px;
	font-weight: 650;
}

/* —— Служебные классы WordPress —— */

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
	word-wrap: normal !important;
}

.screen-reader-text:focus {
	z-index: 100000;
	top: 8px;
	left: 8px;
	display: block;
	width: auto;
	height: auto;
	padding: 12px 18px;
	clip: auto !important;
	clip-path: none;
	border-radius: var(--stsn-radius-sm);
	background: var(--stsn-surface);
	box-shadow: var(--stsn-shadow);
	color: var(--stsn-ink);
	font-weight: 600;
	text-decoration: none;
}

.alignleft {
	float: left;
	margin: 0.3em 1.5em 1em 0;
}

.alignright {
	float: right;
	margin: 0.3em 0 1em 1.5em;
}

.aligncenter {
	display: block;
	margin-right: auto;
	margin-left: auto;
}

.alignwide,
.alignfull {
	max-width: none;
}

.wp-caption,
figure {
	max-width: 100%;
}

.wp-caption-text,
figcaption {
	margin-top: 8px;
	color: var(--stsn-ink-muted);
	font-size: 0.875rem;
}

.sticky,
.bypostauthor,
.gallery-caption {
	/* Классы, которые ожидает WordPress. */
	font-style: normal;
}

.gallery {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: 12px;
}

.gallery-item {
	margin: 0;
}

/* —— Раскладка —— */

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

.stsn-container--narrow {
	max-width: calc(var(--stsn-container-narrow) + 2 * var(--stsn-gutter));
}

.stsn-stack > * + * {
	margin-top: var(--stsn-space-md);
}

.stsn-eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 var(--stsn-space-sm);
	color: var(--stsn-primary);
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.stsn-lead {
	color: var(--stsn-ink-muted);
	font-size: clamp(1.05rem, 1rem + 0.3vw, 1.2rem);
	line-height: 1.55;
}

.stsn-muted {
	color: var(--stsn-ink-muted);
}

.stsn-visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
}

/* Анимация появления включается только если JS отметил <html class="stsn-js">:
   без JS (и при печати) контент виден сразу. */
@media screen and (prefers-reduced-motion: no-preference) {
	.stsn-js .stsn-reveal {
		opacity: 0;
		transform: translateY(14px);
		transition: opacity 0.5s var(--stsn-ease), transform 0.5s var(--stsn-ease);
		transition-delay: calc(var(--stsn-i, 0) * 70ms);
	}

	.stsn-js .stsn-reveal.stsn-revealed {
		opacity: 1;
		transform: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
	}
}
