/**
 * Onset Strona tekstowa v2 — ramka dla treści z Elementora / edytora.
 * Baza v2 zeruje marginesy i listy (.hv2 :where(...)), więc tu przywracamy typografię treści.
 */

.tv2 {
	padding-bottom: clamp(48px, 5.5vw, 88px);
}

/* Część stron ma w treści własne style z „body { background: … }” — tło zostaje jak w v2. */
body.page-template-text-v2 {
	margin: 0 !important;
	padding: 0 !important;
	background: var(--hv2-paper) !important;
}

.tv2-head {
	padding: 0 var(--hv2-pad);
}

.tv2 .tv2-crumbs {
	padding-left: 0;
	padding-right: 0;
}

.hv2 .tv2-title {
	max-width: 22ch;
	margin-top: clamp(4px, 1vw, 12px);
	font-size: clamp(30px, 3.4vw, 48px);
	font-weight: 500;
	line-height: 1.08;
	letter-spacing: -0.04em;
}

/* ---- układ: (spis treści) + kolumna tekstu ---- */

.tv2-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 32px clamp(40px, 6vw, 96px);
	margin-top: clamp(28px, 3.4vw, 48px);
	padding: 0 var(--hv2-pad);
}

@media (min-width: 1100px) {
	.tv2-layout.has-toc {
		grid-template-columns: 260px minmax(0, 760px);
		align-items: start;
	}
}

.tv2-toc {
	padding: 18px 20px;
	border-radius: var(--hv2-radius);
	background: var(--hv2-paper-2);
}

@media (min-width: 1100px) {
	.tv2-toc {
		position: sticky;
		top: calc(var(--hv2-head-h) + 20px);
		max-height: calc(100vh - var(--hv2-head-h) - 40px);
		overflow-y: auto;
	}
}

.hv2 .tv2-toc__title {
	margin-bottom: 10px;
	color: var(--hv2-mute);
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.hv2 .tv2-toc ol {
	display: grid;
	gap: 2px;
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: toc;
}

.tv2-toc li {
	counter-increment: toc;
}

.tv2-toc a {
	display: flex;
	gap: 10px;
	padding: 5px 0;
	color: var(--hv2-soft);
	font-size: 13px;
	line-height: 1.4;
}

.tv2-toc a::before {
	content: counter(toc);
	flex: none;
	min-width: 18px;
	color: var(--hv2-mute);
	font-variant-numeric: tabular-nums;
}

.tv2-toc a:hover {
	color: var(--hv2-ink);
}

/* ---- treść ---- */

.tv2-content {
	max-width: 760px;
	min-width: 0;
	color: var(--hv2-ink);
	font-family: var(--hv2-font);
	font-size: 16px;
	line-height: 1.75;
}

.tv2-layout:not(.has-toc) .tv2-content {
	margin: 0;
}

.tv2-content :where(p, ul, ol, table, blockquote, figure) {
	margin: 0 0 16px;
}

.tv2-content :where(ul, ol) {
	padding-left: 1.3em;
}

.hv2 .tv2-content ul {
	list-style: disc;
}

.hv2 .tv2-content ol {
	list-style: decimal;
}

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

.tv2-content :where(h1, h2, h3, h4) {
	margin: 40px 0 14px;
	color: var(--hv2-ink);
	font-family: var(--hv2-font);
	font-weight: 500;
	line-height: 1.25;
	letter-spacing: -0.02em;
	text-align: left;
	text-transform: none;
	scroll-margin-top: calc(var(--hv2-head-h) + 24px);
}

.tv2-content h1 { font-size: clamp(28px, 3vw, 40px); margin-top: 0; letter-spacing: -0.035em; }
.tv2-content h2 { font-size: 22px; }
.tv2-content h3 { font-size: 18px; }
.tv2-content h4 { font-size: 16px; }

.tv2-content a {
	color: var(--hv2-ink);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.tv2-content strong,
.tv2-content b {
	font-weight: 600;
}

.tv2-content img {
	height: auto;
	max-width: 100%;
	border-radius: var(--hv2-radius);
}

.tv2-content iframe {
	max-width: 100%;
	border: 0;
}

.tv2-content table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}

.tv2-content th,
.tv2-content td {
	padding: 10px 12px 10px 0;
	border-bottom: 1px solid var(--hv2-line);
	text-align: left;
	vertical-align: top;
}

/* Elementor: sekcje bez własnych szerokości i paddingów — kolumna tekstu trzyma rytm. */
.tv2-content .elementor-section.elementor-section-boxed > .elementor-container,
.tv2-content .e-con,
.tv2-content .e-con-inner {
	max-width: none !important;
}

.tv2-content .elementor-section,
.tv2-content .e-con {
	padding-left: 0 !important;
	padding-right: 0 !important;
	background: none !important;
}

.tv2-content .elementor-column > .elementor-widget-wrap,
.tv2-content .elementor-widget-wrap {
	padding: 0 !important;
}

.tv2-content .elementor-widget:not(:last-child) {
	margin-bottom: 16px;
}

.tv2-content .elementor-heading-title {
	color: var(--hv2-ink) !important;
	font-family: var(--hv2-font) !important;
	font-weight: 500 !important;
	letter-spacing: -0.02em !important;
	text-transform: none !important;
}

.tv2-content .elementor-widget-text-editor {
	color: var(--hv2-ink) !important;
	font-family: var(--hv2-font) !important;
	font-size: 16px !important;
	line-height: 1.75 !important;
}

/* Własne „dokumenty” w HTML (np. regulamin promocji) — bez karty i cienia, tekst w kolumnie. */
.tv2-content .wrap {
	max-width: none !important;
	margin: 0 !important;
	padding: 0 !important;
}

.tv2-content .document {
	padding: 0 !important;
	border-radius: 0 !important;
	background: none !important;
	box-shadow: none !important;
}

/* ---- pomoc pod treścią ---- */

.tv2-help {
	display: grid;
	gap: 10px;
	max-width: 760px;
	margin: clamp(48px, 5.5vw, 80px) var(--hv2-pad) 0;
	padding: clamp(24px, 3vw, 36px);
	border-radius: var(--hv2-radius);
	background: var(--hv2-paper-2);
}

@media (min-width: 1100px) {
	.tv2-layout.has-toc + .tv2-help {
		margin-left: calc(var(--hv2-pad) + 260px + clamp(40px, 6vw, 96px));
	}
}

.hv2 .tv2-help__title {
	font-size: 18px;
	font-weight: 500;
}

.hv2 .tv2-help__lead {
	color: var(--hv2-soft);
	font-size: 14px;
}

.tv2-help__links {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 6px;
}

/* Regulaminy: punkt listy, który zawiera tylko zagnieżdżoną listę (grupa punktów), bez własnego numeru —
   inaczej wychodzi „1. 1. …”. Dodane 2026-11-17 (sesja „Zmiany na stronie Onset”). */
.hv2 .tv2-content li:has(> ol:first-child, > ul:first-child) {
	list-style: none;
}

.hv2 .tv2-content ol:has(> li > ol:first-child) {
	padding-left: 0;
}

.tv2-content li:has(> ol:first-child) + li:has(> ol:first-child) {
	margin-top: 22px;
}
