/* Project Portfolio — Featured Homepage Carousel
   ------------------------------------------------------------------
   Brand colors confirmed: Primary green #4CAD49, Accent yellow #FBEF21.
   Text Muted remains a placeholder gray until a real value is given.
   ------------------------------------------------------------------ */

:root {
	--ppf-color-primary:     #4CAD49; /* Primary green */
	--ppf-color-accent:      #FBEF21; /* Accent yellow */
	--ppf-color-text-muted:  #9a9da3; /* placeholder — Text Muted */
}

.ppf-carousel {
	position: relative;
}

.ppf-carousel__track {
	display: flex;
	gap: 24px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth; /* makes the plain <a href="#slide-id"> dots animate too, not just JS-driven ones */
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	-ms-overflow-style: none;
	padding-bottom: 2px; /* avoids clipping card shadow/focus ring */
	cursor: grab;
}

.ppf-carousel__track.is-dragging {
	cursor: grabbing;
	scroll-snap-type: none; /* let the drag move freely; snap resumes on release */
	scroll-behavior: auto; /* otherwise every scrollLeft write during a drag animates, making it lag behind the cursor */
	user-select: none;
}

.ppf-carousel__track::-webkit-scrollbar {
	display: none;
}

/* Slide width driven by --ppf-per-view, which picks the shortcode's
   desktop/tablet/mobile counts (inline --ppf-pv-* vars) per breakpoint.
   Pure CSS, so the layout is correct on first paint and without JS. */
.ppf-carousel__track {
	--ppf-per-view: var(--ppf-pv-desktop, 3);
}

.ppf-carousel__slide {
	flex: 0 0 calc((100% - (var(--ppf-per-view, 3) - 1) * 24px) / var(--ppf-per-view, 3));
	scroll-snap-align: start;
	min-width: 0;
	padding-bottom: 4px; /* clearance so the card's border isn't visually clipped by track overflow */
	display: flex; /* lets the card inside stretch to match the tallest slide */
}

@media (max-width: 992px) {
	.ppf-carousel__track { --ppf-per-view: var(--ppf-pv-tablet, 2); }
}

@media (max-width: 576px) {
	.ppf-carousel__track { --ppf-per-view: var(--ppf-pv-mobile, 1); }
}

.ppf-carousel__card {
	display: flex;
	flex-direction: column;
	width: 100%;
	height: 100%;
	text-decoration: none;
	color: inherit;
	background: #2a313d;
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 14px;
	/* No overflow:hidden here on purpose — the chip below is allowed to
	   straddle the seam between the image and the body without being clipped. */
}

.ppf-carousel__media {
	position: relative;
	flex-shrink: 0; /* keeps the image at its natural aspect-ratio height, never squashed by flex */
}

.ppf-carousel__image {
	width: 100%;
	aspect-ratio: 3 / 2;
	object-fit: cover;
	display: block;
	border-radius: 14px 14px 0 0;
	-webkit-user-drag: none; /* Safari-specific belt-and-suspenders alongside the JS dragstart prevention */
	user-select: none;
}

.ppf-carousel__image--placeholder {
	background: #2a2d33;
}

.ppf-carousel__chip {
	position: absolute;
	left: 20px;
	bottom: -14px;
	background: var(--ppf-color-primary);
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	padding: 6px 16px;
	border-radius: 999px;
	line-height: 1.4;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
	z-index: 2;
}

/* Archive cards with no label in the current view keep an empty chip
   that ppf-archive.js fills in when a filter is chosen. */
.ppf-carousel__chip[hidden] {
	display: none;
}

.ppf-carousel__body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	padding: 28px 20px 20px;
	border-radius: 0 0 14px 14px;
}

.ppf-carousel__title {
	color: #fff;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.3;
	margin: 0 0 8px;
}

.ppf-carousel__desc {
	color: #b8bec7 !important;
	font-size: 16px;
	line-height: 1.5;
	margin: 0;
}

.ppf-carousel__dots {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 8px;
	margin-top: 24px;
}

.ppf-carousel__dots[hidden] {
	display: none; /* display:flex above would otherwise override the hidden attribute */
}

.ppf-carousel__dot {
	display: block;
	width: 8px;
	height: 8px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.25);
	border: none;
	padding: 0;
	cursor: pointer;
	text-decoration: none; /* dots are real <a> tags now for no-JS resilience — strip link defaults */
	transition: background 0.2s ease, width 0.2s ease;
}

.ppf-carousel__dot:focus-visible {
	outline: 2px solid var(--ppf-color-accent);
	outline-offset: 3px;
}

.ppf-carousel__dot:hover {
	background: rgba(255, 255, 255, 0.4);
}

.ppf-carousel__dot.is-active {
	width: 22px;
	background: var(--ppf-color-accent);
}

.ppf-no-projects {
	opacity: 0.7;
	font-style: italic;
}
