/* Portfolio page: project grid and gallery lightbox */

.pf-filters {
	margin-bottom: 40px;
}

.pf-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	grid-auto-flow: dense;
	gap: 28px;
}

/* Card */
.pf-card {
	display: flex;
	flex-direction: column;
	min-width: 0;
	background: #111517;
	border: 1px solid rgba(255, 255, 255, 0.07);
	border-radius: 6px;
	overflow: hidden;
	text-decoration: none;
	transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.pf-card[hidden] {
	display: none;
}

.pf-card:hover,
.pf-card:focus-visible {
	transform: translateY(-5px);
	border-color: #ef0d33;
	box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.pf-card:focus-visible {
	outline: 2px solid #ef0d33;
	outline-offset: 3px;
}

.pf-frame {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-height: 0;
}

.pf-chrome {
	display: flex;
	flex: none;
	gap: 6px;
	padding: 9px 12px;
	background: #232f34;
}

.pf-chrome i {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.22);
}

.pf-chrome i:first-child {
	background: #ef0d33;
}

/* Image window */
.pf-view {
	position: relative;
	display: block;
	flex: 1 1 auto;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	container-type: size;
	background: #0b0e10;
}

.pf-shot {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: top center;
	transition: transform 0.7s ease;
}

.pf-view.is-tall .pf-shot {
	height: auto;
}

/* Wider than the frame: show the whole image over a blurred copy, so logos are not cut off */
.pf-view.is-wide .pf-shot {
	position: relative;
	object-fit: contain;
	object-position: center;
}

.pf-shot-backdrop {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	filter: blur(18px) brightness(0.55);
	transform: scale(1.15);
}

.pf-view.is-contain {
	background: #f5f5f5;
}

.pf-view.is-contain .pf-shot {
	object-fit: contain;
	object-position: center;
}

/* Phones */
.pf-view--stage {
	background:
		radial-gradient(circle at 50% 110%, rgba(239, 13, 51, 0.5), transparent 62%),
		linear-gradient(160deg, #1f2f35, #0b0e10);
}

.pf-phone {
	position: absolute;
	top: 9%;
	left: 50%;
	height: 112%;
	aspect-ratio: 9 / 16;
	border: 4px solid #05070a;
	border-radius: 16px;
	overflow: hidden;
	background: #05070a;
	box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55);
	transform: translateX(-50%);
	transition: transform 0.5s ease;
}

.pf-phone img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: top center;
}

.pf-phone--0 {
	z-index: 2;
}

.pf-phone--1 {
	z-index: 1;
	top: 16%;
	transform: translateX(-120%) rotate(-6deg);
}

.pf-phone--2 {
	z-index: 1;
	top: 16%;
	transform: translateX(20%) rotate(6deg);
}

/* Caption */
.pf-caption {
	display: flex;
	flex: none;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 16px 18px;
}

.pf-caption-text {
	min-width: 0;
}

.pf-title {
	display: block;
	color: #fff;
	font-family: 'Oswald', sans-serif;
	font-size: 18px;
	font-weight: 400;
	line-height: 1.3;
	letter-spacing: 0.3px;
}

.pf-sector {
	display: block;
	margin-top: 3px;
	color: #9aa5a9;
	font-family: 'Open Sans', sans-serif;
	font-size: 13px;
	line-height: 1.4;
}

.pf-count {
	flex: none;
	padding: 3px 9px;
	border: 1px solid rgba(255, 255, 255, 0.18);
	border-radius: 20px;
	color: #d6dbdd;
	font-family: 'Open Sans', sans-serif;
	font-size: 11px;
	white-space: nowrap;
}

.pf-card--featured .pf-title {
	font-size: 24px;
}

/* Below the grid */
.pf-status {
	margin-top: 36px;
	color: #9aa5a9;
	font-size: 14px;
	text-align: center;
}

.pf-actions {
	margin-top: 20px;
	text-align: center;
}

.pf-actions [hidden] {
	display: none;
}

.pf-more {
	border: 0;
	background: transparent;
	outline: 0;
}

/* Lightbox. The dialog sits above the theme's custom cursor, so it uses the normal one. */
.pf-lightbox {
	width: 100vw;
	max-width: none;
	height: 100vh;
	height: 100dvh;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: rgba(8, 11, 13, 0.97);
	color: #fff;
}

.pf-lightbox[open] {
	display: flex;
	flex-direction: column;
}

.pf-lightbox,
.pf-lightbox * {
	cursor: auto !important;
}

.pf-lightbox button {
	cursor: pointer !important;
}

html.pf-locked {
	overflow: hidden;
}

.pf-lb-bar {
	display: flex;
	flex: none;
	align-items: center;
	gap: 20px;
	padding: 14px 22px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.pf-lb-bar > div {
	flex: 1 1 auto;
	min-width: 0;
}

.pf-lb-title {
	margin: 0;
	color: #fff;
	font-family: 'Oswald', sans-serif;
	font-size: 22px;
	font-weight: 400;
	line-height: 1.3;
}

.pf-lb-sector {
	margin: 0;
	color: #9aa5a9;
	font-size: 13px;
	line-height: 1.4;
}

.pf-lb-counter {
	flex: none;
	color: #d6dbdd;
	font-size: 14px;
}

.pf-lb-btn {
	flex: none;
	width: 46px;
	height: 46px;
	border: 1px solid rgba(255, 255, 255, 0.25);
	border-radius: 50%;
	background: rgba(17, 21, 23, 0.85);
	color: #fff;
	font-size: 26px;
	line-height: 1;
	transition: background 0.2s ease, border-color 0.2s ease;
}

.pf-lb-btn:hover,
.pf-lb-btn:focus-visible {
	border-color: #ef0d33;
	background: #ef0d33;
	outline: 0;
}

.pf-lb-btn[hidden] {
	display: none;
}

.pf-lb-stage {
	position: relative;
	display: flex;
	flex: 1 1 auto;
	min-height: 0;
}

.pf-lb-scroll {
	display: flex;
	flex: 1 1 auto;
	min-width: 0;
	padding: 22px 84px;
	overflow-y: auto;
	outline: 0;
}

.pf-lb-scroll img {
	display: block;
	max-width: min(100%, 1200px);
	height: auto;
	margin: auto;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
	transition: opacity 0.25s ease;
}

.pf-lb-scroll img.is-loading {
	opacity: 0.25;
}

.pf-lb-prev,
.pf-lb-next {
	position: absolute;
	z-index: 1;
	top: 50%;
	transform: translateY(-50%);
}

.pf-lb-prev {
	left: 20px;
}

.pf-lb-next {
	right: 20px;
}

.pf-lb-thumbs {
	display: flex;
	flex: none;
	gap: 8px;
	justify-content: safe center;
	padding: 12px 22px;
	overflow-x: auto;
	border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.pf-lb-thumbs:empty {
	display: none;
}

.pf-lb-thumb {
	flex: none;
	width: 84px;
	height: 56px;
	padding: 0;
	border: 2px solid transparent;
	border-radius: 3px;
	overflow: hidden;
	background: #111517;
	opacity: 0.55;
	transition: opacity 0.2s ease, border-color 0.2s ease;
}

.pf-lb-thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: top center;
}

.pf-lb-thumb:hover,
.pf-lb-thumb:focus-visible {
	opacity: 1;
	outline: 0;
}

.pf-lb-thumb[aria-current="true"] {
	border-color: #ef0d33;
	opacity: 1;
}

/* Motion for pointer devices only */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
	.pf-card:hover .pf-view:not(.is-tall):not(.is-contain) .pf-shot {
		transform: scale(1.05);
	}

	/* Long pages scroll inside the frame */
	.pf-card:hover .pf-view.is-tall .pf-shot {
		transform: translateY(calc(-100% + 100cqh));
		transition: transform var(--pf-scroll-time, 4s) ease-in-out 0.15s;
	}

	.pf-card:hover .pf-phone--1 {
		transform: translateX(-132%) rotate(-9deg);
	}

	.pf-card:hover .pf-phone--2 {
		transform: translateX(32%) rotate(9deg);
	}

	.pf-card:hover .pf-phone--0 {
		transform: translateX(-50%) translateY(-5%);
	}
}

@media (prefers-reduced-motion: reduce) {
	.pf-card,
	.pf-shot,
	.pf-phone {
		transition: none;
	}

	.pf-card:hover,
	.pf-card:focus-visible {
		transform: none;
	}
}

/* Large screens: double-size cards */
@media only screen and (min-width: 1000px) {
	.pf-card--featured {
		grid-column: span 2;
		grid-row: span 2;
	}

	.pf-card--featured.pf-card--right {
		grid-column: 2 / span 2;
	}
}

@media only screen and (max-width: 999px) {
	.pf-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 20px;
	}

	.pf-card--featured {
		grid-column: span 2;
	}
}

@media only screen and (max-width: 599px) {
	.pf-grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.pf-card--featured {
		grid-column: auto;
	}

	.pf-card--featured .pf-title {
		font-size: 18px;
	}

	.pf-lb-scroll {
		padding: 12px;
	}

	.pf-lb-prev,
	.pf-lb-next {
		top: auto;
		bottom: 12px;
		transform: none;
	}

	.pf-lb-prev {
		left: 12px;
	}

	.pf-lb-next {
		right: 12px;
	}

	.pf-lb-title {
		font-size: 18px;
	}
}
