/**
 * MA Steelfixing: sections
 * Sheet sections, hero and its drawing, page headers, how we work, sectors, call to action.
 */

/* Each section is a band of the sheet, divided by a drawn line */
.ms-sheet {
	padding-top: clamp(3.5rem, 8vw, 7rem);
	padding-bottom: clamp(3.5rem, 8vw, 7rem);
	border-top: var(--ms-line) solid var(--ms-ink);
}

.wp-block-post-content > .ms-sheet:first-child {
	border-top: 0;
}

.ms-shaded {
	background: var(--ms-shade);
}

.ms-gap-lg {
	gap: clamp(2rem, 6vw, 6rem) !important;
}

/* ---------- Hero ---------- */
.ms-hero {
	padding-top: clamp(2.5rem, 6vw, 5.5rem);
	padding-bottom: clamp(2.5rem, 6vw, 5rem);
}

.ms-hero-cols {
	align-items: center !important;
	gap: clamp(1.5rem, 4vw, 4rem) !important;
}

.ms-hero h1 {
	margin-top: 0;
	font-size: clamp(2.3rem, 4.1vw, 4.1rem);
	font-stretch: 112%;
	max-width: 13ch;
}

.ms-hero .wp-block-shortcode,
.ms-hero .wp-block-column > p:has(.ms-drawing-wrap) {
	margin: 0;
}

@media (max-width: 781px) {
	.ms-hero h1 {
		font-size: clamp(2.1rem, 9vw, 3rem);
	}

	.ms-section-drawing {
		margin: 1rem auto 0;
	}
}

.ms-hero .wp-block-buttons {
	margin-top: 2rem;
}

/* The column section drawing */
.ms-section-drawing {
	display: block;
	width: 100%;
	height: auto;
	max-width: 640px;
	margin-left: auto;
	overflow: visible;
}

.ms-section-drawing .d-concrete rect:first-child {
	fill: var(--ms-shade);
	stroke: var(--ms-ink);
	stroke-width: 2.5;
}

.ms-section-drawing .d-concrete rect:last-child {
	stroke: none;
}

.ms-section-drawing #ms-aggregate * {
	fill: #8E938C;
}

.ms-section-drawing .d-link * {
	fill: none;
	stroke: var(--ms-orange);
	stroke-width: 5;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.ms-section-drawing .d-bar {
	fill: var(--ms-orange);
	stroke: var(--ms-ink);
	stroke-width: 1.6;
}

.ms-section-drawing .d-dim line {
	stroke: var(--ms-blue);
	stroke-width: 1.2;
}

.ms-section-drawing .d-dim text {
	fill: var(--ms-blue);
	font-family: var(--ms-annot);
	font-size: 14px;
}

.ms-section-drawing .d-note polyline {
	fill: none;
	stroke: var(--ms-ink);
	stroke-width: 1.1;
}

.ms-section-drawing .d-note circle {
	fill: var(--ms-ink);
}

.ms-section-drawing .d-note text,
.ms-section-drawing .d-label text {
	fill: var(--ms-ink);
	font-family: var(--ms-annot);
	font-size: 15px;
}

.ms-section-drawing .d-note-sub {
	fill: var(--ms-pencil) !important;
	font-size: 13px !important;
}

.ms-section-drawing .d-label circle {
	fill: none;
	stroke: var(--ms-ink);
	stroke-width: 1.6;
}

.ms-section-drawing .d-label .d-label-ref {
	font-family: var(--wp--preset--font-family--archivo);
	font-weight: 700;
	font-size: 17px;
}

/* One drawing-on moment when the homepage opens */
@media (prefers-reduced-motion: no-preference) {
	.ms-section-drawing .d-concrete {
		animation: ms-fade 0.4s ease both;
	}

	.ms-section-drawing .d-link * {
		stroke-dasharray: 1200;
		stroke-dashoffset: 1200;
		animation: ms-draw 1.1s 0.3s cubic-bezier(0.6, 0, 0.3, 1) forwards;
	}

	.ms-section-drawing .d-bar {
		animation: ms-fade 0.35s ease both;
	}

	.ms-section-drawing .d-bar:nth-child(1) { animation-delay: 1.05s; }
	.ms-section-drawing .d-bar:nth-child(2) { animation-delay: 1.1s; }
	.ms-section-drawing .d-bar:nth-child(3) { animation-delay: 1.15s; }
	.ms-section-drawing .d-bar:nth-child(4) { animation-delay: 1.2s; }
	.ms-section-drawing .d-bar:nth-child(5) { animation-delay: 1.25s; }
	.ms-section-drawing .d-bar:nth-child(6) { animation-delay: 1.3s; }
	.ms-section-drawing .d-bar:nth-child(7) { animation-delay: 1.35s; }
	.ms-section-drawing .d-bar:nth-child(8) { animation-delay: 1.4s; }

	.ms-section-drawing .d-dim,
	.ms-section-drawing .d-note,
	.ms-section-drawing .d-label {
		animation: ms-fade 0.5s 1.5s ease both;
	}
}

@keyframes ms-draw {
	to { stroke-dashoffset: 0; }
}

@keyframes ms-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}

/* ---------- Page headers ---------- */
.ms-pagehead {
	padding-top: clamp(3rem, 7vw, 6rem);
	padding-bottom: clamp(2.5rem, 5vw, 4.5rem);
}

.ms-pagehead h1 {
	margin: 0;
	max-width: 20ch;
}

.ms-pagehead .ms-lead {
	margin-top: 1.25rem;
}

/* ---------- How we work: a real sequence, drawn as a connected line ---------- */
ol.ms-steps {
	list-style: none;
	counter-reset: ms-step;
	padding: 0;
	margin: 0;
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 0;
}

ol.ms-steps li {
	counter-increment: ms-step;
	position: relative;
	padding: 0 2rem 0 0;
	margin: 0;
	color: var(--ms-pencil);
}

ol.ms-steps li::before {
	content: counter(ms-step);
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2.4rem;
	height: 2.4rem;
	border: var(--ms-line) solid var(--ms-ink);
	border-radius: 50%;
	background: var(--ms-film);
	font-weight: 700;
	color: var(--ms-ink);
	margin-bottom: 1.25rem;
	position: relative;
	z-index: 1;
}

/* The line joining each step to the next */
ol.ms-steps li:not(:last-child)::after {
	content: "";
	position: absolute;
	top: 1.2rem;
	left: 2.4rem;
	right: 0;
	height: var(--ms-line);
	background: var(--ms-ink);
}

ol.ms-steps li:first-child::before {
	background: var(--ms-orange);
}

ol.ms-steps strong {
	display: block;
	color: var(--ms-ink);
	font-size: 1.2rem;
	font-weight: 650;
	font-stretch: 112%;
	letter-spacing: -0.01em;
	margin-bottom: 0.4rem;
}

@media (max-width: 860px) {
	ol.ms-steps {
		grid-template-columns: 1fr;
		gap: 0;
	}

	ol.ms-steps li {
		padding: 0 0 2.25rem 3.75rem;
		min-height: 2.4rem;
	}

	ol.ms-steps li::before {
		position: absolute;
		left: 0;
		top: -0.35rem;
		margin: 0;
	}

	ol.ms-steps li:not(:last-child)::after {
		top: 2.05rem;
		bottom: -0.35rem;
		left: 1.2rem;
		right: auto;
		width: var(--ms-line);
		height: auto;
		transform: translateX(-50%);
	}

	ol.ms-steps li:last-child {
		padding-bottom: 0;
	}
}

/* ---------- Sectors ---------- */
.ms-sectors {
	margin-top: 2.5rem !important;
	gap: 0 !important;
}

.ms-sectors > .wp-block-column {
	border-left: var(--ms-line) solid var(--ms-ink);
	padding: 0.25rem 1.5rem 0.25rem 1.25rem;
}

.ms-sectors h3 {
	margin: 0 0 0.4rem;
	font-size: 1.2rem;
}

.ms-sectors p {
	margin: 0;
	color: var(--ms-pencil);
}

@media (max-width: 781px) {
	.ms-sectors > .wp-block-column + .wp-block-column {
		margin-top: 1.5rem;
	}
}

/* ---------- Three plain columns ---------- */
.ms-three {
	gap: 0 !important;
}

.ms-three > .wp-block-column {
	padding-right: 2rem;
}

.ms-three > .wp-block-column + .wp-block-column {
	border-left: 1px solid var(--ms-hair);
	padding-left: 2rem;
}

.ms-three h3 {
	margin-top: 0;
}

.ms-three p {
	color: var(--ms-pencil);
}

@media (max-width: 781px) {
	.ms-three > .wp-block-column + .wp-block-column {
		border-left: 0;
		padding-left: 0;
		border-top: 1px solid var(--ms-hair);
		padding-top: 1.5rem;
	}
}

/* ---------- Call to action, above the footer ---------- */
.ms-cta {
	background: var(--ms-ink);
	color: var(--ms-film);
	padding-top: clamp(3rem, 6vw, 5rem);
	padding-bottom: clamp(3rem, 6vw, 5rem);
}

.ms-cta h2 {
	color: var(--ms-film);
	margin: 0;
}

.ms-cta p {
	margin: 0.75rem 0 0;
	color: var(--ms-concrete);
	max-width: 32rem;
}

.ms-cta-cols {
	align-items: center !important;
}

.ms-cta .wp-block-buttons {
	justify-content: flex-end;
}

.ms-cta .wp-block-button__link {
	border-color: var(--ms-orange) !important;
	font-size: 1.1rem;
	padding: 1rem 1.6rem;
}

.ms-cta .wp-block-button__link:hover {
	background: var(--ms-film);
	color: var(--ms-ink);
	border-color: var(--ms-film) !important;
}

@media (max-width: 781px) {
	.ms-cta .wp-block-buttons {
		justify-content: flex-start;
	}
}

/* The Contact page already has the form, so skip the band there */
body:has(.ms-form) .ms-cta {
	display: none;
}

/* ---------- Section headings: title left, short description right ---------- */
.ms-sec-head {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 24rem);
	align-items: end;
	gap: 1rem 3rem;
	padding-bottom: clamp(1.75rem, 3vw, 2.5rem);
}

.ms-sec-head > * {
	margin: 0 !important;
}

.ms-sec-head .ms-sub {
	font-size: 1.05rem;
	line-height: 1.5;
	color: var(--ms-pencil);
	padding-bottom: 0.35rem;
}

.ms-sec-head + * {
	margin-top: 0 !important;
}

@media (max-width: 781px) {
	.ms-sec-head {
		grid-template-columns: 1fr;
		gap: 0.75rem;
	}
}

/* ---------- Drawing key under the hero ---------- */
.ms-hero {
	padding-bottom: 0 !important;
}

.ms-key {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	margin-top: clamp(2.5rem, 5vw, 4.5rem) !important;
	border-top: var(--ms-line) solid var(--ms-ink);
}

.ms-key > .ms-key-item {
	margin: 0 !important;
	padding: 1.4rem var(--wp--style--root--padding-left, 1.5rem) 1.6rem;
	font-size: 0.95rem;
	line-height: 1.45;
	color: var(--ms-pencil);
}

.ms-key > .ms-key-item + .ms-key-item {
	border-left: 1px solid var(--ms-ink);
}

.ms-key strong {
	display: block;
	color: var(--ms-ink);
	font-size: clamp(1.15rem, 1.6vw, 1.45rem);
	font-weight: 700;
	font-stretch: 118%;
	letter-spacing: -0.02em;
	margin-bottom: 0.2rem;
}

@media (max-width: 900px) {
	.ms-key {
		grid-template-columns: 1fr 1fr;
	}

	.ms-key > .ms-key-item:nth-child(3) {
		border-left: 0;
	}

	.ms-key > .ms-key-item:nth-child(n + 3) {
		border-top: 1px solid var(--ms-ink);
	}
}

@media (max-width: 420px) {
	.ms-key > .ms-key-item {
		padding: 1.1rem 1rem 1.2rem;
		font-size: 0.85rem;
	}

	.ms-key strong {
		font-size: 1.05rem;
	}
}

/* ---------- Call to action phone line ---------- */
.ms-cta .wp-block-column:last-child {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 1rem;
}

.ms-cta .wp-block-column:last-child > * {
	margin: 0;
}

.ms-cta-phone {
	color: var(--ms-concrete);
	margin: 0 !important;
	font-size: 1rem;
}

.ms-cta-phone a {
	color: var(--ms-film);
	font-weight: 650;
	text-decoration-thickness: 1px;
}

@media (max-width: 781px) {
	.ms-cta .wp-block-column:last-child {
		align-items: stretch;
	}

	.ms-cta-phone {
		text-align: center;
	}
}

/* Drawing key lines up with the page content on wide screens */
.ms-key {
	--ms-key-inset: max(var(--wp--style--root--padding-left, 1.5rem), calc((100% - var(--wp--style--global--wide-size)) / 2 + var(--wp--style--root--padding-left, 0px)));
	padding-left: var(--ms-key-inset);
	padding-right: var(--ms-key-inset);
}

.ms-key > .ms-key-item {
	padding-left: 1.5rem;
	padding-right: 1.5rem;
}

.ms-key > .ms-key-item:first-child {
	padding-left: 0;
}

@media (max-width: 900px) {
	.ms-key > .ms-key-item:nth-child(3) {
		padding-left: 0;
	}
}

@media (max-width: 420px) {
	.ms-key > .ms-key-item {
		padding-left: 1rem;
		padding-right: 0.75rem;
	}

	.ms-key > .ms-key-item:first-child,
	.ms-key > .ms-key-item:nth-child(3) {
		padding-left: 0;
	}
}

/* Tablets and phones: keep the drawing a sensible size */
@media (max-width: 781px) {
	.ms-section-drawing {
		max-width: 520px;
		margin-left: auto;
		margin-right: auto;
	}
}
