/* ProMax documentation */

@font-face {
	font-family: "Open Sans";
	font-style: normal;
	font-weight: 300 800;
	font-display: swap;
	src: url("../fonts/open-sans-latin.woff2") format("woff2");
}

:root {
	--bg: #ffffff;
	--bg-soft: #f5f7fa;
	--bg-code: #f2f4f7;
	--text: #1f2328;
	--text-muted: #5b6470;
	--border: #e1e5eb;
	--brand: #3c6e9f;
	--brand-strong: #2c5680;
	--brand-soft: #e8f0f8;
	--header-bg: #2f3237;
	--header-text: #ffffff;
	--pro: #c62828;
	--pro-soft: #fdecec;
	--free: #2e7d32;
	--free-soft: #e8f5e9;
	--warn: #9a6700;
	--warn-soft: #fff6dd;
	--shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 4px 12px rgba(16, 24, 40, 0.06);
	--radius: 10px;
	--sidebar-w: 264px;
	--toc-w: 220px;
	color-scheme: light;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--bg: #15181c;
		--bg-soft: #1c2026;
		--bg-code: #222831;
		--text: #e6e9ee;
		--text-muted: #9aa4b2;
		--border: #2d333b;
		--brand: #7fb0e3;
		--brand-strong: #a9cbf0;
		--brand-soft: #1d2a38;
		--header-bg: #0f1114;
		--pro: #ff7b72;
		--pro-soft: #3a1d1d;
		--free: #7ee787;
		--free-soft: #17301c;
		--warn: #e3b341;
		--warn-soft: #33290f;
		--shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
		color-scheme: dark;
	}
}

:root[data-theme="dark"] {
	--bg: #15181c;
	--bg-soft: #1c2026;
	--bg-code: #222831;
	--text: #e6e9ee;
	--text-muted: #9aa4b2;
	--border: #2d333b;
	--brand: #7fb0e3;
	--brand-strong: #a9cbf0;
	--brand-soft: #1d2a38;
	--header-bg: #0f1114;
	--pro: #ff7b72;
	--pro-soft: #3a1d1d;
	--free: #7ee787;
	--free-soft: #17301c;
	--warn: #e3b341;
	--warn-soft: #33290f;
	--shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
	color-scheme: dark;
}

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

html {
	scroll-padding-top: 80px;
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	font-family: "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	font-size: 16px;
	line-height: 1.7;
	color: var(--text);
	background: var(--bg);
}

a {
	color: var(--brand);
	text-underline-offset: 2px;
}

a:hover {
	color: var(--brand-strong);
}

:focus-visible {
	outline: 3px solid var(--brand);
	outline-offset: 2px;
}

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

.skip-link {
	position: absolute;
	top: -100px;
	left: 16px;
	z-index: 100;
	padding: 8px 14px;
	color: #fff;
	background: var(--brand-strong);
	border-radius: 0 0 6px 6px;
}

.skip-link:focus {
	top: 0;
}

/* Header */
.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	color: var(--header-text);
	background: var(--header-bg);
	box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
}

.site-header__inner {
	display: flex;
	align-items: center;
	gap: 16px;
	height: 64px;
	padding: 0 20px;
}

.brand {
	display: flex;
	align-items: baseline;
	gap: 8px;
	color: #fff;
	text-decoration: none;
}

.brand:hover {
	color: #fff;
}

.brand__name {
	font-size: 1.45rem;
	font-weight: 800;
	letter-spacing: -0.01em;
}

.brand__tag {
	font-size: 0.85rem;
	font-weight: 600;
	color: #b9c2cc;
}

.header-links {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-left: auto;
}

.header-links a,
.icon-button {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 40px;
	padding: 0 12px;
	font-size: 0.9rem;
	font-weight: 600;
	color: #e3e7ec;
	text-decoration: none;
	background: none;
	border: 0;
	border-radius: 6px;
	cursor: pointer;
}

.header-links a:hover,
.icon-button:hover {
	color: #fff;
	background: rgba(255, 255, 255, 0.1);
}

.header-links .button-pro {
	color: #fff;
	background: #d32f2f;
}

.header-links .button-pro:hover {
	background: #b71c1c;
}

.icon-button svg {
	width: 20px;
	height: 20px;
}

.nav-toggle {
	display: none;
}

/* Layout */
.layout {
	display: grid;
	grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
	max-width: 1440px;
	margin: 0 auto;
}

.sidebar {
	position: sticky;
	top: 64px;
	align-self: start;
	height: calc(100vh - 64px);
	padding: 24px 16px 40px 20px;
	overflow-y: auto;
	border-right: 1px solid var(--border);
}

.sidebar__group + .sidebar__group {
	margin-top: 22px;
}

.sidebar__title {
	margin: 0 0 6px 10px;
	font-size: 0.75rem;
	font-weight: 700;
	color: var(--text-muted);
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.sidebar ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.sidebar a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 6px 10px;
	font-size: 0.93rem;
	color: var(--text);
	text-decoration: none;
	border-radius: 6px;
}

.sidebar a:hover {
	background: var(--bg-soft);
}

.sidebar a[aria-current="page"] {
	font-weight: 700;
	color: var(--brand-strong);
	background: var(--brand-soft);
}

.page {
	display: grid;
	grid-template-columns: minmax(0, 1fr) var(--toc-w);
	gap: 48px;
	padding: 40px 48px 80px;
}

.content {
	min-width: 0;
	max-width: 800px;
}

.toc {
	position: sticky;
	top: 96px;
	align-self: start;
	max-height: calc(100vh - 120px);
	overflow-y: auto;
	font-size: 0.85rem;
}

.toc__title {
	margin: 0 0 8px;
	font-size: 0.75rem;
	font-weight: 700;
	color: var(--text-muted);
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.toc ul {
	margin: 0;
	padding: 0 0 0 12px;
	list-style: none;
	border-left: 2px solid var(--border);
}

.toc a {
	display: block;
	padding: 3px 0;
	color: var(--text-muted);
	text-decoration: none;
}

.toc a:hover,
.toc a.is-active {
	color: var(--brand);
}

/* Content */
.content h1 {
	margin: 0 0 8px;
	font-size: clamp(1.9rem, 1.4rem + 1.6vw, 2.5rem);
	font-weight: 800;
	line-height: 1.2;
	letter-spacing: -0.015em;
}

.content .lead {
	margin: 0 0 28px;
	font-size: 1.12rem;
	color: var(--text-muted);
}

.content h2 {
	margin: 48px 0 12px;
	padding-top: 20px;
	font-size: 1.55rem;
	font-weight: 700;
	line-height: 1.3;
	border-top: 1px solid var(--border);
}

.content h3 {
	margin: 32px 0 8px;
	font-size: 1.2rem;
	font-weight: 700;
	line-height: 1.35;
}

.content h4 {
	margin: 24px 0 6px;
	font-size: 1rem;
}

.content p,
.content ul,
.content ol {
	margin: 0 0 16px;
}

.content li + li {
	margin-top: 4px;
}

.content code {
	padding: 1px 6px;
	font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
	font-size: 0.88em;
	background: var(--bg-code);
	border-radius: 4px;
}

.content pre {
	position: relative;
	margin: 0 0 20px;
	padding: 16px 18px;
	overflow-x: auto;
	font-size: 0.86rem;
	line-height: 1.6;
	background: var(--bg-code);
	border: 1px solid var(--border);
	border-radius: 8px;
}

.content pre code {
	padding: 0;
	background: none;
}

.copy-button {
	position: absolute;
	top: 8px;
	right: 8px;
	padding: 3px 10px;
	font: 600 0.75rem/1.6 inherit;
	font-family: inherit;
	color: var(--text-muted);
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: 5px;
	cursor: pointer;
}

.copy-button:hover {
	color: var(--brand);
}

.path {
	font-weight: 600;
}

kbd {
	padding: 1px 6px;
	font: inherit;
	font-size: 0.85em;
	background: var(--bg-soft);
	border: 1px solid var(--border);
	border-bottom-width: 2px;
	border-radius: 4px;
}

/* Badges */
.badge {
	display: inline-block;
	padding: 1px 8px;
	font-size: 0.7rem;
	font-weight: 700;
	line-height: 1.6;
	letter-spacing: 0.04em;
	vertical-align: 0.15em;
	text-transform: uppercase;
	border-radius: 999px;
}

.badge--free {
	color: var(--free);
	background: var(--free-soft);
}

.badge--pro {
	color: var(--pro);
	background: var(--pro-soft);
}

.sidebar .badge {
	font-size: 0.62rem;
}

/* Callouts */
.callout {
	margin: 20px 0;
	padding: 14px 18px;
	background: var(--bg-soft);
	border-left: 4px solid var(--brand);
	border-radius: 0 8px 8px 0;
}

.callout > :last-child {
	margin-bottom: 0;
}

.callout strong:first-child {
	display: block;
	margin-bottom: 2px;
}

.callout--pro {
	background: var(--pro-soft);
	border-color: var(--pro);
}

.callout--warn {
	background: var(--warn-soft);
	border-color: var(--warn);
}

.callout--free {
	background: var(--free-soft);
	border-color: var(--free);
}

/* Figures */
figure {
	margin: 24px 0;
}

figure img {
	display: block;
	background: var(--bg-soft);
	border: 1px solid var(--border);
	border-radius: 8px;
	box-shadow: var(--shadow);
	cursor: zoom-in;
}

figcaption {
	margin-top: 8px;
	font-size: 0.85rem;
	color: var(--text-muted);
}

.figure--narrow img {
	max-width: 340px;
}

.figure--phone img {
	max-width: 240px;
}

.two-up {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 20px;
	align-items: start;
	margin: 24px 0;
}

.two-up figure {
	margin: 0;
}

.gallery {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 16px;
	margin: 20px 0 28px;
}

.gallery--wide {
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.gallery figure {
	margin: 0;
}

.gallery figcaption {
	margin-top: 6px;
	font-weight: 600;
	color: var(--text);
}

.gallery figcaption span {
	display: block;
	font-weight: 400;
	color: var(--text-muted);
}

/* Tables */
.table-wrap {
	margin: 16px 0 24px;
	overflow-x: auto;
	border: 1px solid var(--border);
	border-radius: 8px;
}

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

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

thead th {
	font-size: 0.8rem;
	font-weight: 700;
	color: var(--text-muted);
	text-transform: uppercase;
	letter-spacing: 0.04em;
	white-space: nowrap;
	background: var(--bg-soft);
}

tbody tr:last-child > * {
	border-bottom: 0;
}

td code {
	white-space: nowrap;
}

.compare th:nth-child(n+2),
.compare td:nth-child(n+2) {
	width: 30%;
}

.compare .group th {
	padding-top: 18px;
	font-size: 0.85rem;
	color: var(--brand-strong);
	text-transform: uppercase;
	letter-spacing: 0.04em;
	background: var(--bg);
}

.yes {
	font-weight: 700;
	color: var(--free);
}

.no {
	color: var(--text-muted);
}

/* Home page */
.hero {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 28px;
	margin-bottom: 12px;
}

.hero__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 24px;
}

.pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 12px;
	font-size: 0.85rem;
	font-weight: 600;
	background: var(--bg-soft);
	border: 1px solid var(--border);
	border-radius: 999px;
}

.buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 0 0 8px;
}

.button {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 20px;
	font-weight: 700;
	color: #fff;
	text-decoration: none;
	background: var(--brand-strong);
	border-radius: 8px;
}

.button:hover {
	color: #fff;
	background: var(--brand);
}

:root[data-theme="dark"] .button,
:root[data-theme="dark"] .button:hover {
	color: #0f1114;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .button,
	:root:not([data-theme="light"]) .button:hover {
		color: #0f1114;
	}
}

.button--ghost {
	color: var(--brand-strong);
	background: transparent;
	border: 2px solid var(--border);
}

.button--ghost:hover {
	color: var(--brand-strong);
	background: var(--bg-soft);
}

:root[data-theme="dark"] .button--ghost,
:root[data-theme="dark"] .button--ghost:hover {
	color: var(--brand-strong);
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .button--ghost,
	:root:not([data-theme="light"]) .button--ghost:hover {
		color: var(--brand-strong);
	}
}

.button--pro {
	background: #d32f2f;
}

.button--pro:hover {
	background: #b71c1c;
}

:root[data-theme="dark"] .button--pro,
:root[data-theme="dark"] .button--pro:hover {
	color: #fff;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .button--pro,
	:root:not([data-theme="light"]) .button--pro:hover {
		color: #fff;
	}
}

.cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 14px;
	margin: 20px 0 8px;
}

.card {
	display: block;
	padding: 16px 18px;
	color: var(--text);
	text-decoration: none;
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	transition: border-color 0.15s, box-shadow 0.15s;
}

.card:hover {
	color: var(--text);
	border-color: var(--brand);
	box-shadow: var(--shadow);
}

.card strong {
	display: block;
	margin-bottom: 2px;
	color: var(--brand-strong);
}

.card span {
	font-size: 0.88rem;
	color: var(--text-muted);
}

.steps {
	padding-left: 0;
	list-style: none;
	counter-reset: step;
}

.steps > li {
	position: relative;
	padding-left: 44px;
	counter-increment: step;
}

.steps > li + li {
	margin-top: 14px;
}

.steps > li::before {
	position: absolute;
	top: 0;
	left: 0;
	display: grid;
	width: 30px;
	height: 30px;
	place-items: center;
	font-size: 0.85rem;
	font-weight: 700;
	color: #fff;
	content: counter(step);
	background: var(--brand-strong);
	border-radius: 50%;
}

:root[data-theme="dark"] .steps > li::before {
	color: #0f1114;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .steps > li::before {
		color: #0f1114;
	}
}

/* Page footer navigation */
.pager {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px;
	margin-top: 56px;
}

.pager a {
	padding: 14px 18px;
	text-decoration: none;
	border: 1px solid var(--border);
	border-radius: var(--radius);
}

.pager a:hover {
	border-color: var(--brand);
}

.pager small {
	display: block;
	font-size: 0.78rem;
	color: var(--text-muted);
}

.pager .next {
	grid-column: 2;
	text-align: right;
}

.site-footer {
	padding: 28px 20px;
	font-size: 0.88rem;
	color: var(--text-muted);
	text-align: center;
	border-top: 1px solid var(--border);
}

.site-footer a {
	color: var(--text-muted);
}

/* Lightbox */
.lightbox {
	max-width: min(1400px, 96vw);
	max-height: 94vh;
	padding: 0;
	background: transparent;
	border: 0;
}

.lightbox::backdrop {
	background: rgba(10, 12, 16, 0.85);
}

.lightbox img {
	display: block;
	max-width: 100%;
	max-height: 90vh;
	margin: 0 auto;
	border-radius: 6px;
}

.lightbox p {
	margin: 8px 0 0;
	font-size: 0.9rem;
	color: #e6e9ee;
	text-align: center;
}

.lightbox button {
	position: fixed;
	top: 14px;
	right: 18px;
	width: 44px;
	height: 44px;
	font-size: 28px;
	line-height: 1;
	color: #fff;
	background: rgba(255, 255, 255, 0.12);
	border: 0;
	border-radius: 50%;
	cursor: pointer;
}

/* Responsive */
@media (max-width: 1180px) {
	.page {
		grid-template-columns: minmax(0, 1fr);
		padding: 32px 32px 64px;
	}

	.toc {
		display: none;
	}
}

@media (max-width: 900px) {
	.layout {
		grid-template-columns: minmax(0, 1fr);
	}

	.nav-toggle {
		display: inline-flex;
	}

	.sidebar {
		position: fixed;
		top: 64px;
		bottom: 0;
		left: 0;
		z-index: 40;
		width: min(320px, 86vw);
		height: auto;
		background: var(--bg);
		border-right: 1px solid var(--border);
		box-shadow: var(--shadow);
		transform: translateX(-105%);
		transition: transform 0.2s ease;
		visibility: hidden;
	}

	.nav-open .sidebar {
		transform: none;
		visibility: visible;
	}

	.header-links .hide-sm {
		display: none;
	}
}

@media (max-width: 600px) {
	.site-header__inner {
		gap: 8px;
		padding: 0 8px 0 4px;
	}

	.brand__tag {
		display: none;
	}

	.page {
		padding: 24px 16px 56px;
	}

	.header-links a {
		padding: 0 10px;
	}

	.pager {
		grid-template-columns: minmax(0, 1fr);
	}

	.pager .next {
		grid-column: 1;
	}

	.content h2 {
		font-size: 1.35rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	* {
		transition: none !important;
		scroll-behavior: auto !important;
	}
}

@media print {
	.site-header,
	.sidebar,
	.toc,
	.pager,
	.copy-button {
		display: none !important;
	}

	.layout,
	.page {
		display: block;
		padding: 0;
	}
}
