/* ==========================================================================
   VE Legal Pages — legal.css
   Privacy Policy / Terms & Conditions layout. Uses the brand tokens from
   VE Landing Page (global.css), so light and dark theme both work.

   Elementor structure (CSS classes in Advanced → CSS Classes):
     Container  ve-legal-hero          title area
       Text     ve-eyebrow             small "Legal" chip
       Heading  ve-legal-hero__title   page title (<em>word</em> = blue)
       Text     ve-legal-hero__lede    short summary
       Text     ve-legal-hero__meta    "Last updated ..."
       Text     ve-legal-hero__switch  links to both legal pages
     Container  ve-legal               body (the "On this page" menu is added automatically)
       Text     ve-legal__content      the policy text: H2 = sections, H3 = sub-sections
   Placeholders: wrap text you still have to replace in <mark>…</mark> (Text Editor →
   "Text"/code tab) so it shows with a yellow highlight and is easy to find.
   ========================================================================== */

/* Jumping to a section leaves a little air under the sticky header */
html:has(body.ve-legal-page) { scroll-padding-top: calc(var(--wp-admin--admin-bar--height, 0px) + 104px); }

/* ---------- Title area ---------- */
.ve-page .e-con.ve-legal-hero {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--ve-space-5);
	width: 100%;
	max-width: none;
	margin: 0;
	padding: clamp(3rem, 2rem + 4vw, 6.5rem) max(var(--ve-gutter), calc((100% - var(--ve-max)) / 2)) clamp(2.5rem, 1.5rem + 3vw, 4.5rem);
	background: transparent;
}
/* Soft glow behind the title, painted on the page so it fades out with no visible edge */
body.ve-page.ve-legal-page {
	background:
		radial-gradient(900px 620px at 92% 0%, rgba(63, 169, 245, 0.14), transparent 70%) no-repeat,
		radial-gradient(700px 520px at 0% 380px, rgba(11, 99, 229, 0.06), transparent 70%) no-repeat,
		var(--ve-bg);
}
.ve-page .e-con.ve-legal-hero > .elementor-element { width: auto; max-width: 100%; margin: 0; }
.ve-page .ve-legal-hero__title .elementor-heading-title {
	max-width: 16ch;
	font-size: clamp(2.5rem, 1.6rem + 3.6vw, 5rem);
	line-height: 1;
}
.ve-page .ve-legal-hero__lede p {
	max-width: 62ch;
	margin: 0;
	font-size: var(--ve-fs-lede);
	line-height: 1.65;
	color: var(--ve-ink-soft);
}
.ve-page .ve-legal-hero__meta p {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem 1rem;
	margin: 0;
	font-size: var(--ve-fs-small);
	font-weight: 600;
	color: var(--ve-ink-soft);
}
/* Switch between the two legal pages */
.ve-page .ve-legal-hero__switch p {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 4px;
	margin: 0;
	padding: 5px;
	border: 1px solid var(--ve-line);
	border-radius: 999px;
	background: var(--ve-surface);
	box-shadow: var(--ve-shadow-1);
}
.ve-page .ve-legal-hero__switch a {
	display: inline-flex;
	align-items: center;
	min-height: 42px;
	padding: 0 1.25rem;
	border-radius: 999px;
	color: var(--ve-ink-soft);
	font-size: 0.9375rem;
	font-weight: 600;
	text-decoration: none;
	transition: background-color 0.25s ease, color 0.25s ease;
}
.ve-page .ve-legal-hero__switch a:hover { color: var(--ve-ink); background: var(--ve-accent-08); }
.ve-page .ve-legal-hero__switch a[aria-current="page"] {
	background: linear-gradient(180deg, #3388f4 0%, #0b63e5 55%, #0752c4 100%);
	color: #fff;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 10px 22px -12px rgba(11, 99, 229, 0.9);
}

/* ---------- Body: menu + text ---------- */
.ve-page .e-con.ve-legal {
	display: grid;
	grid-template-columns: minmax(200px, 270px) minmax(0, 1fr);
	align-items: start;
	gap: clamp(2rem, 1rem + 4vw, 5rem);
	width: 100%;
	max-width: none;
	margin: 0;
	padding: clamp(1rem, 0.5rem + 2vw, 2.5rem) max(var(--ve-gutter), calc((100% - var(--ve-max)) / 2)) var(--ve-section-y);
	background: transparent;
}
.ve-page .e-con.ve-legal > .elementor-element { width: auto; max-width: none; margin: 0; min-width: 0; }

/* "On this page" menu (built by legal.js) */
.ve-legal__toc {
	position: sticky;
	top: calc(var(--wp-admin--admin-bar--height, 0px) + var(--ve-header-h, 76px) + 24px);
	min-width: 0;
}
.ve-legal__toc details { margin: 0; }
.ve-legal__toc summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	margin-bottom: var(--ve-space-4);
	font-family: var(--ve-font-body);
	font-size: var(--ve-fs-micro);
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--ve-ink-soft);
	list-style: none;
	cursor: default;
}
.ve-legal__toc summary::-webkit-details-marker { display: none; }
.ve-legal__toc ol {
	display: grid;
	gap: 2px;
	margin: 0;
	padding: 0 0 0 1px;
	list-style: none;
	border-left: 1px solid var(--ve-line);
}
.ve-legal__toc a {
	position: relative;
	display: flex;
	gap: 0.75rem;
	padding: 0.5rem 0.75rem 0.5rem 1rem;
	margin-left: -1px;
	border-left: 2px solid transparent;
	color: var(--ve-ink-soft);
	font-size: 0.9375rem;
	line-height: 1.4;
	text-decoration: none;
	transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}
.ve-legal__toc a span { flex: none; min-width: 1.6rem; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; color: var(--ve-accent-text); padding-top: 0.15em; }
.ve-legal__toc a:hover { color: var(--ve-ink); }
.ve-legal__toc a.is-active {
	border-left-color: var(--ve-accent);
	background: linear-gradient(90deg, var(--ve-accent-08), transparent);
	color: var(--ve-ink);
	font-weight: 600;
}

/* Text card */
.ve-page .ve-legal__content {
	max-width: 860px;
	padding: clamp(1.5rem, 1rem + 3vw, 3.5rem);
	border: 1px solid transparent;
	border-radius: var(--ve-radius-l);
	background:
		linear-gradient(var(--ve-surface), var(--ve-surface)) padding-box,
		linear-gradient(160deg, rgba(255, 255, 255, 1) 0%, rgba(15, 22, 38, 0.09) 38%, rgba(11, 99, 229, 0.3) 100%) border-box;
	box-shadow: 0 1px 2px rgba(15, 22, 38, 0.04), 0 30px 60px -32px rgba(15, 22, 38, 0.3);
	counter-reset: ve-legal;
}
.ve-page .ve-legal__content .elementor-widget-container,
.ve-page .ve-legal__content > * { min-width: 0; }
.ve-page .ve-legal__content p,
.ve-page .ve-legal__content li {
	font-size: var(--ve-fs-body);
	line-height: 1.8;
	color: var(--ve-ink-soft);
}
.ve-page .ve-legal__content p { margin: 0 0 1.1em; }
.ve-page .ve-legal__content strong { color: var(--ve-ink); font-weight: 700; }
.ve-page .ve-legal__content h2 {
	position: relative;
	margin: 2.6em 0 0.8em;
	padding-top: 2.2em;
	border-top: 1px solid var(--ve-line);
	font-family: var(--ve-font-display);
	font-size: clamp(1.35rem, 1.15rem + 0.8vw, 1.85rem);
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: -0.02em;
	color: var(--ve-ink);
	counter-increment: ve-legal;
	scroll-margin-top: calc(var(--wp-admin--admin-bar--height, 0px) + var(--ve-header-h, 76px) + 24px);
}
.ve-page .ve-legal__content h2::before {
	content: counter(ve-legal, decimal-leading-zero);
	display: block;
	margin-bottom: 0.6rem;
	font-family: var(--ve-font-body);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	color: var(--ve-accent-text);
}
.ve-page .ve-legal__content h2:first-child,
.ve-page .ve-legal__content .elementor-widget-container > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.ve-page .ve-legal__content h3 {
	margin: 1.8em 0 0.6em;
	font-family: var(--ve-font-display);
	font-size: 1.125rem;
	font-weight: 600;
	letter-spacing: -0.01em;
	color: var(--ve-ink);
	scroll-margin-top: calc(var(--ve-header-h, 76px) + 24px);
}
.ve-page .ve-legal__content ul,
.ve-page .ve-legal__content ol { margin: 0 0 1.2em; padding-left: 0; list-style: none; }
.ve-page .ve-legal__content ul li,
.ve-page .ve-legal__content ol li { position: relative; padding-left: 1.6rem; margin-bottom: 0.45em; }
.ve-page .ve-legal__content ul li::before {
	content: "";
	position: absolute;
	left: 0.25rem;
	top: 0.72em;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: linear-gradient(180deg, #3fa9f5, #0b63e5);
	box-shadow: 0 0 0 3px var(--ve-accent-12);
}
.ve-page .ve-legal__content ol { counter-reset: ve-legal-ol; }
.ve-page .ve-legal__content ol li { counter-increment: ve-legal-ol; }
.ve-page .ve-legal__content ol li::before {
	content: counter(ve-legal-ol) ".";
	position: absolute;
	left: 0;
	font-weight: 700;
	color: var(--ve-accent-text);
}
.ve-page .ve-legal__content a { color: var(--ve-accent-text); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.ve-page .ve-legal__content a:hover { text-decoration-thickness: 2px; }
/* Text to replace before publishing */
.ve-page .ve-legal mark,
.ve-page .ve-legal-hero mark {
	padding: 0.05em 0.35em;
	border-radius: 6px;
	background: rgba(255, 196, 0, 0.22);
	box-shadow: inset 0 0 0 1px rgba(214, 160, 0, 0.35);
	color: var(--ve-ink);
}
/* No extra space above the first thing in the text card */
.ve-page .ve-legal__content > :first-child,
.ve-page .ve-legal__content > .elementor-widget-container > :first-child { margin-top: 0; }

/* Callout (blockquote) */
.ve-page .ve-legal__content blockquote {
	margin: 1.6em 0;
	padding: 1.1rem 1.3rem;
	border: 0;
	border-left: 3px solid var(--ve-accent);
	border-radius: 0 var(--ve-radius-s) var(--ve-radius-s) 0;
	background: var(--ve-accent-04);
	font-style: normal;
}
.ve-page .ve-legal__content blockquote p:last-child { margin-bottom: 0; }
.ve-page .ve-legal__content blockquote p { color: var(--ve-ink); }

/* ---------- Tablet & phone ---------- */
@media (max-width: 1024px) {
	.ve-page .e-con.ve-legal { grid-template-columns: minmax(0, 1fr); gap: var(--ve-space-5); }
	.ve-legal__toc {
		position: relative;
		top: auto;
		padding: 0.25rem 1.1rem;
		border: 1px solid var(--ve-line);
		border-radius: var(--ve-radius-m);
		background: var(--ve-surface);
		box-shadow: var(--ve-shadow-1);
	}
	.ve-legal__toc summary { min-height: 52px; margin: 0; cursor: pointer; }
	.ve-legal__toc summary::after {
		content: "";
		width: 9px;
		height: 9px;
		border-right: 2px solid currentColor;
		border-bottom: 2px solid currentColor;
		transform: rotate(45deg) translateY(-3px);
		transition: transform 0.3s var(--ve-ease);
	}
	.ve-legal__toc details[open] summary::after { transform: rotate(225deg) translateY(-1px); }
	.ve-legal__toc ol { padding-bottom: 1rem; }
	.ve-page .ve-legal__content { max-width: none; }
}
@media (max-width: 767px) {
	.ve-page .ve-legal__content { border-radius: var(--ve-radius-m); }
	.ve-page .ve-legal-hero__switch p { display: flex; width: 100%; }
	.ve-page .ve-legal-hero__switch a { flex: 1 1 auto; justify-content: center; padding: 0 0.9rem; font-size: 0.875rem; }
}

/* ---------- Dark theme ---------- */
html[data-ve-theme="dark"] body.ve-page .ve-legal__content {
	background:
		linear-gradient(var(--ve-surface), var(--ve-surface)) padding-box,
		linear-gradient(160deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.04) 40%, rgba(63, 150, 245, 0.35) 100%) border-box;
	box-shadow: 0 30px 60px -32px rgba(0, 0, 0, 0.75);
}
html[data-ve-theme="dark"] body.ve-page.ve-legal-page {
	background:
		radial-gradient(900px 620px at 92% 0%, rgba(63, 169, 245, 0.12), transparent 70%) no-repeat,
		radial-gradient(700px 520px at 0% 380px, rgba(11, 99, 229, 0.1), transparent 70%) no-repeat,
		var(--ve-bg);
}
html[data-ve-theme="dark"] .ve-page .ve-legal mark,
html[data-ve-theme="dark"] .ve-page .ve-legal-hero mark {
	background: rgba(255, 196, 0, 0.16);
	box-shadow: inset 0 0 0 1px rgba(255, 196, 0, 0.3);
	color: #ffe7a3;
}
html[data-ve-theme="dark"] body.ve-page .ve-legal-hero__switch p { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.1); }

/* ---------- Print: just the text ---------- */
@media print {
	.ve-page .e-con.ve-header,
	.ve-page .e-con.ve-footer,
	.ve-legal__toc,
	.ve-page .ve-legal-hero__switch,
	.ve-theme-toggle { display: none !important; }
	.ve-page .e-con.ve-legal { display: block; padding: 0; }
	.ve-page .ve-legal__content { padding: 0; border: 0; box-shadow: none; background: none; }
	.ve-page .ve-legal__content h2 { break-after: avoid; }
	.ve-page .ve-legal mark { background: none; box-shadow: none; text-decoration: underline; }
}
