/*
Theme Name: Korona Style
Description: Лёгкая тема для jalusi-spb.ru. Повторяет дизайн Tilda-версии на обычной адаптивной вёрстке, без абсолютного позиционирования и без jQuery.
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 8.1
Text Domain: korona-style
*/

/* Design tokens extracted from the live Tilda site (docs/design/). */
:root {
	--k-brand: #d64521;
	--k-brand-hover: #bd3a19;
	--k-accent: #ff5c39;
	--k-dark: #181818;
	--k-darker: #171717;

	--k-text: #3a3a3a;
	--k-text-muted: #626262;
	--k-text-soft: #9b9b9b;
	--k-text-invert: #ffffff;
	--k-text-invert-soft: #e4e4e4;

	/* Headings sit a step below pure black: reads calmer and more premium
	   than the near-black the Tilda version used. */
	--k-heading: #55565a;
	--k-heading-invert: #ffffff;

	--k-bg: #ffffff;
	--k-bg-alt: #f0f0f0;
	--k-bg-soft: #fbfbfb;
	--k-border: #e4e4e4;

	--k-radius-sm: 15px;
	--k-radius: 20px;
	--k-radius-pill: 30px;
	--k-radius-round: 999px;

	--k-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
	/* Onest — a grotesque drawn for Cyrillic first, so headings keep
	   character without the generic feel of a default UI face. */
	--k-font-display: 'Onest', 'Inter', -apple-system, 'Segoe UI', Arial, sans-serif;

	--k-fs-xs: 0.75rem;
	--k-fs-sm: 0.875rem;
	--k-fs-base: 1rem;
	--k-fs-md: 1.125rem;
	--k-fs-lg: 1.25rem;
	--k-fs-xl: 1.5625rem;
	--k-fs-h2: clamp(1.75rem, 3.2vw, 2.8125rem);
	--k-fs-h1: clamp(2rem, 4vw, 3.125rem);

	--k-space-1: 0.5rem;
	--k-space-2: 1rem;
	--k-space-3: 1.5rem;
	--k-space-4: 2rem;
	--k-space-5: 3rem;
	--k-space-6: 4rem;
	--k-space-7: 6rem;

	--k-container: 1200px;
	--k-gutter: clamp(1rem, 4vw, 2.5rem);
}

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

/* Any author `display` rule outranks the browser's [hidden] rule, so a
   dialog styled `display: grid` would show even while hidden — and could
   not be closed, since closing only sets the attribute back. */
[hidden] {
	display: none !important;
}

body {
	margin: 0;
	font-family: var(--k-font);
	font-size: var(--k-fs-base);
	font-weight: 400;
	line-height: 1.55;
	color: var(--k-text);
	background: var(--k-bg);
	-webkit-font-smoothing: antialiased;
}

img {
	max-width: 100%;
	height: auto;
	display: block;
}

a {
	color: inherit;
}

h1,
h2,
h3,
h4 {
	margin: 0 0 var(--k-space-3);
	font-family: var(--k-font-display);
	font-weight: 500;
	line-height: 1.12;
	letter-spacing: -0.015em;
	color: var(--k-heading);
}

h1 {
	font-size: var(--k-fs-h1);
}

h2 {
	font-size: var(--k-fs-h2);
}

h3 {
	font-size: var(--k-fs-lg);
}

p {
	margin: 0 0 var(--k-space-2);
}

/* Layout */
.k-container {
	width: 100%;
	max-width: var(--k-container);
	margin-inline: auto;
	padding-inline: var(--k-gutter);
}

.k-section {
	padding-block: clamp(2.5rem, 6vw, 5rem);
}

.k-section--alt {
	background: var(--k-bg-alt);
}

.k-section--dark {
	background: var(--k-dark);
	color: var(--k-text-invert);
}

.k-section--dark h1,
.k-section--dark h2,
.k-section--dark h3,
.k-zamer__pitch h2,
.k-zamer__pitch h3 {
	color: var(--k-text-invert);
}

.k-grid {
	display: grid;
	gap: var(--k-space-3);
}

@media (min-width: 640px) {
	.k-grid--2 { grid-template-columns: repeat(2, 1fr); }
	.k-grid--3 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 960px) {
	.k-grid--3 { grid-template-columns: repeat(3, 1fr); }
	.k-grid--4 { grid-template-columns: repeat(4, 1fr); }
}

/* Buttons — 30px pill, brand fill, matching the Tilda CTA styling. */
.k-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5em;
	padding: 0.85rem 1.75rem;
	border: 0;
	border-radius: var(--k-radius-pill);
	background: var(--k-brand);
	color: var(--k-text-invert);
	font: inherit;
	font-size: var(--k-fs-sm);
	font-weight: 500;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.k-btn:hover,
.k-btn:focus-visible {
	background: var(--k-brand-hover);
}

.k-btn--dark {
	background: var(--k-dark);
}

.k-btn--dark:hover {
	background: #000;
}

.k-btn--light {
	background: var(--k-bg);
	color: var(--k-dark);
	font-weight: 600;
}

.k-btn--lg {
	font-size: var(--k-fs-base);
	padding: 1.05rem 2.25rem;
}

/* Cards */
.k-card {
	background: var(--k-bg);
	border-radius: var(--k-radius);
	overflow: hidden;
}

.k-card--alt {
	background: var(--k-bg-alt);
	padding: var(--k-space-3);
}

/* Forms */
.k-form {
	display: grid;
	gap: var(--k-space-2);
}

.k-field input[type='text'],
.k-field input[type='tel'],
.k-field input[type='email'],
.k-field select,
.k-field textarea {
	width: 100%;
	padding: 0.9rem 1.25rem;
	border: 1px solid var(--k-border);
	border-radius: var(--k-radius-pill);
	background: var(--k-bg);
	font: inherit;
	color: var(--k-text);
}

.k-field textarea {
	border-radius: var(--k-radius-sm);
	min-height: 7rem;
	resize: vertical;
}

/* The native select is a different height and font from the inputs beside it;
   these bring it into the same row. */
.k-field select {
	appearance: none;
	background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
		linear-gradient(135deg, currentColor 50%, transparent 50%);
	background-position: right 1.35rem center, right 1.05rem center;
	background-size: 6px 6px, 6px 6px;
	background-repeat: no-repeat;
	padding-right: 2.75rem;
	cursor: pointer;
}

.k-field select:focus-visible,
.k-field input:focus-visible,
.k-field textarea:focus-visible {
	outline: 2px solid var(--k-brand);
	outline-offset: 1px;
}

.k-field--error input {
	border-color: var(--k-brand);
}

.k-consent {
	display: flex;
	gap: 0.6rem;
	align-items: flex-start;
	font-size: var(--k-fs-xs);
	color: var(--k-text-muted);
	line-height: 1.4;
}

.k-form__message {
	font-size: var(--k-fs-sm);
	margin: 0;
}

.k-form__message--error {
	color: var(--k-brand);
}

/* Honeypot: must stay reachable for bots but never shown or focusable. */
.k-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.k-visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.k-skip-link {
	position: absolute;
	left: -9999px;
}

.k-skip-link:focus {
	left: var(--k-gutter);
	top: var(--k-space-2);
	z-index: 100;
	padding: 0.75rem 1.25rem;
	background: var(--k-dark);
	color: var(--k-text-invert);
	border-radius: var(--k-radius-sm);
}
