/**
 * Fenomer Legal Pages — split layout (sticky TOC + content)
 * Strony: /regulamin-szkolen, /regulamin-newslettera, /regulamin-promocji, /polityka-prywatnosci
 * Brand: #e3ff00 (żółty akcent), #1e1e1e (ciemny), #fafafa (jasny), Inter
 *
 * Page template = elementor_header_footer (Hello), więc content jest na 100% szerokości
 * (bez bocznego wrappera theme). Mimo to twardo nadpisujemy szerokości na wypadek innych szablonów.
 */

/* SCROLL: smooth + offset dla anchorów (header ~80px) */
html {
	scroll-behavior: smooth;
}

/* === Reset szerokości w razie gdyby strona była renderowana w Hello default page template === */
body.page .fen-legal,
body.page-template-elementor_header_footer .fen-legal {
	width: 100%;
}

body.page .site-main:has(.fen-legal),
body.page .entry-content:has(.fen-legal) {
	max-width: none !important;
	width: 100% !important;
	padding: 0 !important;
	margin: 0 !important;
}

/* ===== Wrapper sekcji ===== */
.fen-legal {
	background: #fafafa;
	color: #1e1e1e;
	padding: 64px 24px 96px;
	font-family: 'Inter', system-ui, -apple-system, sans-serif;
	font-size: 16px;
	line-height: 1.7;
	box-sizing: border-box;
}

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

.fen-legal__container {
	max-width: 1280px;
	margin: 0 auto !important;
	display: grid !important;
	grid-template-columns: 320px minmax(0, 1fr) !important;
	gap: 64px;
	align-items: start;
	width: 100%;
}

/* ===== TOC (lewa kolumna, sticky) ===== */
.fen-legal__toc {
	position: sticky;
	top: 100px;
	background: #f0f0f0;
	border-radius: 16px;
	padding: 24px;
	max-height: calc(100vh - 140px);
	overflow-y: auto;
	width: 100%;
	margin: 0;
}

.fen-legal__toc-title {
	margin: 0 0 16px;
	font-size: 16px;
	font-weight: 700;
	color: #1e1e1e;
}

.fen-legal__toc-list {
	margin: 0;
	padding-left: 24px;
	list-style: decimal;
}

.fen-legal__toc-list li {
	margin-bottom: 8px;
	font-size: 15px;
	line-height: 1.5;
}

.fen-legal__toc-list a {
	color: #1e1e1e;
	text-decoration: none;
	transition: color 0.15s ease;
}

.fen-legal__toc-list a:hover {
	color: #1e1e1e;
	text-decoration: underline;
	text-decoration-color: #e3ff00;
	text-decoration-thickness: 2px;
	text-underline-offset: 4px;
}

/* ===== Treść (prawa kolumna) ===== */
.fen-legal__content {
	min-width: 0;
	width: 100%;
}

.fen-legal__title {
	margin: 0 0 48px;
	font-size: clamp(32px, 4vw, 48px);
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -0.01em;
}

.fen-legal__section {
	margin-bottom: 48px;
	padding-top: 16px;
	scroll-margin-top: 100px;
}

.fen-legal__section + .fen-legal__section {
	border-top: 1px solid rgba(30, 30, 30, 0.1);
	padding-top: 48px;
}

.fen-legal__section-head {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 24px;
	margin-bottom: 16px;
	flex-wrap: wrap;
}

.fen-legal__section-head h2 {
	margin: 0;
	font-size: clamp(20px, 2.4vw, 26px);
	font-weight: 700;
	line-height: 1.3;
}

/* "Przewiń do początku" — żółty button */
.fen-legal__back-top {
	display: inline-block;
	padding: 8px 18px;
	background: #e3ff00;
	color: #1e1e1e;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	border-radius: 999px;
	white-space: nowrap;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
	flex-shrink: 0;
}

.fen-legal__back-top:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(227, 255, 0, 0.4);
	color: #1e1e1e;
}

.fen-legal__section-body p {
	margin: 0 0 12px;
}

.fen-legal__section-body p:last-child {
	margin-bottom: 0;
}

.fen-legal__section-body ul,
.fen-legal__section-body ol {
	margin: 0 0 16px;
	padding-left: 28px;
}

.fen-legal__section-body li {
	margin-bottom: 8px;
}

.fen-legal__section-body ul ul,
.fen-legal__section-body ol ol,
.fen-legal__section-body ol ul {
	margin-top: 8px;
}

.fen-legal__section-body a {
	color: #1e1e1e;
	font-weight: 500;
	text-decoration: underline;
	text-decoration-color: #e3ff00;
	text-decoration-thickness: 2px;
	text-underline-offset: 3px;
	transition: text-decoration-color 0.15s ease;
}

.fen-legal__section-body a:hover {
	text-decoration-color: #1e1e1e;
}

.fen-legal__effective {
	margin-top: 24px !important;
	padding: 16px 20px;
	background: rgba(227, 255, 0, 0.2);
	border-left: 4px solid #e3ff00;
	border-radius: 8px;
}

/* ===== Tablet (≤900px) — zwiń kolumny dopiero gdy realnie brakuje miejsca ===== */
@media (max-width: 900px) {
	.fen-legal {
		padding: 48px 20px 64px;
	}

	.fen-legal__container {
		grid-template-columns: 1fr !important;
		gap: 32px;
	}

	.fen-legal__toc {
		position: static;
		max-height: none;
	}
}

@media (max-width: 640px) {
	.fen-legal {
		padding: 32px 16px 48px;
	}

	.fen-legal__title {
		margin-bottom: 32px;
	}

	.fen-legal__section {
		margin-bottom: 32px;
	}

	.fen-legal__section + .fen-legal__section {
		padding-top: 32px;
	}

	.fen-legal__section-head {
		flex-direction: column;
		gap: 12px;
	}

	.fen-legal__back-top {
		align-self: flex-start;
	}
}

/* ===== Nagłówki 3. poziomu w treści (np. kategorie cookies) ===== */
.fen-legal__section-body h3 {
	margin: 32px 0 12px;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.3;
	color: #1e1e1e;
}

.fen-legal__section-body h3:first-child {
	margin-top: 0;
}

/* ===== Tabele (cele/podstawy prawne, retencja, wykaz cookies) ===== */
.fen-legal__table-wrap {
	margin: 0 0 24px;
	overflow-x: auto;
	border-radius: 16px;
	border: 1px solid rgba(30, 30, 30, 0.12);
	-webkit-overflow-scrolling: touch;
}

.fen-legal__table {
	width: 100%;
	min-width: 520px;
	border-collapse: collapse;
	background: #fff;
	font-size: 15px;
	line-height: 1.55;
}

.fen-legal__table thead th {
	background: #1e1e1e;
	color: #fafafa;
	font-weight: 600;
	text-align: left;
	padding: 14px 16px;
	white-space: nowrap;
}

.fen-legal__table tbody td {
	padding: 14px 16px;
	vertical-align: top;
	border-top: 1px solid rgba(30, 30, 30, 0.1);
}

.fen-legal__table tbody tr:nth-child(even) td {
	background: rgba(30, 30, 30, 0.025);
}

.fen-legal__table tbody tr:hover td {
	background: rgba(227, 255, 0, 0.14);
}

.fen-legal__table td:first-child {
	font-weight: 500;
}

.fen-legal__table code {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 13px;
	background: rgba(30, 30, 30, 0.06);
	border-radius: 6px;
	padding: 2px 6px;
	word-break: break-word;
}

.fen-legal__muted {
	color: rgba(30, 30, 30, 0.6);
	font-size: 13px;
}

/* ===== Link "Ustawienia plików cookies" ===== */
.fen-cookie-settings {
	cursor: pointer;
}

@media (max-width: 640px) {
	.fen-legal__table {
		font-size: 14px;
		min-width: 460px;
	}

	.fen-legal__table thead th,
	.fen-legal__table tbody td {
		padding: 12px;
	}
}
