/* ==========================================================================
   Sekcja: Zdjęcie + tekst (Figma 1:175 — strona główna; styl kompaktowy:
   1:1016 „Sprzęt i Technologie” na podstronach usług)
   ========================================================================== */
.media-text {
	display: flex;
	flex-direction: column;
	gap: 2.5rem;
}

/* Figura bez przycinania — karta (.media-text__card) może wystawać poza zdjęcie. */
.media-text__media {
	position: relative;
	margin: 0;
}

.media-text__frame {
	position: relative;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	border-radius: 16px;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.media-text__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.media-text__label {
	position: absolute;
	right: 1rem;
	bottom: 1rem;
	padding: 0.75rem 1.5rem;
	border-radius: var(--radius-sm);
	background: var(--color-accent);
	box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
	color: #fff;
	font-weight: 700;
	line-height: 1.5;
}

/* Pływająca karta (zastępuje etykietę). Telefon/tablet: nachodzi na dolną krawędź zdjęcia,
   wyrównana do prawej i mieści się w kontenerze; desktop: wystaje poza róg zdjęcia od strony tekstu. */
.media-text__card {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	width: fit-content;
	max-width: min(320px, calc(100% - 1.5rem));
	margin: -3rem 0.75rem 0 auto;
	padding: 1.25rem 1.5rem;
	border: 1px solid var(--color-bg-light);
	border-radius: var(--radius-lg);
	background: #fff;
	box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.media-text__card-title {
	display: block;
	font-size: 0.875rem;
	font-weight: 700;
	line-height: 1.43;
	color: var(--color-accent);
}

.media-text__card-text {
	display: block;
	font-size: 0.75rem;
	line-height: 1.33;
	color: var(--color-text-muted);
}

.media-text__body {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 1rem;
	min-width: 0;
}

.media-text__heading {
	margin: 0;
	font-size: var(--fs-h2);
	line-height: 1.11;
	letter-spacing: normal;
	color: var(--color-navy);
}

.media-text__content {
	padding-top: 0.5rem;
	font-size: var(--fs-lead);
	line-height: 1.625;
	color: var(--color-text-body);
}

.media-text__content > :last-child {
	margin-bottom: 0;
}

.media-text__content strong {
	font-weight: 700;
}

/* Cechy z ikoną w granatowym kwadracie (Figma 1:1028). */
.media-text__features {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
	margin: 0;
	padding: 0.5rem 0;
	list-style: none;
}

.media-text__feature {
	display: flex;
	align-items: flex-start;
	gap: 1rem;
}

.media-text__feature-icon {
	flex: none;
	display: grid;
	place-items: center;
	width: 48px;
	height: 48px;
	border-radius: var(--radius-sm);
	background: var(--color-navy);
}

.media-text__feature-img {
	display: block;
	width: 16px;
	height: 16px;
	object-fit: contain;
}

.media-text__feature-title {
	margin: 0;
	font-family: var(--font-base);
	font-size: var(--fs-lead);
	font-weight: 700;
	line-height: 1.556;
	letter-spacing: normal;
	color: var(--color-navy);
}

.media-text__feature-text {
	margin: 0;
	font-size: 0.875rem;
	line-height: 1.43;
	color: var(--color-text-muted);
}

.media-text__list {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	margin: 0;
	padding: 1rem 0;
	list-style: none;
}

.media-text__item {
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
	line-height: 1.5;
	color: var(--color-navy);
}

.media-text__check {
	flex: none;
	width: 14px;
	height: 16px;
	margin-top: 8px;
	color: var(--color-accent);
}

/* Styl kompaktowy (Figma 1:1016): nagłówek 30 px wersalikami, akapit 18/28, większe odstępy. */
.media-text--compact .media-text__body {
	gap: 1.5rem;
}

.media-text--compact .media-text__heading {
	font-size: clamp(1.5rem, 1.5vw + 1rem, 1.875rem);
	line-height: 1.2;
	letter-spacing: -0.025em;
	text-transform: uppercase;
}

.media-text--compact .media-text__content {
	padding-top: 0;
	line-height: 1.556;
}

.media-text--compact .media-text__features {
	padding: 0;
}

.section--bg-dark .media-text__heading,
.section--bg-dark .media-text__item,
.section--bg-dark .media-text__feature-title {
	color: #fff;
}

.section--bg-dark .media-text__content,
.section--bg-dark .media-text__feature-text {
	color: var(--color-text-on-dark);
}

.section--bg-dark .media-text__feature-icon {
	background: rgba(255, 255, 255, 0.1);
}

@media (min-width: 640px) {
	.media-text__label {
		right: 1.5rem;
		bottom: 1.5rem;
	}

	.media-text__card {
		margin-right: 1.5rem;
	}
}

@media (min-width: 1024px) {
	.media-text {
		flex-direction: row;
		align-items: center;
		gap: 4rem;
	}

	.media-text__media,
	.media-text__body {
		flex: 1 1 0;
	}

	.media-text__frame {
		aspect-ratio: auto;
		height: 450px;
	}

	.media-text--image-right .media-text__media {
		order: 1;
	}

	/* Karta wystaje 24 px poza dolny róg zdjęcia — w stronę tekstu (w odstęp 64 px między kolumnami). */
	.media-text__card {
		position: absolute;
		right: -24px;
		bottom: -24px;
		max-width: 320px;
		margin: 0;
		padding: 1.5rem 4.5rem 1.5rem 1.5rem;
	}

	.media-text--image-right .media-text__card {
		right: auto;
		left: -24px;
	}

	.media-text--compact .media-text__frame {
		height: 400px;
	}

	.media-text--compact .media-text__body {
		gap: 2rem;
	}

	/* Figma (strona główna): 36px przerwy przed kolejną sekcją. */
	.section--media_text {
		padding-bottom: calc(var(--section-space) + 36px);
	}

	/* Figma (podstrony, 1:1016; panel 29:5): zwykły odstęp sekcji. */
	.section--media_text:has(> .media-text--compact),
	.section--media_text:has(> .media-text--panel) {
		padding-bottom: var(--section-space);
	}
}

/* ==========================================================================
   Kolaż 3 zdjęć (Figma 27:246 „Nowoczesne Podejście”, Prace ziemne): wysokie zdjęcie
   po lewej + 2 dodatkowe jedno pod drugim, odstęp 16 px, zaokrąglenia 24 px, bez cienia.
   Telefon: wysokie na całą szerokość (kadr 4:3), pod nim 2 obok siebie.
   ========================================================================== */
.media-text__collage {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.75rem;
}

.media-text .media-text__collage .media-text__frame {
	height: auto;
	aspect-ratio: 4 / 3;
	border-radius: 16px;
	box-shadow: none;
}

.media-text__collage > .media-text__frame:first-child {
	grid-column: 1 / -1;
}

/* Jedno dodatkowe zdjęcie: też na całą szerokość. */
.media-text__collage--2 > .media-text__frame--extra {
	grid-column: 1 / -1;
}

.media-text__collage .media-text__card {
	grid-column: 1 / -1;
}

@media (min-width: 640px) {
	.media-text__collage {
		grid-template-rows: repeat(2, minmax(0, 1fr));
		gap: 1rem;
		height: clamp(380px, 60vw, 500px);
	}

	.media-text .media-text__collage .media-text__frame {
		aspect-ratio: auto;
		height: 100%;
		border-radius: 24px;
	}

	.media-text__collage > .media-text__frame:first-child,
	.media-text__collage--2 > .media-text__frame--extra {
		grid-column: auto;
		grid-row: 1 / span 2;
	}

	/* Zdjęcie po prawej: kolaż w lustrze, wysokie zdjęcie przy krawędzi strony. */
	.media-text--image-right .media-text__collage > .media-text__frame:first-child,
	.media-text--image-right .media-text__collage--2 > .media-text__frame--extra {
		grid-column: 2;
	}

	.media-text--image-right .media-text__collage--3 > .media-text__frame--extra {
		grid-column: 1;
	}

	.media-text--image-right .media-text__collage--2 > .media-text__frame--extra {
		grid-column: 1;
	}

	.media-text__collage .media-text__card {
		position: absolute;
		right: 1.5rem;
		bottom: -1.5rem;
		margin: 0;
	}
}

@media (min-width: 1024px) {
	.media-text--collage {
		gap: 5rem;
	}

	.media-text__collage {
		height: 500px;
	}

	.media-text__collage .media-text__card {
		right: -24px;
		bottom: -24px;
	}
}

/* ==========================================================================
   Kolaż 2 zdjęć (projekt własny, „Spawanie światłowodów”, Światłowody): duże zdjęcie
   przy krawędzi strony (84% × 84% kadru) + mniejsze (50%, 6:5) w białej ramce z cieniem,
   nachodzące na jego dolny róg od strony tekstu. Kadr o proporcjach 592 × 450 (Figma 29:5).
   ========================================================================== */
.media-text .media-text__collage--2 {
	display: block;
	height: auto;
	aspect-ratio: 592 / 450;
}

.media-text .media-text__collage--2 > .media-text__frame {
	position: absolute;
	top: 0;
	left: 0;
	width: 84%;
	height: 84%;
	aspect-ratio: auto;
	border-radius: 16px;
}

.media-text--image-right .media-text__collage--2 > .media-text__frame:first-child {
	left: auto;
	right: 0;
}

.media-text .media-text__collage--2 > .media-text__frame--extra {
	top: auto;
	right: 0;
	bottom: 0;
	left: auto;
	width: 50%;
	height: auto;
	aspect-ratio: 6 / 5;
	border: 4px solid #fff;
	background: #fff;
	box-shadow: 0 25px 50px -12px rgba(16, 36, 58, 0.3);
}

.media-text--image-right .media-text__collage--2 > .media-text__frame--extra {
	right: auto;
	left: 0;
}

@media (min-width: 640px) {
	.media-text .media-text__collage--2 > .media-text__frame {
		border-radius: 24px;
	}

	.media-text .media-text__collage--2 > .media-text__frame--extra {
		border-width: 8px;
	}
}

/* ==========================================================================
   Styl „Panel” (Figma 29:5 „Spawanie światłowodów z dokumentacją”):
   wyśrodkowany nagłówek — nadtytuł 14/21 (+16), H2 36/54 bez wersalików (+24), belka 80×6 (+32),
   opis 16/24 maks. 800 px; 80 px do treści. Treść: 2 kolumny 592 + 592 co 48 px, środkowane w pionie —
   szara karta (#f3f5f7, promień 24, padding 32, odstęp 24): H3 24/36 + lista co 16 px (ptaszek 14 px,
   tekst 16/24 #4b5563) ‖ zdjęcie 450 px, promień 24, lub kolaż 2 zdjęć.
   Telefon/tablet (projekt własny): karta, pod nią zdjęcie; mniejszy padding karty.
   ========================================================================== */
.media-text.media-text--panel {
	display: block;
}

.media-text__head {
	gap: 0;
	margin-bottom: clamp(2.5rem, 6vw, 5rem);
}

.media-text__eyebrow {
	margin: 0 0 1rem;
	font-size: 0.875rem;
	font-weight: 700;
	line-height: 1.5;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--color-accent);
}

.media-text__head-heading {
	margin: 0 0 1.25rem;
	line-height: 1.25;
	letter-spacing: -0.0333em;
	text-transform: none;
	text-wrap: balance;
	color: var(--color-navy);
}

.media-text__bar {
	width: 80px;
	margin-bottom: 1.5rem;
}

.media-text__bar:last-child {
	margin-bottom: 0;
}

.media-text__lead {
	max-width: 800px;
	line-height: 1.5;
	color: var(--color-text-body);
	text-wrap: pretty;
}

.media-text__lead p {
	margin: 0;
}

.media-text__lead p + p {
	margin-top: 0.75rem;
}

.media-text__columns {
	display: grid;
	gap: 2rem;
}

.media-text__panel {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
	min-width: 0;
	padding: 1.5rem;
	border: 1px solid #f3f4f6;
	border-radius: 24px;
	background: var(--color-bg-light);
}

.media-text__panel-heading {
	margin: 0;
	font-size: clamp(1.25rem, 0.5vw + 1.125rem, 1.5rem);
	line-height: 1.5;
	color: var(--color-navy);
}

.media-text--panel .media-text__list {
	padding: 0;
}

.media-text--panel .media-text__item {
	gap: 1rem;
	color: var(--color-text-body);
}

.media-text--panel .media-text__check {
	margin-top: 4px;
}

.media-text__note {
	margin: 0;
	padding-top: 1.5rem;
	border-top: 1px solid var(--color-border);
	line-height: 1.5;
	color: var(--color-text-body);
}

.media-text--panel .media-text__actions {
	padding-top: 0.25rem;
}

/* Jedno zdjęcie: promień 24, bez cienia (Figma). */
.media-text--panel .media-text__media:not(.media-text__collage) .media-text__frame {
	border-radius: 24px;
	box-shadow: none;
}

@media (min-width: 640px) {
	.media-text__panel {
		padding: 2rem;
	}

	/* Tablet: zdjęcie/kolaż nie szerszy niż w kolumnie na desktopie. */
	.media-text--panel .media-text__media {
		width: 100%;
		max-width: 592px;
		margin-inline: auto;
	}
}

@media (min-width: 1024px) {
	.media-text__head-heading {
		margin-bottom: 1.5rem;
		line-height: 1.5;
	}

	.media-text__bar {
		margin-bottom: 2rem;
	}

	.media-text__columns {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		align-items: center;
		gap: 3rem;
	}

	.media-text--panel.media-text--image-left .media-text__media {
		order: -1;
	}
}

/* Cechy z ptaszkiem w pomarańczowym kółku (Figma 27:262): ikona 24 px, tytuł 16/24, opis 14/21. */
.media-text--feature-checks .media-text__features {
	gap: 1rem;
	padding: 1rem 0 0;
}

.media-text--feature-checks .media-text__feature {
	gap: 0.75rem;
}

.media-text--feature-checks .media-text__feature-icon {
	width: 24px;
	height: 24px;
	margin-top: 2px;
	border-radius: 50%;
	background: var(--color-accent);
	color: #fff;
}

.media-text--feature-checks .media-text__feature-check {
	display: block;
	width: 10.5px;
	height: 12px;
}

.media-text--feature-checks .media-text__feature-title {
	font-size: 1rem;
	line-height: 1.5;
}

.media-text--feature-checks .media-text__feature-text {
	line-height: 1.5;
}

.section--bg-dark .media-text--feature-checks .media-text__feature-icon {
	background: var(--color-accent);
}

/* ==========================================================================
   Animacja wejścia: zdjęcie miękko — fade + blur (data-reveal="fade" na figurze)
   + wewnętrzny zoom-out 1.08 → 1; etykieta wjeżdża z prawej, karta z dołu po zdjęciu (~0.6 s);
   tekst fade-up z blur, cechy kaskadowo fade-up, punkty kaskadowo fade-left z ptaszkiem „pop”,
   przycisk na końcu.
   ========================================================================== */
.has-reveal .media-text__media[data-reveal] .media-text__image {
	transform: scale(1.08);
}

.has-reveal .media-text__media[data-reveal].is-revealed .media-text__image {
	transform: none;
	transition: transform 1.3s var(--ease-soft) var(--reveal-delay, 0ms);
}

.has-reveal .media-text__media[data-reveal] .media-text__label {
	opacity: 0;
	filter: blur(var(--reveal-blur));
	transform: translate3d(var(--reveal-distance-x), 0, 0);
}

.has-reveal .media-text__media[data-reveal].is-revealed .media-text__label {
	opacity: 1;
	filter: none;
	transform: none;
	transition:
		opacity 0.8s var(--ease-soft) 0.6s,
		filter 0.9s var(--ease-soft) 0.6s,
		transform 0.9s var(--ease-out) 0.6s;
}

/* Karta: wysuwa się z dołu z rozmyciem, po zdjęciu (jak etykieta). */
.has-reveal .media-text__media[data-reveal] .media-text__card {
	opacity: 0;
	filter: blur(var(--reveal-blur));
	transform: translate3d(0, 32px, 0);
}

.has-reveal .media-text__media[data-reveal].is-revealed .media-text__card {
	opacity: 1;
	filter: none;
	transform: none;
	transition:
		opacity 0.8s var(--ease-soft) 0.6s,
		filter 0.9s var(--ease-soft) 0.6s,
		transform 1s var(--ease-out) 0.6s;
}

/* Kolaż 2 zdjęć: mniejsze zdjęcie wsuwa się po dużym, ukosem od strony tekstu. */
.has-reveal .media-text__collage--2[data-reveal] > .media-text__frame--extra {
	opacity: 0;
	filter: blur(var(--reveal-blur));
	transform: translate3d(0, 40px, 0) scale(0.96);
}

.has-reveal .media-text__collage--2[data-reveal].is-revealed > .media-text__frame--extra {
	opacity: 1;
	filter: none;
	transform: none;
	transition:
		opacity 0.7s var(--ease-soft) calc(var(--reveal-delay, 0ms) + 450ms),
		filter 0.8s var(--ease-soft) calc(var(--reveal-delay, 0ms) + 450ms),
		transform 0.9s var(--ease-out) calc(var(--reveal-delay, 0ms) + 450ms);
}

.has-reveal .media-text__item[data-reveal] {
	--reveal-distance-x: 40px;
}

.has-reveal .media-text__item[data-reveal] .media-text__check {
	transform: scale(0);
}

.has-reveal .media-text__item[data-reveal].is-revealed .media-text__check {
	transform: none;
	transition: transform 0.6s var(--ease-back) calc(var(--reveal-delay, 0ms) + 300ms);
}

@media (prefers-reduced-motion: reduce) {
	.has-reveal .media-text__media[data-reveal] .media-text__image,
	.has-reveal .media-text__media[data-reveal] .media-text__label,
	.has-reveal .media-text__media[data-reveal] .media-text__card,
	.has-reveal .media-text__collage--2[data-reveal] > .media-text__frame--extra,
	.has-reveal .media-text__item[data-reveal] .media-text__check {
		opacity: 1;
		filter: none;
		transform: none;
		transition: none;
	}
}
