/**
 * Cypros Power — Responsive system contract.
 *
 * Permanent cross-route rules for mobile composition, content safety and
 * consistent CTA alignment. This replaces release-specific RC19/RC20 patches.
 *
 * @package Cypros_Core
 */

/* --------------------------------------------------------------------------
   Content safety — all public routes
   -------------------------------------------------------------------------- */
.site-main,
.site-main > *,
.site-main .cy-container,
.site-main [class*="__layout"],
.site-main [class*="__grid"],
.site-main [class*="__content"],
.site-main [class*="__intro"] {
	min-width: 0;
}

.site-main :is(h1, h2, h3) {
	max-width: 100%;
	overflow-wrap: normal;
	word-break: normal;
	hyphens: none;
}

.site-main :is(img, picture, svg, video) {
	max-width: 100%;
}

/* --------------------------------------------------------------------------
   CTA contract — text, icon and arrow are one centered composition
   -------------------------------------------------------------------------- */
:is(
	.cy-button,
	.cy-hero__button,
	.cy-statement__link,
	.cy-industrial-evidence__cta a,
	.cy-contact__button,
	.cy-product-cta__button,
	.cy-mobile-sheet-action,
	.site-mobile-actions a,
	.site-main button[type="submit"]
) {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .65rem;
	max-width: 100%;
	box-sizing: border-box;
	text-align: center;
}

:is(
	.cy-button,
	.cy-hero__button,
	.cy-statement__link,
	.cy-industrial-evidence__cta a,
	.cy-contact__button,
	.cy-product-cta__button,
	.cy-mobile-sheet-action,
	.site-mobile-actions a,
	.site-main button[type="submit"]
) > :is(span, svg, i) {
	position: static;
	flex: 0 0 auto;
	margin-inline: 0;
}

/* --------------------------------------------------------------------------
   Technical system cards — centred by design, not just by accident
   -------------------------------------------------------------------------- */
.cy-hero__flow-node {
	align-items: center;
	text-align: center;
}

.cy-hero__flow-node > * {
	max-width: 100%;
}

.cy-hero__flow-node svg {
	margin-inline: auto;
}

.cy-hero__flow-node small {
	width: 100%;
}

/* Generic cards remain editorially aligned, but are always shrink-safe. */
:is(
	.cy-card,
	.cy-equipment-card,
	.cy-equipment__item,
	.cy-equipment__brand-card,
	.cy-process__step,
	.cy-process-page-flow__item,
	.cy-configurations__item,
	.cy-range-applications__item,
	.cy-product-related__card,
	.cy-industries__item,
	.cy-industrial-evidence__grid > li
) {
	min-width: 0;
}

:is(
	.cy-card__title,
	.cy-equipment-card__title,
	.cy-configurations__item h3,
	.cy-process__step h3,
	.cy-process-page-flow__item h3,
	.cy-industries__item h3,
	.cy-product-related__card h3
) {
	overflow-wrap: normal;
	word-break: normal;
	hyphens: none;
}

/* --------------------------------------------------------------------------
   Mobile rhythm and typography
   -------------------------------------------------------------------------- */
@media (max-width: 48rem) {
	.site-main :is(h1, h2, h3) {
		text-wrap: balance;
	}

	:is(
		.cy-hero__actions,
		.cy-product-hero__actions,
		.cy-contact__actions,
		.cy-page-hero__actions
	) :is(.cy-button, .cy-hero__button) {
		width: 100%;
		min-width: 0;
		padding-inline: 1rem;
	}

	/* Home engineering statement: three intentional complete lines. */
	.cy-industrial-evidence__intro {
		grid-template-columns: minmax(0, 1fr);
		gap: 1.75rem;
		text-align: center;
	}

	.cy-industrial-evidence__intro h2 {
		width: 100%;
		max-width: 100%;
		margin-inline: auto;
		font-size: clamp(2rem, 9.4vw, 3.25rem);
		line-height: .94;
		letter-spacing: -.04em;
		text-align: center;
	}

	.cy-industrial-evidence__intro h2 > span {
		display: block;
		width: 100%;
		max-width: 100%;
		white-space: nowrap;
		text-align: center;
		overflow-wrap: normal;
		word-break: normal;
		hyphens: none;
	}

	.cy-industrial-evidence__intro > p {
		max-width: 34rem;
		margin-inline: auto;
		text-align: center;
	}

	/* Route headlines get a bounded mobile scale instead of character wrapping. */
	:is(
		.cy-hero__title,
		.cy-page-hero__headline h1,
		.cy-industries-page-hero__headline h1,
		.cy-services-page-hero h1,
		.cy-process-page-hero h1,
		.cy-contact-page-hero h1,
		.cy-comparison-page-hero h1,
		.cy-seo-pillar-hero h1,
		.cy-industry-page-hero h1,
		.cy-product-page h1
	) {
		font-size: clamp(2.35rem, 11vw, 4rem) !important;
		line-height: .94 !important;
		letter-spacing: -.045em !important;
	}

	:is(
		.cy-statement h2,
		.cy-emergency-power h2,
		.cy-equipment h2,
		.cy-capabilities h2,
		.cy-industries h2,
		.cy-process h2,
		.cy-contact h2,
		.cy-industries-page h2,
		.cy-services-page h2,
		.cy-process-page h2,
		.cy-contact-page h2,
		.cy-comparison-page h2,
		.cy-equipment-page h2,
		.cy-product-page h2,
		.cy-seo-pillar h2,
		.cy-industry-page h2
	) {
		font-size: clamp(1.9rem, 8.8vw, 3rem) !important;
		line-height: .98 !important;
		letter-spacing: -.035em !important;
	}
}

/* --------------------------------------------------------------------------
   Ultra-narrow phones — 280–360 px runtime contract
   -------------------------------------------------------------------------- */
@media (max-width: 22.5rem) {
	.site-main .cy-container {
		width: min(100% - 1.5rem, var(--cypros-container-width));
	}

	.cy-industrial-evidence__intro h2 {
		font-size: clamp(1.7rem, 9.25vw, 2.08rem) !important;
		line-height: .96 !important;
		letter-spacing: -.032em !important;
	}

	.cy-industrial-evidence__intro > p {
		font-size: .96rem;
		line-height: 1.6;
	}

	:is(
		.cy-hero__title,
		.cy-page-hero__headline h1,
		.cy-industries-page-hero__headline h1,
		.cy-services-page-hero h1,
		.cy-process-page-hero h1,
		.cy-contact-page-hero h1,
		.cy-comparison-page-hero h1,
		.cy-seo-pillar-hero h1,
		.cy-industry-page-hero h1,
		.cy-product-page h1
	) {
		font-size: clamp(1.95rem, 9.8vw, 2.35rem) !important;
		line-height: .96 !important;
		letter-spacing: -.035em !important;
	}

	:is(
		.cy-statement h2,
		.cy-emergency-power h2,
		.cy-equipment h2,
		.cy-capabilities h2,
		.cy-industries h2,
		.cy-process h2,
		.cy-contact h2,
		.cy-statement h2,
		.cy-emergency-power h2,
		.cy-equipment h2,
		.cy-capabilities h2,
		.cy-industries h2,
		.cy-process h2,
		.cy-contact h2,
		.cy-industries-page h2,
		.cy-services-page h2,
		.cy-process-page h2,
		.cy-contact-page h2,
		.cy-comparison-page h2,
		.cy-equipment-page h2,
		.cy-product-page h2,
		.cy-seo-pillar h2,
		.cy-industry-page h2,
		.cy-process__intro h2
	) {
		font-size: clamp(1.65rem, 8.6vw, 2rem) !important;
		line-height: 1 !important;
		letter-spacing: -.028em !important;
	}

	.cy-card__title,
	.cy-equipment-card__title {
		font-size: clamp(1.08rem, 5.8vw, 1.3rem) !important;
		line-height: 1.08 !important;
	}

	.cy-hero__flow-node,
	.cy-hero__flow-node--generator {
		min-height: 11.5rem;
		padding: 1.25rem 1rem;
	}

	.cy-hero__flow-node strong {
		font-size: clamp(1.45rem, 8.6vw, 1.9rem);
	}

	:is(
		.cy-button,
		.cy-hero__button,
		.cy-statement__link,
		.cy-contact__button,
		.cy-product-cta__button,
		.cy-mobile-sheet-action
	) {
		min-width: 0;
		padding-inline: .85rem;
		line-height: 1.15;
	}
}

@media (max-width: 18.75rem) {
	.cy-industrial-evidence__intro h2 {
		font-size: 1.58rem !important;
	}
}
