/**
 * Pattern: Case studies
 * Sekcja z tytułem, intro, siatką okrągłych zdjęć case study i przyciskiem CTA.
 *
 * @package nbs-theme
 */

.nbs-case-studies-wrapper {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 0;
	width: 100%;
	box-sizing: border-box;
}

section.nbs-case-studies {
	max-width: var(--wp--custom--section-width, 1140px);
	margin-top: var(--wp--custom--section-top-and-bottom-margin, 2rem);
	margin-bottom: var(--wp--custom--section-top-and-bottom-margin, 2rem);
	/* 24px na wszystkich ekranach (w tym 375px) */
	margin-left: 24px;
	margin-right: 24px;
	min-width: 0;
	box-sizing: border-box;
}

/* Tytuł H2 – wyśrodkowany, Oswald 32px, line-height 130% */
.nbs-case-studies__title {
	color: var(--wp--preset--color--text-primary, #1A1A1A);
	text-align: center;
	font-family: Oswald, sans-serif;
	font-size: 32px;
	font-style: normal;
	font-weight: 500;
	line-height: 130%;
	margin-top: 0;
	margin-bottom: 1rem;
}

/* Intro – body-default, Montserrat 16px, line-height 150%; szerokość = sectionWidth bez padding */
.nbs-case-studies__intro {
	max-width: 100%;
	margin-bottom: 2.5rem;
	min-width: 0;
}

.nbs-case-studies__intro .body-default {
	color: var(--wp--preset--color--text-primary, #1A1A1A);
	font-family: Montserrat, sans-serif;
	font-size: 16px;
	font-style: normal;
	font-weight: 400;
	line-height: 150%;
	margin-top: 0;
	margin-bottom: 1rem;
}

.nbs-case-studies__intro .body-default:last-child {
	margin-bottom: 0;
}

/* Siatka 3 kolumny – gap 0, odstępy realizowane przez padding na itemach */
.nbs-case-studies__grid {
	display: flex;
	flex-wrap: wrap;
	gap: 0;
	justify-content: center;
	width: 100%;
	margin-bottom: 60px;
	min-width: 0;
}

.nbs-case-studies__item {
	display: flex;
	flex-direction: column;
	align-items: center;
	flex: 0 0 auto;
	padding: 24px;
	min-width: 0;
}

/* Okrągłe zdjęcie – 325px desktop; na wąskich ekranach shrink, żeby nie psuć 24px marginesu */
.nbs-case-studies__thumb {
	width: 325px;
	max-width: 100%;
	height: 325px;
	border-radius: 158px;
	overflow: hidden;
	flex-shrink: 1;
	min-width: 0;
	align-self: stretch;
	margin: 0;
	background-color: var(--wp--preset--color--neutral-border, lightgray);
	background-size: cover;
	background-position: 50% 50%;
	background-repeat: no-repeat;
}

.nbs-case-studies__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	vertical-align: middle;
}

/* Podpis h3 – styl globalny ze style.css (Oswald 20px), wyśrodkowany */
.nbs-case-studies__item h3 {
	text-align: center;
	margin-top: 0.75rem;
	margin-bottom: 0;
}

/* Linki dla zdjęcia i podpisu (klik w miniaturę/nazwę prowadzi na stronę sekcji). */
.nbs-case-studies__thumb-link,
.nbs-case-studies__caption-link {
	text-decoration: none;
	color: inherit;
	display: inline-block;
}

.nbs-case-studies__thumb-link:focus-visible,
.nbs-case-studies__caption-link:focus-visible {
	outline: 2px solid var(--wp--preset--color--int-green);
	outline-offset: 4px;
}

/* CTA – wyśrodkowany */
.nbs-case-studies__cta {
	margin: 0;
	justify-content: center;
}

/* Mobile: margines 24px + thumb może się skurczyć, zachowuje proporcje koła */
@media (max-width: 767px) {
	section.nbs-case-studies {
		margin-left: 24px !important;
		margin-right: 24px !important;
	}
	.nbs-case-studies__thumb {
		width: 100%;
		max-width: 325px;
		height: auto;
		aspect-ratio: 1;
	}
}
