/*
 * Block layer for the Mechatronics homepage.
 *
 * The homepage is built from native Gutenberg blocks so the client can edit it
 * in the editor. Core blocks carry the existing mc-* classes, so home.css,
 * sections.css and contact.css keep supplying the visual design. This file only
 * does two jobs: it neutralises core block spacing that would fight that design,
 * and it holds the reworked sections.
 */

/* ---------------------------------------------------------------------------
 * 1. Core block reset inside the homepage.
 * Core layout styles inject margins between siblings. The homepage controls its
 * own rhythm with grid and flex, so those margins are removed here.
 * ------------------------------------------------------------------------ */

.mc-home :where(.wp-block-group, .wp-block-columns, .wp-block-column) > * {
	margin-block-start: 0;
	margin-block-end: 0;
}

.mc-home .wp-block-group,
.mc-home .wp-block-columns,
.mc-home .wp-block-column {
	margin-block: 0;
}

.mc-home .wp-block-image,
.mc-home figure.wp-block-image {
	margin: 0;
}

.mc-home .wp-block-image img {
	display: block;
	width: 100%;
	height: auto;
}

.mc-home .wp-block-heading,
.mc-home .wp-block-buttons {
	margin: 0;
}

.mc-home .wp-block-buttons {
	gap: 28px;
}

/* Groups that stand in for the original layout wrappers must not add padding. */
.mc-home .wp-block-group.mc-container,
.mc-home .wp-block-group.mc-section {
	padding-inline: 0;
}

.mc-home .wp-block-group.mc-section {
	padding-block: 94px;
}

/* A link wrapping a whole card is a group with the mc-linked class. */
.mc-home .mc-linked {
	display: block;
	color: inherit;
	text-decoration: none;
}

/* ---------------------------------------------------------------------------
 * 2. Reworked: facts band (replaces the six-across statistics strip).
 * The original set its labels at 10px, dropping to 8px on small screens, which
 * was not readable. This version raises the label to 12px, enlarges the figure,
 * and lets the band breathe.
 * ------------------------------------------------------------------------ */

.mc-home .mc-statband {
	background: var(--mc-paper);
	border-block: 1px solid var(--mc-line);
	padding-block: 54px;
}

.mc-home .mc-statband-grid {
	display: grid;
	grid-template-columns: repeat(6, 1fr);
	gap: 40px 32px;
}

.mc-home .mc-stat {
	display: flex;
	flex-direction: column;
	gap: 10px;
	position: relative;
}

.mc-home .mc-stat + .mc-stat::before {
	content: "";
	position: absolute;
	left: -16px;
	top: 4px;
	bottom: 4px;
	width: 1px;
	background: #dde2e1;
}

.mc-home .mc-stat-value {
	font-size: clamp(34px, 3vw, 44px);
	font-weight: 600;
	letter-spacing: -1.8px;
	line-height: 1.05;
	color: var(--mc-navy);
	margin: 0;
}

.mc-home .mc-stat-value em {
	font-style: normal;
	color: var(--mc-orange);
	font-size: 0.62em;
	letter-spacing: 0;
	vertical-align: 0.14em;
	margin-left: 2px;
}

.mc-home .mc-stat-label {
	font-size: 12px;
	line-height: 1.55;
	letter-spacing: 0.2px;
	color: var(--mc-muted);
	margin: 0;
	max-width: 16ch;
}

/* ---------------------------------------------------------------------------
 * 3. Reworked: brand wall (replaces the flat logo strip).
 * The original desaturated six logos of differing weight into a filler band.
 * These are the client's main credibility asset, so each logo now sits in an
 * even tile, at a consistent size, and comes to full colour on hover.
 * ------------------------------------------------------------------------ */

.mc-home .mc-brandband {
	padding-block: 0 78px;
}

.mc-home .mc-brandband-head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 32px;
	border-top: 1px solid var(--mc-line);
	padding-top: 44px;
	margin-bottom: 28px;
}

.mc-home .mc-brandband-head .mc-eyebrow {
	margin: 0 0 6px;
}

.mc-home .mc-brandband-title {
	font-size: clamp(22px, 2vw, 28px);
	font-weight: 600;
	letter-spacing: -0.8px;
	line-height: 1.25;
	margin: 0;
}

.mc-home .mc-brandband-grid {
	display: grid;
	grid-template-columns: repeat(6, 1fr);
	gap: 16px;
}

.mc-home .mc-brand-tile {
	display: grid;
	place-items: center;
	height: 104px;
	padding: 20px;
	border: 1px solid var(--mc-line);
	background: #fff;
	transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
}

.mc-home .mc-brand-tile img {
	max-height: 46px;
	max-width: 100%;
	width: auto;
	object-fit: contain;
	filter: grayscale(1);
	opacity: 0.72;
	transition: filter 0.3s, opacity 0.3s;
}

.mc-home .mc-brand-tile:hover {
	border-color: #eeac8d;
	box-shadow: 0 14px 28px #0d25370f;
	transform: translateY(-4px);
}

.mc-home .mc-brand-tile:hover img {
	filter: grayscale(0);
	opacity: 1;
}

/* ---------------------------------------------------------------------------
 * 4. Responsive behaviour for the reworked sections.
 * ------------------------------------------------------------------------ */

@media (max-width: 1150px) {
	.mc-home .mc-statband-grid {
		grid-template-columns: repeat(3, 1fr);
		gap: 38px 28px;
	}

	.mc-home .mc-stat:nth-child(3n + 1)::before {
		display: none;
	}

	.mc-home .mc-brandband-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (max-width: 700px) {
	.mc-home .wp-block-group.mc-section {
		padding-block: 56px;
	}

	.mc-home .mc-statband {
		padding-block: 40px;
	}

	.mc-home .mc-statband-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 30px 20px;
	}

	.mc-home .mc-stat::before {
		display: none;
	}

	.mc-home .mc-stat-label {
		font-size: 12px;
		max-width: 100%;
	}

	.mc-home .mc-brandband {
		padding-bottom: 48px;
	}

	.mc-home .mc-brandband-head {
		flex-direction: column;
		align-items: flex-start;
		gap: 14px;
		padding-top: 34px;
	}

	.mc-home .mc-brandband-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 12px;
	}

	.mc-home .mc-brand-tile {
		height: 84px;
		padding: 14px;
	}

	.mc-home .mc-brand-tile img {
		max-height: 36px;
	}
}

/* ---------------------------------------------------------------------------
 * 5. Figure wrappers.
 * The core image block wraps every image in a figure, so containers that sized
 * the image directly need the figure to carry that height.
 * ------------------------------------------------------------------------ */

.mc-home .mc-division-photo .wp-block-image,
.mc-home .mc-brochure-image .wp-block-image,
.mc-home .mc-project-photo .wp-block-image {
	height: 100%;
}

.mc-home .mc-division-photo .wp-block-image img,
.mc-home .mc-project-photo .wp-block-image img {
	height: 100%;
	object-fit: cover;
}

.mc-home .mc-brand-tile .wp-block-image {
	display: grid;
	place-items: center;
	width: 100%;
	height: 100%;
}

.mc-home .mc-brand-tile .wp-block-image img {
	width: auto;
}

/* ---------------------------------------------------------------------------
 * 6. Brochure card in block markup.
 * The original card styled bare small and strong elements. Blocks emit a
 * paragraph and a heading instead, so the same treatment is mapped onto them.
 * ------------------------------------------------------------------------ */

.mc-home .mc-brochure-image {
	position: relative;
}

.mc-home .mc-brochure-image .wp-block-image img {
	height: 220px;
	object-fit: cover;
}

.mc-home .mc-brochure-year {
	position: absolute;
	right: 10px;
	top: 10px;
	background: var(--mc-navy);
	color: #fff;
	padding: 4px 9px;
	font-size: 9px;
	letter-spacing: 1px;
	margin: 0;
}

.mc-home .mc-brochure-kicker {
	font-size: 9px;
	letter-spacing: 1.7px;
	font-weight: 700;
	color: #b34d23;
	margin: 0;
}

.mc-home .mc-brochure-title {
	display: block;
	font-size: 22px;
	line-height: 1.35;
	font-weight: 600;
	letter-spacing: -0.4px;
	margin: 14px 0 22px;
}

.mc-home .mc-brochure-actions .wp-block-button__link {
	font-size: 11px;
	font-weight: 700;
}

/* The section heading splits into a copy group and a supporting paragraph. */
.mc-home .mc-section-heading > .mc-section-heading-main {
	flex: 1 1 auto;
}

/* ---------------------------------------------------------------------------
 * 7. Sections converted from anchor-wrapped cards to block groups.
 * The originals wrapped whole cards in a link and styled bare small, strong and
 * span elements. Blocks emit groups, headings and paragraphs, so the same
 * treatment is mapped onto them here and each card gains a visible link.
 * ------------------------------------------------------------------------ */

/* Application videos. */
.mc-home .mc-media-frame {
	height: 235px;
	position: relative;
	overflow: hidden;
	background: #17384e;
}

.mc-home .mc-media-frame .wp-block-image,
.mc-home .mc-media-frame .wp-block-image img {
	height: 100%;
	object-fit: cover;
}

.mc-home .mc-media-frame::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(0deg, #0d2537cc, transparent 62%);
}

.mc-home .mc-media-tag {
	position: absolute;
	z-index: 2;
	left: 18px;
	bottom: 15px;
	margin: 0;
	font-size: 9px;
	letter-spacing: 1.3px;
	color: #fff;
}

.mc-home .mc-media-card h3 {
	font-size: 18px;
	margin: 17px 0 7px;
}

.mc-home .mc-media-actions .wp-block-button__link {
	color: #aebec8;
	font-size: 11px;
	font-weight: 400;
}

.mc-home .mc-media-actions .wp-block-button__link:hover {
	color: #f59a6f;
}

/* Manufacturing section. */
.mc-home .mc-about-visual .wp-block-image img {
	height: 510px;
	object-fit: cover;
}

.mc-home .mc-about-tag {
	position: absolute;
	right: 0;
	bottom: 53px;
	background: var(--mc-navy);
	color: #fff;
	padding: 26px 32px;
	border-top: 3px solid var(--mc-orange);
	display: grid;
	grid-template-columns: auto 1fr;
	column-gap: 17px;
	row-gap: 8px;
	align-items: start;
	max-width: 330px;
}

.mc-home .mc-about-tag > .mc-icon {
	grid-row: 1 / 3;
	width: 31px;
	height: 31px;
	color: #fa8a52;
}

.mc-home .mc-about-tag-kicker {
	margin: 0;
	font-size: 9px;
	letter-spacing: 1.6px;
}

.mc-home .mc-about-tag-title {
	margin: 0;
	font-size: 23px;
	font-weight: 500;
	letter-spacing: -0.5px;
	line-height: 1.3;
}

.mc-home .mc-photo-label {
	position: absolute;
	bottom: 0;
	left: 0;
	margin: 0;
	font-size: 9px;
	letter-spacing: 1.5px;
	color: var(--mc-muted);
}

.mc-home .mc-benefit {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 12px;
	align-items: start;
}

.mc-home .mc-benefit > .mc-icon {
	border: 1px solid #e6c9b9;
	color: #b94a20;
	padding: 3px;
	width: 22px;
	height: 22px;
	margin-top: 3px;
}

.mc-home .mc-benefit-title {
	margin: 0 0 3px;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0;
	color: var(--mc-ink);
}

.mc-home .mc-benefit-copy {
	margin: 0;
	font-size: 12px;
	line-height: 1.7;
	color: var(--mc-muted);
}

/* Industries band. */
.mc-home .mc-industry {
	margin: 0;
	border: 1px solid #ffffff30;
	padding: 9px 15px;
	font-size: 12px;
	color: #dce3e6;
}

.mc-home .mc-industry-actions .wp-block-button__link {
	color: #ff9a65;
	font-size: 12px;
	padding: 9px 0;
}

/* Project cards. */
.mc-home .mc-project-mark {
	position: absolute;
	right: 15px;
	bottom: 15px;
	width: 39px;
	height: 39px;
	padding: 10px;
	background: #fff;
	color: var(--mc-ink);
	transition: background 0.3s, color 0.3s;
}

.mc-home .mc-project:hover .mc-project-mark {
	background: var(--mc-orange);
	color: #fff;
}

.mc-home .mc-project .mc-eyebrow {
	margin: 22px 0 9px;
}

.mc-home .mc-project > p:not(.mc-eyebrow) {
	font-size: 13px;
	line-height: 1.8;
	color: var(--mc-muted);
	margin-top: 9px;
}

.mc-home .mc-project-actions {
	margin-top: 16px;
}

/* Exhibition cards. */
.mc-home .mc-exhibition {
	position: relative;
	overflow: hidden;
	background: #eef1f1;
	min-height: 330px;
}

.mc-home .mc-exhibition .wp-block-image img {
	height: 330px;
	object-fit: cover;
	transition: transform 0.5s;
}

.mc-home .mc-exhibition:hover .wp-block-image img {
	transform: scale(1.05);
}

.mc-home .mc-exhibition::after {
	content: "";
	position: absolute;
	inset: 30% 0 0;
	background: linear-gradient(transparent, #0b202ee8);
}

.mc-home .mc-exhibition-meta {
	position: absolute;
	z-index: 2;
	left: 19px;
	right: 19px;
	bottom: 18px;
	color: #fff;
}

.mc-home .mc-exhibition-year {
	margin: 0;
	font-size: 9px;
	letter-spacing: 1.3px;
	color: #ef9b70;
}

.mc-home .mc-exhibition-name {
	margin: 4px 0 0;
	font-size: 17px;
	font-weight: 600;
	letter-spacing: -0.3px;
}

/* Section heading that carries a link on the right. */
.mc-home .mc-section-actions {
	flex: none;
	padding-bottom: 6px;
}

/* Contact band. */
.mc-home .mc-contact-main > p:not(.mc-eyebrow) {
	max-width: 480px;
	color: #5c6263;
	font-size: 14px;
	line-height: 1.8;
	margin-top: 19px;
}

@media (max-width: 900px) {
	.mc-home .mc-media-grid,
	.mc-home .mc-exhibition-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 700px) {
	.mc-home .mc-media-grid,
	.mc-home .mc-exhibition-grid {
		grid-template-columns: 1fr;
	}

	.mc-home .mc-about-visual .wp-block-image img {
		height: 380px;
	}

	.mc-home .mc-about-tag {
		padding: 22px;
		max-width: none;
	}
}

/* ---------------------------------------------------------------------------
 * 8. Editor only: the hero carousel slide forms.
 * These class names never appear on the front end. The carousel renders on the
 * server, so the editor shows each slide as a plain form instead of a moving
 * carousel, which keeps every field visible while editing.
 * ------------------------------------------------------------------------ */

.mc-hero-editor {
	border: 1px solid #d7dcdf;
	background: #f7f8f8;
	padding: 18px;
}

.mc-hero-editor__note {
	margin: 0 0 14px;
	font-size: 12px;
	letter-spacing: 0.4px;
	text-transform: uppercase;
	color: #6a747a;
}

.mc-slide-editor {
	border: 1px solid #dfe3e5;
	background: #fff;
	padding: 16px;
	margin-bottom: 14px;
}

.mc-slide-editor__badge {
	display: inline-block;
	background: #0d2537;
	color: #fff;
	font-size: 11px;
	letter-spacing: 1.4px;
	padding: 5px 10px;
	margin-bottom: 14px;
}

.mc-slide-editor__grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 24px;
	align-items: start;
}

.mc-slide-editor__media {
	display: grid;
	gap: 10px;
	justify-items: start;
	margin-bottom: 14px;
}

.mc-slide-editor__media img {
	width: 100%;
	height: 150px;
	object-fit: cover;
	background: #eef1f2;
}

.mc-slide-editor__placeholder {
	display: grid;
	place-items: center;
	width: 100%;
	height: 150px;
	background: #eef1f2;
	color: #6a747a;
	font-size: 12px;
}

@media (max-width: 900px) {
	.mc-slide-editor__grid {
		grid-template-columns: 1fr;
	}
}

/* ---------------------------------------------------------------------------
 * 9. Header, navigation and footer as blocks.
 * The originals used bare anchors inside nav and footer columns. Blocks emit a
 * button wrapper around every link, so the same treatment is mapped onto that
 * structure, including the sliding underline on the navigation.
 * ------------------------------------------------------------------------ */

.mc-home .mc-topbar-tagline {
	margin: 0;
}

.mc-home .mc-topbar-links {
	display: flex;
	align-items: center;
	gap: 22px;
}

.mc-home .mc-topbar-links p {
	margin: 0;
}

.mc-home .mc-topbar-phone {
	position: relative;
	padding-left: 23px;
}

.mc-home .mc-topbar-phone::before {
	content: "";
	position: absolute;
	left: 0;
	top: 50%;
	transform: translateY(-50%);
	height: 12px;
	width: 1px;
	background: #53606a;
}

.mc-home .mc-header .mc-logo .wp-block-image,
.mc-home .mc-footer-logo .wp-block-image {
	margin: 0;
}

.mc-home .mc-header .mc-logo img {
	width: 100%;
	height: auto;
}

@media (min-width: 701px) {
	.mc-home .mc-header .mc-nav {
		display: flex;
		align-items: center;
	}
}

.mc-home .mc-header .mc-nav-links {
	display: flex;
	align-items: center;
	gap: 31px;
	flex-wrap: nowrap;
}

.mc-home .mc-nav-link > .wp-block-button__link {
	position: relative;
	display: inline-block;
	background: transparent;
	color: var(--mc-ink);
	padding: 33px 0;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.4;
}

.mc-home .mc-nav-link > .wp-block-button__link::after {
	content: "";
	position: absolute;
	height: 2px;
	background: var(--mc-orange);
	bottom: 23px;
	left: 0;
	right: 100%;
	transition: right 0.25s;
	margin: 0;
}

.mc-home .mc-nav-link > .wp-block-button__link:hover::after,
.mc-home .mc-nav-link.mc-active > .wp-block-button__link::after {
	right: 0;
}

.mc-home .mc-nav-link > .wp-block-button__link:hover {
	background: transparent;
	color: var(--mc-ink);
}

/* Footer columns. */
.mc-home .mc-footer-column h3 {
	margin: 0 0 20px;
}

.mc-home .mc-footer-links {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0;
}

.mc-home .mc-footer .mc-footer-link > .wp-block-button__link {
	display: flex;
	align-items: center;
	gap: 10px;
	background: transparent;
	color: inherit;
	padding: 5px 0;
	font-size: 12px;
	font-weight: 400;
	line-height: 1.6;
	overflow-wrap: anywhere;
}

.mc-home .mc-footer .mc-footer-link > .wp-block-button__link:hover {
	background: transparent;
	color: #ff9a65;
}

.mc-home .mc-footer .mc-footer-link > .wp-block-button__link::after {
	content: none;
}

.mc-home .mc-footer .mc-footer-brochure > .wp-block-button__link {
	color: #fff;
	font-weight: 600;
	padding-top: 18px;
}

.mc-home .mc-footer-copyright {
	margin: 0;
}

.mc-home .mc-footer .mc-footer-top > .wp-block-button__link::after {
	content: "\2191";
	font-size: 14px;
	margin-left: 4px;
}

@media (max-width: 700px) {
	.mc-home .mc-header .mc-nav-links {
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		width: 100%;
	}

	.mc-home .mc-nav-link > .wp-block-button__link {
		padding: 12px 0;
		display: block;
	}

	.mc-home .mc-nav-link > .wp-block-button__link::after {
		display: none;
	}

	.mc-home .mc-header .mc-nav .mc-button {
		margin-top: 10px;
	}
}

/* The mobile menu opens by toggling mc-open on the navigation element. */
@media (max-width: 700px) {
	.mc-home .mc-header .mc-nav {
		display: none;
	}

	.mc-home .mc-header .mc-nav.mc-open {
		display: flex;
		flex-direction: column;
	}
}

/* The top bar keeps only the phone number on small screens, as it did before. */
@media (max-width: 700px) {
	.mc-home .mc-topbar > .mc-container {
		justify-content: center;
		min-height: 30px;
	}

	.mc-home .mc-topbar-tagline,
	.mc-home .mc-topbar-mail {
		display: none;
	}

	.mc-home .mc-topbar-phone {
		padding-left: 0;
	}

	.mc-home .mc-topbar-phone::before {
		display: none;
	}
}

/* A telephone link reads better without the forward arrow used on page links. */
.mc-home .mc-phone-link > .wp-block-button__link::after {
	content: none;
}

/* ---------------------------------------------------------------------------
 * 10. Navigation sizing between phone and desktop.
 * The original navigation was a row of bare anchors that inherited a smaller
 * font and tighter gap as the viewport narrowed. Block buttons carry their own
 * font size, so the same steps are restated here, and labels are kept on one
 * line so they cannot break mid-word.
 * ------------------------------------------------------------------------ */

.mc-home .mc-header .wp-block-button__link {
	white-space: nowrap;
}

@media (max-width: 1150px) {
	.mc-home .mc-header .mc-nav-links {
		gap: 20px;
	}

	.mc-home .mc-nav-link > .wp-block-button__link {
		font-size: 12px;
	}
}

@media (max-width: 900px) {
	.mc-home .mc-header .mc-nav-links {
		gap: 14px;
	}

	.mc-home .mc-nav-link > .wp-block-button__link {
		font-size: 11px;
	}

	.mc-home .mc-header .mc-button > .wp-block-button__link {
		padding: 12px 14px;
		gap: 12px;
	}
}

@media (max-width: 700px) {
	.mc-home .mc-header .wp-block-button__link {
		white-space: normal;
	}

	.mc-home .mc-nav-link > .wp-block-button__link {
		font-size: 14px;
	}
}

/* ---------------------------------------------------------------------------
 * 11. Card sizes at the original breakpoints.
 * sections.css steps the brochure, video and exhibition cards down at 1050,
 * 700 and 380 pixels by sizing bare img and strong elements. Block markup wraps
 * images in a figure and uses a heading, so those same steps are restated for
 * the block structure.
 * ------------------------------------------------------------------------ */

@media (max-width: 1050px) {
	.mc-home .mc-brochure-card {
		grid-template-columns: 160px 1fr;
		gap: 20px;
	}

	.mc-home .mc-brochure-image,
	.mc-home .mc-brochure-image .wp-block-image img {
		height: 190px;
		min-height: 190px;
	}

	.mc-home .mc-brochure-title {
		font-size: 18px;
	}

	.mc-home .mc-media-frame {
		height: 200px;
	}

	.mc-home .mc-exhibition,
	.mc-home .mc-exhibition .wp-block-image img {
		height: 270px;
		min-height: 270px;
	}
}

@media (max-width: 700px) {
	.mc-home .mc-brochure-card {
		grid-template-columns: 135px 1fr;
		padding: 19px;
		gap: 18px;
	}

	.mc-home .mc-brochure-image,
	.mc-home .mc-brochure-image .wp-block-image img {
		height: 165px;
		min-height: 165px;
	}

	.mc-home .mc-brochure-title {
		font-size: 16px;
		margin: 10px 0 16px;
	}

	.mc-home .mc-media-frame {
		height: 220px;
	}

	.mc-home .mc-media-card h3 {
		font-size: 19px;
	}
}

@media (max-width: 380px) {
	.mc-home .mc-brochure-card {
		grid-template-columns: 110px 1fr;
		padding: 14px;
	}

	.mc-home .mc-brochure-image,
	.mc-home .mc-brochure-image .wp-block-image img {
		height: 145px;
		min-height: 145px;
	}

	.mc-home .mc-brochure-title {
		font-size: 14px;
	}

	.mc-home .mc-exhibition,
	.mc-home .mc-exhibition .wp-block-image img {
		height: 220px;
		min-height: 220px;
	}
}
