/* Dewick Project Filters — dropdown UI.
   Brand: green #3fae2a, dark grey #3e3f43. Designed to sit cleanly on a
   white band above the projects grid. Mostly self-contained so it won't
   inherit odd spacing from the theme. */

.dpf-filters--dropdown {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem;
	margin: 0 0 2rem;
	font-family: inherit;
}

/* Each facet is a native <details> acting as a dropdown. */
.dpf-facet {
	position: relative;
}

/* The trigger (summary) styled as a pill button. */
.dpf-facet__summary {
	list-style: none;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.6rem 1rem;
	border: 1px solid #dcdee1;
	border-radius: 999px;
	background: #fff;
	color: #3e3f43;
	font-weight: 600;
	font-size: 0.95rem;
	line-height: 1;
	user-select: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	white-space: nowrap;
}

/* Remove the default disclosure triangle across browsers. */
.dpf-facet__summary::-webkit-details-marker { display: none; }
.dpf-facet__summary::marker { content: ""; }

.dpf-facet__summary:hover {
	border-color: #3fae2a;
}

.dpf-facet[open] > .dpf-facet__summary {
	border-color: #3fae2a;
	box-shadow: 0 0 0 3px rgba(63, 174, 42, 0.12);
}

/* Selected-count badge on the trigger. */
.dpf-facet__badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 1.25rem;
	height: 1.25rem;
	padding: 0 0.35rem;
	border-radius: 999px;
	background: #3fae2a;
	color: #fff;
	font-size: 0.75rem;
	font-weight: 700;
}

.dpf-facet__chevron {
	transition: transform 0.2s ease;
	color: #8a8c90;
}

.dpf-facet[open] > .dpf-facet__summary .dpf-facet__chevron {
	transform: rotate(180deg);
}

/* The dropdown panel. */
.dpf-facet__panel {
	position: absolute;
	z-index: 40;
	top: calc(100% + 0.5rem);
	left: 0;
	min-width: 220px;
	max-height: 320px;
	overflow-y: auto;
	background: #fff;
	border: 1px solid #e6e7e9;
	border-radius: 12px;
	box-shadow: 0 12px 28px rgba(20, 21, 23, 0.12);
	padding: 0.5rem;
}

.dpf-facet__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.125rem;
}

.dpf-facet__label {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	cursor: pointer;
	color: #3e3f43;
	line-height: 1.3;
	padding: 0.5rem 0.6rem;
	border-radius: 8px;
	transition: background 0.12s ease;
}

.dpf-facet__label:hover {
	background: #f4f7f3;
}

.dpf-facet__input {
	accent-color: #3fae2a;
	width: 1rem;
	height: 1rem;
	flex: none;
}

.dpf-facet__text {
	flex: 1 1 auto;
}

.dpf-facet__input:checked ~ .dpf-facet__text {
	color: #3fae2a;
	font-weight: 600;
}

/* Per-term project count, right-aligned and muted. */
.dpf-facet__count {
	color: #9a9b9e;
	font-size: 0.8rem;
	font-variant-numeric: tabular-nums;
}

/* Actions row. */
.dpf-filters__actions {
	display: inline-flex;
	align-items: center;
	gap: 1rem;
}

.dpf-filters__apply {
	background: #3fae2a;
	color: #fff;
	border: 0;
	padding: 0.6rem 1.25rem;
	border-radius: 999px;
	cursor: pointer;
	font-weight: 600;
	font-size: 0.95rem;
}

.dpf-filters__apply:hover { filter: brightness(0.95); }

.dpf-filters__clear {
	color: #3e3f43;
	text-decoration: underline;
	font-size: 0.9rem;
}

.dpf-facet__badge.is-hidden,
.dpf-filters__clear.is-hidden { display: none; }

/* When JS is active we auto-apply, so the Apply button is redundant. */
.dpf-js .dpf-filters__apply { display: none; }

/* Grid dim while a filter request is in flight. */
.dpf-is-loading {
	opacity: 0.6;
	transition: opacity 0.15s ease;
	pointer-events: none;
}

@media (max-width: 600px) {
	.dpf-filters--dropdown { gap: 0.5rem; }
	.dpf-facet, .dpf-facet__summary { width: 100%; }
	.dpf-facet__panel { width: 100%; }
}

/* ---------------------------------------------------------------------------
   Fast AJAX grid: cards, skeleton, empty state, show-more.
   Styled to sit beside your Elementor loop cards (image, title, green link).
   --------------------------------------------------------------------------- */

.dpf-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 24px;
	margin-top: 8px;
}

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

.dpf-card {
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid #ececec;
	border-radius: 4px;
	overflow: hidden;
	text-decoration: none;
	color: inherit;
	transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.dpf-card:hover {
	box-shadow: 0 10px 24px rgba(20, 21, 23, 0.10);
	transform: translateY(-2px);
}

.dpf-card__media {
	aspect-ratio: 3 / 2;
	background: #eef0ee;
	overflow: hidden;
}

.dpf-card__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.dpf-card__body {
	padding: 18px 18px 22px;
	display: flex;
	flex-direction: column;
	gap: 14px;
	flex: 1;
}

.dpf-card__title {
	margin: 0;
	font-size: 1.05rem;
	font-weight: 700;
	color: #3e3f43;
	line-height: 1.3;
}

.dpf-card__link {
	margin-top: auto;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: #3fae2a;
	font-weight: 600;
	font-size: 0.95rem;
	transition: gap 0.15s ease;
}

.dpf-card:hover .dpf-card__link { gap: 10px; }

/* Skeleton placeholders shown while a request is in flight. */
.dpf-skel {
	background: linear-gradient(90deg, #ececec 25%, #f5f5f5 37%, #ececec 63%);
	background-size: 400% 100%;
	animation: dpf-shimmer 1.2s ease-in-out infinite;
	border-radius: 4px;
}
.dpf-card--skeleton { pointer-events: none; border-color: #f0f0f0; }
.dpf-card--skeleton .dpf-card__media { aspect-ratio: 3 / 2; }
.dpf-skel--line { height: 14px; }
.dpf-skel--short { width: 55%; }

@keyframes dpf-shimmer {
	0%   { background-position: 100% 0; }
	100% { background-position: 0 0; }
}

.dpf-empty {
	grid-column: 1 / -1;
	padding: 2.5rem 0;
	color: #6b6c70;
	font-size: 1rem;
}

.dpf-grid__more { margin-top: 24px; text-align: center; }

.dpf-grid__more-btn {
	background: #fff;
	border: 1px solid #3fae2a;
	color: #3fae2a;
	font-weight: 600;
	padding: 0.7rem 1.5rem;
	border-radius: 999px;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}
.dpf-grid__more-btn:hover { background: #3fae2a; color: #fff; }

/* While loading we keep interactions live but hint at the refresh. */
.dpf-is-loading .dpf-grid { opacity: 0.85; }
