/* ==========================================================================
   Project Tab Filter
   ========================================================================== */
.ptf {
	--ptf-h: var(--ptf-hd, 400px);
	--ptf-gap: 30px;
	--ptf-pad: 35px;
	position: relative;
	width: 100%;
}

/* ---------- Tabs ---------- */
.ptf .ptf-tabs {
	position: relative;
	z-index: 2;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0 45px;
	margin: 0;
	padding: 0;
}
.ptf .ptf-tab,
.ptf .ptf-tab:hover,
.ptf .ptf-tab:focus {
	position: relative;
	margin: 0;
	padding: 6px 0 20px;
	background: none;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	outline: none;
	color: #1a1a1a;
	font-family: inherit;
	font-size: 17px;
	font-weight: 400;
	line-height: 1.3;
	letter-spacing: 0;
	text-transform: none;
	cursor: pointer;
	transition: color .25s ease;
}
.ptf .ptf-tab:focus-visible {
	outline: 2px solid var(--ptf-accent);
	outline-offset: 4px;
}
.ptf .ptf-tab::after {
	content: "";
	position: absolute;
	left: 50%;
	bottom: -2px;
	width: 0;
	height: 3px;
	background: var(--ptf-accent);
	transform: translateX(-50%);
	transition: width .35s ease;
}
.ptf .ptf-tab:hover::after { width: 20px; }
.ptf .ptf-tab.is-active::after { width: 100%; }

.ptf .ptf-divider {
	position: relative;
	height: 1px;
	margin: 0 0 70px;
	background: #dcdcdc;
}
.ptf .ptf-divider::before,
.ptf .ptf-divider::after {
	content: "";
	position: absolute;
	top: -4px;
	width: 9px;
	height: 9px;
	background: var(--ptf-accent);
}
.ptf .ptf-divider::before { left: 0; }
.ptf .ptf-divider::after  { right: 0; }

/* ---------- Grid ---------- */
.ptf .ptf-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	grid-auto-flow: row;
	gap: var(--ptf-gap);
}
.ptf .ptf-small { grid-column: span 1; }
.ptf .ptf-wide  { grid-column: span 2; }
.ptf .ptf-full  { grid-column: 1 / -1; }

.ptf .ptf-item.is-hidden { display: none; }
.ptf .ptf-item.is-entering { animation: ptfIn .55s cubic-bezier(.2,.7,.3,1) both; }
@keyframes ptfIn {
	from { opacity: 0; transform: translateY(24px) scale(.98); }
	to   { opacity: 1; transform: none; }
}

/* ---------- Card ---------- */
.ptf .ptf-card {
	position: relative;
	height: var(--ptf-h);
	overflow: hidden;
	background: #222;
	color: #fff;
	isolation: isolate;
	touch-action: pan-y;
}

/* Slider */
.ptf .ptf-slider {
	position: absolute;
	inset: 0;
	z-index: 0;
	overflow: hidden;
}
.ptf .ptf-track {
	display: flex;
	height: 100%;
	transition: transform .6s cubic-bezier(.65,0,.35,1);
	will-change: transform;
}
.ptf .ptf-slide {
	flex: 0 0 100%;
	height: 100%;
}
.ptf .ptf-slide img {
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	object-fit: cover;
	transition: transform 1.2s cubic-bezier(.2,.7,.3,1);
}
.ptf .ptf-card:hover .ptf-slide img { transform: scale(1.05); }

/* Gradient (default) → full dark overlay (hover) */
.ptf .ptf-card::before,
.ptf .ptf-card::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	transition: opacity .45s ease;
}
.ptf .ptf-card::before {
	background: linear-gradient(to bottom, rgba(0,0,0,0) 45%, rgba(0,0,0,.78) 100%);
}
.ptf .ptf-card::after {
	background: rgba(0,0,0,.65);
	opacity: 0;
}
.ptf .ptf-card:hover::before,
.ptf .ptf-card:focus-within::before { opacity: 0; }
.ptf .ptf-card:hover::after,
.ptf .ptf-card:focus-within::after  { opacity: 1; }

/* Whole-card link */
.ptf .ptf-cover-link {
	position: absolute;
	inset: 0;
	z-index: 2;
}

/* Whole-card lightbox trigger */
.ptf .ptf-cover-open,
.ptf .ptf-cover-open:hover,
.ptf .ptf-cover-open:focus {
	position: absolute;
	inset: 0;
	z-index: 2;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	cursor: zoom-in;
}
.ptf .ptf-cover-open:focus-visible {
	outline: 3px solid var(--ptf-accent);
	outline-offset: -3px;
}

/* Text block: sits at the bottom, slides to the top on hover */
.ptf .ptf-holder {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	z-index: 3;
	padding: var(--ptf-pad) var(--ptf-pad) var(--ptf-pad);
	pointer-events: none;
	transform: translateY(calc(var(--ptf-h) - 100%));
	transition: transform .55s cubic-bezier(.65,0,.35,1), opacity .35s ease;
}
.ptf .is-multi ~ .ptf-holder { padding-bottom: calc(var(--ptf-pad) + 18px); }
.ptf .ptf-card:hover .ptf-holder,
.ptf .ptf-card:focus-within .ptf-holder {
	transform: translateY(0);
	padding-bottom: var(--ptf-pad);
}

.ptf .ptf-cats {
	margin: 0 0 10px;
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.7;
	letter-spacing: .12em;
	text-transform: uppercase;
}
.ptf .ptf-title {
	margin: 0;
	padding: 0;
	color: #fff;
	font-family: inherit;
	font-size: 22px;
	font-weight: 700;
	line-height: 1.35;
}
.ptf .ptf-desc {
	max-width: 480px;
	max-height: 0;
	margin: 0;
	overflow: hidden;
	opacity: 0;
	color: rgba(255,255,255,.82);
	font-size: 15px;
	line-height: 1.75;
	transition: max-height .55s cubic-bezier(.65,0,.35,1), opacity .3s ease, margin .55s ease;
}
.ptf .ptf-card:hover .ptf-desc,
.ptf .ptf-card:focus-within .ptf-desc {
	max-height: 200px;
	margin-top: 22px;
	opacity: 1;
	transition-delay: 0s, .15s, 0s;
}

/* Orange arrow button (bottom-right) */
.ptf .ptf-arrow {
	position: absolute;
	right: 0;
	bottom: 0;
	z-index: 4;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	background: var(--ptf-accent);
	color: #fff;
	opacity: 0;
	transform: translate(100%, 100%);
	transition: transform .45s cubic-bezier(.65,0,.35,1), opacity .3s ease;
}
.ptf .ptf-card:hover .ptf-arrow,
.ptf .ptf-card:focus-within .ptf-arrow {
	opacity: 1;
	transform: none;
}
.ptf .ptf-arrow svg { transition: transform .3s ease; }
.ptf .ptf-arrow:hover svg { transform: translate(2px, -2px); }

/* Slider nav */
.ptf .ptf-nav,
.ptf .ptf-nav:hover,
.ptf .ptf-nav:focus {
	position: absolute;
	top: 50%;
	z-index: 4;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	margin: -21px 0 0;
	padding: 0;
	border: 1px solid rgba(255,255,255,.55);
	border-radius: 50%;
	background: rgba(0,0,0,.25);
	color: #fff;
	box-shadow: none;
	cursor: pointer;
	opacity: 0;
	transition: opacity .3s ease, background .25s ease, border-color .25s ease;
}
.ptf .ptf-prev { left: 14px; }
.ptf .ptf-next { right: 14px; }
.ptf .ptf-card:hover .ptf-nav,
.ptf .ptf-card:focus-within .ptf-nav { opacity: 1; }
.ptf .ptf-nav:hover {
	background: var(--ptf-accent);
	border-color: var(--ptf-accent);
}

.ptf .ptf-dots {
	position: absolute;
	left: 50%;
	bottom: 16px;
	z-index: 4;
	display: flex;
	gap: 7px;
	transform: translateX(-50%);
}
.ptf .ptf-dot,
.ptf .ptf-dot:hover,
.ptf .ptf-dot:focus {
	width: 8px;
	height: 8px;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: rgba(255,255,255,.5);
	box-shadow: none;
	cursor: pointer;
	transition: width .3s ease, background .3s ease;
}
.ptf .ptf-dot.is-active {
	width: 22px;
	background: var(--ptf-accent);
}


/* ---------- Image view (after a slide) ----------
   Overlay, gradient, text and link button hide so the image is fully
   visible; arrows and dots stay. Moving over the image restores hover. */
.ptf .ptf-card.is-sliding::before,
.ptf .ptf-card.is-sliding::after,
.ptf .ptf-card.is-sliding:hover::before,
.ptf .ptf-card.is-sliding:hover::after,
.ptf .ptf-card.is-sliding:focus-within::before,
.ptf .ptf-card.is-sliding:focus-within::after { opacity: 0; }

.ptf .ptf-card.is-sliding .ptf-holder,
.ptf .ptf-card.is-sliding:hover .ptf-holder,
.ptf .ptf-card.is-sliding:focus-within .ptf-holder { opacity: 0; }

.ptf .ptf-card.is-sliding .ptf-arrow,
.ptf .ptf-card.is-sliding:hover .ptf-arrow,
.ptf .ptf-card.is-sliding:focus-within .ptf-arrow {
	opacity: 0;
	transform: translate(100%, 100%);
	pointer-events: none;
}
.ptf .ptf-card.is-sliding .ptf-slide img,
.ptf .ptf-card.is-sliding:hover .ptf-slide img { transform: none; }

.ptf .ptf-card.is-sliding .ptf-nav { opacity: 1; }
.ptf .ptf-card.is-sliding .ptf-nav:not(:hover) { background: rgba(0,0,0,.35); }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
	.ptf {
		--ptf-h: min(var(--ptf-hd, 400px), 360px);
		--ptf-gap: 20px;
		--ptf-pad: 26px;
	}
	.ptf .ptf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.ptf .ptf-divider { margin-bottom: 45px; }
	.ptf .ptf-tabs { gap: 0 30px; }
}

@media (max-width: 767px) {
	.ptf {
		--ptf-h: min(var(--ptf-hd, 400px), 320px);
		--ptf-gap: 16px;
		--ptf-pad: 22px;
	}
	.ptf .ptf-grid { grid-template-columns: minmax(0, 1fr); }
	.ptf .ptf-item { grid-column: 1 / -1 !important; }

	/* Tabs scroll sideways on phones instead of wrapping */
	.ptf .ptf-tabs {
		flex-wrap: nowrap;
		justify-content: flex-start;
		gap: 0 26px;
		overflow-x: auto;
		scrollbar-width: none;
		-webkit-overflow-scrolling: touch;
	}
	.ptf .ptf-tabs::-webkit-scrollbar { display: none; }
	.ptf .ptf-tab { flex: 0 0 auto; font-size: 15px; white-space: nowrap; padding-bottom: 14px; }
	.ptf .ptf-tab::after { bottom: 0; }
	.ptf .ptf-divider { margin-bottom: 30px; }

	.ptf .ptf-title { font-size: 19px; }
	.ptf .ptf-cats  { font-size: 11px; }
	.ptf .ptf-nav   { opacity: 1; width: 36px; height: 36px; margin-top: -18px; }
	.ptf .ptf-arrow { width: 52px; height: 52px; }
}

@media (hover: none) {
	.ptf .ptf-nav { opacity: 1; }
}

/* ==========================================================================
   Lightbox
   ========================================================================== */
html.ptf-lb-lock,
html.ptf-lb-lock body { overflow: hidden !important; }

.ptf-lb {
	--ptf-lb-bg: rgba(10, 10, 10, .96);
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: grid;
	grid-template-rows: auto minmax(0, 1fr) auto;
	background: var(--ptf-lb-bg);
	color: #fff;
	opacity: 0;
	transition: opacity .3s ease;
	-webkit-tap-highlight-color: transparent;
}
.ptf-lb[hidden] { display: none; }
.ptf-lb.is-open { opacity: 1; }
.ptf-lb:focus { outline: none; }

.ptf-lb-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 16px 0 24px;
	min-height: 64px;
}
.ptf-lb-counter {
	font-size: 14px;
	letter-spacing: .1em;
	opacity: .8;
}

/* Buttons */
.ptf-lb .ptf-lb-btn,
.ptf-lb .ptf-lb-btn:hover,
.ptf-lb .ptf-lb-btn:focus {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 50px;
	height: 50px;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 1px solid rgba(255,255,255,.35);
	border-radius: 50%;
	background: rgba(0,0,0,.35);
	color: #fff;
	box-shadow: none;
	cursor: pointer;
	transition: background .25s ease, border-color .25s ease, transform .25s ease;
}
.ptf-lb .ptf-lb-btn:hover {
	background: var(--ptf-accent, #f15a24);
	border-color: var(--ptf-accent, #f15a24);
}
.ptf-lb .ptf-lb-btn:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 3px;
}
.ptf-lb .ptf-lb-close { border-color: transparent; background: transparent; }
.ptf-lb .ptf-lb-close:hover { transform: rotate(90deg); }

.ptf-lb .ptf-lb-prev,
.ptf-lb .ptf-lb-next {
	position: absolute;
	top: 50%;
	z-index: 2;
	margin-top: -25px;
}
.ptf-lb .ptf-lb-prev { left: 20px; }
.ptf-lb .ptf-lb-next { right: 20px; }
/* Arrows appear only while hovering the image area (mouse devices).
   Touch devices and keyboard focus always show them. */
@media (hover: hover) and (pointer: fine) {
	.ptf-lb .ptf-lb-prev,
	.ptf-lb .ptf-lb-next {
		opacity: 0;
		visibility: hidden;
		transition: opacity .3s ease, visibility .3s ease, background .25s ease, border-color .25s ease, transform .3s ease;
	}
	.ptf-lb .ptf-lb-prev { transform: translateX(-10px); }
	.ptf-lb .ptf-lb-next { transform: translateX(10px); }

	.ptf-lb .ptf-lb-stage:hover ~ .ptf-lb-prev,
	.ptf-lb .ptf-lb-stage:hover ~ .ptf-lb-next,
	.ptf-lb .ptf-lb-prev:hover,
	.ptf-lb .ptf-lb-next:hover,
	.ptf-lb .ptf-lb-prev:focus-visible,
	.ptf-lb .ptf-lb-next:focus-visible,
	.ptf-lb.is-keyboard .ptf-lb-prev,
	.ptf-lb.is-keyboard .ptf-lb-next {
		opacity: 1;
		visibility: visible;
		transform: none;
	}
}

.ptf-lb.is-single .ptf-lb-prev,
.ptf-lb.is-single .ptf-lb-next,
.ptf-lb.is-single .ptf-lb-thumbs { display: none; }

/* Stage */
.ptf-lb-stage {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 0;
	padding: 10px 90px;
	touch-action: pan-y;
	user-select: none;
}
.ptf-lb .ptf-lb-img {
	display: block;
	width: auto !important;
	height: auto !important;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	box-shadow: 0 20px 60px rgba(0,0,0,.5);
	opacity: 0;
	transform: scale(.97);
	transition: opacity .35s ease, transform .35s ease;
	cursor: default;
}
.ptf-lb .ptf-lb-img.is-shown {
	opacity: 1;
	transform: none;
}

.ptf-lb-spinner {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 38px;
	height: 38px;
	margin: -19px 0 0 -19px;
	border: 3px solid rgba(255,255,255,.2);
	border-top-color: #fff;
	border-radius: 50%;
	opacity: 0;
	transition: opacity .2s ease;
	animation: ptfSpin .8s linear infinite;
	pointer-events: none;
}
.ptf-lb.is-loading .ptf-lb-spinner { opacity: 1; transition-delay: .15s; }
@keyframes ptfSpin { to { transform: rotate(360deg); } }

/* Bottom: caption + thumbnails */
.ptf-lb-bottom {
	padding: 14px 24px 20px;
	text-align: center;
}
.ptf-lb-caption {
	min-height: 1.5em;
	margin: 0 auto 12px;
	max-width: 900px;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.5;
}
.ptf-lb-thumbs {
	display: flex;
	gap: 8px;
	max-width: 100%;
	overflow-x: auto;
	padding: 4px;
	scrollbar-width: none;
}
.ptf-lb-thumbs::-webkit-scrollbar { display: none; }
.ptf-lb .ptf-lb-thumbs > .ptf-lb-thumb:first-child { margin-left: auto; }
.ptf-lb .ptf-lb-thumbs > .ptf-lb-thumb:last-child { margin-right: auto; }
.ptf-lb .ptf-lb-thumb,
.ptf-lb .ptf-lb-thumb:hover,
.ptf-lb .ptf-lb-thumb:focus {
	flex: 0 0 auto;
	width: 72px;
	height: 52px;
	min-height: 0;
	margin: 0;
	padding: 0;
	overflow: hidden;
	border: 2px solid transparent;
	border-radius: 0;
	background: #222;
	box-shadow: none;
	cursor: pointer;
	opacity: .5;
	transition: opacity .25s ease, border-color .25s ease;
}
.ptf-lb .ptf-lb-thumb:hover { opacity: .85; }
.ptf-lb .ptf-lb-thumb.is-active {
	opacity: 1;
	border-color: var(--ptf-accent, #f15a24);
}
.ptf-lb .ptf-lb-thumb:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.ptf-lb .ptf-lb-thumb img {
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	object-fit: cover;
	pointer-events: none;
}

@media (max-width: 767px) {
	.ptf-lb-top { padding: 8px 8px 0 16px; min-height: 56px; }
	.ptf-lb-stage { padding: 8px 0; }
	.ptf-lb .ptf-lb-prev,
	.ptf-lb .ptf-lb-next {
		top: auto;
		bottom: 96px;
		margin-top: 0;
		width: 42px;
		height: 42px;
	}
	.ptf-lb .ptf-lb-prev { left: 12px; }
	.ptf-lb .ptf-lb-next { right: 12px; }
	.ptf-lb-bottom { padding: 12px 64px 16px; }
	.ptf-lb-caption { font-size: 14px; }
	.ptf-lb .ptf-lb-thumb { width: 56px; height: 42px; }
}

@media (prefers-reduced-motion: reduce) {
	.ptf *,
	.ptf *::before,
	.ptf *::after,
	.ptf-lb,
	.ptf-lb * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
