/* Frontend styles for NetSuccess case study blocks. */
.ns-case-study,
.ns-case-study-section {
	--ns-cs-black: #101010;
	--ns-cs-green: #d4df4d;
	--ns-cs-gray: #4b4b4b;
	--ns-cs-line: #dedede;
	background: #fff;
	color: var(--ns-cs-black);
	font-family: "Poppins", Arial, sans-serif;
}

.ns-case-study *, .ns-case-study-section * { box-sizing: border-box; }
.ns-case-study.alignfull,
.ns-case-study-section.alignfull { width: 100vw; max-width: 100vw; margin-right: calc(50% - 50vw); margin-left: calc(50% - 50vw); }
/* Compensate only for Exponent's padded page wrapper, absent on portfolio items. */
.be-themes-content-padding > .ns-case-study.alignfull { margin-top: -70px !important; margin-bottom: -70px !important; }
/* The regular portfolio template already renders content at full width. */
body.single-portfolio #be-content > .ns-case-study.alignfull,
body.single-portfolio #be-content > .ns-case-study-section.alignfull {
	width: 100%; max-width: none; margin: 0 !important;
}
.ns-case-study > .ns-case-study-section { margin: 0; max-width: none; }

/* WordPress 5.7 wraps the children of every core/group in an extra container.
   Flatten it so the grid and flex layouts match the original static HTML. */
.ns-case-study .wp-block-group > .wp-block-group__inner-container,
.ns-case-study-section .wp-block-group > .wp-block-group__inner-container { display: contents; }
.ns-case-study__section { padding: 110px max(30px, calc((100vw - 1320px) / 2)); }
.ns-case-study__section--dark { background: var(--ns-cs-black); color: #fff; }
.ns-case-study__section--green { background: var(--ns-cs-green); color: var(--ns-cs-black); }
.ns-case-study__section--dark h1,
.ns-case-study__section--dark h2,
.ns-case-study__section--dark h3 { color: #fff !important; }
.ns-case-study__eyebrow { margin: 0 0 18px; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.ns-case-study h1, .ns-case-study h2, .ns-case-study h3, .ns-case-study p,
.ns-case-study-section h1, .ns-case-study-section h2, .ns-case-study-section h3, .ns-case-study-section p { margin-top: 0; }
.ns-case-study h1, .ns-case-study-section h1 { max-width: 980px; margin-bottom: 30px; font-size: clamp(42px, 6vw, 88px); line-height: 1.02; letter-spacing: -.045em; }
.ns-case-study h2, .ns-case-study-section h2 { max-width: 820px; margin-bottom: 34px; font-size: clamp(32px, 4.2vw, 62px); line-height: 1.08; letter-spacing: -.035em; }
.ns-case-study h3, .ns-case-study-section h3 { margin-bottom: 12px; font-size: clamp(20px, 2vw, 28px); line-height: 1.2; }
.ns-case-study p, .ns-case-study-section p { color: var(--ns-cs-gray); font-size: 16px; line-height: 1.85; }
.ns-case-study__section--dark p { color: #c1c1c1; }
.ns-case-study__lead { max-width: 820px; font-size: clamp(19px, 2vw, 25px) !important; line-height: 1.55 !important; }

.ns-case-study__hero { min-height: 760px; display: flex; align-items: flex-end; position: relative; overflow: hidden; }
.ns-case-study__hero::after { content: "17,71 %"; position: absolute; right: -2vw; top: 50px; color: rgba(212,223,77,.08); font-size: clamp(110px, 20vw, 330px); font-weight: 800; line-height: 1; pointer-events: none; }
.ns-case-study__hero-copy { position: relative; z-index: 1; width: 100%; }
.ns-case-study__hero h1 span { color: var(--ns-cs-green); }
.ns-case-study__meta { display: flex; flex-wrap: wrap; gap: 12px 30px; margin-top: 52px; padding-top: 24px; border-top: 1px solid #383838; }
.ns-case-study__meta p { margin: 0; color: #c1c1c1; font-size: 13px; }

.ns-case-study__stats { display: grid; grid-template-columns: repeat(4, 1fr); }
.ns-case-study__stat { min-height: 240px; padding: 46px 34px; border-right: 1px solid rgba(16,16,16,.18); display: flex; flex-direction: column; justify-content: space-between; }
.ns-case-study__stat:last-child { border-right: 0; }
.ns-case-study__stat p { margin-bottom: 0; color: var(--ns-cs-black); }
.ns-case-study__stat-label { max-width: 180px; font-size: 13px !important; font-weight: 700; line-height: 1.45 !important; text-transform: uppercase; }
.ns-case-study__stat-value { font-size: clamp(34px, 4vw, 60px) !important; font-weight: 800; letter-spacing: -.04em; line-height: 1 !important; }
.ns-case-study__stat-note { font-size: 13px !important; font-weight: 600; }

.ns-case-study__summary { position: relative; overflow: hidden; }
.ns-case-study__summary-grid { display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr); gap: 9vw; align-items: start; }
.ns-case-study__summary-heading { padding-left: 40px; }
.ns-case-study__summary-heading h2 { margin-bottom: 0; }
.ns-case-study__summary-copy { max-width: 760px; }
.ns-case-study__summary-copy p { margin-bottom: 24px; }
.ns-case-study__summary-copy p:last-child { margin-bottom: 0; }
.ns-case-study__summary-result { padding: 24px 28px; margin-left: -24px; border-left: 0px solid var(--ns-cs-green); background: var(--ns-cs-green); color: var(--ns-cs-black) !important; }
.ns-case-study__summary-result strong { font-weight: 800; }

.ns-case-study__split { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 9vw; align-items: start; }
.ns-case-study__prose { max-width: 720px; }
.ns-case-study__prose p:last-child { margin-bottom: 0; }
.ns-case-study__constraints { display: grid; gap: 1px; background: #343434; }
.ns-case-study__constraint { padding: 28px; background: var(--ns-cs-black); }
.ns-case-study__constraint h3 { color: var(--ns-cs-green) !important; font-size: 20px; }
.ns-case-study__constraint p:last-child { margin-bottom: 0; }

.ns-case-study__goals { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--ns-cs-line); }
.ns-case-study__goal { min-height: 250px; padding: 36px; background: #fff; }
.ns-case-study__goal-no { margin-bottom: 18px; color: var(--ns-cs-green) !important; font-size: 52px !important; font-weight: 800; line-height: 1 !important; }
.ns-case-study__goal-status { display: inline-block; margin: 24px 0 0; padding: 8px 12px; background: var(--ns-cs-green); color: var(--ns-cs-black) !important; font-size: 12px !important; font-weight: 800; line-height: 1.2 !important; text-transform: uppercase; }

.ns-case-study__decisions { counter-reset: decision; display: grid; grid-template-columns: repeat(2, 1fr); gap: 70px 8vw; }
.ns-case-study__decision { counter-increment: decision; position: relative; padding-top: 68px; }
.ns-case-study__decision::before { content: "0" counter(decision); position: absolute; top: 0; color: rgba(16,16,16,.36); font-size: 42px; font-weight: 800; }

.ns-case-study__phases { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 44px; }
.ns-case-study__phases::before { content: ""; position: absolute; top: 48px; left: 0; right: 0; height: 1px; background: #444; }
.ns-case-study__phase { position: relative; padding-top: 60px; }
.ns-case-study__phase::before { content: ""; position: absolute; top: 8px; left: 0; width: 15px; height: 15px; border: 4px solid var(--ns-cs-black); background: var(--ns-cs-green); border-radius: 50%; box-shadow: 0 0 0 1px var(--ns-cs-green); }
.ns-case-study__phase-kpis { margin-top: 24px; color: #fff !important; font-weight: 700; line-height: 1.8 !important; }

/* Explicit dates make the electronics rollout a readable timeline. */
.ns-case-study__phases--dated { gap: 36px; }
.ns-case-study__phases--dated::before { top: 48px; left: 7px; right: calc((100% - 72px) / 3 - 7px); background: #666; }
.ns-case-study__phases--dated .ns-case-study__phase { padding-top: 0; min-width: 0; }
.ns-case-study__phases--dated .ns-case-study__phase::before { top: 41px; }
.ns-case-study .ns-case-study__phase-date { color: var(--ns-cs-green); font-size: 14px; font-weight: 700; line-height: 1.5; margin: 0 0 65px; }
.ns-case-study__phases--dated .ns-case-study__phase h3 { font-size: clamp(20px, 1.8vw, 26px); }
@media only screen and (max-width: 959px) {
 .ns-case-study__phases--dated { gap: 0; }
 .ns-case-study__phases--dated::before { top: 10px; bottom: 0; left: 7px; right: auto; height: auto; width: 1px; }
 .ns-case-study__phases--dated .ns-case-study__phase { padding: 0 0 36px 40px; }
 .ns-case-study__phases--dated .ns-case-study__phase::before { top: 4px; }
 .ns-case-study__phases--dated .ns-case-study__phase:last-child { padding-bottom: 0; }
 .ns-case-study .ns-case-study__phase-date { margin-bottom: 14px; }
}

/* Opt-in spacing for the anonymised e-shop study; other studies keep their layout. */
.ns-case-study .ns-case-study__section--compact-summary { padding-top: 72px; padding-bottom: 56px; border-bottom: 1px solid var(--ns-cs-line); }
.ns-case-study .ns-case-study__section--compact-summary + .ns-case-study-section { padding-top: 64px; }
.ns-case-study .ns-case-study__section--compact-decisions { padding-top: 72px; padding-bottom: 64px; }
.ns-case-study .ns-case-study__section--compact-decisions .ns-case-study__decisions { gap: 32px 6vw; }
.ns-case-study .ns-case-study__section--compact-decisions .ns-case-study__decision { border-top: 1px solid #a6af36; padding-top: 22px; }
.ns-case-study .ns-case-study__section--compact-decisions .ns-case-study__decision::before { display: none; }
.ns-case-study .ns-case-study__section--compact-decisions .ns-case-study__decision p:last-child { margin-bottom: 0; }
@media only screen and (max-width: 767px) {
 .ns-case-study .ns-case-study__section--compact-summary,
 .ns-case-study .ns-case-study__section--compact-decisions { padding-top: 48px; padding-bottom: 48px; }
 .ns-case-study .ns-case-study__section--compact-summary + .ns-case-study-section { padding-top: 48px; }
 .ns-case-study .ns-case-study__section--compact-decisions .ns-case-study__decisions { gap: 26px; }
}

.ns-case-study__chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 70px 34px; }
.ns-case-study__chart { margin: 0; min-width: 0; }
.ns-case-study__chart--wide { grid-column: 1 / -1; }
.ns-case-study__chart-frame { background: #fff; position: relative; }
.ns-case-study__chart-frame::before {
	content: "";
	position: absolute;
	top: -12px;
	right: -12px;
	width: 40px;
	height: 40px;
	background: var(--ns-cs-green);
	z-index: 0;
}
.ns-case-study__chart-frame .wp-block-image {
	margin: 0;
	padding: 26px;
	z-index: 40;
	position: relative;
	background: #fff;
}
.ns-case-study__chart img { display: block; width: 100%; height: auto; }
.ns-case-study__chart-caption { margin: 16px 0 0 !important; color: #c1c1c1 !important; font-size: 13px !important; line-height: 1.65 !important; }
.ns-case-study__note { margin-top: 60px; padding: 28px 30px; border-left: 7px solid var(--ns-cs-green); background: #1c1c1c; }
.ns-case-study__note p { margin: 0; }

.ns-case-study__customer-chart { margin-top: 40px; padding: 28px; background: #fff; }
.ns-case-study__customer-chart .wp-block-image { margin: 0; }
.ns-case-study__customer-chart img { display: block; width: 100%; height: auto; }
.ns-case-study__insights { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 70px; background: rgba(16,16,16,.22); }
.ns-case-study__insight { padding: 30px; background: var(--ns-cs-green); }
.ns-case-study__insight p { margin-bottom: 0; color: #101010; }

.ns-case-study__impact { display: grid; grid-template-columns: 1fr 1fr; gap: 7vw; align-items: end; }
.ns-case-study__impact-number { margin: 0; color: var(--ns-cs-green) !important; font-size: clamp(58px, 9vw, 132px) !important; font-weight: 800; letter-spacing: -.06em; line-height: .95 !important; }
.ns-case-study__impact-label { max-width: 520px; margin-top: 18px; color: #fff !important; font-size: 18px !important; font-weight: 700; line-height: 1.55 !important; }
.ns-case-study__closing-lead { margin-top: 70px; }

.ns-case-study__next { display: grid; }
.ns-case-study__next-item { display: grid; grid-template-columns: 72px 1fr; gap: 24px; padding: 28px 0; border-top: 1px solid rgba(16,16,16,.25); }
.ns-case-study__next-item:last-child { border-bottom: 1px solid rgba(16,16,16,.25); }
.ns-case-study__next-no { font-size: 24px !important; font-weight: 800; }
.ns-case-study__next-item p { margin: 6px 0 0; color: #101010; }
.ns-case-study__source { margin-top: 30px; color: #666 !important; font-size: 12px !important; }

.ns-case-study .wp-block-table.ns-table,
.ns-case-study-section .wp-block-table.ns-table { display: flex; flex-direction: column; margin: 34px 0; overflow-x: auto; border: 0; background: #fff; }
.ns-case-study .wp-block-table.ns-table table,
.ns-case-study-section .wp-block-table.ns-table table { order: 2; width: 100%; min-width: 760px; margin: 0; border: 0; border-collapse: collapse; color: #191919; font-size: 14px; }
.ns-case-study .wp-block-table.ns-table caption,
.ns-case-study-section .wp-block-table.ns-table caption,
.ns-case-study .wp-block-table.ns-table figcaption,
.ns-case-study .ns-table thead{
	border-top: 0 !important;
	border-bottom: 0 !important;
}
.ns-case-study-section .wp-block-table.ns-table figcaption { order: 1; min-width: 760px; margin: 0; padding: 14px 18px; background: #101010; color: #fff !important; font-size: 15px; font-weight: 700; line-height: 1.5; text-align: left; caption-side: top; }
.ns-case-study .wp-block-table.ns-table th,
.ns-case-study .wp-block-table.ns-table td,
.ns-case-study-section .wp-block-table.ns-table th,
.ns-case-study-section .wp-block-table.ns-table td { padding: 15px 18px; border: 0; text-align: right; white-space: nowrap; }
.ns-case-study .wp-block-table.ns-table th:first-child,
.ns-case-study .wp-block-table.ns-table td:first-child,
.ns-case-study-section .wp-block-table.ns-table th:first-child,
.ns-case-study-section .wp-block-table.ns-table td:first-child { text-align: left; font-weight: 700; }
.ns-case-study .wp-block-table.ns-table thead th,
.ns-case-study-section .wp-block-table.ns-table thead th { background: #f2f2f2; color: #101010 !important; font-size: 12px; text-transform: uppercase; }
.ns-case-study .wp-block-table.ns-table tbody tr:nth-child(even),
.ns-case-study-section .wp-block-table.ns-table tbody tr:nth-child(even) { background: #fafafa; }
.ns-case-study .wp-block-table.ns-table th:last-child,
.ns-case-study .wp-block-table.ns-table td:last-child,
.ns-case-study-section .wp-block-table.ns-table th:last-child,
.ns-case-study-section .wp-block-table.ns-table td:last-child { background: var(--ns-cs-green) ; font-weight: 800; }
.ns-case-study-section .ns-table tbody tr:hover{
	background: var(--ns-cs-green) ;
}

@media only screen and (max-width: 959px) {
	.ns-case-study__stats { grid-template-columns: repeat(2, 1fr); }
	.ns-case-study__stat:nth-child(2) { border-right: 0; }
	.ns-case-study__summary-grid, .ns-case-study__split, .ns-case-study__impact { grid-template-columns: 1fr; }
	.ns-case-study__summary-grid { gap: 46px; }
	.ns-case-study__chart-grid { grid-template-columns: 1fr; }
	.ns-case-study__chart--wide { grid-column: auto; }
	.ns-case-study__chart img{
		width: 100% !important;
		height: auto !important;
		min-width: 0 !important;
	}
	.ns-case-study__phases { grid-template-columns: 1fr; }
	.ns-case-study__phases::before { top: 0; bottom: 0; left: 7px; right: auto; width: 1px; height: auto; }
	.ns-case-study__phase { padding: 0 0 30px 48px; }
	.ns-case-study__phase::before { top: 4px; }
	.ns-case-study__summary-result {     margin-left: 0; }
}

@media only screen and (max-width: 767px) {
	.ns-case-study__section { padding: 76px 24px; }
	.ns-case-study__hero { min-height: 650px; }
	.ns-case-study__summary::before { left: 24px; }
	.ns-case-study__summary-heading { padding-left: 28px; }
	.ns-case-study__summary-result { padding: 20px; }
	.ns-case-study__stats, .ns-case-study__goals, .ns-case-study__decisions, .ns-case-study__insights { grid-template-columns: 1fr; }
	.ns-case-study__stat { min-height: 190px; border-right: 0; border-bottom: 1px solid rgba(16,16,16,.18); }
	.ns-case-study__chart-frame, .ns-case-study__customer-chart { position: relative; }
	.ns-case-study__impact-number { overflow-wrap: anywhere; }

	/* Mobile results table: each metric becomes a vertical card, so no
	   horizontal scrolling is needed. */
	.ns-case-study .wp-block-table.ns-table,
	.ns-case-study-section .wp-block-table.ns-table {
		box-sizing: border-box;
		display: flex !important;
		width: 100%;
		max-width: 100%;
		overflow: visible !important;
		border: 0;
		background: transparent;
	}
	.ns-case-study .wp-block-table.ns-table figcaption,
	.ns-case-study-section .wp-block-table.ns-table figcaption {
		min-width: 0 !important;
		max-width: 100%;
		padding: 18px 20px;
		font-size: 14px;
	}
	.ns-case-study .wp-block-table.ns-table table,
	.ns-case-study-section .wp-block-table.ns-table table {
		display: block !important;
		width: 100% !important;
		min-width: 0 !important;
		max-width: 100% !important;
		background: transparent;
		table-layout: auto !important;
	}
	.ns-case-study .wp-block-table.ns-table thead,
	.ns-case-study-section .wp-block-table.ns-table thead {
		display: none;
	}
	.ns-case-study .wp-block-table.ns-table tbody,
	.ns-case-study-section .wp-block-table.ns-table tbody {
		display: grid !important;
		gap: 16px;
		width: 100% !important;
		min-width: 0 !important;
		max-width: 100% !important;
		padding-top: 16px;
	}
	.ns-case-study .wp-block-table.ns-table tbody tr,
	.ns-case-study-section .wp-block-table.ns-table tbody tr {
		box-sizing: border-box;
		display: block !important;
		width: 100% !important;
		min-width: 0 !important;
		max-width: 100% !important;
		overflow: hidden;
		border: 1px solid #dedede;
		background: #fff;
	}
	.ns-case-study .wp-block-table.ns-table tbody td,
	.ns-case-study-section .wp-block-table.ns-table tbody td {
		box-sizing: border-box;
		display: grid !important;
		grid-template-columns: minmax(0, 1fr) minmax(96px, 120px);
		gap: 12px;
		align-items: center;
		width: 100% !important;
		min-width: 0 !important;
		max-width: 100% !important;
		padding: 12px 16px;
		border: 0;
		border-bottom: 1px solid #e7e7e7;
		background: #fff;
		color: #101010;
		font-size: 14px;
		font-variant-numeric: tabular-nums;
		line-height: 1.45;
		text-align: right;
		white-space: normal;
		overflow-wrap: anywhere;
	}
	.ns-case-study .wp-block-table.ns-table tbody td:first-child,
	.ns-case-study-section .wp-block-table.ns-table tbody td:first-child {
		display: block;
		padding: 15px 16px;
		background: #101010;
		color: #fff;
		font-size: 15px;
		font-weight: 800;
		text-align: left;
	}
	.ns-case-study .wp-block-table.ns-table tbody td:last-child,
	.ns-case-study-section .wp-block-table.ns-table tbody td:last-child {
		border-bottom: 0;
		background: #f4f6d2;
		font-weight: 800;
	}
	.ns-case-study .wp-block-table.ns-table tbody td:not(:first-child)::before,
	.ns-case-study-section .wp-block-table.ns-table tbody td:not(:first-child)::before {
		color: #686868;
		font-size: 10px;
		font-weight: 800;
		letter-spacing: .08em;
		line-height: 1.3;
		text-align: left;
		text-transform: uppercase;
	}
	.ns-case-study .wp-block-table.ns-table tbody td:nth-child(2)::before,
	.ns-case-study-section .wp-block-table.ns-table tbody td:nth-child(2)::before { content: "Pred prevzatím"; }
	.ns-case-study .wp-block-table.ns-table tbody td:nth-child(3)::before,
	.ns-case-study-section .wp-block-table.ns-table tbody td:nth-child(3)::before { content: "Po prevzatí"; }
	.ns-case-study .wp-block-table.ns-table tbody td:nth-child(4)::before,
	.ns-case-study-section .wp-block-table.ns-table tbody td:nth-child(4)::before { content: "Zmena"; color: #101010; }
	.ns-case-study .wp-block-table.ns-table.ns-table--periods tbody td:nth-child(2)::before,
	.ns-case-study-section .wp-block-table.ns-table.ns-table--periods tbody td:nth-child(2)::before { content: "Porovnávacie obdobie"; }
	.ns-case-study .wp-block-table.ns-table.ns-table--periods tbody td:nth-child(3)::before,
	.ns-case-study-section .wp-block-table.ns-table.ns-table--periods tbody td:nth-child(3)::before { content: "Aktuálne obdobie"; }
}
