/**
 * Frontend Feed Styles
 *
 * @file           wp-content/plugins/project-portfolio/assets/css/frontend.css
 * @package        PPF
 * @description    Mobile-first glassmorphism UI with aligned panel headers, stable controls, visible filter text on hover, fixed-height slider viewport, and premium “card” styling (no buttons) inspired by the provided reference.
 *
 * @link           https://magidacreative.co.za
 * @version        1.0.0
 * @author         Magida Creative
 * @author URI     https://magidacreative.co.za
 * @copyright      2026 Magida Creative
 * @license        GPL-2.0-or-later
 *
 * @wordpress-plugin
 */

:root {
	--cc-primary: var(--wp--preset--color--primary, #222);
	--cc-accent: var(--wp--preset--color--secondary, #0073aa);
	--cc-bg: var(--wp--preset--color--background, #fff);
	--cc-text: var(--wp--preset--color--text, currentColor);
	--cc-font-head: var(--wp--preset--font-family--heading, serif);
	--cc-font-body: var(--wp--preset--font-family--body, sans-serif);

	--cc-glass-bg: rgba(255, 255, 255, 0.16);
	--cc-glass-border: rgba(255, 255, 255, 0.28);
	--cc-glass-shadow: 0 10px 40px rgba(20, 30, 70, 0.24);
	--cc-glass-blur: blur(16px);

	--ppf-left-desktop: 280px;
	--ppf-right-desktop: 784px;
	--ppf-stage-gap: 18px;
	--ppf-radius: 22px;

	--ppf-panel-head-height: 52px;

	--ppf-rail-width: 18px;
	--ppf-rail-gap: 12px;
	--ppf-rail-btn-height-mobile: 62px;
	--ppf-rail-btn-height-desktop: 68px;

	--ppf-touch-mobile: 48px;
	--ppf-touch-desktop: 46px;

	/* FIXED SLIDER HEIGHTS */
	--ppf-slider-height-mobile: 320px;
	--ppf-slider-height-tablet: 440px;
	--ppf-slider-height-desktop: 440px;

	/* Card styling controls */
	--ppf-card-radius: 18px;
	--ppf-card-pad-x: 16px;
	--ppf-card-pad-y: 16px;
	--ppf-card-strip-width: 54px;
}

.ppf-feed {
	width: 100%;
	margin: 0 auto;
	padding: 14px;
	font-family: var(--cc-font-body);
	color: var(--cc-text);
	box-sizing: border-box;
}

.ppf-feed *,
.ppf-feed *::before,
.ppf-feed *::after {
	box-sizing: border-box;
}

.ppf-feed__filters-row {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 0 0 14px;
}

.ppf-filter-pill {
	min-height: 40px;
	padding: 8px 16px;
	border: 1px solid rgba(17, 24, 39, 0.22);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.6);
	color: #111827;
	font-size: 16px;
	line-height: 1.3;
	text-decoration: none;
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	cursor: pointer;
	box-shadow: 0 6px 16px rgba(17, 24, 39, 0.08);
	transition:
		transform 0.2s ease,
		background 0.2s ease,
		border-color 0.2s ease,
		box-shadow 0.2s ease,
		color 0.2s ease;
}

.ppf-filter-pill:hover {
	transform: translateY(-1px);
	background: rgba(255, 255, 255, 0.86);
	border-color: rgba(17, 24, 39, 0.32);
	color: #111827;
	box-shadow: 0 10px 22px rgba(17, 24, 39, 0.12);
}

.ppf-filter-pill:focus-visible {
	outline: 2px solid rgba(0, 115, 170, 0.8);
	outline-offset: 2px;
	color: #111827;
}

.ppf-filter-pill.is-active {
	background: linear-gradient(
		135deg,
		rgba(0, 115, 170, 0.95),
		rgba(20, 90, 180, 0.88)
	);
	color: #fff;
	border-color: rgba(255, 255, 255, 0.55);
	box-shadow: 0 10px 26px rgba(0, 115, 170, 0.25);
}

.ppf-feed__stage {
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding: 14px;
	border-radius: var(--ppf-radius);
	border: 1px solid var(--cc-glass-border);
	background:
		linear-gradient(
			145deg,
			rgba(255, 255, 255, 0.24),
			rgba(255, 255, 255, 0.08)
		),
		var(--cc-glass-bg);
	box-shadow: var(--cc-glass-shadow);
	overflow: visible;
}

.ppf-glass {
	background-color: rgba(255, 255, 255, 0.16);
}

@supports (
	(backdrop-filter: blur(10px)) or (-webkit-backdrop-filter: blur(10px))
) {
	.ppf-glass {
		backdrop-filter: var(--cc-glass-blur) saturate(130%);
		-webkit-backdrop-filter: var(--cc-glass-blur) saturate(130%);
	}
}

@supports not (
	(backdrop-filter: blur(10px)) or (-webkit-backdrop-filter: blur(10px))
) {
	.ppf-glass {
		background: rgba(248, 249, 252, 0.95);
	}
}

.ppf-feed__left,
.ppf-feed__right {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.ppf-panel-head {
	height: var(--ppf-panel-head-height);
	min-height: var(--ppf-panel-head-height);
	display: flex;
	align-items: center;
	padding: 0 4px;
	margin: 0 0 8px;
}

.ppf-panel-title {
	margin: 0;
	font-family: var(--cc-font-head);
	font-size: 20px;
	line-height: 1.2;
	color: #111827;
	letter-spacing: 0.2px;
}

.ppf-feed__left-body {
	display: grid;
	grid-template-columns: var(--ppf-rail-width) minmax(0, 1fr);
	column-gap: var(--ppf-rail-gap);
	align-items: stretch;
	min-width: 0;
	flex: 1 1 auto;
}

.ppf-left__rail-controls {
	grid-column: 1;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 10px;
	width: var(--ppf-rail-width);
	min-width: var(--ppf-rail-width);
	max-width: var(--ppf-rail-width);
	position: relative;
	z-index: 4;
}

.ppf-left__cards {
	grid-column: 2;
	max-height: 420px;
	overflow-y: auto;
	overflow-x: hidden;
	padding: 2px 6px 2px 2px;
	scrollbar-width: none;
	-ms-overflow-style: none;
	position: relative;
	z-index: 2;

	/* NEW: Counter for “01/02/03…” background numbers */
	counter-reset: ppf-card;
}

.ppf-left__cards::-webkit-scrollbar {
	width: 0;
	height: 0;
}

.ppf-left__cards:focus-visible {
	outline: 2px solid rgba(0, 115, 170, 0.78);
	outline-offset: 2px;
	border-radius: 12px;
}

.ppf-left__up,
.ppf-left__down {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--ppf-rail-width);
	min-width: var(--ppf-rail-width);
	max-width: var(--ppf-rail-width);
	height: var(--ppf-rail-btn-height-mobile);
	border: 1px solid rgba(255, 255, 255, 0.52);
	border-radius: 999px;
	background: linear-gradient(
		180deg,
		rgba(18, 22, 35, 0.88),
		rgba(26, 30, 42, 0.84)
	);
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	line-height: 1;
	padding: 0;
	margin: 0;
	cursor: pointer;
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
	text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
	transition:
		background 0.2s ease,
		border-color 0.2s ease,
		transform 0.2s ease;
}

.ppf-left__up:hover,
.ppf-left__down:hover {
	background: linear-gradient(
		180deg,
		rgba(10, 14, 28, 0.95),
		rgba(18, 23, 37, 0.93)
	);
	border-color: rgba(255, 255, 255, 0.9);
	transform: translateY(-1px);
}

.ppf-left__up:focus-visible,
.ppf-left__down:focus-visible {
	outline: 2px solid rgba(255, 255, 255, 0.9);
	outline-offset: 2px;
}

/* ===========================
   PREMIUM CARD LOOK (NO BUTTONS)
   Inspired by provided reference image:
   - darker glass base
   - inset depth
   - soft glow edge
   - left translucent strip
   - big “01/02/03” ghost number
   =========================== */

.ppf-card {
	counter-increment: ppf-card;
	position: relative;
	margin: 0 0 14px;
	padding: var(--ppf-card-pad-y) var(--ppf-card-pad-x);
	border-radius: var(--ppf-card-radius);
	border: 1px solid rgba(255, 255, 255, 0.12);
	background:
		linear-gradient(
			160deg,
			rgba(255, 255, 255, 0.12),
			rgba(255, 255, 255, 0.04)
		),
		rgba(18, 20, 28, 0.65);
	box-shadow:
		0 18px 40px rgba(0, 0, 0, 0.35),
		inset 0 1px 0 rgba(255, 255, 255, 0.1),
		inset 0 -1px 0 rgba(0, 0, 0, 0.25);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	overflow: hidden;
}

.ppf-card::before {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: var(--ppf-card-radius);
	pointer-events: none;
	background:
		/* left vertical strip */
		linear-gradient(
			90deg,
			rgba(255, 255, 255, 0.1) 0,
			rgba(255, 255, 255, 0.08) var(--ppf-card-strip-width),
			rgba(255, 255, 255, 0) calc(var(--ppf-card-strip-width) + 1px)
		),
		/* subtle top sheen */
		linear-gradient(
				180deg,
				rgba(255, 255, 255, 0.1),
				rgba(255, 255, 255, 0) 55%
			);
}

.ppf-card::after {
	/* “01” style ghost number in the corner */
	content: '0' counter(ppf-card);
	position: absolute;
	top: 10px;
	right: 14px;
	font-family: var(--cc-font-head);
	font-size: 64px;
	line-height: 1;
	font-weight: 700;
	letter-spacing: 1px;
	color: rgba(255, 255, 255, 0.1);
	text-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
	pointer-events: none;
}

.ppf-card__title {
	position: relative;
	margin: 0 0 10px;
	font-family: var(--cc-font-head);
	font-size: 22px;
	line-height: 1.2;
	color: rgba(255, 255, 255, 0.92);
	text-shadow: 0 1px 1px rgba(0, 0, 0, 0.4);
}

.ppf-card__meta {
	position: relative;
	margin: 0 0 7px;
	font-size: 15px;
	line-height: 1.4;
	color: rgba(255, 255, 255, 0.78);
	word-break: break-word;
}

.ppf-card__meta span {
	font-weight: 700;
	color: rgba(255, 255, 255, 0.88);
}

.ppf-feed__right {
	position: relative;
	overflow: visible;
	padding: 0 10px 10px 6px;
}

/* Fixed viewport height so container does not jump between images */
.ppf-right__slider {
	position: relative;
	height: var(--ppf-slider-height-mobile);
	min-height: var(--ppf-slider-height-mobile);
	max-height: var(--ppf-slider-height-mobile);
	border-radius: 16px;
	overflow: hidden;
	background: rgba(255, 255, 255, 0.24);
	border: 1px solid rgba(255, 255, 255, 0.36);
}

.ppf-slide {
	display: none;
	width: 100%;
	height: 100%;
}

.ppf-slide.is-active {
	display: block;
}

.ppf-slide img,
.ppf-slide video {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	background: rgba(12, 14, 22, 0.12);
}

.ppf-slide__caption {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	margin: 0;
	padding: 10px 12px;
	background: rgba(15, 18, 28, 0.62);
	color: #fff;
	font-size: 14px;
	line-height: 1.35;
}

.ppf-right__controls {
	position: absolute;
	left: 18px;
	right: 18px;
	bottom: 20px;
	display: flex;
	justify-content: space-between;
	gap: 12px;
	z-index: 6;
	pointer-events: none;
}

.ppf-right__prev,
.ppf-right__next {
	pointer-events: auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 0;
	width: var(--ppf-touch-mobile);
	height: var(--ppf-touch-mobile);
	min-width: var(--ppf-touch-mobile);
	min-height: var(--ppf-touch-mobile);
	border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, 0.72);
	background:
		linear-gradient(
			145deg,
			rgba(255, 255, 255, 0.28),
			rgba(255, 255, 255, 0.1)
		),
		rgba(15, 22, 40, 0.32);
	backdrop-filter: blur(10px) saturate(130%);
	-webkit-backdrop-filter: blur(10px) saturate(130%);
	box-shadow:
		0 8px 18px rgba(12, 16, 30, 0.22),
		inset 0 1px 0 rgba(255, 255, 255, 0.45);
	color: #fff;
	font-size: 23px;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
	transition:
		transform 0.2s ease,
		background 0.2s ease,
		border-color 0.2s ease;
}

.ppf-right__prev:hover,
.ppf-right__next:hover {
	transform: translateY(-1px);
	border-color: rgba(255, 255, 255, 0.95);
	background:
		linear-gradient(
			145deg,
			rgba(255, 255, 255, 0.36),
			rgba(255, 255, 255, 0.16)
		),
		rgba(15, 22, 40, 0.4);
}

.ppf-right__prev:focus-visible,
.ppf-right__next:focus-visible {
	outline: 2px solid rgba(255, 255, 255, 0.95);
	outline-offset: 2px;
}

.ppf-empty-note,
.ppf-feed-empty {
	margin: 0;
	padding: 14px;
	border-radius: 12px;
	background: rgba(255, 255, 255, 0.56);
	color: #111827;
	font-size: 16px;
	line-height: 1.4;
}

@media (min-width: 768px) {
	.ppf-feed {
		padding: 16px;
		max-width: 1160px;
	}

	.ppf-feed__stage {
		flex-direction: row;
		align-items: stretch;
		gap: var(--ppf-stage-gap);
	}

	.ppf-feed__left {
		flex: 0 0 34%;
	}

	.ppf-feed__right {
		flex: 1 1 auto;
		padding: 0 14px 12px 8px;
	}

	.ppf-left__cards {
		max-height: 440px;
	}

	.ppf-right__slider {
		height: var(--ppf-slider-height-tablet);
		min-height: var(--ppf-slider-height-tablet);
		max-height: var(--ppf-slider-height-tablet);
	}

	.ppf-left__up,
	.ppf-left__down {
		height: var(--ppf-rail-btn-height-desktop);
	}

	.ppf-card::after {
		font-size: 72px;
		top: 10px;
		right: 16px;
	}
}

@media (min-width: 1025px) {
	.ppf-feed {
		max-width: calc(
			var(--ppf-left-desktop) + var(--ppf-right-desktop) +
				var(--ppf-stage-gap) + 36px
		);
		margin: 0 auto;
	}

	/* Make pills row align to the same outer container width */
	.ppf-feed__filters-row {
		max-width: calc(
			var(--ppf-left-desktop) + var(--ppf-right-desktop) +
				var(--ppf-stage-gap) + 36px
		);
		margin-left: auto;
		margin-right: auto;
	}

	/* Keep your “no max-width stage” but ensure it centers consistently */
	.ppf-feed__stage {
		width: 100%;
		margin: 0 auto;
	}

	.ppf-feed__left {
		flex: 0 0 var(--ppf-left-desktop);
		max-width: var(--ppf-left-desktop);
	}

	/* FIX: remove asymmetry that makes right side feel tighter */
	.ppf-feed__right {
		flex: 0 0 var(--ppf-right-desktop);
		max-width: var(--ppf-right-desktop);
		padding: 0 14px 14px; /* equal left/right */
	}

	.ppf-right__slider {
		height: var(--ppf-slider-height-desktop);
		min-height: var(--ppf-slider-height-desktop);
		max-height: var(--ppf-slider-height-desktop);
	}

	.ppf-right__controls {
		left: 24px;
		right: 24px;
		bottom: 24px;
	}

	.ppf-right__prev,
	.ppf-right__next {
		width: var(--ppf-touch-desktop);
		height: var(--ppf-touch-desktop);
		min-width: var(--ppf-touch-desktop);
		min-height: var(--ppf-touch-desktop);
		font-size: 22px;
	}

	.ppf-card::after {
		font-size: 76px;
	}
}
