/* K2CTS — dynamiczna galeria z filtrowaniem tagami. */
body .entry-content .k2cts-gallery-filter,
body.editor-styles-wrapper .k2cts-gallery-filter,
.editor-styles-wrapper .k2cts-gallery-filter {
	width: 100% !important;
	max-width: none !important;
	margin: 0 !important;
	padding: clamp(2.5rem, 5vw, 5rem) 0 !important;
	background: #f0e8d5 !important;
	color: #1c1e18;
}

.k2cts-gallery-filter__inner {
	width: min(calc(100% - 2 * 3rem), 86rem);
	margin: 0 auto;
}

.k2cts-gallery-filter__tags {
	display: flex !important;
	gap: 0.65rem !important;
	flex-wrap: wrap !important;
	margin: 0 !important;
}

.k2cts-gallery-filter__button {
	display: inline-flex;
	min-height: 2.45rem;
	padding: 0.5rem 1rem;
	align-items: center;
	justify-content: center;
	border: 1px solid rgba(139, 105, 20, 0.75) !important;
	border-radius: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	color: #76590e !important;
	font-family: Oswald, sans-serif !important;
	font-size: 0.65rem;
	font-weight: 500;
	letter-spacing: 0.08em;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	text-transform: uppercase;
	cursor: pointer;
}

.k2cts-gallery-filter__button.is-active,
.k2cts-gallery-filter__button:hover,
.k2cts-gallery-filter__button:focus-visible {
	border-color: #8b6914 !important;
	background: #8b6914 !important;
	color: #1c1e18 !important;
}

.k2cts-gallery-filter__count {
	margin: 2.4rem 0 1.3rem;
	color: #8b6914;
	font-family: Oswald, sans-serif;
	font-size: 0.72rem;
	font-weight: 500;
	letter-spacing: 0.12em;
	line-height: 1.25;
	text-transform: uppercase;
}

.k2cts-gallery-filter__grid {
	display: grid !important;
	width: 100% !important;
	max-width: none !important;
	margin: 0 !important;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	grid-auto-flow: dense;
	gap: 1.25rem;
}

.k2cts-gallery-filter__item {
	position: relative;
	display: block !important;
	min-width: 0;
	margin: 0 !important;
	overflow: hidden;
	background: #1c1e18;
	transition: opacity 180ms ease, transform 180ms ease;
}

.k2cts-gallery-filter__item.is-filtered-out {
	display: none !important;
}

.k2cts-gallery-filter__item--tall {
	grid-row: span 2;
}

.k2cts-gallery-filter__item--wide {
	grid-column: span 2;
}

.k2cts-gallery-filter__open {
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	cursor: zoom-in;
}

.k2cts-gallery-filter__open:focus-visible {
	outline: 3px solid #b48a1b;
	outline-offset: -3px;
}

.k2cts-gallery-filter__item img {
	display: block;
	width: 100%;
	height: 19.5rem;
	object-fit: cover;
	transition: transform 250ms ease, opacity 250ms ease;
}

.k2cts-gallery-filter__item--tall img {
	height: 40.25rem;
}

.k2cts-gallery-filter__item--wide img {
	height: 19.5rem;
}

.k2cts-gallery-filter__item:hover img {
	transform: scale(1.025);
	opacity: 0.78;
}

.k2cts-gallery-filter__caption {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 1;
	max-width: 100%;
	margin: 0;
	padding: 0.55rem 0.75rem;
	background: rgba(28, 30, 24, 0.9);
	color: rgba(240, 232, 213, 0.86);
	font-family: Barlow, sans-serif;
	font-size: 0.78rem;
	line-height: 1.35;
	pointer-events: none;
}

.k2cts-gallery-filter__empty {
	margin: 1.5rem 0 0;
	padding: 2rem;
	border: 1px dashed #8b6914;
	color: #76590e;
	font-family: Barlow, sans-serif;
	text-align: center;
}

/* Ta reguła obejmuje starszy blok "Szkolenia w terenie" na stronie głównej.
 * Po aktualizacji jego kafelki dostają obsługę klawiatury i pełny podgląd. */
.k2cts-gallery .k2cts-gallery-item[data-k2cts-full] {
	cursor: zoom-in;
}

.k2cts-gallery .k2cts-gallery-item[data-k2cts-full]:focus-visible {
	outline: 3px solid #b48a1b;
	outline-offset: -3px;
}

/* Pełny podgląd: obraz zachowuje swoje naturalne wymiary i proporcje.
 * Jeżeli jest większy od ekranu, użytkownik przewija podgląd zamiast oglądać
 * automatycznie przycięte albo dopasowane zdjęcie. */
html.k2cts-gallery-lightbox-open {
	overflow: hidden;
}

.k2cts-gallery-lightbox {
	position: fixed;
	z-index: 100000;
	display: none;
	inset: 0;
}

.k2cts-gallery-lightbox.is-open {
	display: block;
}

.k2cts-gallery-lightbox__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(7, 9, 7, 0.94);
	cursor: zoom-out;
}

.k2cts-gallery-lightbox__viewport {
	position: relative;
	z-index: 1;
	display: block;
	width: 100vw;
	height: 100vh;
	padding: 4.5rem 2.25rem 2.25rem;
	overflow: auto;
	text-align: center;
}

.k2cts-gallery-lightbox__image-wrap {
	display: inline-block;
	min-width: min-content;
	vertical-align: top;
	background: #10110d;
	box-shadow: 0 1rem 4rem rgba(0, 0, 0, 0.5);
}

.k2cts-gallery-lightbox__image {
	display: block;
	width: auto !important;
	max-width: none !important;
	height: auto !important;
	max-height: none !important;
	margin: 0 auto;
	object-fit: initial !important;
	transform: none !important;
	opacity: 1 !important;
}

.k2cts-gallery-lightbox__caption {
	display: inline-block;
	max-width: min(100%, 62rem);
	margin: 0;
	padding: 0.75rem 1rem;
	background: #171811;
	color: #f0e8d5;
	font-family: Barlow, sans-serif;
	font-size: 0.9rem;
	line-height: 1.4;
	text-align: left;
}

.k2cts-gallery-lightbox__caption[hidden] {
	display: none;
}

.k2cts-gallery-lightbox__close {
	position: fixed;
	top: 1rem;
	right: 1rem;
	z-index: 2;
	display: inline-flex;
	width: 2.75rem;
	height: 2.75rem;
	padding: 0;
	align-items: center;
	justify-content: center;
	border: 1px solid rgba(240, 232, 213, 0.65);
	border-radius: 0;
	background: #171811;
	color: #f0e8d5;
	font-family: Arial, sans-serif;
	font-size: 2rem;
	font-weight: 300;
	line-height: 1;
	cursor: pointer;
}

.k2cts-gallery-lightbox__close:hover,
.k2cts-gallery-lightbox__close:focus-visible {
	border-color: #b48a1b;
	background: #b48a1b;
	color: #171811;
}

@media (max-width: 63.99rem) {
	.k2cts-gallery-filter__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.k2cts-gallery-filter__item--wide {
		grid-column: span 1;
	}
}

@media (max-width: 47.99rem) {
	.k2cts-gallery-filter__inner {
		width: calc(100% - 3rem);
	}

	.k2cts-gallery-filter__tags {
		gap: 0.5rem !important;
	}

	.k2cts-gallery-filter__button {
		min-height: 2.2rem;
		padding: 0.45rem 0.65rem;
		font-size: 0.57rem;
	}

	.k2cts-gallery-filter__grid {
		grid-template-columns: 1fr;
	}

	.k2cts-gallery-filter__item--tall,
	.k2cts-gallery-filter__item--wide {
		grid-column: auto;
		grid-row: auto;
	}

	.k2cts-gallery-filter__item img,
	.k2cts-gallery-filter__item--tall img,
	.k2cts-gallery-filter__item--wide img {
		height: 20rem;
	}

	.k2cts-gallery-lightbox__viewport {
		padding: 4.25rem 1rem 1rem;
		text-align: left;
	}

	.k2cts-gallery-lightbox__image-wrap {
		text-align: left;
	}

	.k2cts-gallery-lightbox__close {
		top: 0.65rem;
		right: 0.65rem;
	}
}
