/* ==========================================================================
   Feature grid — reusable media/title/body card component
   Used by: Broadband "Why Cybronet" section. (The ILL "Why ILL" section
   moved to its own standalone component, see why-ill.css.)
   Reuses global tokens (--blue, --tint, .eyebrow, .section, .container) so
   it matches the rest of the site.

   --card-min-height / --rest-offset are measured once against this grid's
   own tallest expanded card (hardcoded on the modifier class below).
   ========================================================================== */

.feature-grid-section { background: var(--tint); }
.feature-grid__heading { max-width: 18ch; }

/* Broadband "Why Cybronet" grid — sized to "OTT Included" (2 body lines). */
.feature-grid-section--sm {
	--card-min-height: 260px;
	--rest-offset: 32px;
}

.feature-grid {
	display: grid;
	grid-template-columns: repeat(6, 1fr);
	grid-auto-rows: 1fr;
	column-gap: 16px;
	row-gap: 64px;
	margin-top: 40px;
	align-items: stretch;
}

/* ==========================================================================
   Card
   ========================================================================== */

.feature-card {
	position: relative;
	z-index: 0;
	overflow: visible;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	min-height: var(--card-min-height, auto);
	padding: 24px 14px 28px;
	background: var(--white);
	border: 1px solid rgba(15, 23, 42, .06);
	border-radius: 18px;
	box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

/* Hover fill — same blue gradient as the homepage benefits cards. */
.feature-card::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 0;
	border-radius: inherit;
	background: linear-gradient(135deg,
		#2f87ff 0%, #2f87ff 48%,
		#0b63f6 48.15%, #0b63f6 100%);
	opacity: 0;
	transition: opacity .3s ease-out;
}
.feature-card:hover::before,
.feature-card:focus-within::before,
.feature-card:focus-visible::before {
	opacity: 1;
}
.feature-card:hover .feature-card__title,
.feature-card:focus-within .feature-card__title,
.feature-card:focus-visible .feature-card__title {
	color: #fff;
}
.feature-card:hover .feature-card__body,
.feature-card:focus-within .feature-card__body,
.feature-card:focus-visible .feature-card__body {
	color: rgba(255, 255, 255, .92);
}
.feature-card:hover .feature-card__media--icon,
.feature-card:focus-within .feature-card__media--icon,
.feature-card:focus-visible .feature-card__media--icon {
	background: rgba(255, 255, 255, .18);
	color: #fff;
}

.feature-card:focus-visible {
	outline: 2px solid #2563EB;
	outline-offset: 2px;
}

/* Lifts the popped media above neighbouring cards in the row below. */
.feature-card:hover,
.feature-card:focus-within {
	z-index: 10;
}

/* Media/title block — moves together so the title tracks the media as it
   lifts off the top edge on hover. */
.feature-card__head {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	transform: translateY(var(--rest-offset, 0px));
}

.feature-card__media {
	width: 76px;
	aspect-ratio: 1 / 1;
	flex-shrink: 0;
	display: grid;
	place-items: center;
	border-radius: 20px;
	overflow: hidden;
	background: var(--tint);
	transform: translateY(0) scale(1);
	box-shadow: none;
}
.feature-card__media--icon {
	background: rgba(0, 104, 255, .08);
	color: var(--blue);
	transition: background .3s ease-out, color .3s ease-out;
}
.feature-card__media img,
.feature-card__media svg {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.feature-card__media svg {
	width: 44px;
	height: 44px;
	object-fit: none;
}

.feature-card__title {
	margin: 18px 0 0;
	font-size: 17px;
	font-weight: 600;
	line-height: 1.4;
	color: #0F172A;
	transition: color .3s ease-out;
}

.feature-card__body {
	position: relative;
	z-index: 1;
	margin: 12px 0 0;
	color: #475569;
	font-size: 15px;
	line-height: 1.6;
	opacity: 0;
	max-height: 0;
	overflow: hidden;
	transform: translateY(10px);
}

/* ==========================================================================
   Hover / focus animation — transform, opacity, max-height, box-shadow and
   border-color only, sequenced so the media lifts first and the text
   arrives behind it.
   ========================================================================== */

@media (prefers-reduced-motion: no-preference) {
	.feature-card {
		transition: box-shadow .3s ease-out, border-color .3s ease-out;
	}
	.feature-card__head {
		transition: transform .34s cubic-bezier(.34, 1.16, .64, 1);
	}
	.feature-card__media {
		transition: transform .34s cubic-bezier(.34, 1.16, .64, 1),
			box-shadow .34s cubic-bezier(.34, 1.16, .64, 1);
	}
	.feature-card__body {
		transition: opacity .24s ease-out .07s,
			max-height .24s ease-out .07s,
			transform .24s ease-out .07s,
			color .3s ease-out;
	}

	.feature-card:hover,
	.feature-card:focus-within,
	.feature-card:focus-visible {
		box-shadow: 0 18px 36px -14px rgba(15, 23, 42, .22);
		border-color: rgba(37, 99, 235, .28);
	}
	.feature-card:hover .feature-card__head,
	.feature-card:focus-within .feature-card__head,
	.feature-card:focus-visible .feature-card__head {
		transform: translateY(0);
	}
	.feature-card:hover .feature-card__media,
	.feature-card:focus-within .feature-card__media,
	.feature-card:focus-visible .feature-card__media {
		transform: translateY(-44px) scale(.82);
		box-shadow: 0 14px 26px -8px rgba(15, 23, 42, .28);
	}
	.feature-card:hover .feature-card__body,
	.feature-card:focus-within .feature-card__body,
	.feature-card:focus-visible .feature-card__body {
		opacity: 1;
		max-height: 220px;
		transform: translateY(0);
	}

	/* Entrance — hidden state only exists once JS adds this class after the
	   IntersectionObserver is registered (see partial's inline script).
	   Cards are visible by default in the raw HTML/CSS otherwise. */
	.feature-grid__inner.js-enter-pending .feature-anim {
		opacity: 0;
		transform: translateY(24px);
		transition: opacity .5s ease-out, transform .5s ease-out;
		transition-delay: var(--enter-delay, 0ms);
	}
}

/* Reduced motion: card is always in its expanded state. Hover only changes
   border-color and box-shadow — no lift, no scale, no transform. */
@media (prefers-reduced-motion: reduce) {
	.feature-card__head { transform: none; }
	.feature-card__media { transform: none; box-shadow: none; }
	.feature-card__body {
		opacity: 1;
		max-height: none;
		overflow: visible;
		transform: none;
	}
	.feature-card {
		transition: box-shadow .3s ease-out, border-color .3s ease-out;
	}
	.feature-card:hover,
	.feature-card:focus-within,
	.feature-card:focus-visible {
		box-shadow: 0 18px 36px -14px rgba(15, 23, 42, .22);
		border-color: rgba(37, 99, 235, .28);
	}
}

/* Touch: no hover to drive the reveal, so every card renders permanently
   expanded. No tap handler, no JS toggle. */
@media (hover: none) {
	.feature-card { min-height: auto; }
	.feature-card__head { transform: none; }
	.feature-card__media { transform: none; box-shadow: none; }
	.feature-card__body {
		opacity: 1;
		max-height: none;
		overflow: visible;
		transform: none;
	}
}

@media (max-width: 1279px) {
	.feature-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1023px) {
	.feature-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 639px) {
	.feature-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Desktop refinements (>=1024px only — mobile/tablet untouched)
   The heading was boxed into 18ch (~373px) inside a 640px block while the card
   grid runs the full 1132px, which is where the empty right side came from.
   ========================================================================== */
@media (min-width: 1024px) {
	.feature-card__title { font-size: 19px; }
	.feature-grid-section .section-heading { max-width: none; }
	.feature-grid-section .section-heading h2 { max-width: none; font-size: 40px; }
}
