/**
 * Projects — front-end styles.
 *
 * Every selector is scoped under `.project-directory` and every themeable
 * value is exposed as a CSS custom property with a sensible default, so
 * the plugin's look is self-contained and independent of the active theme.
 * Layout: a sticky sidebar of filters (search, year, status, category)
 * next to a project list grouped by Year, each Year group introduced by
 * a timeline-style heading (marker + rule + count badge).
 *
 * Scroll-reveal animation ("basic animation") is provided by the `wow` +
 * `fadeInUp` classes on each card — these are handled by the WOW.js /
 * animate.css libraries already loaded site-wide, the same mechanism the
 * theme's own card grids (team, causes, testimonials) use.
 */
.project-directory {
	--project-accent: #0e649c;
	--project-heading-color: #16233c;
	--project-text-color: #55605d;
	--project-card-bg: #ffffff;
	--project-card-border: #e7ebf0;
	--project-card-radius: 14px;
	--project-tag-bg: #eaf3fa;
	--project-tag-color: #0e649c;
	--project-font: "Nunito", sans-serif;
	--project-sidebar-bg: #fbfbfd;
	--project-sidebar-border: #e7ebf0;
	--project-label-color: #16233c;
	--project-muted-color: #6b7a90;
	--project-status-ongoing: #1f9d55;
	--project-status-completed: #6b7a90;

	font-family: var( --project-font );
	color: var( --project-text-color );
	margin: 0 0 2em;
	padding-top: 100px;
}

/* Wider than the theme's usual 1230px content container: the sidebar +
   3-across project list needs the extra room so each card stays legible
   rather than cramming three narrow columns into the standard width. */
.project-directory__container {
	width: 100%;
	max-width: 1600px;
	margin: 0 auto;
	padding: 0 15px;
	box-sizing: border-box;
}

.project-directory__layout {
	display: grid;
	grid-template-columns: 280px 1fr;
	gap: 36px;
	align-items: start;
}

@media ( max-width: 900px ) {
	.project-directory__layout {
		grid-template-columns: 1fr;
	}
}

/* ------------------------------------------------------------------ */
/* Sidebar filters                                                     */
/* ------------------------------------------------------------------ */

.project-directory__sidebar {
	background: var( --project-sidebar-bg );
	border: 1px solid var( --project-sidebar-border );
	border-radius: 16px;
	padding: 28px 24px;
	position: sticky;
	top: 24px;
}

@media ( max-width: 900px ) {
	.project-directory__sidebar {
		position: static;
	}
}

.project-directory__sidebar-title {
	font-size: 20px;
	font-weight: 800;
	color: var( --project-heading-color );
	margin: 0 0 24px;
}

.project-directory__filter-group {
	margin-bottom: 24px;
}

.project-directory__filter-group:last-of-type {
	margin-bottom: 20px;
}

.project-directory__filter-label {
	display: block;
	font-size: 14px;
	font-weight: 700;
	color: var( --project-label-color );
	margin-bottom: 10px;
}

.project-directory__search {
	position: relative;
}

.project-directory__search-input {
	width: 100%;
	font-family: var( --project-font );
	font-size: 14px;
	color: var( --project-text-color );
	background: #ffffff;
	border: 1px solid var( --project-card-border );
	border-radius: 10px;
	padding: 11px 40px 11px 14px;
	box-sizing: border-box;
	appearance: none;
}

.project-directory__search-input:focus {
	outline: 2px solid var( --project-accent );
	outline-offset: 1px;
}

.project-directory__search-icon {
	position: absolute;
	right: 14px;
	top: 50%;
	transform: translateY( -50% );
	width: 14px;
	height: 14px;
	fill: var( --project-muted-color );
	pointer-events: none;
}

.project-directory__select-wrap {
	position: relative;
}

.project-directory__select {
	width: 100%;
	font-family: var( --project-font );
	font-size: 14px;
	color: var( --project-text-color );
	background: #ffffff;
	border: 1px solid var( --project-card-border );
	border-radius: 10px;
	padding: 11px 36px 11px 14px;
	box-sizing: border-box;
	appearance: none;
	cursor: pointer;
}

.project-directory__select:focus {
	outline: 2px solid var( --project-accent );
	outline-offset: 1px;
}

.project-directory__select-icon {
	position: absolute;
	right: 14px;
	top: 50%;
	transform: translateY( -50% );
	width: 11px;
	height: 11px;
	fill: var( --project-muted-color );
	pointer-events: none;
}

.project-directory__checkbox {
	display: flex;
	align-items: center;
	gap: 9px;
	font-size: 14px;
	color: var( --project-text-color );
	padding: 6px 0;
	cursor: pointer;
}

.project-directory__checkbox input {
	width: 16px;
	height: 16px;
	accent-color: var( --project-accent );
	cursor: pointer;
	flex-shrink: 0;
}

.project-directory__checkbox-label {
	flex: 1;
}

.project-directory__checkbox-count {
	color: var( --project-muted-color );
	font-weight: 600;
	font-size: 13px;
}

.project-directory__view-more {
	appearance: none;
	background: none;
	border: none;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var( --project-accent );
	font-family: var( --project-font );
	font-size: 13px;
	font-weight: 700;
	padding: 6px 0 0;
	cursor: pointer;
}

.project-directory__view-more svg {
	width: 9px;
	height: 9px;
	fill: currentColor;
	transition: transform 0.2s ease;
}

.project-directory__view-more.is-expanded svg {
	transform: rotate( 180deg );
}

.project-directory__clear {
	appearance: none;
	width: 100%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	background: #ffffff;
	border: 1px solid var( --project-card-border );
	border-radius: 999px;
	color: var( --project-heading-color );
	font-family: var( --project-font );
	font-size: 14px;
	font-weight: 700;
	padding: 12px 20px;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.project-directory__clear:hover {
	background: var( --project-tag-bg );
}

.project-directory__clear svg {
	width: 14px;
	height: 14px;
	fill: currentColor;
}

/* ------------------------------------------------------------------ */
/* Content: year timeline + project list                              */
/* ------------------------------------------------------------------ */

.project-directory__empty {
	font-size: 15px;
	color: var( --project-muted-color );
	padding: 40px 0;
	text-align: center;
}

.project-directory__group {
	margin-bottom: 44px;
}

.project-directory__group:last-child {
	margin-bottom: 0;
}

.project-directory__year-row {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-bottom: 24px;
}

.project-directory__year-marker {
	flex: 0 0 auto;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	border: 3px solid var( --project-accent );
	background: #ffffff;
}

.project-directory__year-title {
	flex: 0 0 auto;
	font-size: 26px;
	font-weight: 800;
	color: var( --project-heading-color );
	margin: 0;
}

.project-directory__year-line {
	flex: 1 1 auto;
	height: 1px;
	background: var( --project-card-border );
}

.project-directory__list {
	display: grid;
	grid-template-columns: repeat( 3, 1fr );
	gap: 22px;
}

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

@media ( max-width: 640px ) {
	.project-directory__list {
		grid-template-columns: 1fr;
	}
}

.project-directory__card {
	display: flex;
	flex-direction: column;
	background: var( --project-card-bg );
	border: 1px solid var( --project-card-border );
	border-radius: var( --project-card-radius );
	overflow: hidden;
	color: inherit;
	text-decoration: none;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-directory__card:hover,
.project-directory__card:focus {
	color: inherit;
	text-decoration: none;
}

.project-directory__card:hover {
	transform: translateY( -4px );
	box-shadow: 0 14px 28px rgba( 16, 35, 60, 0.1 );
}

.project-directory__photo-wrap {
	flex: 0 0 auto;
	width: 100%;
	aspect-ratio: 2.7 / 1;
	position: relative;
	overflow: hidden;
}

/* !important overrides the theme's blanket `.elementor img { height: auto }`
   reset, which otherwise outranks a single-class selector and collapses
   the photo back to its intrinsic aspect ratio instead of filling the
   card's full height. */
.project-directory__photo-wrap .project-directory__photo {
	display: block;
	position: absolute;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	object-fit: cover;
}

.project-directory__photo--placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	min-height: 160px;
	background: var( --project-tag-bg );
}

.project-directory__photo--placeholder svg {
	width: 15%;
	max-width: 56px;
	fill: var( --project-accent );
	opacity: 0.45;
}

.project-directory__body {
	flex: 1 1 auto;
	min-width: 0;
	padding: 22px 24px 20px;
	display: flex;
	flex-direction: column;
}

.project-directory__tags {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 16px;
	padding: 0;
}

.project-directory__tag {
	background: var( --project-tag-bg );
	color: var( --project-tag-color );
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.01em;
	padding: 6px 16px;
	border-radius: 999px;
}

.project-directory__title {
	font-size: 20px;
	font-weight: 800;
	color: var( --project-heading-color );
	margin: 0 0 18px;
	line-height: 1.35;
}

.project-directory__funder {
	display: flex;
	flex-direction: column;
	gap: 4px;
	font-size: 14px;
	margin-bottom: 20px;
}

.project-directory__funder-label {
	color: var( --project-muted-color );
	font-weight: 600;
}

.project-directory__funder-value {
	color: var( --project-heading-color );
	font-weight: 700;
}

.project-directory__footer-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	margin-top: auto;
	padding-top: 16px;
	border-top: 1px solid var( --project-card-border );
}

.project-directory__status {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font-size: 13px;
	font-weight: 700;
	color: var( --project-heading-color );
}

.project-directory__status-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var( --project-status-completed );
}

.project-directory__status--ongoing .project-directory__status-dot {
	background: var( --project-status-ongoing );
}

.project-directory__view-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var( --project-accent );
	font-size: 13px;
	font-weight: 800;
}

.project-directory__view-link svg {
	width: 12px;
	height: 12px;
	fill: currentColor;
	transition: transform 0.25s ease;
}

.project-directory__card:hover .project-directory__view-link svg {
	transform: translateX( 4px );
}

@media ( max-width: 640px ) {
	.project-directory__photo-wrap {
		aspect-ratio: 16 / 9;
	}
}

/* Respect reduced-motion preferences: skip the entrance animation, cards
   are simply visible immediately (WOW.js/animate.css already honour this
   site-wide, this is a defensive fallback). */
@media ( prefers-reduced-motion: reduce ) {
	.project-directory__card.wow {
		animation: none !important;
		opacity: 1 !important;
	}
}

/* ------------------------------------------------------------------ */
/* Single Project detail page                                         */
/* ------------------------------------------------------------------ */

.project-single {
	--project-accent: #0e649c;
	--project-heading-color: #283734;
	--project-text-color: #55605d;
	--project-tag-bg: #eaf3fa;
	--project-tag-color: #0e649c;
	--project-btn-bg: #fbd45a;
	--project-btn-color: #283734;
	--project-font: "Nunito", sans-serif;

	font-family: var( --project-font );
	color: var( --project-text-color );
	padding: 60px 0 80px;
}

.project-single__container {
	width: 100%;
	max-width: 1230px;
	margin: 0 auto;
	padding: 0 15px;
	box-sizing: border-box;
}

.project-single__back {
	display: inline-block;
	margin-bottom: 32px;
	color: var( --project-accent );
	font-weight: 700;
	text-decoration: none;
}

.project-single__back:hover {
	text-decoration: underline;
}

.project-single__grid {
	display: grid;
	grid-template-columns: 380px 1fr;
	gap: 48px;
	align-items: start;
}

@media ( max-width: 780px ) {
	.project-single__grid {
		grid-template-columns: 1fr;
	}
}

.project-single__photo-wrap {
	border-radius: 20px;
	overflow: hidden;
	box-shadow: 0 12px 32px rgba( 0, 0, 0, 0.1 );
}

.project-single__photo {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
}

.project-single__photo--placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	aspect-ratio: 4 / 3;
	background: var( --project-tag-bg );
	color: var( --project-accent );
	font-size: 72px;
	font-weight: 800;
}

.project-single__tags {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 20px 0 0;
	padding: 0;
}

.project-single__tag {
	background: var( --project-tag-bg );
	color: var( --project-tag-color );
	font-size: 12px;
	font-weight: 700;
	padding: 10px 14px;
	line-height: 1.2;
	border-radius: 30px;
}

.project-single__status {
	display: inline-block;
	background: var( --project-tag-bg );
	color: var( --project-accent );
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	padding: 10px 14px;
	line-height: 1.2;
	border-radius: 30px;
	margin-bottom: 16px;
}

.project-single__title {
	font-size: 32px;
	font-weight: 800;
	color: var( --project-heading-color );
	margin: 0 0 18px;
	line-height: 1.25;
}

.project-single__meta {
	list-style: none;
	margin: 0 0 28px;
	padding: 20px 0;
	border-top: 1px solid rgba( 0, 0, 0, 0.08 );
	border-bottom: 1px solid rgba( 0, 0, 0, 0.08 );
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.project-single__meta-item {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-size: 15px;
	line-height: 1.2;
}

.project-single__meta-icon {
	flex: 0 0 auto;
	width: 16px;
	height: 16px;
	display: flex;
}

.project-single__meta-icon svg {
	width: auto;
	height: 100%;
	fill: var( --project-accent );
}

.project-single__description {
	font-size: 15px;
	line-height: 1.8;
	margin-bottom: 28px;
}

.project-single__description p:last-child {
	margin-bottom: 0;
}

.project-single__contact {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
}

.project-single__contact-btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	background: var( --project-btn-bg );
	color: var( --project-btn-color );
	font-size: 13px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	text-decoration: none;
	padding: 12px 24px;
	border-radius: 30px;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-single__contact-btn:hover {
	color: var( --project-btn-color );
	transform: translateY( -3px );
	box-shadow: 0 10px 20px rgba( 14, 100, 156, 0.2 );
}

.project-single__contact-icon {
	width: 14px;
	height: 14px;
	display: inline-flex;
}

.project-single__contact-icon svg {
	width: 100%;
	height: 100%;
	fill: currentColor;
}

@media ( prefers-reduced-motion: reduce ) {
	.project-single .wow {
		animation: none !important;
		opacity: 1 !important;
	}
}
