/* ==========================================================================
   ebg services - scroll-stacked dark cards. Source: Layout H04
   (tj-service-list .service-item.style-5.service-stack); legacy runs the
   same widget in Greek ("Ολοκληρωμένες Ψηφιακές Λύσεις").
   Left (ebg metrics): 80px icon well, 32/500 title, text, pill button
   (ebg's "01." number dropped: the panel's outlined index numbers the card). ebg's right-hand photo (581x605) is replaced by a
   "what is included" panel: the service's deliverables as large rows with
   ticks, and a giant outlined index number drawn from a CSS counter, so the
   entry needs no images. Stacking: .ebg-stack + ebg-stack.js (_core).
   Icon per card: modifier class ebg-stk__card--<icon> (Advanced > Additional
   CSS class): strategy | integration | growth | support | identity
   (tji-service-1..5).
   ========================================================================== */

@layer components {

	.ebg-stk {
		margin: 0;
		padding-block: var(--ebg-stk-py, 120px);
		background-color: var(--ebg-surface-0);

		& > .ebg-shell { margin-block: 0; } /* Blocksy flow spacing */
		& .ebg-shell > * { margin-block-start: 0; }
	}

	/* Heading row: intro left, call to action right (legacy layout). */
	.ebg-stk__head {
		display: flex;
		flex-wrap: wrap;
		align-items: flex-end;
		justify-content: space-between;
		gap: var(--space-m) var(--space-xl);
		margin: 0 0 52px;

		& > * { margin: 0; }
	}

	/* The intro takes the row's free width; only the lead keeps a reading measure. */
	.ebg-stk__intro {
		flex: 1 1 0;
		min-inline-size: min(100%, 320px);

		& > * { margin: 0; }
		& .is-style-ebg-subtitle { margin-block-end: 20px; }
	}

	.ebg-stk .ebg-stk__heading {
		margin-block-end: var(--space-s);
		color: var(--ebg-heading-ink);
		font-family: var(--font-display);
		font-size: var(--fs-48);
		font-weight: 500;
		line-height: 1.125;
		letter-spacing: -0.03em;
	}

	.ebg-stk .ebg-stk__lead {
		max-inline-size: 80ch;
		color: var(--ebg-ink-2);
		font-size: var(--fs-16);
		line-height: 1.5;
	}

	/* Card: two columns over four shared rows (subgrid), so both sides line up:
	   1 icon | panel label, 2 title | list start, 3 text, 4 button.
	   ebg's 605px height and 50px icon gap came from its photo; without it the
	   card sizes to its content. Background: the anchor lifted with 16% accent. */
	.ebg-stk__card {
		--ebg-stk-card-bg: color-mix(in srgb, var(--ebg-surface-anchor) 84%, color-mix(in srgb, var(--ebg-accent) 65%, #8A8F90)); /* accent tint softened by a neutral grey: less green, not grey */

		display: grid;
		grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
		grid-template-rows: repeat(4, auto);
		row-gap: 0;
		overflow: hidden;
		border-radius: 12px;
		background-color: var(--ebg-stk-card-bg);
		counter-increment: ebg-stk;
	}

	.ebg-stk__main,
	.ebg-stk__panel {
		display: grid;
		grid-row: 1 / -1;
		grid-template-rows: subgrid;
		align-content: start;
	}

	.ebg-stk__cards { counter-reset: ebg-stk; }

	.ebg-stk__card--strategy { --ebg-stk-icon: "\e905"; }
	.ebg-stk__card--integration { --ebg-stk-icon: "\e904"; }
	.ebg-stk__card--growth { --ebg-stk-icon: "\e903"; }
	.ebg-stk__card--support { --ebg-stk-icon: "\e902"; }
	.ebg-stk__card--identity { --ebg-stk-icon: "\e901"; }

	.ebg-stk__main {
		justify-items: start;
		margin: 0;
		padding: 60px;

		& > * { margin: 0; }

		&::before {
			content: var(--ebg-stk-icon, "");
			display: inline-flex;
			flex: none;
			align-items: center;
			justify-content: center;
			grid-row: 1;
			inline-size: 80px;
			block-size: 80px;
			margin-block-end: var(--ebg-stk-icon-gap, 20px);
			border: 1px solid rgb(30 138 138 / 0.15);
			border-radius: 50%;
			background: linear-gradient(-45deg, rgb(30 138 138 / 0.3) 0%, rgb(30 138 138 / 0) 50%, rgb(30 138 138 / 0.3) 100%);
			color: var(--ebg-accent);
			font-family: "ebg-icons";
			font-size: 4rem;
			line-height: 1;
		}
	}

	.ebg-stk .ebg-stk__title {
		grid-row: 2;
		max-inline-size: 420px;
		margin-block-end: 20px;
		color: #FFFFFF;
		font-family: var(--font-display);
		font-size: var(--fs-32, 2rem);
		font-weight: 500;
		line-height: 1.25;
	}

	.ebg-stk .ebg-stk__desc {
		grid-row: 3;
		max-inline-size: 420px;
		color: #A9B8B8;
		font-size: var(--fs-16);
		line-height: 1.5;
	}

	.ebg-stk .ebg-stk__actions { grid-row: 4; padding-block-start: 30px; }

	/* Deliverables panel, in place of ebg's photo. */
	.ebg-stk__panel {
		position: relative;
		margin: 0;
		padding: 60px;
		overflow: hidden;
		border-inline-start: 1px solid rgb(255 255 255 / 0.08);
		background: linear-gradient(135deg, rgb(255 255 255 / 0.04), rgb(255 255 255 / 0) 60%);

		& > * { position: relative; z-index: 1; margin: 0; }

		/* Label centred on the 80px icon of row 1. */
		& .is-style-ebg-subtitle-chip { grid-row: 1; align-self: start; justify-self: start; margin-block-start: calc((80px - var(--ebg-stk-chip-h, 36px)) / 2); }

		/* List starts level with the title and runs down the remaining rows. */
		& .ebg-stk__list { grid-row: 2 / -1; align-self: start; }

		&::after {
			content: counter(ebg-stk, decimal-leading-zero);
			position: absolute;
			inset-inline-end: -0.04em;
			inset-block-end: -0.2em;
			z-index: 0;
			font-family: var(--font-display);
			font-size: var(--ebg-stk-index, 280px);
			font-weight: 600;
			line-height: 1;
			letter-spacing: -0.04em;
			-webkit-text-fill-color: transparent;
			-webkit-text-stroke: 2px rgb(255 255 255 / 0.1);
			pointer-events: none;
		}
	}

	.ebg-stk .ebg-stk__list {
		max-inline-size: 520px;
		margin: 0;
		padding: 0;
		list-style: none;

		& li {
			display: flex;
			align-items: center;
			gap: 18px;
			margin: 0;
			padding-block: 22px;
			border-block-end: 1px dashed rgb(255 255 255 / 0.14);
			color: #FFFFFF;
			font-size: var(--fs-20);
			font-weight: 500;
			line-height: 1.35;
			transition: color 0.25s ease, transform 0.25s ease;

			&:first-child { padding-block-start: 0; }

			@media (prefers-reduced-motion: no-preference) {
				&:hover {
					color: #FFFFFF;
					transform: translateX(4px);
				}

				&:hover::before {
					background-color: rgb(30 138 138 / 0.3);
					border-color: var(--ebg-accent);
					box-shadow: 0 0 12px color-mix(in srgb, var(--ebg-accent) 40%, transparent);
				}
			}

			&::before {
				content: "\2713" / "";
				display: inline-flex;
				flex: none;
				align-items: center;
				justify-content: center;
				inline-size: 32px;
				block-size: 32px;
				border: 1px solid rgb(30 138 138 / 0.45);
				border-radius: 50%;
				background-color: rgb(30 138 138 / 0.12);
				color: var(--ebg-accent);
				font-size: var(--fs-14);
				font-weight: 700;
				line-height: 1;
				transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
			}
		}
	}

	@media (max-width: 1200px) {
		.ebg-stk__card { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
		.ebg-stk__main { padding: 50px 40px; }
		.ebg-stk__panel { padding: 50px 40px; }
	}

	@media (max-width: 1024px) {
		.ebg-stk { --ebg-stk-py: 100px; }
		.ebg-stk .ebg-stk__heading { font-size: var(--fs-36, 2.25rem); }
		.ebg-stk__card { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
		.ebg-stk__main,
		.ebg-stk__panel { display: flex; flex-direction: column; align-items: flex-start; grid-row: auto; }
		.ebg-stk__panel .is-style-ebg-subtitle-chip { margin-block: 0 30px; }
		.ebg-stk__panel { --ebg-stk-index: 200px; border-inline-start: 0; border-block-start: 1px solid rgb(255 255 255 / 0.08); }
		.ebg-stk .ebg-stk__title,
		.ebg-stk .ebg-stk__desc { max-inline-size: 560px; }
	}

	@media (max-width: 767px) {
		.ebg-stk { --ebg-stk-py: 80px; }
		.ebg-stk .ebg-stk__heading { font-size: var(--fs-30, 1.875rem); }
		.ebg-stk__main,
		.ebg-stk__panel { padding: 40px 20px; }
		.ebg-stk__main::before { margin-block-end: 20px; }
		.ebg-stk .ebg-stk__title { font-size: var(--fs-24); }
		.ebg-stk__panel { --ebg-stk-index: 150px; }
		.ebg-stk .ebg-stk__list li { padding-block: 16px; font-size: var(--fs-16); }
	}
}
