/* Projects: [projects_grid] / [awards_grid] filter pills and grid, project cards, single project page. */

:root {
	--pagnes-pill-navy: rgb(1, 51, 74);       /* header / footer navy */
	--pagnes-pill-tint: #eef3f6;
	--pagnes-project-blue: rgb(2, 110, 159);
	--pagnes-project-ink: #1f2a30;
	--pagnes-project-line: #dde3e8;
}

/* ---- Project grids (inc/projects-grid.php) ---- */

.pagnes-projects {
	scroll-margin-top: 120px; /* clear the sticky nav when paging scrolls back up */
}

.pagnes-projects__filters {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
	margin-bottom: 28px;
}

/* Narrows the row so the pills wrap more evenly instead of leaving one alone on the last line. */
@media (min-width: 1220px) {
	.pagnes-projects__filters {
		padding: 0 75px;
	}
}

/* #colibri matches the theme's own button rules so these win. */
#colibri .pagnes-projects__filter {
	margin: 0;
	padding: 8px 18px;
	border: 1px solid var(--pagnes-pill-navy);
	border-radius: 999px;
	background: #fff;
	box-shadow: none;
	color: var(--pagnes-pill-navy);
	cursor: pointer;
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: .01em;
	line-height: 1.3;
	text-transform: none;
	transition: background-color .15s ease, color .15s ease;
}

#colibri .pagnes-projects__filter:hover {
	background: var(--pagnes-pill-tint);
	color: var(--pagnes-pill-navy);
}

#colibri .pagnes-projects__filter.is-active {
	background: var(--pagnes-pill-navy);
	color: #fff;
}

#colibri .pagnes-projects__filter:focus-visible {
	outline: 2px solid var(--pagnes-pill-navy);
	outline-offset: 2px;
}

#colibri .pagnes-projects__count {
	margin: 0 0 15px;
	color: #1f1f1f;
	font-size: 14px;
	line-height: 1.35;
}

.pagnes-projects__results {
	transition: opacity .2s ease;
}

.pagnes-projects__results.is-loading {
	opacity: .45;
	pointer-events: none;
}

#colibri .pagnes-projects__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 30px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.pagnes-projects__item {
	margin: 0;
}

@media (min-width: 576px) {
	#colibri .pagnes-projects__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 768px) {
	#colibri .pagnes-projects__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 992px) {
	#colibri .pagnes-projects__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.pagnes-projects__empty {
	padding: 60px 0;
	text-align: center;
}

#colibri .pagnes-projects__pagination ul {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	margin: 40px 0 0;
	padding: 0;
	list-style: none;
}

#colibri .pagnes-projects__pagination li {
	margin: 0;
}

#colibri .pagnes-projects__page {
	display: inline-block;
	min-width: 40px;
	color: #1f1f1f;
	font-size: 16px;
	line-height: 1;
	text-align: center;
	text-decoration: none;
}

#colibri a.pagnes-projects__page:hover {
	color: var(--pagnes-project-blue);
}

#colibri .pagnes-projects__page.is-current {
	font-weight: 700;
}

/* ---- Project cards (grid and related projects, markup from inc/projects.php) ---- */

.pagnes-project-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	background: #fff;
	border: 1px solid var(--pagnes-project-line);
	color: inherit;
	text-decoration: none !important;
	overflow: hidden;
	transition: box-shadow .25s ease, transform .25s ease;
}

.pagnes-project-card:hover,
.pagnes-project-card:focus-visible {
	box-shadow: 0 12px 30px rgba(1, 51, 74, .14);
	transform: translateY(-3px);
}

.pagnes-project-card:focus-visible {
	outline: 2px solid var(--pagnes-pill-navy);
	outline-offset: 2px;
}

.pagnes-project-card__media {
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: var(--pagnes-pill-tint);
}

.pagnes-project-card__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .5s ease;
}

.pagnes-project-card:hover .pagnes-project-card__img {
	transform: scale(1.05);
}

.pagnes-project-card__body {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 16px 18px 20px;
	text-align: left;
}

.pagnes-project-card__sector {
	color: var(--pagnes-project-blue);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .08em;
	line-height: 1.3;
	text-transform: uppercase;
}

.pagnes-project-card__title {
	margin: 0;
	color: var(--pagnes-pill-navy);
	font-size: 17px;
	font-weight: 600;
	line-height: 1.35;
	transition: color .2s ease;
}

.pagnes-project-card:hover .pagnes-project-card__title {
	color: var(--pagnes-project-blue);
}

/* Award designations ([awards_grid]) */
#colibri .pagnes-project-card__awards {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 6px 0 0;
	padding: 12px 0 0;
	border-top: 1px solid var(--pagnes-project-line);
	list-style: none;
}

#colibri .pagnes-project-card__awards li {
	position: relative;
	margin: 0;
	padding-left: 23px;
	color: var(--pagnes-project-ink);
	font-size: 14px;
	line-height: 1.4;
}

/* Font Awesome Pro "award" (regular) as a mask, so it can be coloured with the brand blue.
   The viewBox is widened to fit the path, which overflows FA's 448x512 box. */
.pagnes-project-card__awards li::before {
	--pagnes-award-icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -32 448 592'><path d='M109.4 77.4c-11.2 11.2-23.5 19.6-37 27.1 .2 15.4-.9 30.2-5 45.6S56.8 178.8 49 192c7.9 13.2 14.4 26.6 18.5 41.9s5.2 30.2 5 45.6c13.4 7.5 25.7 15.9 37 27.1s19.6 23.5 27.1 37c15.4-.2 30.2 .9 45.6 5S210.8 359.2 224 367c13.2-7.9 26.6-14.4 41.9-18.5s30.2-5.2 45.6-5c7.5-13.4 15.9-25.7 27.1-37s23.5-19.6 37-27.1c-.2-15.4 .9-30.2 5-45.6S391.2 205.2 399 192c-7.9-13.2-14.4-26.6-18.5-41.9s-5.2-30.2-5-45.6c-13.4-7.5-25.7-15.9-37-27.1s-19.6-23.5-27.1-37c-15.4 .2-30.2-.9-45.6-5S237.2 24.8 224 17c-13.2 7.9-26.6 14.4-41.9 18.5s-30.2 5.2-45.6 5c-7.5 13.4-15.9 25.7-27.1 37zM202.1-25.9c13.4-8.2 30.3-8.2 43.7 0 24.4 14.9 39.5 18.9 68.1 18.3 15.7-.4 30.3 8.1 37.9 21.9 13.7 25.1 24.8 36.2 49.9 49.9 13.8 7.5 22.2 22.2 21.9 37.9-.7 28.6 3.4 43.7 18.3 68.1 8.2 13.4 8.2 30.3 0 43.7-14.9 24.4-18.9 39.5-18.3 68.1 .4 15.7-8.1 30.3-21.9 37.9-15.1 8.2-25.1 15.5-33.6 25.5l61.1 115.4c6.2 11.7 1.8 26.1-9.8 32.4l-104 56c-11.6 6.2-26 2-32.4-9.5l-59-106.2-59 106.2c-6.4 11.5-20.8 15.7-32.4 9.5l-104-56c-11.6-6.3-16-20.7-9.8-32.4L79.9 345.3c-8.6-9.9-18.6-17.2-33.6-25.5-13.8-7.5-22.2-22.2-21.9-37.9 .7-28.6-3.4-43.7-18.3-68.1-8.2-13.4-8.2-30.3 0-43.7 14.9-24.4 18.9-39.5 18.3-68.1-.4-15.7 8.1-30.3 21.9-37.9 25.1-13.7 36.2-24.8 49.9-49.9 7.5-13.8 22.2-22.2 37.9-21.9 28.6 .7 43.7-3.4 68.1-18.3zm59 427.3l52.3 94.2 62.2-33.5-40.2-75.9c-6.4 3.6-13.8 5.5-21.5 5.3-22.2-.5-36.3 1.8-52.9 9.8zM134 391.6c-7.7 .2-15-1.7-21.5-5.3l-40.2 75.9 62.2 33.5 52.3-94.2c-16.6-8-30.7-10.3-52.9-9.8zM152 192a72 72 0 1 0 144 0 72 72 0 1 0 -144 0zm72 120a120 120 0 1 1 0-240 120 120 0 1 1 0 240z'/></svg>");
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	width: 14.4px; /* 19px tall at the viewBox ratio, 448:592 */
	height: 19px;
	background: var(--pagnes-project-blue);
	-webkit-mask: var(--pagnes-award-icon) center / contain no-repeat;
	mask: var(--pagnes-award-icon) center / contain no-repeat;
}

@media (prefers-reduced-motion: reduce) {
	.pagnes-projects__results,
	.pagnes-project-card,
	.pagnes-project-card__img {
		transition: none;
	}
	.pagnes-project-card:hover { transform: none; }
	.pagnes-project-card:hover .pagnes-project-card__img { transform: none; }
}

/* ---- Single project (single-projects.php) ---- */

.pagnes-project__container {
	padding-left: 16px;
	padding-right: 16px;
}

/* The photo runs behind Colibri's overlapping nav; .pagnes-nav-spacer keeps the text clear of it. */
.pagnes-project__hero {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	min-height: clamp(420px, 75vh, 860px);
	padding: 0 0 48px;
	background-color: var(--pagnes-pill-navy);
	/* The nav is solid, so only the bottom (behind the title) is darkened. */
	background-image:
		linear-gradient(180deg, rgba(1, 25, 37, 0) 45%, rgba(1, 25, 37, .85) 100%),
		var(--pagnes-hero, none);
	background-position: center;
	background-size: cover;
	color: #fff;
}

.pagnes-project__hero.is-plain {
	min-height: 0;
}

.pagnes-project__hero .pagnes-project__container {
	width: 100%;
	padding-top: 48px;
}

.pagnes-project__back {
	display: inline-block;
	margin-bottom: 20px;
	color: rgba(255, 255, 255, .85) !important;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none !important;
}

.pagnes-project__back::before {
	content: "\2190  ";
}

.pagnes-project__back:hover {
	color: #fff !important;
}

.pagnes-project__sector {
	margin: 0 0 10px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: #9fd8f5;
}

.pagnes-project__title {
	max-width: 900px;
	margin: 0;
	color: #fff;
	font-size: clamp(28px, 4vw, 46px);
	line-height: 1.15;
	text-shadow: 0 1px 12px rgba(0, 0, 0, .25);
}

.pagnes-project__location {
	margin: 12px 0 0;
	color: rgba(255, 255, 255, .85);
	font-size: 17px;
}

.pagnes-project__layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 320px;
	gap: 56px;
	align-items: start;
	padding-top: 56px;
	padding-bottom: 72px;
}

@media (max-width: 991px) {
	.pagnes-project__layout {
		grid-template-columns: 1fr;
		gap: 32px;
		padding-top: 40px;
	}
}

.pagnes-project__content {
	color: var(--pagnes-project-ink);
	font-size: 17px;
	line-height: 1.75;
}

/* Older projects set justify inline; left-aligned reads better.
   #colibri matches Colibri's own paragraph rules so these win. */
#colibri .pagnes-project__content p {
	margin: 0 0 1.25em;
	font-size: inherit;
	line-height: inherit;
	padding-left: 0 !important;
	text-align: left !important;
}

#colibri .pagnes-project__content > p:first-child {
	font-size: 19px;
	line-height: 1.65;
}

.pagnes-project__content img {
	max-width: 100%;
	height: auto;
}

.pagnes-project__content figure {
	margin: 2em 0;
}

.pagnes-project__content .wp-block-gallery {
	gap: 12px;
}

/* A few projects have a leftover Gallery block with no images. */
.pagnes-project__content .wp-block-gallery:not(:has(img)) {
	display: none;
}

/* ---- Gallery carousel (assets/js/project-gallery.js) ---- */

.pagnes-carousel {
	margin: 2em 0;
}

.pagnes-carousel__stage {
	position: relative;
}

.pagnes-carousel__track {
	display: flex;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	overscroll-behavior-x: contain;
	scrollbar-width: none;
	background: var(--pagnes-pill-tint);
}

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

@media (prefers-reduced-motion: no-preference) {
	.pagnes-carousel__track {
		scroll-behavior: smooth;
	}
}

.pagnes-carousel__track:focus-visible {
	outline: 2px solid var(--pagnes-pill-navy);
	outline-offset: 2px;
}

.pagnes-project__content .pagnes-carousel__slide {
	position: relative;
	flex: 0 0 100%;
	margin: 0;
	aspect-ratio: 4 / 3;
	scroll-snap-align: start;
	scroll-snap-stop: always;
}

.pagnes-project__content .pagnes-carousel__slide img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.pagnes-carousel__slide figcaption {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	margin: 0;
	padding: 28px 20px 14px;
	background: linear-gradient(transparent, rgba(0, 0, 0, .6));
	color: #fff;
	font-size: 14px;
	line-height: 1.4;
}

.pagnes-carousel__button {
	position: absolute;
	top: 50%;
	display: grid;
	place-items: center;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .92);
	box-shadow: 0 2px 10px rgba(0, 0, 0, .2);
	color: var(--pagnes-pill-navy);
	cursor: pointer;
	transform: translateY(-50%);
	transition: background-color .15s, color .15s, opacity .15s;
}

.pagnes-carousel__button.is-prev {
	left: 16px;
}

.pagnes-carousel__button.is-next {
	right: 16px;
}

/* Chevron */
.pagnes-carousel__button::before {
	content: "";
	width: 11px;
	height: 11px;
	border: solid currentColor;
	border-width: 0 2.5px 2.5px 0;
	transform: translateX(-2px) rotate(-45deg);
}

.pagnes-carousel__button.is-prev::before {
	transform: translateX(2px) rotate(135deg);
}

.pagnes-carousel__button:hover:not(:disabled) {
	background: var(--pagnes-pill-navy);
	color: #fff;
}

.pagnes-carousel__button:focus-visible {
	outline: 2px solid var(--pagnes-pill-navy);
	outline-offset: 2px;
}

.pagnes-carousel__button:disabled {
	opacity: 0;
	pointer-events: none;
}

.pagnes-carousel__count {
	margin-top: 10px;
	color: var(--pagnes-project-blue);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .1em;
	text-align: right;
}

.pagnes-carousel__caption {
	margin-top: 6px;
	font-size: 14px;
	text-align: center;
}

@media (max-width: 600px) {
	.pagnes-carousel__button {
		width: 40px;
		height: 40px;
	}

	.pagnes-carousel__button.is-prev {
		left: 8px;
	}

	.pagnes-carousel__button.is-next {
		right: 8px;
	}
}

.pagnes-project__details {
	position: sticky;
	top: 90px;
	padding: 28px;
	background: var(--pagnes-pill-tint);
	border-top: 4px solid var(--pagnes-pill-navy);
}

.pagnes-project__details-title {
	margin: 0 0 18px;
	color: var(--pagnes-pill-navy);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
}

.pagnes-project__details dl {
	margin: 0;
}

.pagnes-project__detail {
	padding: 12px 0;
	border-top: 1px solid var(--pagnes-project-line);
}

.pagnes-project__detail:first-child {
	padding-top: 0;
	border-top: 0;
}

.pagnes-project__detail dt {
	margin-bottom: 2px;
	color: #5b6770;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
}

.pagnes-project__detail dd {
	margin: 0;
	color: var(--pagnes-project-ink);
	font-size: 16px;
	font-weight: 600;
	line-height: 1.4;
}

.pagnes-project__related {
	padding: 64px 0 80px;
	background: #f6f8f9;
	border-top: 1px solid var(--pagnes-project-line);
}

.pagnes-project__related-head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 28px;
}

.pagnes-project__related-head h2 {
	margin: 0;
	color: var(--pagnes-pill-navy);
	font-size: 28px;
}

.pagnes-project__related-head a {
	margin-left: auto; /* clearfix pseudo-elements count as flex items, so space-between can't be trusted */
	color: var(--pagnes-project-blue);
	font-weight: 600;
	text-decoration: none;
}

.pagnes-project__related-head a::after {
	content: " \2192";
}

.pagnes-project__related-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 24px;
}

@media (max-width: 991px) {
	.pagnes-project__related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 575px) {
	.pagnes-project__related-grid { grid-template-columns: 1fr; }
}
