/**
 * HPMSM Platform Section Styles
 * Cards maintain fixed size, only image appears on hover
 */

/* ============================================
   HPMSM PLATFORM SECTION
   ============================================ */

.hpmsm-platform-section {
	position: relative;
	padding: clamp(80px, 12vw, 160px) 0;
	background: linear-gradient(0deg, #CCE3FB 0, #FFFFFF 100%);
	overflow: hidden;
}

/* Use standard .container class - no custom container needed */

/* ============================================
   HEADER (Title + Description)
   ============================================ */

.hpmsm-platform-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: clamp(24px, 4vw, 60px);
	margin-bottom: 60px;
}

.hpmsm-platform-title {
	font-family: var(--font-heading);
	font-size: var(--font-size-h2);
	font-weight: var(--font-weight-h2);
	line-height: var(--line-height-h2);
	color: var(--color-night-core);
	margin: 0;
	max-width: 510px;
	flex-shrink: 0;
}

.hpmsm-platform-description {
	max-width: 637px;
	flex-shrink: 0;
}

.hpmsm-platform-description p {
	font-family: var(--font-body);
	font-size: 16px;
	font-weight: 400;
	line-height: 24px;
	color: var(--color-night-core);
	margin: 0 0 16px 0;
}

.hpmsm-platform-description p:last-child {
	margin-bottom: 24px;
}

.hpmsm-platform-esg {
	font-family: var(--font-body);
	font-size: 16px;
	font-weight: 400;
	line-height: 24px;
	color: var(--color-night-core);
	background-color: #cce3fb;
	padding: 24px;
	border-radius: 8px;
	margin-top: 24px;
}

.hpmsm-platform-esg strong {
	font-weight: 600;
	display: block;
	margin-bottom: 8px;
}

/* ============================================
   SUBTITLE
   ============================================ */

.hpmsm-platform-subtitle {
	margin-top: 60px;
	margin-bottom: 24px;
}

.hpmsm-platform-subtitle span {
	font-family: var(--font-body);
	font-size: 14px;
	font-weight: 400;
	line-height: 1.4;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: var(--color-steel-mist);
}

/* ============================================
   CARDS
   ============================================ */

.hpmsm-platform-cards {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 24px;
	align-items: stretch;
}

.hpmsm-platform-card {
	position: relative;
	padding: 24px;
	height: 301px;
	border-radius: 20px;
	background-color: #212B3B;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	cursor: default;
	isolation: isolate;
}

/* ============================================
   CARD IMAGE
   ============================================ */

.hpmsm-platform-card__image-wrapper {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	transition: opacity 0.4s ease;
	pointer-events: none;
	z-index: 1;
	border-radius: 20px;
	overflow: hidden;
}

.hpmsm-platform-card__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 20px;
}

/* Show image on hover */
.hpmsm-platform-card:hover .hpmsm-platform-card__image-wrapper {
	opacity: 1;
}

/* Default active state: keep the first card image visible when nothing is hovered */
.hpmsm-platform-card:first-child .hpmsm-platform-card__image-wrapper {
	opacity: 1;
}

/* When hovering within the cards grid, hide the default image... */
.hpmsm-platform-cards:hover .hpmsm-platform-card:first-child .hpmsm-platform-card__image-wrapper {
	opacity: 0;
}

/* ...but keep it visible if the first card itself is hovered */
.hpmsm-platform-cards:hover .hpmsm-platform-card:first-child:hover .hpmsm-platform-card__image-wrapper {
	opacity: 1;
}

/* Touch/mobile: show images immediately (no hover behavior) */
@media (hover: none), (pointer: coarse) {
	.hpmsm-platform-card__image-wrapper {
		opacity: 1;
		transition: none;
	}

	/* Prevent the first-card special-case from being hidden by sticky :hover on touch browsers */
	.hpmsm-platform-cards:hover .hpmsm-platform-card:first-child .hpmsm-platform-card__image-wrapper {
		opacity: 1;
	}

	/* Improve text readability over photos */
	.hpmsm-platform-card__image-wrapper::after {
		content: '';
		position: absolute;
		inset: 0;
		background: linear-gradient(
			180deg,
			rgba(0, 0, 0, 0.35) 0%,
			rgba(0, 0, 0, 0.45) 100%
		);
	}
}

/* ============================================
   CARD CONTENT
   ============================================ */

.hpmsm-platform-card__content {
	position: relative;
	z-index: 2;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	height: 100%;
}

.hpmsm-platform-card__title {
	font-family: 'Plus Jakarta Sans', sans-serif;
	font-size: 24px;
	font-weight: 600;
	font-style: normal;
	line-height: 1.2;
	color: var(--color-pure-white);
	margin: 0 0 16px 0;
}

.hpmsm-platform-card__description {
	font-family: var(--font-body);
	font-size: 16px;
	font-weight: 400;
	line-height: 24px;
	color: var(--color-pure-white);
	margin: 0;
	margin-top: auto;
	width: 100%;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
	/* Container padding handled by standard .container class */
	
	.hpmsm-platform-header {
		flex-direction: column;
		gap: 32px;
	}
	
	.hpmsm-platform-title {
		max-width: 100%;
	}
	
	.hpmsm-platform-description {
		max-width: 100%;
	}
	
	.hpmsm-platform-cards {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 768px) {
	.hpmsm-platform-section {
		padding: clamp(60px, 10vw, 120px) 0;
	}
	
	.hpmsm-platform-header {
		margin-bottom: 40px;
	}
	
	.hpmsm-platform-cards {
		grid-template-columns: 1fr;
	}
	
	.hpmsm-platform-card {
		height: auto;
		min-height: 301px;
	}
}

