/*
 * Wisext Legal: a published legal document ({wxlegal document} tags, the
 * public archive view « legal », the admin preview). Layout only: fonts and
 * colours are the site template's; the accent follows Bootstrap's.
 */

.wxlegal {
	--wxl-muted: var(--wx-text-muted, #6c757d);
	--wxl-border: var(--wx-border-color, rgba(0, 0, 0, 0.12));
}

.wxlegal-title {
	font-size: 1.5rem;
	font-weight: 600;
	margin-bottom: 0.25rem;
}

.wxlegal-header,
.wxlegal-upcoming {
	color: var(--wxl-muted);
	font-size: 0.9rem;
	margin-bottom: 0.5rem;
}

.wxlegal-upcoming {
	border-left: 3px solid var(--bs-info, #0dcaf0);
	padding-left: 0.6rem;
}

.wxlegal-toc {
	border: 1px solid var(--wxl-border);
	border-radius: 0.4rem;
	margin: 1rem 0 1.5rem;
	padding: 0.75rem 1rem;
}

.wxlegal-toc-title {
	font-weight: 600;
	margin-bottom: 0.4rem;
}

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

.wxlegal-toc li {
	margin: 0.1rem 0;
}

.wxlegal-toc .wxlegal-toc-1 {
	font-weight: 600;
	margin-top: 0.4rem;
}

.wxlegal-toc .wxlegal-toc-2 {
	padding-left: 1.2rem;
}

.wxlegal-toc .wxlegal-toc-3 {
	padding-left: 2.4rem;
	font-size: 0.92em;
}

.wxlegal-clause {
	scroll-margin-top: 80px;
}

.wxlegal-heading {
	margin-top: 1.4rem;
}

.wxlegal-level-1 > .wxlegal-heading {
	margin-top: 2rem;
	padding-bottom: 0.3rem;
	border-bottom: 1px solid var(--wxl-border);
}

.wxlegal-num {
	margin-right: 0.4em;
}

.wxlegal-alias {
	display: block;
	position: relative;
	top: -80px;
	visibility: hidden;
}

.wxlegal-versions {
	padding-left: 1.2rem;
}

.wxlegal-version-item {
	margin: 0.3rem 0;
}

.wxlegal-version-item .wxlegal-summary {
	color: var(--wxl-muted);
	font-size: 0.9em;
}

.wxlegal-archive-versions {
	margin-bottom: 1rem;
}

.wxlegal-archive-versions > summary {
	cursor: pointer;
	color: var(--wxl-muted);
}

/* Legal Editor (admin): whole working copy, clause tree. */
.wxlegal-edit {
	font-size: 0.8em;
	margin-left: 0.4em;
	opacity: 0.5;
}

.wxlegal-heading:hover .wxlegal-edit {
	opacity: 1;
}

.wxlegal-missing {
	border-left: 3px solid var(--bs-danger, #dc3545);
	padding-left: 0.6rem;
}

.wxlegal-tree {
	list-style: none;
	margin: 0;
	max-height: 75vh;
	overflow-y: auto;
	padding: 0;
}

.wxlegal-tree li a {
	border-radius: 0.25rem;
	display: block;
	padding: 0.15rem 0.4rem;
	text-decoration: none;
}

.wxlegal-tree li a.active {
	background: var(--bs-primary, #0d6efd);
	color: #fff;
}

.wxlegal-tree .wxlegal-num {
	opacity: 0.7;
}

.wxlegal-source {
	background: var(--bs-light, #f8f9fa);
	border: 1px solid var(--wxl-border, rgba(0, 0, 0, 0.12));
	border-radius: 0.4rem;
	max-height: 40vh;
	overflow-y: auto;
	padding: 0.75rem 1rem;
}

/* Redline (Legal Compare, the editor's « changes since », Legal AI proposals). */
.wxlegal-ins {
	background: rgba(25, 135, 84, 0.15);
	color: inherit;
	text-decoration: none;
	border-bottom: 1px solid rgba(25, 135, 84, 0.6);
}

.wxlegal-del {
	background: rgba(220, 53, 69, 0.12);
	color: inherit;
	text-decoration: line-through;
	text-decoration-color: rgba(220, 53, 69, 0.8);
}

.wxlegal-redline p:last-child {
	margin-bottom: 0;
}

/* Legal AI chat. */
.wxlegalai-chat {
	max-height: 65vh;
	overflow-y: auto;
}

.wxlegalai-msg {
	border-radius: 0.5rem;
	margin-bottom: 0.75rem;
	padding: 0.6rem 0.8rem;
}

.wxlegalai-msg p:last-child {
	margin-bottom: 0;
}

.wxlegalai-user {
	background: var(--bs-light, #f8f9fa);
	margin-left: 2rem;
}

.wxlegalai-ai {
	border: 1px solid var(--wxl-border, rgba(0, 0, 0, 0.12));
	margin-right: 1rem;
}


/* Registration form: a document's registration article and its box (plg_system_wisextlegal). */
.wxlegal-registration > :last-child {
	margin-bottom: 0;
}

.wxlegal-registration .wxlegal-accept-box {
	margin: 0.75rem 0 1rem;
}

/* Legal Documents (admin): folding sections, « New document » dialog. */
.wxlegal-section > summary {
	cursor: pointer;
	list-style: none;
}

.wxlegal-section > summary::-webkit-details-marker {
	display: none;
}

.wxlegal-section > summary::before {
	content: "▸";
	display: inline-block;
	width: 1em;
	transition: transform .15s;
}

.wxlegal-section[open] > summary::before {
	transform: rotate(90deg);
}

.wxlegal-section:not([open]) > summary {
	border-bottom: 0;
}

#wxlegal-reading > summary {
	cursor: pointer;
}

.wxlegal-dialog {
	width: min(40rem, calc(100vw - 2rem));
	color: inherit;
	background: var(--body-bg, #fff);
}

.wxlegal-dialog::backdrop {
	background: rgba(0, 0, 0, .35);
}
