/* =============================================================================
   Portfolio Page — assets/css/portfolio.css
   Loaded only on the Portfolio template.
   ============================================================================= */

/* ── Dark page — scoped to main content only so footer styles are unaffected ── */
.portfolio-wrap {
	background: #0a0a0a;
	color: #ffffff;
	padding: 0;
}

/* =============================================================================
   Page header
   ============================================================================= */
.port-page-header {
	padding: 48px 0 32px;
}

.port-page-title {
	font-family: 'Darker Grotesque', sans-serif;
	font-size: var(--type-h1-size);
	font-weight: var(--type-h1-weight);
	letter-spacing: var(--type-h1-ls);
	line-height: var(--type-h1-lh);
	color: #ffffff;
	margin: 0 0 24px;
}

.port-page-sub {
	font-size: 16px;
	color: rgba(255, 255, 255, 0.4);
	margin: 0;
	line-height: 1.5;
}

/* =============================================================================
   Sticky filter bar
   ============================================================================= */
.port-filter-wrap {
	position: sticky;
	top: 72px;
	background: rgba(10, 10, 10, 0.92);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border-bottom: 1px solid rgba(255, 255, 255, 0.06);
	padding: 16px 0;
	z-index: 100;
	transition: box-shadow 0.2s;
}

.port-filter-wrap.scrolled {
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.port-filter-bar {
	display: flex;
	align-items: center;
	gap: 8px;
}

/* ── Pills ── */
.port-pill {
	background: transparent;
	border: 1px solid rgba(255, 255, 255, 0.15);
	color: rgba(255, 255, 255, 0.5);
	padding: 8px 20px;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	white-space: nowrap;
	transition: border-color 0.2s, color 0.2s, background 0.2s;
	font-family: inherit;
	line-height: 1;
	min-height: 44px;
	display: inline-flex;
	align-items: center;
}

.port-pill:hover {
	border-color: rgba(255, 255, 255, 0.35);
	color: #ffffff;
}

.port-pill.is-active {
	background: #c8f135;
	border-color: #c8f135;
	color: #1a1a1a;
	font-weight: 600;
}

/* =============================================================================
   Unified card grid
   ============================================================================= */
.port-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 2px;
	padding-top: 24px;
	padding-bottom: 80px;
}

@media (max-width: 900px) {
	.port-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 540px) {
	.port-grid { grid-template-columns: repeat(2, 1fr); gap: 1px; }
}

/* =============================================================================
   Card — universal base
   ============================================================================= */
.port-card {
	position: relative;
	overflow: hidden;
	border-radius: 0;
	cursor: pointer;
	background: #111111;
	display: block;
	text-decoration: none;
	-webkit-tap-highlight-color: transparent;
}

/* ── Placeholder (shown until real image assets land) ── */
.port-placeholder {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 13px;
	font-weight: 500;
	color: rgba(255, 255, 255, 0.25);
	text-align: center;
	padding: 16px;
	transition: transform 0.4s ease;
	will-change: transform;
}

.port-card:hover .port-placeholder {
	transform: scale(1.03);
}

/* Aspect ratios per type — all uniform 4/3 */
.port-placeholder {
	aspect-ratio: 4 / 3;
}

/* Trade background colours */
.port-placeholder[data-trade="roofing"]     { background: #2a1208; }
.port-placeholder[data-trade="plumbing"]    { background: #081830; }
.port-placeholder[data-trade="hvac"]        { background: #062020; }
.port-placeholder[data-trade="electrical"]  { background: #1f1600; }
.port-placeholder[data-trade="landscaping"] { background: #061a08; }

/* Platform colours */
.port-placeholder[data-platform="facebook"]  { background: #060f2a; }
.port-placeholder[data-platform="google"]    { background: #2a0806; }
.port-placeholder[data-platform="instagram"] { background: #1e0616; }

/* =============================================================================
   Hover overlay
   ============================================================================= */
.port-card-overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(
		to top,
		rgba(0, 0, 0, 0.85) 0%,
		rgba(0, 0, 0, 0.2)  50%,
		transparent         100%
	);
	opacity: 0;
	transition: opacity 0.3s ease;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	padding: 20px;
	pointer-events: none;
}

.port-card:hover .port-card-overlay,
.port-card:focus-visible .port-card-overlay {
	opacity: 1;
}

.port-overlay-info {
	display: flex;
	flex-direction: column;
}

.port-card-type {
	font-size: 10px;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	color: #c8f135;
	margin-bottom: 6px;
}

.port-card-name {
	font-family: 'Darker Grotesque', sans-serif;
	font-size: 15px;
	font-weight: 900;
	color: #ffffff;
	line-height: 1.3;
}

.port-card-meta {
	font-size: 12px;
	color: rgba(255, 255, 255, 0.5);
	margin-top: 4px;
}

/* External link icon — websites + landing pages */
.port-ext-link-icon {
	position: absolute;
	top: 16px;
	right: 16px;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.15);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	display: flex;
	align-items: center;
	justify-content: center;
	color: #ffffff;
	opacity: 0;
	transition: opacity 0.3s;
	pointer-events: none;
}

.port-card:hover .port-ext-link-icon,
.port-card:focus-visible .port-ext-link-icon {
	opacity: 1;
}

/* =============================================================================
   Video cards
   ============================================================================= */

/* Play button — always visible */
.port-play-btn {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.15);
	border: 1px solid rgba(255, 255, 255, 0.25);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	display: flex;
	align-items: center;
	justify-content: center;
	color: #ffffff;
	font-size: 16px;
	transition: background 0.2s, transform 0.2s, color 0.2s;
	pointer-events: none;
	z-index: 2;
	will-change: transform;
}

.port-card--video:hover .port-play-btn {
	background: rgba(200, 241, 53, 0.9);
	color: #1a1a1a;
	transform: translate(-50%, -50%) scale(1.08);
}

/* Duration badge — always visible */
.port-dur-badge {
	position: absolute;
	bottom: 12px;
	right: 12px;
	background: #c8f135;
	color: #1a1a1a;
	font-size: 11px;
	font-weight: 700;
	padding: 3px 9px;
	border-radius: 4px;
	pointer-events: none;
	z-index: 2;
}

/* =============================================================================
   Social cards
   ============================================================================= */

/* Trade badge — always visible */
.port-trade-badge {
	position: absolute;
	top: 10px;
	left: 10px;
	background: rgba(0, 0, 0, 0.5);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	color: #ffffff;
	font-size: 10px;
	font-weight: 500;
	padding: 4px 10px;
	border-radius: 999px;
	pointer-events: none;
	z-index: 2;
}

/* =============================================================================
   Empty state
   ============================================================================= */
.port-empty-state {
	grid-column: 1 / -1;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	margin: 80px auto;
	text-align: center;
}

.port-empty-state:not([hidden]) {
	display: flex;
}

.port-empty-icon {
	display: block;
	font-size: 48px;
	line-height: 1;
	color: rgba(255, 255, 255, 0.15);
	margin-bottom: 16px;
}

.port-empty-state p {
	font-size: 15px;
	color: rgba(255, 255, 255, 0.3);
	margin: 0;
}

/* =============================================================================
   JS filtering
   ============================================================================= */
[data-hidden="true"] {
	display: none !important;
}

/* =============================================================================
   Video lightbox
   ============================================================================= */
.lightbox {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.92);
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 9999;
}

.lightbox.is-open {
	display: flex;
}

.lightbox-inner {
	width: 90%;
	max-width: 880px;
	aspect-ratio: 16 / 9;
	position: relative;
}

.lightbox-inner iframe {
	width: 100%;
	height: 100%;
	border: none;
}

.lightbox-close {
	position: absolute;
	top: -44px;
	right: 0;
	color: rgba(255, 255, 255, 0.6);
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	background: none;
	border: none;
	padding: 0;
	transition: color 0.15s;
}

.lightbox-close:hover {
	color: #ffffff;
}

/* =============================================================================
   Image lightbox (social + ads)
   ============================================================================= */
.port-img-lightbox {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.92);
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 9999;
}

.port-img-lightbox.is-open {
	display: flex;
}

.port-img-lb-inner {
	position: relative;
	max-width: min(90vw, 600px);
	max-height: 90vh;
}

.port-img-lb-inner img {
	max-width: 100%;
	max-height: 90vh;
	object-fit: contain;
	display: block;
	border-radius: 4px;
}

/* Card thumbnails */
.port-card-thumb {
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	display: block;
	transition: transform 0.4s ease;
}

.port-card:hover .port-card-thumb {
	transform: scale(1.03);
}


/* Image lightbox nav arrows */
.port-img-lb-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(0, 0, 0, 0.5);
	color: #fff;
	border: none;
	border-radius: 4px;
	width: 40px;
	height: 56px;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	transition: background 0.15s;
	z-index: 1;
}

.port-img-lb-nav:hover {
	background: rgba(0, 0, 0, 0.8);
}

#port-img-lb-prev { left: -52px; }
#port-img-lb-next { right: -52px; }

@media (max-width: 767px) {
	#port-img-lb-prev { left: 8px; }
	#port-img-lb-next { right: 8px; }

	.port-img-lb-nav {
		background: rgba(0, 0, 0, 0.72);
		color: #fff;
		opacity: 0.9;
	}
}

/* Gallery footer: dots + counter */
.port-img-lb-footer {
	position: absolute;
	bottom: -44px;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	white-space: nowrap;
}

.port-img-lb-dots {
	display: flex;
	gap: 6px;
}

.port-img-lb-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.35);
	border: none;
	padding: 0;
	cursor: pointer;
	transition: background 0.2s;
}

.port-img-lb-dot.is-active {
	background: #fff;
}

.port-img-lb-counter {
	color: rgba(255, 255, 255, 0.6);
	font-size: 12px;
}

/* Mobile hint — shown only on mobile */
.port-mobile-hint {
	display: none;
}

/* =============================================================================
   Mobile
   ============================================================================= */
@media (max-width: 767px) {

	/* Filter bar — 2-row grid: row 1 = 2 pills, row 2 = 3 pills */
	.port-filter-wrap {
		padding: 14px 0;
	}

	.port-filter-wrap .section-container {
		padding-left: 20px;
		padding-right: 20px;
	}

	.port-filter-bar {
		display: grid;
		grid-template-columns: repeat(6, 1fr);
		gap: 8px;
		overflow: visible;
		padding: 0;
	}

	/* Row 1: Websites spans cols 1–3, Landing Pages spans cols 4–6 */
	.port-pill:nth-child(1) { grid-column: 1 / 4; }
	.port-pill:nth-child(2) { grid-column: 4 / 7; }

	/* Row 2: Social, Videos, Ads each span 2 of 6 cols */
	.port-pill:nth-child(3) { grid-column: 1 / 3; }
	.port-pill:nth-child(4) { grid-column: 3 / 5; }
	.port-pill:nth-child(5) { grid-column: 5 / 7; }

	/* All pills same height and centred text */
	.port-pill {
		justify-content: center;
		text-align: center;
	}

	/* Hide text overlays on mobile — too small to be useful */
	.port-card-overlay {
		display: none;
	}

	/* Mobile hint text between filters and grid */
	.port-mobile-hint {
		display: block;
		text-align: center;
		font-size: 12px;
		color: rgba(255, 255, 255, 0.35);
		padding: 14px 20px 4px;
		margin: 0;
		letter-spacing: 0.02em;
	}

	/* Grid gap tighter */
	.port-grid {
		gap: 1px;
	}

}

@media (max-width: 540px) {

	/* port-page-title scales via global mobile clamp */

}
