/*
 * Footer: graphite. Brand block (logo, text, button), then menu, contact and workshop columns,
 * and a bottom bar with the copyright and the legal pages. The number of columns adapts to
 * the printed blocks, so there is never an empty column.
 */

.mj-footer {
	position: relative;
	padding: clamp(3rem, 6vw, 4.5rem) 0 0;
	background: var(--mj-graphite);
	color: var(--mj-cream);
	overflow: hidden;
}

.mj-footer__inner {
	position: relative;
	z-index: 1;
}

/* Logo mark as a watermark: tilted about 32 degrees, cropped in the bottom right corner */
.mj-footer__mark {
	position: absolute;
	right: -6rem;
	bottom: -9.5rem;
	width: 28rem;
	height: 28rem;
	fill: none;
	stroke: rgba(242, 240, 235, 0.045);
	stroke-width: 9;
	stroke-linecap: round;
	transform: rotate(-32deg);
	pointer-events: none;
}

.mj-footer__mark circle {
	fill: var(--mj-orange);
	stroke: none;
	opacity: 0.3;
}

/* Slogan: centered on top, separated from the columns by a thin line */
.mj-footer__tagline {
	position: relative;
	margin: 0 0 clamp(2rem, 4vw, 3rem);
	padding-bottom: clamp(1.75rem, 3vw, 2.25rem);
	/* Subtle: it must not pull attention away from the content below */
	color: rgba(242, 240, 235, 0.6);
	font-family: var(--mj-font-display);
	font-size: clamp(0.9375rem, 1.5vw, 1.125rem);
	font-weight: 700;
	letter-spacing: 0.01em;
	line-height: 1.4;
	text-align: center;
	text-wrap: balance;
}

/*
 * Ruler under the slogan (same idea as the measuring scales in the light sections):
 * a base line with short ticks every 8 px and long ticks every 40 px, fading out at both ends,
 * and a small orange mark in the middle like the zero of a scale.
 */
.mj-footer__tagline::after {
	content: '';
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	height: 14px;
	background:
		linear-gradient(rgba(242, 240, 235, 0.22), rgba(242, 240, 235, 0.22)) 0 100% / 100% 1px no-repeat,
		repeating-linear-gradient(90deg, rgba(242, 240, 235, 0.22) 0 1px, transparent 1px 40px) 0 100% / 100% 12px no-repeat,
		repeating-linear-gradient(90deg, rgba(242, 240, 235, 0.14) 0 1px, transparent 1px 8px) 0 100% / 100% 6px no-repeat;
	-webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
	mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
	pointer-events: none;
}

.mj-footer__tagline::before {
	content: '';
	position: absolute;
	bottom: 0;
	left: 50%;
	width: 2px;
	height: 14px;
	margin-left: -1px;
	background: var(--mj-orange);
	opacity: 0.7;
}

/* One line on screens where it fits */
@media (min-width: 561px) {
	.mj-footer__tagline {
		white-space: nowrap;
	}
}

/*
 * Brand block and menu are the first two columns (the menu is wider: its links are in two
 * columns). The columns that follow (contact, workshop) are created automatically, one for
 * each block that is printed, so there is never an empty column.
 */
.mj-footer__grid {
	display: grid;
	grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.5fr);
	grid-auto-flow: column;
	grid-auto-columns: minmax(0, 1fr);
	gap: 2.5rem clamp(2rem, 4vw, 4rem);
}

/* Brand */
.mj-footer__logo {
	display: inline-block;
	line-height: 0;
}

.mj-footer__logo img {
	display: block;
	width: auto;
	height: 2.25rem;
}

.mj-footer__about {
	max-width: 22rem;
	margin: 1.25rem 0 1.5rem;
	color: rgba(242, 240, 235, 0.72);
	font-size: 0.9375rem;
	line-height: 1.65;
}

.mj-footer__brand .mj-btn {
	margin-top: 0.25rem;
}

.mj-footer__logo + .mj-btn {
	margin-top: 1.5rem;
}

/* Columns */
.mj-footer__title {
	margin: 0 0 1.25rem;
	color: var(--mj-orange);
	font-family: var(--mj-font-display);
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.mj-footer__list {
	display: grid;
	gap: 0.625rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.mj-footer__list a,
.mj-footer__legal a,
.mj-footer__consent {
	color: rgba(242, 240, 235, 0.78);
	text-decoration: none;
	transition: color 0.2s;
}

/* "Postavke kolačića" is a button (it opens the cookie banner) that looks like the links next to it */
.mj-footer__consent {
	padding: 0;
	border: 0;
	background: none;
	font: inherit;
	cursor: pointer;
}

.mj-footer__list a:hover,
.mj-footer__legal a:hover,
.mj-footer__consent:hover {
	color: var(--mj-orange);
}

.mj-footer__list {
	font-size: 0.9375rem;
	line-height: 1.5;
}

/* Menu in two columns (count-agnostic: works for any number of links) */
.mj-footer__list--menu {
	display: block;
	column-count: 2;
	column-gap: clamp(1.5rem, 3vw, 2.5rem);
}

.mj-footer__list--menu li {
	margin-bottom: 0.625rem;
	break-inside: avoid;
}

.mj-footer__list--icons li {
	display: flex;
	align-items: flex-start;
	gap: 0.625rem;
}

.mj-footer__list--icons .mj-icon {
	margin-top: 0.1875rem;
	color: var(--mj-orange);
}

.mj-footer__list address {
	display: grid;
	font-style: normal;
}

.mj-footer__hours {
	color: rgba(242, 240, 235, 0.78);
}

/* Hours line sits under the address text (same indent as the text next to the icon) */
.mj-footer__list--icons li.mj-footer__hours {
	display: block;
	padding-left: 1.75rem;
}

/* Bottom bar */
.mj-footer__bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem 2rem;
	margin-top: clamp(2.5rem, 5vw, 4rem);
	padding: 1.5rem 0;
	border-top: 1px solid rgba(242, 240, 235, 0.12);
	color: rgba(242, 240, 235, 0.55);
	font-size: 0.8125rem;
}

.mj-footer__copy {
	margin: 0;
}

.mj-footer__legal {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.mj-footer__credit {
	margin: 0;
}

.mj-footer__credit a {
	color: rgba(242, 240, 235, 0.55);
	text-decoration: none;
	transition: color 0.2s;
}

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

@media (max-width: 960px) {
	.mj-footer__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		grid-auto-flow: row;
	}

	.mj-footer__brand {
		grid-column: 1 / -1;
	}
}

@media (max-width: 760px) {
	/* Phones and small tablets: the bottom bar centred, row by row (©, legal links, credit) */
	.mj-footer__bar {
		flex-direction: column;
		align-items: center;
		text-align: center;
	}

	.mj-footer__legal {
		justify-content: center;
	}
}

@media (max-width: 560px) {
	/* Smaller watermark on phones, so the knob does not sit behind the contact data */
	.mj-footer__mark {
		right: -4.5rem;
		bottom: -6.5rem;
		width: 17rem;
		height: 17rem;
	}

	.mj-footer__mark circle {
		opacity: 0.2;
	}

	.mj-footer__grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.mj-footer__brand .mj-btn {
		width: 100%;
	}

	/* Taller tap targets for the footer links (at least 24 px, as WCAG asks) */
	.mj-footer__list--menu a,
	.mj-footer__legal a,
	.mj-footer__consent {
		display: inline-block;
		padding-block: 0.25rem;
	}
}
