/*
 * Sheetal Metals - "Machinery" section
 * Markup: inc/sheetal-machinery.php  (WPBakery element "Machinery")
 *
 * Colours and the column count come from --sm-mc-* custom properties written
 * inline by the shortcode, so the Design Options drive everything here. Each
 * card may override --sm-mc-accent / --sm-mc-accent-rgb, which is what lets the
 * columns run green, blue and purple beside each other.
 *
 *   1. Shell + header
 *   2. Grid
 *   3. Card
 *   4. Card header (brand, model, photo)
 *   5. Specification table
 *   6. Highlight strip
 *   7. Responsive
 */

/* ======================================================= 1. Shell + header */
.sm-mach {
	--sm-mc-accent: #22a06b;
	--sm-mc-accent-rgb: 34, 160, 107;
	--sm-mc-ink: #16243c;
	--sm-mc-label: #5a6577;
	--sm-mc-value: #16243c;
	--sm-mc-card: #ffffff;
	--sm-mc-border: #e6ebf2;
	--sm-mc-tint: 0.1;
	--sm-mc-cols: 3;

	/* set from the "Container width" option */
	--sm-mc-max: 1600px;

	position: relative;
	overflow: hidden;
	font-family: 'Exo', sans-serif;
}

/* Break out of the page container so the background runs edge to edge; the
   grid then caps itself at --sm-mc-max. Margins do the breakout rather than
   `left`, which leaves the box half a container off when the row itself is
   not already full width. */
.sm-mach--full {
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
}

.sm-mach--full .sm-mach-head,
.sm-mach--full .sm-mach-grid {
	box-sizing: border-box;
	padding-left: 30px;
	padding-right: 30px;
}

.sm-mach-bg {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center;
	pointer-events: none;
	z-index: 0;
}

.sm-mach-head {
	position: relative;
	z-index: 1;
	max-width: 760px;
	margin: 0 auto 50px;
	text-align: center;
}

.sm-mach-eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 14px;
	color: var(--sm-mc-accent);
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 2px;
	text-transform: uppercase;
}

.sm-mach-eyebrow i {
	display: block;
	width: 26px;
	height: 2px;
	background: currentColor;
	opacity: 0.6;
}

.sm-mach-title {
	margin: 0;
	color: var(--sm-mc-ink);
	font-size: 40px;
	font-weight: 700;
	line-height: 1.2;
}

.sm-mach-title span {
	color: var(--sm-mc-accent);
}

.sm-mach-sub {
	margin: 16px 0 0;
	color: var(--sm-mc-label);
	font-size: 16px;
	line-height: 1.7;
}

/* ================================================================= 2. Grid */
.sm-mach-grid {
	position: relative;
	z-index: 1;
	display: grid;
	grid-template-columns: repeat(var(--sm-mc-cols), minmax(0, 1fr));
	gap: 30px;
	max-width: var(--sm-mc-max);
	margin: 0 auto;
	/* The cards are equal-height columns, so a short spec list still lines its
	   highlight strip up with its neighbours. */
	align-items: stretch;
}

/* ================================================================= 3. Card */
.sm-mach-card {
	display: flex;
}

.sm-mach-inner {
	display: flex;
	flex-direction: column;
	width: 100%;
	padding: 26px 26px 22px;
	box-sizing: border-box;
	background: var(--sm-mc-card);
	border: 1px solid var(--sm-mc-border);
	border-radius: 18px;
	/* The faint wash of the machine colour that separates one column from the
	   next in the reference. */
	background-image: linear-gradient(
		160deg,
		rgba(var(--sm-mc-accent-rgb), calc(var(--sm-mc-tint) * 0.9)) 0%,
		rgba(var(--sm-mc-accent-rgb), 0) 45%
	);
	box-shadow: 0 18px 40px rgba(16, 36, 60, 0.06);
	transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

a.sm-mach-inner {
	text-decoration: none;
	color: inherit;
}

.sm-mach-card:hover .sm-mach-inner {
	transform: translateY(-6px);
	border-color: rgba(var(--sm-mc-accent-rgb), 0.45);
	box-shadow: 0 26px 52px rgba(16, 36, 60, 0.12);
}

/* ======================================================== 4. Card header */
.sm-mach-top {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 14px;
	margin-bottom: 22px;
}

.sm-mach-id {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.sm-mach-brand {
	color: var(--sm-mc-ink);
	font-size: 26px;
	font-weight: 800;
	letter-spacing: 1px;
	line-height: 1.1;
	text-transform: uppercase;
}

.sm-mach-model {
	margin-top: 2px;
	color: var(--sm-mc-accent);
	font-size: 32px;
	font-weight: 800;
	letter-spacing: -0.5px;
	line-height: 1.05;
}

.sm-mach-type {
	margin-top: 4px;
	color: var(--sm-mc-label);
	font-size: 15px;
	font-weight: 500;
}

.sm-mach-media {
	flex: 0 1 58%;
	align-self: center;
}

.sm-mach-img {
	display: block;
	width: 100%;
	height: auto;
	/* Machine photos are wide cut-outs; contain keeps the whole machine in the
	   frame whatever the upload's proportions are. */
	object-fit: contain;
}

/* ================================================== 5. Specification table */
.sm-mach-specs {
	margin: 0;
	padding: 18px 16px;
	background: rgba(var(--sm-mc-accent-rgb), calc(var(--sm-mc-tint) * 0.35));
	border-radius: 14px;
	/* Pushes the highlight strip to the bottom of an equal-height column. */
	flex: 1 1 auto;
}

.sm-mach-row {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 9px 0;
	border-bottom: 1px solid rgba(var(--sm-mc-accent-rgb), 0.16);
}

.sm-mach-row:last-child,
.sm-mach--norule .sm-mach-row {
	border-bottom: 0;
}

.sm-mach-label {
	display: flex;
	align-items: center;
	gap: 12px;
	flex: 1 1 52%;
	min-width: 0;
	margin: 0;
	color: var(--sm-mc-label);
	font-size: 14px;
	font-weight: 500;
	line-height: 1.4;
}

.sm-mach-chip {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: rgba(var(--sm-mc-accent-rgb), 0.16);
	color: var(--sm-mc-accent);
	font-size: 12px;
}

.sm-mach-chip i {
	line-height: 1;
}

.sm-mach-value {
	flex: 1 1 48%;
	min-width: 0;
	margin: 0;
	color: var(--sm-mc-value);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	/* Long values such as "1,800 shots/day (Depends on Die)" wrap instead of
	   forcing the card wider than its column. */
	overflow-wrap: anywhere;
}

/* ===================================================== 6. Highlight strip */
.sm-mach-foot {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-top: 18px;
	padding: 14px 18px;
	background: rgba(var(--sm-mc-accent-rgb), calc(var(--sm-mc-tint) * 0.6));
	border-radius: 14px;
}

.sm-mach-foot-ico {
	display: inline-flex;
	flex: 0 0 auto;
	color: var(--sm-mc-accent);
	font-size: 26px;
	line-height: 1;
}

.sm-mach-tags {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 14px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.sm-mach-tags li {
	position: relative;
	color: var(--sm-mc-accent);
	font-size: 13.5px;
	font-weight: 600;
}

/* The thin separator between phrases; drawn in the gap so it never appears
   after the last item however the list wraps. */
.sm-mach-tags li + li::before {
	content: '';
	position: absolute;
	left: -8px;
	top: 50%;
	width: 1px;
	height: 13px;
	transform: translateY(-50%);
	background: currentColor;
	opacity: 0.45;
}

/* =========================================================== 7. Responsive */
@media (max-width: 1400px) {
	.sm-mach-model {
		font-size: 34px;
	}

	.sm-mach-brand {
		font-size: 22px;
	}
}

@media (max-width: 1199px) {
	.sm-mach-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.sm-mach-title {
		font-size: 34px;
	}
}

@media (max-width: 767px) {
	.sm-mach-grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 22px;
	}

	.sm-mach--full .sm-mach-head,
	.sm-mach--full .sm-mach-grid {
		padding-left: 16px;
		padding-right: 16px;
	}

	.sm-mach-inner {
		padding: 20px 18px 18px;
	}

	.sm-mach-title {
		font-size: 28px;
	}
}

@media (max-width: 479px) {
	/* Below this the photo beside the model leaves neither enough room, so the
	   header stacks and the image runs full width. */
	.sm-mach-top {
		flex-direction: column;
		align-items: stretch;
	}

	.sm-mach-media {
		flex: 1 1 auto;
	}

	.sm-mach-row {
		align-items: flex-start;
		flex-direction: column;
		gap: 4px;
	}

	.sm-mach-value {
		padding-left: 38px;
	}

	.sm-mach--norule .sm-mach-row {
		padding: 7px 0;
	}
}
