/*
 * Brands: dark section, header, one riveted "type plate" per brand,
 * then a strip with what applies to all brands and the enquiry for other brands.
 */

.mj-brands {
	padding: clamp(4.5rem, 8vw, 7rem) 0;
	background: var(--mj-graphite);
	color: var(--mj-cream);
	scroll-margin-top: var(--mj-bar-h);

	--mj-btn-hover-bg: var(--mj-cream);
	--mj-btn-hover-fg: var(--mj-graphite);
}

/*
 * Background photo (as in the hero): graphite gradient over it, stronger at the top
 * and bottom so the header and the small print stay readable. Plates become solid.
 */
.mj-brands--photo {
	position: relative;
	isolation: isolate;
	overflow: hidden;
}

.mj-brands__media {
	position: absolute;
	inset: 0;
	z-index: -1;
}

.mj-brands__media picture {
	display: block;
	height: 100%;
}

.mj-brands .mj-brands__img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	object-position: 50% 55%;
}

.mj-brands__media::after {
	content: '';
	position: absolute;
	inset: 0;
	background:
		linear-gradient(180deg, rgba(22, 24, 29, 0.86) 0%, rgba(22, 24, 29, 0.3) 38%, rgba(22, 24, 29, 0.3) 64%, rgba(22, 24, 29, 0.92) 90%),
		linear-gradient(90deg, rgba(22, 24, 29, 0.45) 0%, rgba(22, 24, 29, 0.05) 100%);
}

/* Solid plates over the photo: graphite lifted by 3.5 % cream, as before over flat graphite */
.mj-brands--photo .mj-plate {
	background-color: #1e2025;
	box-shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.6);
}

/* Header: title left, intro right, both ending on the same line (as in Services) */
.mj-brands__head {
	display: grid;
	grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
	align-items: end;
	gap: 1.75rem clamp(2rem, 5vw, 5rem);
	margin-bottom: clamp(2.5rem, 4.5vw, 3.5rem);
}

.mj-brands__eyebrow {
	color: rgba(242, 240, 235, 0.72);
}

.mj-brands__title {
	margin: 0;
	font-size: clamp(2.25rem, 3.8vw, 3.25rem);
	letter-spacing: -0.015em;
}

/* Accent words: thick orange bar under the text, as in the Services title */
.mj-brands__accent {
	background: linear-gradient(var(--mj-orange), var(--mj-orange)) 0 100% / 100% 0.12em no-repeat;
	-webkit-box-decoration-break: clone;
	box-decoration-break: clone;
}

.mj-brands__intro {
	max-width: 36rem;
	margin: 0;
	padding: 0.125rem 0 0.125rem 1.25rem;
	border-left: 2px solid var(--mj-orange);
	color: rgba(242, 240, 235, 0.68);
	font-size: 1rem;
	line-height: 1.65;
}

/* Type plates */
.mj-brands__plates {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: clamp(1rem, 2vw, 1.5rem);
	margin: 0;
	padding: 0;
	list-style: none;
}

/*
 * A plate: thin frame with four rivets in the corners (radial gradients),
 * label, brand name with a short orange rule, data fields on dashed lines.
 */
.mj-plate {
	--mj-rivet: radial-gradient(circle, rgba(242, 240, 235, 0.3) 0 3px, rgba(242, 240, 235, 0.08) 3.5px 4px, transparent 4.5px);

	display: flex;
	flex-direction: column;
	padding: clamp(2rem, 3vw, 2.5rem) clamp(1.75rem, 2.6vw, 2.25rem);
	border: 1px solid rgba(242, 240, 235, 0.16);
	border-radius: var(--mj-radius);
	background:
		var(--mj-rivet) 0.75rem 0.75rem / 10px 10px no-repeat,
		var(--mj-rivet) calc(100% - 0.75rem) 0.75rem / 10px 10px no-repeat,
		var(--mj-rivet) 0.75rem calc(100% - 0.75rem) / 10px 10px no-repeat,
		var(--mj-rivet) calc(100% - 0.75rem) calc(100% - 0.75rem) / 10px 10px no-repeat,
		rgba(242, 240, 235, 0.035);
}

.mj-plate__label {
	margin: 0 0 0.625rem;
	color: rgba(242, 240, 235, 0.55);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.mj-plate__name {
	margin: 0 0 1.75rem;
	font-size: clamp(1.875rem, 2.8vw, 2.5rem);
	letter-spacing: -0.01em;
}

.mj-plate__name::after {
	content: '';
	display: block;
	width: 2.5rem;
	height: 3px;
	margin-top: 1rem;
	background: var(--mj-orange);
}

/*
 * Trademark mark next to the brand name (see the note at the bottom).
 * It hangs after the last letter and takes no width, so it never wraps a long name.
 */
.mj-plate__brand {
	position: relative;
}

.mj-plate__mark {
	position: absolute;
	top: 0.1em;
	left: 100%;
	margin-left: 0.15em;
	color: rgba(242, 240, 235, 0.45);
	font-family: var(--mj-font-text);
	font-size: 0.45em;
	font-weight: 500;
	line-height: 1;
}

/* Optional brand logo (only with the owner's permission), above the name */
.mj-plate__logo {
	margin-bottom: 1rem;
}

.mj-plate .mj-plate__logo-img {
	display: block;
	width: auto;
	max-width: 12rem;
	height: 2.75rem;
	object-fit: contain;
	object-position: left center;
}

/* Logo without the visible name: the orange rule goes under the logo */
.mj-plate__logo:has(+ .screen-reader-text) {
	margin-bottom: 1.75rem;
}

.mj-plate__logo:has(+ .screen-reader-text)::after {
	content: '';
	display: block;
	width: 2.5rem;
	height: 3px;
	margin-top: 1rem;
	background: var(--mj-orange);
}

.mj-plate__fields {
	margin: 0;
	border-bottom: 1px dashed rgba(242, 240, 235, 0.18);
}

.mj-plate__field {
	display: grid;
	grid-template-columns: 6.5rem minmax(0, 1fr);
	gap: 1rem;
	padding: 0.75rem 0;
	border-top: 1px dashed rgba(242, 240, 235, 0.18);
}

.mj-plate__field dt {
	color: rgba(242, 240, 235, 0.55);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.1em;
	line-height: 1.6;
	text-transform: uppercase;
}

.mj-plate__field dd {
	margin: 0;
	font-size: 0.9375rem;
	font-weight: 500;
	line-height: 1.45;
}

.mj-plate__text {
	margin: 1.5rem 0 2rem;
	color: rgba(242, 240, 235, 0.72);
	font-size: 0.9375rem;
	line-height: 1.65;
}

/*
 * Rows shared across the plates (subgrid): head, data, text and link sit on the same
 * lines in every plate, whatever the text length. Row count comes from the widget (--mj-plate-rows).
 */
@supports (grid-template-rows: subgrid) {
	.mj-plate {
		display: grid;
		grid-row: span var(--mj-plate-rows, 4);
		grid-template-rows: subgrid;
		row-gap: 0;
	}

	.mj-plate .mj-plate__link {
		align-self: end;
		justify-self: start;
		margin-top: 0;
	}
}

.mj-plate__link {
	align-self: flex-start;
	margin-top: auto;
	padding-bottom: 0.25rem;
	border-bottom: 2px solid var(--mj-orange);
	color: var(--mj-cream);
	font-size: 0.9375rem;
	font-weight: 600;
	text-decoration: none;
	transition: border-color 0.2s;
}

.mj-plate__link:hover {
	border-color: var(--mj-cream);
}

/* Foot: common scope left, other brands right */
.mj-brands__foot {
	display: grid;
	grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
	align-items: center;
	gap: 1.5rem clamp(2rem, 5vw, 5rem);
	margin-top: clamp(2.5rem, 4vw, 3.5rem);
	padding-top: clamp(1.75rem, 3vw, 2.25rem);
	border-top: 1px solid rgba(242, 240, 235, 0.14);
}

.mj-brands__common-title {
	margin: 0 0 0.75rem;
	color: rgba(242, 240, 235, 0.55);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

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

.mj-brands__common-list li {
	position: relative;
	padding-left: 1.125rem;
	font-size: 0.9375rem;
	font-weight: 500;
}

.mj-brands__common-list li::before {
	content: '';
	position: absolute;
	left: 0;
	top: 0.5em;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--mj-orange);
}

.mj-brands__other {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 1.5rem;
}

.mj-brands__other p {
	max-width: 17rem;
	margin: 0;
	color: rgba(242, 240, 235, 0.72);
	font-size: 0.9375rem;
	line-height: 1.55;
}

.mj-brands__other .mj-btn {
	flex: none;
}

/* Trademark note: small print at the very bottom */
.mj-brands__note {
	max-width: none;
	margin: clamp(2.25rem, 4vw, 3rem) 0 0;
	padding-top: 1.25rem;
	border-top: 1px solid rgba(242, 240, 235, 0.1);
	color: rgba(242, 240, 235, 0.45);
	font-size: 0.75rem;
	line-height: 1.6;
}

/* Narrow plates (three columns up to 1180 px, phones): label above the value, so every value keeps one line */
@media (min-width: 961px) and (max-width: 1180px), (max-width: 560px) {
	.mj-plate__field {
		grid-template-columns: minmax(0, 1fr);
		gap: 0.25rem;
	}
}

@media (max-width: 1080px) {
	.mj-brands__foot {
		grid-template-columns: minmax(0, 1fr);
	}

	.mj-brands__other {
		justify-content: space-between;
	}
}

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

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

@media (max-width: 560px) {
	.mj-brands__common-list {
		flex-direction: column;
	}

	.mj-brands__other {
		flex-direction: column;
		align-items: stretch;
	}

	.mj-brands__other p {
		max-width: none;
	}
}
