/**
 * KOPIE — Kontakty
 * Visual language aligned with Agrion Testimonials (.testimonial-one__*).
 * Scoped under .kopie-kontakty — no vendor CSS coupling.
 *
 * Row spacing = ribbon overhang + clear air below ribbon.
 * Ribbon skew uses FIXED px (not % of width) so long labels don't open a huge white cut.
 */

.kopie-kontakty {
	--kk-green: #36731F;
	--kk-green-deep: #2a5816;
	--kk-sub: #9dbe91;
	--kk-border: #ece9e0;
	--kk-radius: 10px;
	--kk-cols: 3;
	/* How far the ribbon sits below the card edge */
	--kk-ribbon-overhang: 25px;
	/* Visible empty space: ribbon bottom → next card top (~35–45px target) */
	--kk-row-clear: 40px;
	--kk-col-gap: 28px;
	/* Fixed horizontal run of the diagonal (same on every card) */
	--kk-skew: 36px;
	width: 100%;
	overflow-x: clip;
}

.kopie-kontakty--empty {
	padding: 1.5rem;
	text-align: center;
	color: #5a6b5a;
}

.kopie-kontakty__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	column-gap: var(--kk-col-gap);
	/* overhang + clear — do NOT use a single gap for both axes */
	row-gap: calc(var(--kk-ribbon-overhang) + var(--kk-row-clear));
	align-items: stretch;
	padding-bottom: var(--kk-ribbon-overhang);
}

.kopie-kontakty__card--featured {
	grid-column: 1 / -1;
	justify-self: center;
	width: calc((100% - (var(--kk-cols) - 1) * var(--kk-col-gap)) / var(--kk-cols));
	max-width: 100%;
	height: auto;
}

.kopie-kontakty__card {
	position: relative;
	display: flex;
	flex-direction: column;
	background-color: #ffffff;
	border: 1px solid var(--kk-border);
	border-radius: var(--kk-radius);
	padding: 32px 36px 64px;
	margin: 0;
	height: 100%;
	box-sizing: border-box;
	z-index: 1;
	overflow: visible;
	transition: border-color 0.5s ease, box-shadow 0.5s ease;
}

.kopie-kontakty__card::before {
	content: "";
	position: absolute;
	top: -1px;
	left: -1px;
	right: -1px;
	bottom: -1px;
	border: 2px solid transparent;
	border-radius: var(--kk-radius);
	pointer-events: none;
	transition: border-color 0.4s ease;
	z-index: 0;
}

.kopie-kontakty__card:hover {
	border-color: transparent;
	box-shadow: 0 10px 60px 0 rgba(0, 0, 0, 0.07);
}

.kopie-kontakty__card:hover::before {
	border-color: var(--kk-green);
}

.kopie-kontakty__body {
	position: relative;
	display: block;
	z-index: 1;
	flex: 0 1 auto;
}

.kopie-kontakty__people {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.kopie-kontakty__person {
	margin: 0;
	padding: 0;
}

.kopie-kontakty__person + .kopie-kontakty__person {
	padding-top: 16px;
	border-top: 1px solid #f0ece3;
}

.kopie-kontakty__person-name {
	margin: 0 0 10px;
	font-size: 20px;
	font-weight: 700;
	color: #0e2207;
	line-height: 1.3;
}

.kopie-kontakty__link {
	display: block;
	color: var(--kk-green);
	text-decoration: none;
	word-break: break-word;
	font-size: 15px;
	line-height: 1.5;
	margin: 0 0 4px;
}

.kopie-kontakty__link:hover {
	text-decoration: underline;
}

/* ---- Green ribbon ----
 * Single geometry: clip-path with FIXED px skew (not % of width).
 * No extra pseudo triangles — they caused white slits against the clip edge.
 */
.kopie-kontakty__ribbon {
	position: absolute;
	bottom: calc(-1 * var(--kk-ribbon-overhang));
	left: -1px;
	z-index: 2;
	max-width: calc(100% - 4px);
}

.kopie-kontakty__ribbon-inner {
	position: relative;
	z-index: 1;
	background-color: var(--kk-green);
	/* padding-right keeps label clear of the skew zone */
	padding: 15px 48px 18px 36px;
	border-bottom-left-radius: 10px;
	clip-path: polygon(0 0, calc(100% - var(--kk-skew)) 0, 100% 100%, 0 100%);
	min-width: 180px;
	max-width: 100%;
	width: max-content;
	box-sizing: border-box;
}

.kopie-kontakty__ribbon-title {
	display: block;
	font-size: 16px;
	font-weight: 700;
	color: #ffffff;
	line-height: 1.3;
	margin: 0;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	max-width: 100%;
	overflow-wrap: anywhere;
	word-break: break-word;
}

.kopie-kontakty__ribbon-sub {
	display: block;
	font-size: 12px;
	color: var(--kk-sub);
	line-height: 1.35;
	margin: 4px 0 0;
	text-transform: none;
	letter-spacing: 0;
	max-width: 100%;
	overflow-wrap: anywhere;
}

@media (max-width: 1024px) {
	.kopie-kontakty {
		--kk-row-clear: 38px;
		--kk-col-gap: 24px;
		--kk-cols: 2;
		--kk-skew: 32px;
	}

	.kopie-kontakty__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.kopie-kontakty__card {
		padding: 28px 28px 60px;
	}

	.kopie-kontakty__card--featured {
		grid-column: 1 / -1;
		justify-self: center;
		width: calc((100% - (var(--kk-cols) - 1) * var(--kk-col-gap)) / var(--kk-cols));
	}

	.kopie-kontakty__ribbon-inner {
		padding-right: 44px;
		padding-left: 28px;
		min-width: 160px;
	}
}

@media (max-width: 767px) {
	.kopie-kontakty {
		--kk-row-clear: 36px;
		--kk-col-gap: 0px;
		--kk-cols: 1;
		--kk-skew: 28px;
	}

	.kopie-kontakty__grid {
		grid-template-columns: 1fr;
	}

	.kopie-kontakty__card {
		padding: 28px 24px 58px;
	}

	.kopie-kontakty__card--featured {
		grid-column: auto;
		justify-self: stretch;
		width: 100%;
	}

	.kopie-kontakty__ribbon {
		max-width: calc(100% - 4px);
	}

	.kopie-kontakty__ribbon-inner {
		padding: 14px 40px 16px 24px;
		min-width: 0;
		width: min(100%, 300px);
	}

	.kopie-kontakty__person-name {
		font-size: 18px;
	}
}

@media (max-width: 360px) {
	.kopie-kontakty {
		--kk-row-clear: 36px;
		--kk-skew: 24px;
	}

	.kopie-kontakty__ribbon-inner {
		width: min(100%, 270px);
		padding-right: 36px;
	}

	.kopie-kontakty__ribbon-title {
		font-size: 14px;
		line-height: 1.3;
	}
}
