/* ==========================================================================
   TPK Portfolyo — Frontend
   ========================================================================== */

:root {
	--tpk-white: #ffffff;
	--tpk-black: #111111;
	--tpk-gray: #f9faf9;
	--tpk-bar: #fafafa;
	--tpk-overlay: rgba(0, 0, 0, 0.3);
	--tpk-top-offset: 90px;
	--tpk-font: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	--tpk-slide-duration: 0.9s;
	--tpk-slide-ease: cubic-bezier(0.33, 1, 0.68, 1);
	--tpk-overlay-side: rgba(26, 37, 48, 0.48);
	--tpk-overlay-in: 0.7s;
	--tpk-overlay-out: 0.75s;
	--tpk-overlay-delay: 0.08s;
}

/* --------------------------------------------------------------------------
   Full-screen Gallery — hazanmimarlik referans
   -------------------------------------------------------------------------- */

.tpk-gallery {
	--tpk-bar-height: 56px;
	position: relative;
	display: grid;
	grid-template-rows: minmax(0, 1fr) auto;
	width: 100vw;
	max-width: 100vw;
	height: calc(100vh - var(--tpk-top-offset));
	height: calc(100dvh - var(--tpk-top-offset));
	margin-top: var(--tpk-top-offset);
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	overflow: hidden;
	background: #1a2530;
	font-family: var(--tpk-font);
	box-sizing: border-box;
	opacity: 0;
	transition: opacity 0.25s ease;
}

.tpk-gallery.is-ready {
	opacity: 1;
}

.tpk-gallery *,
.tpk-gallery *::before,
.tpk-gallery *::after {
	box-sizing: border-box;
}

/* Görsel alanı — değişken genişlik carousel (hazan referans) */
.tpk-gallery__viewport {
	position: relative;
	min-height: 0;
	width: 100%;
	overflow: hidden;
	cursor: grab;
	touch-action: pan-y;
	background: #1a2530;
}

.tpk-gallery__viewport.is-dragging {
	cursor: grabbing;
}

.tpk-gallery__track {
	display: flex;
	align-items: stretch;
	height: 100%;
	will-change: transform;
	backface-visibility: hidden;
	-webkit-backface-visibility: hidden;
}

.tpk-gallery__slide {
	flex: 0 0 auto;
	height: 100%;
	position: relative;
	overflow: hidden;
	cursor: pointer;
	background: #1a2530;
}

.tpk-gallery__photo {
	position: absolute;
	inset: 0;
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	user-select: none;
	-webkit-user-drag: none;
	pointer-events: none;
	transform: translateZ(0);
	backface-visibility: hidden;
	-webkit-backface-visibility: hidden;
	border-radius: 0 !important;
	object-fit: cover !important;
	object-position: center center !important;
}

.tpk-gallery__slide.is-side {
	cursor: pointer;
	z-index: 1;
}

.tpk-gallery__slide.is-side:hover .tpk-gallery__overlay {
	opacity: 0.72;
}

.tpk-gallery__slide.is-side .tpk-gallery__photo {
	object-fit: cover;
	object-position: center center;
}

.tpk-gallery__slide.is-active {
	z-index: 2;
	background: transparent;
}

.tpk-gallery__slide.is-active .tpk-gallery__photo {
	object-fit: cover;
	object-position: center center;
}

.tpk-gallery__overlay {
	position: absolute;
	inset: 0;
	z-index: 2;
	background: var(--tpk-overlay-side);
	pointer-events: none;
	opacity: 0;
	transition: opacity var(--tpk-overlay-out) var(--tpk-slide-ease);
	will-change: opacity;
}

.tpk-gallery__slide.is-side .tpk-gallery__overlay {
	opacity: 0.9;
	transition: opacity var(--tpk-overlay-in) var(--tpk-slide-ease) var(--tpk-overlay-delay);
}

.tpk-gallery__slide.is-active .tpk-gallery__overlay {
	opacity: 0;
	transition: opacity var(--tpk-overlay-out) var(--tpk-slide-ease) 0.05s;
}

.tpk-gallery__slide.is-side::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	background: rgba(26, 37, 48, 0.38);
	pointer-events: none;
}

/* Kayma bitene kadar aktif sınıfı değişmesin — overlay/object-fit ani sıçramasın */
.tpk-gallery.is-sliding .tpk-gallery__slide.is-active .tpk-gallery__photo {
	object-fit: cover;
}

.tpk-gallery.is-sliding .tpk-gallery__slide.is-side .tpk-gallery__overlay {
	transition: opacity var(--tpk-overlay-in) var(--tpk-slide-ease) 0.18s;
}

/* Alt bar — görsele yapışık */
.tpk-gallery__bar {
	position: relative;
	z-index: 30;
	display: grid !important;
	visibility: visible !important;
	opacity: 1 !important;
	grid-template-columns: 1fr auto auto;
	align-items: center;
	gap: 20px;
	min-height: var(--tpk-bar-height);
	padding: 10px 32px;
	background: var(--tpk-bar) !important;
	color: var(--tpk-black);
	border-top: none;
}

.tpk-gallery__bar-left {
	min-width: 0;
}

.tpk-gallery__meta {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 6px 14px;
}

/* Tema stillerini ez — Manrope 14px */
.tpk-gallery .tpk-gallery__title {
	margin: 0 !important;
	padding: 0 !important;
	font-family: 'Manrope', sans-serif !important;
	font-size: 14px !important;
	font-weight: 600 !important;
	letter-spacing: 0 !important;
	text-transform: none !important;
	line-height: 1.4 !important;
	color: var(--tpk-black) !important;
	background: none !important;
	border: none !important;
}

.tpk-gallery .tpk-gallery__category {
	font-family: 'Manrope', sans-serif !important;
	font-size: 14px !important;
	font-weight: 400 !important;
	letter-spacing: 0 !important;
	color: #666 !important;
	white-space: nowrap;
}

.tpk-gallery .tpk-gallery__category::before {
	content: "—";
	margin-right: 12px;
	opacity: 0.35;
}

.tpk-gallery__bar-center {
	display: flex;
	align-items: center;
	gap: 16px;
	flex-shrink: 0;
}

.tpk-gallery .tpk-gallery__back {
	font-family: 'Manrope', sans-serif !important;
	font-size: 14px !important;
	font-weight: 500 !important;
	letter-spacing: 0 !important;
	color: #444 !important;
	text-decoration: none !important;
	white-space: nowrap;
	transition: color 0.2s;
}

.tpk-gallery .tpk-gallery__back:hover {
	color: var(--tpk-black) !important;
}

.tpk-gallery__social {
	display: flex;
	align-items: stretch;
	background: var(--tpk-white);
	border: 1px solid #e5e5e5;
	overflow: hidden;
}

.tpk-gallery__social a {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	font-size: 12px;
	font-weight: 700;
	color: #888;
	text-decoration: none;
	transition: color 0.2s, background 0.2s;
}

.tpk-gallery__social a:hover {
	color: var(--tpk-black);
	background: var(--tpk-gray);
}

.tpk-gallery__bar-right {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-shrink: 0;
}

.tpk-gallery button.tpk-gallery__nav,
.tpk-gallery button.tpk-gallery__nav:hover,
.tpk-gallery button.tpk-gallery__nav:focus,
.tpk-gallery button.tpk-gallery__nav:active {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: auto !important;
	height: auto !important;
	min-width: 0 !important;
	min-height: 0 !important;
	padding: 0 2px !important;
	margin: 0 !important;
	border: none !important;
	border-radius: 0 !important;
	background: none !important;
	background-color: transparent !important;
	box-shadow: none !important;
	outline: none !important;
	color: #111 !important;
	font-family: 'Manrope', sans-serif !important;
	font-size: 20px !important;
	font-weight: 400 !important;
	line-height: 1 !important;
	cursor: pointer !important;
	-webkit-appearance: none !important;
	appearance: none !important;
}

.tpk-gallery button.tpk-gallery__nav:hover {
	opacity: 0.45;
}

.tpk-gallery__counter {
	display: flex;
	align-items: center;
	gap: 3px;
	font-family: 'Manrope', sans-serif;
	font-size: 14px;
	font-weight: 500;
	letter-spacing: 0;
	color: #555;
	min-width: 44px;
	justify-content: center;
}

/* --------------------------------------------------------------------------
   Projects Grid
   -------------------------------------------------------------------------- */

.tpk-projects {
	display: grid;
	grid-template-columns: repeat(var(--tpk-cols, 3), 1fr);
	gap: 24px;
	padding: 0;
}

.tpk-projects__item {
	background: var(--tpk-white);
}

.tpk-projects__link {
	display: block;
	text-decoration: none;
	color: inherit;
}

.tpk-projects__thumb {
	position: relative;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: var(--tpk-gray);
}

.tpk-projects__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.5s ease;
}

.tpk-projects__link:hover .tpk-projects__thumb img {
	transform: scale(1.04);
}

.tpk-projects__thumb--empty {
	background: var(--tpk-gray);
}

.tpk-projects__info {
	padding: 16px 0;
}

.tpk-projects__title {
	margin: 0;
	font-family: 'Manrope', sans-serif;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--tpk-black);
	line-height: 1.4;
}

.tpk-projects__cat {
	margin: 6px 0 0;
	font-size: 11px;
	color: #666;
	letter-spacing: 0.04em;
}

.tpk-projects-empty {
	padding: 40px;
	text-align: center;
	color: #666;
	background: var(--tpk-gray);
}

.tpk-categories {
	display: grid;
	grid-template-columns: repeat(var(--tpk-cols, 2), 1fr);
	gap: 24px;
	padding: 0;
}

.tpk-categories__link {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 0;
	text-decoration: none;
	color: inherit;
	border-bottom: 1px solid #e8e8e8;
	transition: opacity 0.2s ease;
}

.tpk-categories__link:hover {
	opacity: 0.55;
}

.tpk-categories__title {
	margin: 0;
	font-family: 'Manrope', sans-serif;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--tpk-black);
	line-height: 1.4;
}

.tpk-categories__arrow {
	font-size: 18px;
	line-height: 1;
	color: #888;
}

.tpk-project-title {
	margin: 0;
	font-size: inherit;
	font-weight: inherit;
}

.tpk-project-category {
	margin: 0;
	font-size: inherit;
}

.tpk-project-categories {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
}

.tpk-project-categories__item {
	display: inline-flex;
	align-items: center;
	white-space: nowrap;
}

.tpk-project-categories__item + .tpk-project-categories__item::before {
	content: '';
	display: inline-block;
	width: 1px;
	height: 0.85em;
	margin: 0 14px;
	background: currentColor;
	opacity: 0.35;
	vertical-align: middle;
}

.tpk-project-back {
	color: inherit;
	text-decoration: none;
}

.elementor-widget-tpk_project_gallery .elementor-widget-container {
	overflow: visible;
}

.elementor-widget-tpk_project_gallery .tpk-gallery__bar {
	display: grid !important;
	visibility: visible !important;
	opacity: 1 !important;
	background: var(--tpk-bar) !important;
}

.elementor-widget-tpk_project_gallery .tpk-gallery__bar-center,
.elementor-widget-tpk_project_gallery .tpk-gallery__bar-right {
	display: flex !important;
}

/* --------------------------------------------------------------------------
   Proje filtreleri — düz metin sidebar (buton yok)
   -------------------------------------------------------------------------- */

.tpk-filters,
.tpk-filters * {
	margin: 0 !important;
	padding: 0 !important;
	border: none !important;
	border-radius: 0 !important;
	background: transparent !important;
	background-color: transparent !important;
	box-shadow: none !important;
	outline: none !important;
	-webkit-appearance: none !important;
	appearance: none !important;
	font-family: 'HR Velsa', 'HR Velsan', var(--tpk-font) !important;
	color: #767777 !important;
	-webkit-text-fill-color: #767777 !important;
}

.tpk-filters {
	width: 100% !important;
}

.tpk-filters__search {
	display: flex !important;
	align-items: center !important;
	gap: 12px !important;
	width: 100% !important;
	margin: 0 0 28px !important;
	padding: 0 0 10px !important;
	border: none !important;
	border-bottom: 1px solid #d8d8d8 !important;
	border-radius: 0 !important;
	background: transparent !important;
}

.tpk-filters__search-input {
	display: block !important;
	flex: 1 1 auto !important;
	width: 100% !important;
	min-width: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	border: none !important;
	border-radius: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	outline: none !important;
	font-family: 'HR Velsa', 'HR Velsan', var(--tpk-font) !important;
	font-size: 16px !important;
	font-weight: 400 !important;
	line-height: 1.4 !important;
	color: #767777 !important;
	-webkit-text-fill-color: #767777 !important;
}

.tpk-filters__search-input::placeholder {
	color: #999 !important;
	-webkit-text-fill-color: #999 !important;
	opacity: 1 !important;
}

.tpk-filters__search-input:focus {
	outline: none !important;
	box-shadow: none !important;
}

.tpk-filters__search-submit {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	flex: 0 0 auto !important;
	width: auto !important;
	min-width: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	border: none !important;
	border-radius: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	font-family: 'HR Velsa', 'HR Velsan', var(--tpk-font) !important;
	font-size: 18px !important;
	font-weight: 300 !important;
	line-height: 1 !important;
	color: #767777 !important;
	-webkit-text-fill-color: #767777 !important;
	cursor: pointer !important;
	transition: opacity 0.15s ease !important;
}

.tpk-filters__search-submit:hover {
	opacity: 0.55 !important;
}

.tpk-filters__group {
	margin-bottom: 28px !important;
	padding: 0 !important;
}

.tpk-filters__head {
	display: flex !important;
	align-items: center !important;
	justify-content: space-between !important;
	width: 100% !important;
	font-size: 20px !important;
	font-weight: 400 !important;
	line-height: 1.3 !important;
	text-align: left !important;
	cursor: pointer !important;
	user-select: none !important;
}

.tpk-filters__label {
	flex: 1 1 auto !important;
	text-align: left !important;
}

.tpk-filters__toggle {
	flex: 0 0 auto !important;
	margin-left: 16px !important;
	font-size: 18px !important;
	font-weight: 300 !important;
	line-height: 1 !important;
	text-align: right !important;
}

.tpk-filters__body {
	display: block !important;
	padding-top: 10px !important;
}

.tpk-filters__body[hidden] {
	display: none !important;
}

.tpk-filters__option {
	display: block !important;
	width: 100% !important;
	padding: 4px 0 !important;
	font-size: 16px !important;
	font-weight: 400 !important;
	line-height: 1.4 !important;
	text-align: left !important;
	text-decoration: none !important;
	cursor: pointer !important;
	pointer-events: auto !important;
	position: relative !important;
	z-index: 2 !important;
	transition: opacity 0.15s ease !important;
}

.tpk-filters__option:hover {
	opacity: 0.55 !important;
}

.tpk-filters__option.is-selected,
.tpk-filters__option.is-active {
	display: block !important;
	width: 100% !important;
	font-size: 18px !important;
	font-weight: 500 !important;
	color: #2a2a2a !important;
	-webkit-text-fill-color: #2a2a2a !important;
	text-decoration: none !important;
	border: none !important;
	opacity: 1 !important;
}

.tpk-filters__option.is-selected:hover,
.tpk-filters__option.is-active:hover {
	opacity: 0.75 !important;
}

.tpk-filters__hidden,
.elementor-loop-container .e-loop-item.tpk-filters__hidden,
.elementor-widget-loop-grid .tpk-filters__hidden,
.elementor-widget-loop-carousel .tpk-filters__hidden {
	display: none !important;
	visibility: hidden !important;
	height: 0 !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	overflow: hidden !important;
	opacity: 0 !important;
	pointer-events: none !important;
}

@media (max-width: 767px) {
	.tpk-filters__head {
		font-size: 16px !important;
	}

	.tpk-filters__option {
		font-size: 14px !important;
	}

	.tpk-filters__option.is-selected,
	.tpk-filters__option.is-active {
		font-size: 15px !important;
	}
}

/* Kategori arşiv — loop grid yanıp sönmesin */
body.tax-tpk_project_category .elementor-location-archive .elementor-invisible,
body.tax-tpk_project_category .elementor-location-archive .animated-slow,
body.tax-tpk_project_category .elementor-location-archive .e-loop-item {
	visibility: visible !important;
	opacity: 1 !important;
	animation: none !important;
	transition: none !important;
}

body.tax-tpk_project_category .elementor-location-archive .elementor-widget-loop-grid,
body.tax-tpk_project_category .elementor-location-archive .elementor-loop-container {
	opacity: 1 !important;
	animation: none !important;
}

/* Archive şablonunda [tpk_projects] kısa kodunu gizle — Loop Grid tasarımı kullanılsın */
body.tax-tpk_project_category .elementor-location-archive .tpk-projects {
	display: none !important;
}

/* --------------------------------------------------------------------------
   Elementor Loop Grid — taşmayı önle, 3 sütun düzgün kırılsın
   -------------------------------------------------------------------------- */

.elementor-widget-loop-grid {
	width: 100% !important;
	max-width: 100% !important;
	min-width: 0 !important;
}

.elementor-widget-loop-grid .elementor-loop-container.elementor-grid {
	display: grid !important;
	width: 100% !important;
	max-width: 100% !important;
	min-width: 0 !important;
}

.elementor-widget-loop-grid.elementor-grid-3 .elementor-loop-container {
	grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.elementor-widget-loop-grid .e-loop-item {
	min-width: 0 !important;
	max-width: 100% !important;
	width: 100% !important;
}

.elementor-widget-loop-grid .e-loop-item .e-con,
.elementor-widget-loop-grid .e-loop-item .elementor-element {
	max-width: 100% !important;
	min-width: 0 !important;
}

.elementor-widget-loop-grid .e-loop-item .elementor-widget-heading,
.elementor-widget-loop-grid .e-loop-item .elementor-widget-heading .elementor-widget-container,
.elementor-widget-loop-grid .e-loop-item .elementor-widget__width-initial {
	width: 100% !important;
	max-width: 100% !important;
	min-width: 0 !important;
}

.elementor-widget-loop-grid .e-loop-item .elementor-heading-title {
	max-width: 100% !important;
	overflow-wrap: anywhere;
	word-break: break-word;
}

.elementor-widget-loop-grid .e-loop-item img {
	max-width: 100% !important;
}

@media (max-width: 1024px) {
	.elementor-widget-loop-grid.elementor-grid-tablet-2 .elementor-loop-container {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}
}

@media (max-width: 767px) {
	.elementor-widget-loop-grid.elementor-grid-mobile-1 .elementor-loop-container {
		grid-template-columns: minmax(0, 1fr) !important;
	}
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1024px) {
	:root {
		--tpk-top-offset: 80px;
	}

	/* Mobil / tablet galeri — tam ekran, eşit slayt, gri boşluk yok */
	.tpk-gallery.is-compact .tpk-gallery__viewport,
	.tpk-gallery.is-compact .tpk-gallery__slide {
		background: #1a2530;
	}

	.tpk-gallery.is-compact .tpk-gallery__slide.is-active .tpk-gallery__photo,
	.tpk-gallery.is-compact .tpk-gallery__slide.is-side .tpk-gallery__photo,
	.tpk-gallery.is-compact.is-sliding .tpk-gallery__slide.is-active .tpk-gallery__photo {
		object-fit: cover !important;
		object-position: center center !important;
		width: 100% !important;
		height: 100% !important;
	}

	.tpk-gallery__bar {
		grid-template-columns: 1fr;
		gap: 10px;
		padding: 10px 20px;
		min-height: auto;
	}

	/* Mobil/tablet alt bar — başlık üstte, kategori + sayaç yan yana, geri dön gizli */
	.tpk-gallery.is-compact .tpk-gallery__bar {
		display: grid;
		grid-template-columns: minmax(0, 1fr) auto auto auto;
		grid-template-rows: auto auto;
		align-items: center;
		gap: 6px 8px;
	}

	.tpk-gallery.is-compact .tpk-gallery__bar-left,
	.tpk-gallery.is-compact .tpk-gallery__meta {
		display: contents;
	}

	.tpk-gallery.is-compact .tpk-gallery__title {
		grid-column: 1 / -1;
		grid-row: 1;
		font-size: 17px !important;
		line-height: 1.35 !important;
	}

	.tpk-gallery.is-compact .tpk-gallery__category {
		grid-column: 1;
		grid-row: 2;
		min-width: 0;
		white-space: normal;
	}

	.tpk-gallery.is-compact .tpk-gallery__bar-center {
		display: none;
	}

	.tpk-gallery.is-compact .tpk-gallery__bar-right {
		display: contents;
	}

	.tpk-gallery.is-compact .tpk-gallery__counter {
		grid-column: 2;
		grid-row: 2;
		min-width: auto;
		flex-shrink: 0;
	}

	.tpk-gallery.is-compact .tpk-gallery__nav--prev {
		grid-column: 3;
		grid-row: 2;
	}

	.tpk-gallery.is-compact .tpk-gallery__nav--next {
		grid-column: 4;
		grid-row: 2;
	}

	.tpk-gallery__bar-center {
		flex-wrap: wrap;
	}

	.tpk-projects {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 600px) {
	:root {
		--tpk-top-offset: 70px;
	}

	.tpk-gallery.is-compact .tpk-gallery__title {
		font-size: 18px !important;
	}

	.tpk-projects {
		grid-template-columns: 1fr;
	}
}
