/* Default = visible (no JS fallback safe) */
.project-item {
	opacity: 1;
	transform: translateY(0);
}

/* Only apply animation setup when JS is active */
.js .project-item {
	opacity: 0;
	transform: translateY(40px);
	/*transition: 
		opacity 0.6s ease,
		transform 0.6s ease;*/
	transition: 
		opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
		transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
	will-change: opacity, transform;
}

/* Animated in */
.js .project-item.is-visible {
	opacity: 1;
	transform: translateY(0);
}

.project-card__image {
	flex: 0 0 auto; /* prevent flex weirdness */
	width: 100%;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	position: relative;
}

.project-card__image img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100% !important;
	object-fit: cover;
	object-position: center;
	transition: all 0.3s ease;

	/* override WP defaults */
	max-width: none;
}


.project-card:hover .project-card__image img {
	transform: scale(1.15);
}

.projects-grid {
	display: grid;
	gap: 30px;
	align-items: stretch; 
	margin: 0;
	padding: 0;
	list-style: none;
}

.projects-grid.columns-1 { grid-template-columns: repeat(1, 1fr); }
.projects-grid.columns-2 { grid-template-columns: repeat(2, 1fr); }
.projects-grid.columns-3 { grid-template-columns: repeat(3, 1fr); }
.projects-grid.columns-4 { grid-template-columns: repeat(4, 1fr); }
.projects-grid.columns-5 { grid-template-columns: repeat(5, 1fr); }
.projects-grid.columns-6 { grid-template-columns: repeat(6, 1fr); }


.projects-grid li {
	display: flex; 
	list-style: none;
}

.project-card {
	display: flex;
	flex-direction: column;
	width: 100%;
	background-color: #fff;
	box-shadow: 0 4px 16.2px 0 rgba(0, 0, 0, 0.19);
	border-radius: 7px 7px 0 0;
	overflow: hidden;
	position: relative;
	transition: all 0.3s ease;
}

.project-card::after {
	content: '';
	position: absolute;
	left: 0;
	bottom: 0;
	width: 100%;
	height: 8px;
	background: #BC3B28;

	transform: scaleX(0);
	transform-origin: left;
	transition: transform 0.3s ease;
}

.project-card:hover {
	transform: translateY(-5px);
	box-shadow: 0 14px 16.2px 0 rgba(0, 0, 0, 0.19);
}

.project-card:hover::after {
	transform: scaleX(1);
}

.project-card img {
	width: 100%;
	height: auto;
	display: block;
}

.project-card > a {
	display: flex;
	flex-direction: column;
	height: 100%;
}

.project-card__content {
	padding: 5px 20px 30px 20px;
}

.project-card__location {
	margin: 0.5rem 0 0;
	font-size: 22px;
	font-weight: 600;
	opacity: 0.7;
}

.project-card__title {
	margin: 0.25rem 0 0;
	font-size: 25px;
	font-weight: 400;
}

.projects-archive {
	position: relative;
}

.projects-filter {
	width: 65%;
    margin: 0 auto;
    margin-bottom: 60px;
    position: sticky;
    top: 105px;
    z-index: 50;
    background: rgba(255, 255, 255, .9);
    padding: 20px;
	-webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
	border-radius: 10px;
}

body.has-project-filter {
	overflow: visible !important;
}

.projects-filter h6 {
	font-size: 25px;
	font-style: normal;
	font-weight: 500 !important;
	text-transform: uppercase !important;
}

.projects-filter select {
	border: 1px solid #757982;
    border-radius: 7px;
	appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: #fff;
    padding: 14px 40px 14px 12px;
    font-size: 18px !important;
    /*background-image: url("data:image/svg+xml;utf8,<svg fill='black' height='20' viewBox='0 0 24 24' width='20' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");*/
	background-image: url("/wp-content/uploads/select-menu-arrow-icon.svg");
    background-repeat: no-repeat;
    background-position: right 20px center;
    background-size: 22px;
    font-weight: 500;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.projects-carousel-wrapper {
	position: relative;
}

.projects-carousel-nav .swiper-button-prev,
.projects-carousel-nav .swiper-button-next {
	color: #000;
}

.projects-carousel-nav .swiper-button-prev {
	left: -50px;
}

.projects-carousel-nav .swiper-button-next {
	right: -50px;
}

.swiper-button-prev::after,
.swiper-button-next::after {
	display: none;
}

.projects-carousel-nav .swiper-button-prev,
.projects-carousel-nav .swiper-button-next {
	width: 46px;
	height: 46px;
	border-radius: 50%;
	background-color: rgba(117, 121, 130, 0.4); /* #757982 @ 40% */
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background-color 0.3s ease;
	background-image: url('/wp-content/uploads/white-arrow.svg');
	background-repeat: no-repeat;
	background-position: center;
	background-size: 21px 20px;
}

.projects-carousel-nav .swiper-button-next {
	transform: rotate(180deg);
}

.projects-carousel-nav .swiper-button-prev:hover {
	background-color: rgba(188, 59, 40, 1); /* #BC3B28 */
	transform: scale(1.05);
}

.projects-carousel-nav .swiper-button-next:hover {
	background-color: rgba(188, 59, 40, 1); /* #BC3B28 */
	transform: rotate(180deg) scale(1.05);
}

.swiper-pagination {
	text-align: center;
}

.swiper-pagination-bullet {
	height: 22px;
	width: 22px;
}

.swiper-pagination-bullet-active {
	background-color: #C32D26 !important;
}

/* Card consistency */
.swiper-slide {
	height: auto;
	display: flex;
	padding: 15px 15px 75px 15px;
	box-sizing: border-box;
}

.swiper-slide .project-card {
	height: 100%;
	width: 100%;
}

/* --------------------------------------------------------------------------------------
   Single Project Template
   ------------------------------------------------------------------------------------ */

.project-hero h1 {
	font-family: Poppins;
	font-size: 48px;
	font-style: normal;
	font-weight: 400;
}

.project-hero__categories h2 {
	font-size: 32px;
	font-style: normal;
	font-weight: 700;
}

.project-page-content {
	padding: 60px 0;
}

.project-long-copy {
	width: 65% !important;
	padding: 0 0 60px 0 !important;
	margin: 0 auto;
}

.project-gallery-carousel-wrapper {
	padding: 0 80px;
	margin: 0 0 60px 0;
}

.project-gallery-carousel-wrapper img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	display: block;
	margin: 0 auto;
}

/* Ensure slide content is centered */
.project-gallery-carousel-wrapper .swiper-slide {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 4 / 3;
	overflow: hidden;
}

/* Prevent image from stretching weirdly */
.project-gallery-carousel-wrapper img {
	max-width: 100%;
	height: auto;
	display: block;
	margin: 0 auto;
	border-radius: 7px;
}

.project-gallery-carousel-wrapper {
	position: relative;
}

.project-gallery-carousel-wrapper .swiper-button-prev,
.project-gallery-carousel-wrapper .swiper-button-next {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 10;
}

.projects-carousel-nav .swiper-button-prev {
	left: -50px;
}
.projects-carousel-nav .swiper-button-next {
	right: -50px;
}

.project-gallery-carousel-wrapper .swiper-button-prev {
	left: 20px;
}

.project-gallery-carousel-wrapper .swiper-button-next {
	right: 20px;
}

.project-gallery-carousel-wrapper .swiper {
	width: 100%;
	height: auto;
}

.project-gallery-carousel-wrapper .swiper-slide {
	width: 100%;
}

.project-related {
	margin-bottom: 60px !important;
}

/* =========================================
   FIX: Gallery Carousel Arrows
========================================= */

/* Keep arrows vertically centered ALWAYS */
.project-gallery-carousel-wrapper .swiper-button-prev,
.project-gallery-carousel-wrapper .swiper-button-next {
	top: 50%;
	transform: translateY(-50%);
}

/* LEFT arrow (normal direction) */
.project-gallery-carousel-wrapper .swiper-button-prev {
	left: 20px;
}

/* RIGHT arrow (flipped correctly) */
.project-gallery-carousel-wrapper .swiper-button-next {
	right: 20px;
	transform: translateY(-50%) rotate(180deg);
}

/* FIX hover jump (preserve translateY) */
.project-gallery-carousel-wrapper .swiper-button-prev:hover {
	transform: translateY(-50%) scale(1.05);
}

.project-gallery-carousel-wrapper .swiper-button-next:hover {
	transform: translateY(-50%) rotate(180deg) scale(1.05);
}

@media (max-width: 999px) {
	.projects-filter {
		width: 100%;
	}
	
	.projects-filter select {
	    background-position: right 10px center;
	}
}

@media (max-width: 768px) {
	.projects-grid {
		grid-template-columns: repeat(2, 1fr) !important;
	}
	
	.carousel-slide {
		flex: 0 0 50%;
	}
	

	.projects-carousel-nav .swiper-button-prev {
		left: -20px;
	}

	.projects-carousel-nav .swiper-button-next {
		right: -20px;
	}
	
	.project-long-copy {
		width: 100% !important;
	}
	
	.project-gallery-carousel-wrapper {
		padding: 0;
	}

}

@media (max-width: 480px) {
	.projects-grid {
		grid-template-columns: 1fr !important;
	}
}