/* Superuser Portfolio block. Uses the theme's colour tokens when present (block themes), plain fallbacks otherwise. */
.su-pf {
	--su-pf-card: var(--wp--preset--color--card, #fff);
	--su-pf-surface: var(--wp--preset--color--surface, #f4f4f5);
	--su-pf-text: var(--wp--preset--color--contrast, #111);
	--su-pf-muted: var(--wp--preset--color--muted, #555);
	--su-pf-accent: var(--wp--preset--color--accent, #c2410c);
	--su-pf-on-accent: var(--wp--preset--color--on-accent, #fff);
	--su-pf-line: var(--wp--preset--color--line, rgba(127, 127, 127, 0.25));
	--su-pf-radius: var(--su-radius-card, 10px);
}

/* Filters */
.su-pf-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0 0 1.5rem;
}
.su-pf-filters[hidden] {
	display: none;
}
.su-pf-filter {
	font: inherit;
	font-size: 0.9375rem;
	padding: 0.5rem 1rem;
	min-height: 44px;
	border-radius: 999px;
	border: 1px solid var(--su-pf-line);
	background: transparent;
	color: var(--su-pf-text);
	cursor: pointer;
}
.su-pf-filter:hover {
	border-color: var(--su-pf-accent);
}
.su-pf-filter[aria-pressed="true"] {
	background: var(--su-pf-accent);
	border-color: var(--su-pf-accent);
	color: var(--su-pf-on-accent);
	font-weight: 600;
}
.su-pf-n {
	opacity: 0.75;
	font-size: 0.85em;
}
.su-pf-filter[aria-pressed="true"] .su-pf-n {
	opacity: 1;
}

/* Grid + cards */
.su-pf-grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(20rem, 100%), 1fr));
	gap: clamp(1rem, 2.5vw, 2rem);
}
.su-pf-item {
	display: flex;
	flex-direction: column;
	margin: 0;
	background: var(--su-pf-card);
	border: 1px solid var(--su-pf-line);
	border-radius: var(--su-pf-radius);
	overflow: hidden;
}
.su-pf-item[hidden] {
	display: none;
}
.su-pf-body {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	padding: 1rem 1.5rem 1.5rem;
	flex: 1;
}
.su-pf-body > * {
	margin: 0;
}
.su-pf .su-pf-meta {
	font-size: 0.75rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--su-pf-accent);
	font-weight: 600;
}
.su-pf-title {
	font-size: 1.375rem;
	line-height: 1.2;
}
.su-pf-title a {
	color: var(--su-pf-text);
	text-decoration: none;
}
.su-pf-title a:hover,
.su-pf-title a:focus-visible {
	text-decoration: underline;
}
.su-pf .su-pf-result {
	align-self: flex-start;
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.4;
	padding: 0.35rem 0.65rem 0.35rem 0.8rem;
	border-radius: 6px;
	background: color-mix(in srgb, var(--su-pf-accent) 14%, transparent);
	box-shadow: inset 3px 0 0 var(--su-pf-accent);
	color: var(--su-pf-text);
	text-wrap: balance;
}
.su-pf .su-pf-services,
.su-pf .su-pf-text {
	font-size: 0.9375rem;
	color: var(--su-pf-muted);
}
.su-pf-links {
	margin-top: auto !important;
	padding-top: 0.5rem;
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1.25rem;
	font-size: 0.9375rem;
	font-weight: 600;
}
.su-pf-links a {
	text-decoration: none;
}
.su-pf-links a::after {
	content: " →";
}
.su-pf-links a[target="_blank"]::after {
	content: " ↗";
}

/* Media */
.su-pf-media {
	position: relative;
	background: var(--su-pf-surface);
	overflow: hidden;
}
.su-pf-media img,
.su-pf-media video {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.su-pf-browser {
	aspect-ratio: 16 / 11;
	padding-top: 1.5rem;
	border-bottom: 1px solid var(--su-pf-line);
}
.su-pf-dots {
	position: absolute;
	inset: 0 0 auto;
	height: 1.5rem;
	background:
		radial-gradient(circle at 0.9rem 0.75rem, #ff5f57 0.24rem, transparent 0.26rem),
		radial-gradient(circle at 1.6rem 0.75rem, #febc2e 0.24rem, transparent 0.26rem),
		radial-gradient(circle at 2.3rem 0.75rem, #28c840 0.24rem, transparent 0.26rem),
		var(--su-pf-card);
}
.su-pf-browser img {
	object-position: 50% 0;
}

/* Before / after */
.su-pf-ba {
	position: relative;
	height: 100%;
}
.su-pf-ba-before {
	position: absolute;
	inset: 0;
	clip-path: inset(0 calc(100% - var(--pos, 50%)) 0 0);
}
.su-pf-ba-before::after {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	left: var(--pos, 50%);
	width: 2px;
	background: #fff;
	box-shadow: 0 0 6px rgba(0, 0, 0, 0.5);
}
.su-pf-ba-tag {
	position: absolute;
	bottom: 0.5rem;
	font-size: 0.75rem;
	font-weight: 600;
	padding: 0.15rem 0.5rem;
	border-radius: 4px;
	background: rgba(0, 0, 0, 0.7);
	color: #fff;
}
.su-pf-ba-tag.is-before {
	left: 0.5rem;
}
.su-pf-ba-tag.is-after {
	right: 0.5rem;
}
.su-pf-ba-range {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: ew-resize;
}
.su-pf-ba-range[hidden] {
	display: none;
}
.su-pf-ba:has(.su-pf-ba-range:focus-visible) {
	outline: 3px solid var(--su-pf-accent);
	outline-offset: -3px;
}

/* Phone frame (ads) */
.su-pf-phone {
	padding: 1.25rem 1.25rem 0;
	display: flex;
	flex-direction: column;
}
.su-pf-phone-head,
.su-pf-phone-body {
	background: #fff;
	color: #111;
	width: min(100%, 20rem);
	margin-inline: auto;
}
.su-pf-phone-head {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.6rem 0.75rem;
	border-radius: 18px 18px 0 0;
	font-size: 0.8125rem;
	line-height: 1.2;
}
.su-pf-phone-head small {
	display: block;
	color: #555;
}
.su-pf-avatar {
	display: grid;
	place-items: center;
	width: 2rem;
	height: 2rem;
	border-radius: 50%;
	background: var(--su-pf-accent);
	color: var(--su-pf-on-accent);
	font-weight: 700;
	flex: none;
}
.su-pf-phone-body {
	aspect-ratio: 4 / 5;
	overflow: hidden;
}
.su-pf-fmt-square .su-pf-phone-body {
	aspect-ratio: 1;
}
.su-pf-fmt-story .su-pf-phone-body {
	aspect-ratio: 9 / 16;
}
.su-pf-carousel {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	height: 100%;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
}
.su-pf-carousel li {
	flex: 0 0 100%;
	scroll-snap-align: start;
}
.su-pf-carousel:focus-visible {
	outline: 3px solid var(--su-pf-accent);
	outline-offset: -3px;
}

/* Reels */
.su-pf-reel {
	aspect-ratio: 9 / 16;
	max-height: 36rem;
}
.su-pf-reel.is-landscape {
	aspect-ratio: 16 / 9;
}

/* Development copies only: items not cleared yet (hidden on the live site) */
.su-pf .su-pf-hold {
	font-size: 0.8125rem;
	padding: 0.35rem 0.6rem;
	border-radius: 6px;
	border: 1px dashed #d63638;
	color: var(--su-pf-text);
	background: color-mix(in srgb, #d63638 12%, transparent);
}
.su-pf-hold strong {
	color: #ff9a9a; /* dark backgrounds */
}
:root[data-theme="light"] .su-pf-hold strong {
	color: #b32d2e;
}
.su-pf-play {
	position: relative;
	display: block;
	height: 100%;
}
.su-pf-play-icon {
	position: absolute;
	inset: 50% auto auto 50%;
	transform: translate(-50%, -50%);
	display: grid;
	place-items: center;
	width: 4rem;
	height: 4rem;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.65);
	color: #fff;
	transition: transform 0.2s;
}
.su-pf-play:hover .su-pf-play-icon,
.su-pf-play:focus-visible .su-pf-play-icon {
	transform: translate(-50%, -50%) scale(1.1);
}
.su-pf-video {
	background: #000;
}

/* Design + lightbox */
.su-pf-design {
	aspect-ratio: 4 / 3;
}
.su-pf-zoom {
	display: block;
	height: 100%;
	cursor: zoom-in;
}
.su-pf-count-badge {
	position: absolute;
	right: 0.75rem;
	bottom: 0.75rem;
	padding: 0.15rem 0.55rem;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.7);
	color: #fff;
	font-size: 0.8125rem;
	font-weight: 600;
}
.su-pf-lightbox {
	width: min(96vw, 72rem);
	max-height: 92vh;
	padding: 3.5rem 1rem 1rem;
	border: 0;
	border-radius: 12px;
	background: #111;
	color: #fff;
}
.su-pf-lightbox::backdrop {
	background: rgba(0, 0, 0, 0.8);
}
.su-pf-lightbox-images {
	display: grid;
	gap: 1rem;
}
.su-pf-lightbox-images img {
	width: 100%;
	height: auto;
	border-radius: 6px;
}
.su-pf-close {
	position: absolute;
	top: 0.75rem;
	right: 0.75rem;
	min-height: 44px;
	padding: 0.5rem 1rem;
	font: inherit;
	border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, 0.4);
	background: transparent;
	color: #fff;
	cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
	.su-pf-play-icon {
		transition: none;
	}
}

/* Cards are grouped by picture height (one grid each): space between the groups = the grid gap,
   and a group with every card filtered out takes no space. */
.su-pf-grid + .su-pf-grid {
	margin-top: clamp(1rem, 2.5vw, 2rem);
}
.su-pf-grid:not(:has(> .su-pf-item:not([hidden]))) {
	display: none;
}

/* Carousel controls (added by view.js; without JavaScript the scrollbar stays). */
.su-pf .has-carousel {
	position: relative;
}
.su-pf .has-carousel .su-pf-carousel {
	scrollbar-width: none;
}
.su-pf .has-carousel .su-pf-carousel::-webkit-scrollbar {
	display: none;
}
.su-pf-arrow {
	position: absolute;
	top: 50%;
	translate: 0 -50%;
	width: 2.25rem;
	height: 2.25rem;
	display: grid;
	place-items: center;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgb(255 255 255 / 0.92);
	color: #15162d;
	box-shadow: 0 2px 8px rgb(0 0 0 / 0.3);
	cursor: pointer;
	transition: opacity 0.2s;
}
.su-pf-arrow.is-prev {
	left: 0.5rem;
}
.su-pf-arrow.is-next {
	right: 0.5rem;
}
.su-pf-arrow:disabled {
	opacity: 0;
	pointer-events: none;
}
.su-pf-arrow:focus-visible {
	outline: 3px solid var(--su-pf-accent);
	outline-offset: 2px;
}
.su-pf-count {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
	padding: 0.15rem 0.55rem;
	border-radius: 999px;
	background: rgb(0 0 0 / 0.7);
	color: #fff;
	font-size: 0.75rem;
	font-weight: 600;
	line-height: 1.5;
	font-variant-numeric: tabular-nums;
}
.su-pf-dots-nav {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0.6rem;
	display: flex;
	justify-content: center;
	gap: 0.35rem;
	pointer-events: none;
}
.su-pf-dot {
	width: 0.45rem;
	height: 0.45rem;
	border-radius: 50%;
	background: rgb(255 255 255 / 0.55);
	box-shadow: 0 0 0 1px rgb(0 0 0 / 0.25);
	transition: background 0.2s, transform 0.2s;
}
.su-pf-dot.is-on {
	background: #fff;
	transform: scale(1.25);
}
@media (prefers-reduced-motion: reduce) {
	.su-pf-arrow,
	.su-pf-dot {
		transition: none;
	}
}

/* Portrait reels: the whole 9:16 video (nothing cropped), centred on a dark backdrop at the card's full width. */
.su-pf .su-pf-reel:not(.is-landscape) {
	aspect-ratio: auto;
	height: 36rem;
	max-height: none;
	display: flex;
	justify-content: center;
	background: #0d0e1a;
}
.su-pf .su-pf-reel:not(.is-landscape) > .su-pf-play,
.su-pf .su-pf-reel:not(.is-landscape) > video {
	height: 100%;
	width: auto;
	max-width: 100%;
	aspect-ratio: 9 / 16;
}
