/* TPK — Yazılar galerisi: yan yana grid + yumuşak lightbox */

.tpk-yazi-gallery {
	width: 100%;
}

.tpk-yazi-gallery__grid {
	display: flex;
	flex-wrap: wrap;
	gap: 3px;
	width: 100%;
	align-items: flex-start;
}

.tpk-yazi-gallery__item {
	display: block;
	flex: 0 0 calc((100% - 5 * 3px) / 6);
	max-width: calc((100% - 5 * 3px) / 6);
	aspect-ratio: 1;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: #111111 !important;
	box-shadow: none !important;
	outline: none;
	cursor: pointer;
	overflow: hidden;
	line-height: 0;
	transition: opacity 0.25s ease;
}

.tpk-yazi-gallery__item:hover {
	opacity: 0.82;
}

.tpk-yazi-gallery__item:focus-visible {
	outline: 2px solid #111;
	outline-offset: 2px;
}

.tpk-yazi-gallery__item img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: 100%;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: #111111 !important;
	object-fit: cover;
	object-position: center center;
	box-shadow: none !important;
	clip-path: none !important;
	-webkit-mask-image: none !important;
	mask-image: none !important;
}

.tpk-yazi-gallery__lightbox {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	box-sizing: border-box;
	background: rgb(255 255 255 / 43%);
	backdrop-filter: blur(15px) saturate(170%);
	-webkit-backdrop-filter: blur(18px) saturate(170%);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition:
		opacity 0.42s ease,
		visibility 0.42s ease,
		backdrop-filter 0.42s ease,
		-webkit-backdrop-filter 0.42s ease,
		background-color 0.42s ease;
}

.tpk-yazi-gallery__lightbox[hidden] {
	display: flex !important;
}

.tpk-yazi-gallery__lightbox.is-open {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

.tpk-yazi-gallery__stage {
	position: absolute;
	inset: 72px 96px;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
	z-index: 1;
}

.tpk-yazi-gallery__slide {
	display: block;
	max-width: 100%;
	max-height: calc(100vh - 120px);
	width: auto;
	height: auto;
	object-fit: contain;
	user-select: none;
	-webkit-user-drag: none;
	opacity: 0;
	transform: scale(0.96);
	transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.tpk-yazi-gallery__lightbox.is-open .tpk-yazi-gallery__slide {
	opacity: 1;
	transform: scale(1);
}

.tpk-yazi-gallery__close {
	position: fixed;
	top: 24px;
	right: 28px;
	z-index: 1000002;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	color: #111111 !important;
	font-size: 56px;
	font-weight: 300;
	line-height: 1;
	cursor: pointer;
	opacity: 0.9;
	transition: opacity 0.2s ease;
	-webkit-appearance: none;
	appearance: none;
}

.tpk-yazi-gallery__close span {
	display: block;
	font-size: 56px;
	line-height: 1;
}

.tpk-yazi-gallery__close:hover {
	opacity: 1;
}

.tpk-yazi-gallery__nav {
	position: fixed;
	top: 50%;
	z-index: 1000002;
	display: flex !important;
	align-items: center;
	justify-content: center;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	color: #111111 !important;
	cursor: pointer !important;
	transform: translateY(-50%);
	opacity: 1 !important;
	visibility: visible !important;
	transition: opacity 0.2s ease;
	-webkit-appearance: none;
	appearance: none;
}

.tpk-yazi-gallery__nav-icon {
	display: block;
	font-size: 56px;
	font-weight: 300;
	line-height: 1;
	pointer-events: none;
}

.tpk-yazi-gallery__nav:hover,
.tpk-yazi-gallery__close:hover {
	opacity: 0.65;
}

.tpk-yazi-gallery__nav.is-hidden {
	opacity: 0 !important;
	visibility: hidden !important;
	pointer-events: none !important;
}

.tpk-yazi-gallery__nav--prev {
	left: 28px;
}

.tpk-yazi-gallery__nav--next {
	right: 28px;
}

.tpk-yazi-gallery__counter {
	position: fixed;
	bottom: 24px;
	left: 50%;
	z-index: 1000002;
	transform: translateX(-50%);
	color: #666666;
	font-size: 14px;
	letter-spacing: 0.04em;
}

body.tpk-yazi-gallery-open {
	overflow: hidden;
}

@media (max-width: 1200px) {
	.tpk-yazi-gallery__item {
		flex-basis: calc((100% - 3 * 3px) / 4);
		max-width: calc((100% - 3 * 3px) / 4);
	}
}

@media (max-width: 768px) {
	.tpk-yazi-gallery__grid {
		gap: 3px;
	}

	.tpk-yazi-gallery__item {
		flex-basis: calc((100% - 2 * 3px) / 3);
		max-width: calc((100% - 2 * 3px) / 3);
	}

	.tpk-yazi-gallery__stage {
		inset: 64px 56px;
	}
}

@media (max-width: 540px) {
	.tpk-yazi-gallery__item {
		flex-basis: calc(50% - 2px);
		max-width: calc(50% - 2px);
	}

	.tpk-yazi-gallery__stage {
		inset: 56px 12px;
	}

	.tpk-yazi-gallery__nav--prev {
		left: 10px;
	}

	.tpk-yazi-gallery__nav--next {
		right: 10px;
	}

	.tpk-yazi-gallery__nav-icon {
		font-size: 44px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.tpk-yazi-gallery__item,
	.tpk-yazi-gallery__lightbox,
	.tpk-yazi-gallery__slide,
	.tpk-yazi-gallery__close,
	.tpk-yazi-gallery__nav {
		transition: none;
	}

	.tpk-yazi-gallery__slide {
		transform: none;
	}
}
