/**
 * RSI Toolkit — Legal Document widget.
 *
 * Head: the Coming Soon brand band (dark gradient, red glow from the top)
 * shortened to a page header, bleeding full width and up behind the theme's
 * transparent overlapping header. Body: 1200px shell, sticky index on the
 * reading-start side + a 760px reading column. Type uses the shared scale's
 * tokens (type.css). Logical properties throughout, so Arabic needs no rtl.css.
 */

.rsi-legal {
	--rsi-lg-accent: #bf0031;
	--rsi-lg-ink: #0a0a0a;
	--rsi-lg-body: #2e2e2e;
	--rsi-lg-muted: #6b6b6b;
	--rsi-lg-line: #e6e6e8;
	font-family: var(--rsi-font, 'Alexandria', sans-serif);
}

/* ------------------------------- head ---------------------------------- */

.rsi-legal__head {
	position: relative;
	width: 100vw;
	max-width: 100vw;
	margin-inline: calc(50% - 50vw);
	box-sizing: border-box;
	/* Top room clears the overlapping header. */
	padding: 190px 24px 88px;
	background:
		radial-gradient(110% 90% at 50% -20%, rgba(191, 0, 49, .3), transparent 60%),
		linear-gradient(165deg, #100608 0%, #0a0a0a 50%, #05060a 100%);
	color: #fff;
	overflow: hidden;
}

.rsi-legal__head-in {
	max-width: 1200px;
	margin: 0 auto;
}

.rsi-legal__eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 20px;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 1.5px;
	text-transform: uppercase;
	color: rgba(255, 255, 255, .78);
}

/* The section accent bar the rest of the site uses before headings. */
.rsi-legal__eyebrow::before {
	content: "";
	width: 28px;
	height: 3px;
	background: var(--rsi-lg-accent);
}

.rsi-legal__title {
	margin: 0;
	font-family: inherit;
	font-weight: 700;
	font-size: 56px;
	line-height: 1.15;
	letter-spacing: -1px;
	color: #fff;
}

.rsi-legal__updated {
	margin: 18px 0 0;
	font-size: 15px;
	line-height: 24px;
	color: rgba(255, 255, 255, .62);
}

.rsi-legal__intro {
	max-width: 760px;
	margin: 28px 0 0;
	font-size: var(--rsi-body-size, 18px);
	line-height: 30px;
	color: rgba(255, 255, 255, .86);
}

/* ------------------------------- body ---------------------------------- */

.rsi-legal__body {
	display: grid;
	grid-template-columns: 260px minmax(0, 760px);
	justify-content: space-between;
	gap: 64px;
	/* Same full-bleed box and side inset as the head band, so the index and the
	   title share one left edge. The theme's content wrapper indents the widget
	   (15px + 45px at desktop), so a plain centred max-width would sit 24px off. */
	width: 100vw;
	max-width: 100vw;
	margin-inline: calc(50% - 50vw);
	box-sizing: border-box;
	padding: 88px max(24px, calc((100vw - 1200px) / 2)) 112px;
}

.rsi-legal__toc {
	position: sticky;
	top: 120px;
	align-self: start;
	max-height: calc(100vh - 160px);
	overflow: auto;
}

.rsi-legal__toc-label {
	margin: 0 0 16px;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 1.2px;
	text-transform: uppercase;
	color: var(--rsi-lg-muted);
}

.rsi-legal__toc-list {
	margin: 0;
	padding: 0;
	list-style: none;
	border-inline-start: 1px solid var(--rsi-lg-line);
}

.rsi-legal__toc-list li {
	margin: 0;
	list-style: none;
}

.rsi-legal__toc-list a {
	display: block;
	margin-inline-start: -1px;
	padding: 7px 0 7px 18px;
	padding-inline: 18px 0;
	border-inline-start: 2px solid transparent;
	font-size: 15px;
	line-height: 22px;
	color: var(--rsi-lg-muted) !important;
	text-decoration: none !important;
	transition: color .2s ease, border-color .2s ease;
}

@media (hover: hover) {
	.rsi-legal__toc-list a:hover {
		color: var(--rsi-lg-ink) !important;
	}
}

.rsi-legal__toc-list a.is-active {
	color: var(--rsi-lg-ink) !important;
	font-weight: 600;
	border-inline-start-color: var(--rsi-lg-accent);
}

.rsi-legal__toc-list a:focus-visible {
	outline: 2px solid var(--rsi-lg-accent);
	outline-offset: 2px;
}

.rsi-legal__content {
	min-width: 0;
}

.rsi-legal__sec {
	/* Anchor jumps land below the sticky header. */
	scroll-margin-top: 110px;
	padding-bottom: 44px;
	margin-bottom: 44px;
	border-bottom: 1px solid var(--rsi-lg-line);
}

.rsi-legal__sec:last-child {
	margin-bottom: 0;
	border-bottom: 0;
}

.rsi-legal__h2 {
	display: flex;
	align-items: baseline;
	gap: 16px;
	margin: 0 0 20px;
	font-family: inherit;
	font-weight: 700;
	font-size: 28px;
	line-height: 38px;
	color: var(--rsi-lg-ink);
}

.rsi-legal__num {
	flex: none;
	font-size: 15px;
	font-weight: 600;
	letter-spacing: .5px;
	color: var(--rsi-lg-accent);
	font-variant-numeric: tabular-nums;
}

/* Prose from the WYSIWYG — scoped so the theme's content styles can't leak. */
.rsi-legal__prose {
	font-size: 17px;
	line-height: 29px;
	color: var(--rsi-lg-body);
}

.rsi-legal__prose > :first-child {
	margin-top: 0;
}

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

.rsi-legal__prose p {
	margin: 0 0 16px;
}

.rsi-legal__prose h3 {
	margin: 28px 0 10px;
	font-family: inherit;
	font-size: 19px;
	line-height: 28px;
	font-weight: 700;
	color: var(--rsi-lg-ink);
}

.rsi-legal__prose ul,
.rsi-legal__prose ol {
	margin: 0 0 16px;
	padding-inline-start: 22px;
}

.rsi-legal__prose li {
	margin: 0 0 8px;
	padding-inline-start: 4px;
}

.rsi-legal__prose li::marker {
	color: var(--rsi-lg-accent);
}

.rsi-legal__prose strong {
	font-weight: 600;
	color: var(--rsi-lg-ink);
}

.rsi-legal__prose a {
	color: var(--rsi-lg-accent) !important;
	text-decoration: underline !important;
	text-underline-offset: 3px;
	overflow-wrap: anywhere;
}

/* Cookie table: scrolls sideways on its own rather than widening the page. */
.rsi-legal__prose .rsi-legal__table {
	overflow-x: auto;
	margin: 8px 0 20px;
	border: 1px solid var(--rsi-lg-line);
	border-radius: 8px;
}

.rsi-legal__prose table {
	width: 100%;
	min-width: 620px;
	margin: 0;
	border-collapse: collapse;
	font-size: 15px;
	line-height: 23px;
}

.rsi-legal__prose th,
.rsi-legal__prose td {
	padding: 12px 16px;
	border: 0;
	border-bottom: 1px solid var(--rsi-lg-line);
	text-align: start;
	vertical-align: top;
}

.rsi-legal__prose th {
	background: #f7f7f8;
	font-weight: 600;
	color: var(--rsi-lg-ink);
}

.rsi-legal__prose tr:last-child td {
	border-bottom: 0;
}

.rsi-legal__prose code {
	padding: 1px 6px;
	border-radius: 4px;
	background: #f1f1f3;
	font-size: 14px;
	direction: ltr;
	unicode-bidi: isolate;
}

/* ----------------------------- responsive ------------------------------ */

@media (max-width: 1024px) {
	.rsi-legal__body {
		grid-template-columns: minmax(0, 1fr);
		gap: 40px;
		padding-top: 56px;
	}
	/* Index becomes a plain list at the top of the page. */
	.rsi-legal__toc {
		position: static;
		max-height: none;
		padding: 24px;
		border-radius: 8px;
		background: #f7f7f8;
	}
	.rsi-legal__toc-list {
		border: 0;
		counter-reset: rsi-toc;
	}
	.rsi-legal__toc-list a {
		padding: 6px 0;
		border: 0;
		margin: 0;
	}
	.rsi-legal__toc-list a.is-active {
		font-weight: 400;
		color: var(--rsi-lg-muted) !important;
	}
}

@media (max-width: 767px) {
	.rsi-legal__head {
		padding: 140px 20px 56px;
	}
	.rsi-legal__title {
		font-size: 38px;
	}
	.rsi-legal__intro {
		font-size: 16px;
		line-height: 27px;
	}
	.rsi-legal__body {
		padding: 40px 20px 80px;
	}
	.rsi-legal__toc {
		padding: 20px;
	}
	.rsi-legal__h2 {
		font-size: 23px;
		line-height: 32px;
		gap: 12px;
	}
	.rsi-legal__prose {
		font-size: 16px;
		line-height: 27px;
	}
	.rsi-legal__sec {
		padding-bottom: 32px;
		margin-bottom: 32px;
	}
}
