/*
 * Legal pages (template "Pravna stranica"): title band on millimetre paper, table of contents on
 * the side, the text in a white panel, the other legal pages below it.
 */

/* Title band */
.mj-legal__hero {
	position: relative;
	padding: calc(var(--mj-header-h) + clamp(2.5rem, 5vw, 4rem)) 0 clamp(2rem, 4vw, 3rem);
	border-bottom: 1px solid rgba(22, 24, 29, 0.1);
	background: #fff;
	isolation: isolate;
}

/* Millimetre paper (the same motif as the light sections of the home page), fading downwards */
.mj-legal__hero::before {
	content: '';
	position: absolute;
	inset: 0;
	z-index: -1;
	background:
		linear-gradient(rgba(22, 24, 29, 0.055) 1px, transparent 1px) 0 0 / 120px 120px,
		linear-gradient(90deg, rgba(22, 24, 29, 0.055) 1px, transparent 1px) 0 0 / 120px 120px,
		linear-gradient(rgba(22, 24, 29, 0.028) 1px, transparent 1px) 0 0 / 24px 24px,
		linear-gradient(90deg, rgba(22, 24, 29, 0.028) 1px, transparent 1px) 0 0 / 24px 24px;
	-webkit-mask-image: linear-gradient(180deg, #000 30%, transparent);
	mask-image: linear-gradient(180deg, #000 30%, transparent);
	pointer-events: none;
}

.mj-legal__title {
	margin: 0;
	font-size: clamp(2.25rem, 5vw, 3.75rem);
	letter-spacing: -0.015em;
}

.mj-legal__updated {
	margin: 1rem 0 0;
	color: rgba(22, 24, 29, 0.6);
	font-size: 0.9375rem;
}

.mj-legal__updated time {
	color: var(--mj-graphite);
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

/* Table of contents and text */
.mj-legal__body {
	display: grid;
	grid-template-columns: minmax(13rem, 17rem) minmax(0, 50rem);
	justify-content: space-between;
	gap: clamp(2rem, 4vw, 4rem);
	padding: clamp(2.5rem, 5vw, 4rem) 0 clamp(4rem, 8vw, 6rem);
}

.mj-legal__body--solo {
	grid-template-columns: minmax(0, 50rem);
	justify-content: center;
}

.mj-legal__label {
	margin: 0 0 1rem;
	color: rgba(22, 24, 29, 0.6);
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.mj-legal__toc {
	position: sticky;
	top: calc(var(--mj-bar-h) + 2rem);
	align-self: start;
	max-height: calc(100vh - var(--mj-bar-h) - 4rem);
	overflow-y: auto;
}

.mj-legal__toc ul {
	margin: 0;
	padding: 0;
	list-style: none;
	border-left: 1px solid rgba(22, 24, 29, 0.14);
}

.mj-legal__toc a {
	display: block;
	margin-left: -1px;
	padding: 0.4375rem 0 0.4375rem 1rem;
	border-left: 2px solid transparent;
	color: rgba(22, 24, 29, 0.72);
	font-size: 0.9375rem;
	line-height: 1.4;
	text-decoration: none;
	transition: color 0.2s ease, border-color 0.2s ease;
}

.mj-legal__toc a:hover,
.mj-legal__toc a:focus-visible {
	border-left-color: var(--mj-orange);
	color: var(--mj-graphite);
}

/* Text panel */
.mj-legal__content {
	padding: clamp(1.5rem, 4vw, 3rem);
	background: #fff;
	box-shadow: 0 1px 2px rgba(22, 24, 29, 0.06), 0 12px 32px -12px rgba(22, 24, 29, 0.16);
	color: rgba(22, 24, 29, 0.82);
	font-size: 1.0625rem;
	line-height: 1.7;
}

.mj-legal__content > * {
	margin: 0;
}

.mj-legal__content > * + * {
	margin-top: 1rem;
}

.mj-legal__content h2 {
	scroll-margin-top: calc(var(--mj-bar-h) + 1.5rem);
	margin-top: 2.5rem;
	padding-top: 2rem;
	border-top: 1px solid rgba(22, 24, 29, 0.1);
	color: var(--mj-graphite);
	font-size: clamp(1.375rem, 2.4vw, 1.75rem);
	letter-spacing: -0.01em;
}

.mj-legal__content h2:first-child {
	margin-top: 0;
	padding-top: 0;
	border-top: 0;
}

.mj-legal__content h3 {
	margin-top: 1.75rem;
	color: var(--mj-graphite);
	font-size: 1.1875rem;
}

.mj-legal__content strong {
	color: var(--mj-graphite);
	font-weight: 600;
}

.mj-legal__content a {
	color: var(--mj-graphite);
	text-decoration: underline;
	text-decoration-color: var(--mj-orange);
	text-decoration-thickness: 2px;
	text-underline-offset: 0.2em;
	overflow-wrap: anywhere;
}

.mj-legal__content a[href^="tel:"] {
	white-space: nowrap; /* a phone number never breaks in the middle */
}

.mj-legal__content a:hover {
	color: var(--mj-orange-deep);
}

.mj-legal__content ul,
.mj-legal__content ol {
	padding-left: 1.25rem;
}

.mj-legal__content li + li {
	margin-top: 0.5rem;
}

.mj-legal__content li::marker {
	color: var(--mj-orange);
}

.mj-legal__content code {
	font-family: ui-monospace, Consolas, monospace;
	font-size: 0.875em;
	color: var(--mj-graphite);
}

/* Company data (Impressum) */
.mj-legal__facts {
	border-top: 2px solid var(--mj-graphite);
}

.mj-legal__facts > div {
	display: grid;
	grid-template-columns: 11rem minmax(0, 1fr);
	gap: 1rem;
	padding: 0.75rem 0;
	border-bottom: 1px solid rgba(22, 24, 29, 0.1);
}

.mj-legal__facts dt {
	color: rgba(22, 24, 29, 0.6);
	font-size: 0.9375rem;
	font-weight: 600;
}

.mj-legal__facts dd {
	margin: 0;
	color: var(--mj-graphite);
}

/* Cookie table */
.mj-legal__table {
	overflow-x: auto;
	border: 1px solid rgba(22, 24, 29, 0.12);
}

.mj-legal__table table {
	width: 100%;
	min-width: 40rem;
	border-collapse: collapse;
	font-size: 0.875rem;
	line-height: 1.5;
}

.mj-legal__table th,
.mj-legal__table td {
	padding: 0.75rem;
	border-bottom: 1px solid rgba(22, 24, 29, 0.1);
	text-align: left;
	vertical-align: top;
}

.mj-legal__table th {
	background: var(--mj-cream);
	color: rgba(22, 24, 29, 0.7);
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.mj-legal__table tr:last-child td {
	border-bottom: 0;
}

/* Other legal pages */
.mj-legal__others {
	margin-top: 2.5rem;
}

.mj-legal__others ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.mj-legal__others a {
	display: inline-flex;
	align-items: center;
	gap: 0.625rem;
	padding: 0.75rem 1.25rem;
	border: 1px solid rgba(22, 24, 29, 0.2);
	border-radius: var(--mj-radius);
	background: #fff;
	color: var(--mj-graphite);
	font-weight: 600;
	text-decoration: none;
	transition: border-color 0.2s ease, color 0.2s ease;
}

/* The orange ball from the logo, as everywhere on the site (no arrows) */
.mj-legal__others a::before {
	content: '';
	flex: none;
	width: 0.5rem;
	height: 0.5rem;
	border-radius: 50%;
	background: var(--mj-orange);
}

.mj-legal__others a:hover {
	border-color: var(--mj-graphite);
}

@media (max-width: 960px) {
	.mj-legal__body {
		grid-template-columns: minmax(0, 1fr);
		gap: 1.5rem;
	}

	.mj-legal__toc {
		position: static;
		max-height: none;
		padding: 1.25rem;
		border: 1px solid rgba(22, 24, 29, 0.12);
		background: #fff;
	}

	.mj-legal__toc ul {
		border-left: 0;
	}

	.mj-legal__toc a {
		padding-left: 0;
		border-left: 0;
	}
}

@media (max-width: 600px) {
	.mj-legal__facts > div {
		grid-template-columns: minmax(0, 1fr);
		gap: 0.125rem;
	}

	.mj-legal__content {
		font-size: 1rem;
	}

	.mj-legal__others a {
		width: 100%;
	}
}
