/* Figma redesign — team-portfolio (owned by the team-portfolio agent)
 * Team (page 305): layout "team"  -> template-parts/redesign/team-portfolio-team.php
 * Portfolio (page 307): layout "portfolio_companies" -> template-parts/redesign/team-portfolio-portfolio.php
 * Figma: filter button 2093:2009, team-card 2041:1934, portfolio card 2016:876, expanded panel 2046:1818.
 */

/* ==========================================================================
   Filter bar (shared by Team and Portfolio)
   ========================================================================== */

.tp-filters {
	display: flex;
	align-items: flex-start;
	box-sizing: border-box;
}

.tp-filter {
	flex: 1 1 0;
	min-width: 0;
}

.tp-filters--portfolio .tp-filter--industry {
	flex: 851 1 0;
}

.tp-filters--portfolio .tp-filter--status {
	flex: 320 1 0;
	min-width: 260px;
}

/* The design hides the "View" group (Gallery/List + "See Case Studies Only") on desktop. */
.tp-filters--portfolio .tp-filter--view {
	display: none;
}

.tp-filter__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	margin: 0;
	padding: 22px 24px;
	border: 0;
	border-right: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 0;
	background: #262929;
	color: #fff;
	font: 18px/1.5 'TitlingGothicFBWideMedium', sans-serif;
	text-align: left;
	cursor: default;
	box-sizing: border-box;
	-webkit-appearance: none;
	appearance: none;
}

.tp-filter:last-child .tp-filter__head {
	border-right: 0;
}

.tp-filter__head span {
	display: block;
	line-height: 14px; /* design trims the text box to cap height: 22 + 13 + 22 = 57px bar */
}

.tp-filter__chev {
	display: none;
	width: 11px;
	height: 6px;
	flex: none;
	transition: transform 0.3s ease;
}

.tp-filter__opts {
	display: flex;
	flex-wrap: wrap;
	gap: 15px 40px;
	padding: 35px 24px 0;
}

.tp-opt {
	display: inline-block;
	position: relative;
	padding-bottom: 7px;
	color: #9B9FA2;
	font: 12px/12px 'SackersGothicStd-Heavy', sans-serif;
	text-transform: uppercase;
	text-decoration: none;
	transition: color 0.3s ease;
}

.tp-opt:after {
	content: '';
	position: absolute;
	left: 0;
	bottom: 0;
	width: 0;
	height: 1px;
	background-color: #D69C36;
	transition: width 0.3s ease;
}

.tp-opt:hover,
.tp-opt:focus-visible,
.tp-opt.active {
	color: var(--np-gold, #D69C36);
}

.tp-opt.active:after {
	width: 100%;
}

.tp-opt--icon {
	display: inline-flex;
	align-items: center;
	gap: 12px;
}

.tp-opt--icon i {
	font-size: 16px;
	line-height: 1;
}

.tp-opt--switch.active:after {
	width: 0;
}

.tp-empty {
	padding: 40px 0;
	color: #797C7C;
	font: 16px/1.5 'PragmaticaLight', sans-serif;
}

/* ==========================================================================
   Team
   ========================================================================== */

section.tp-team {
	padding-top: 0;
}

.tp-team .tp-filters {
	margin-bottom: 75px;
}

/* space before the next row (the footnote complex_block, which has no top padding) */
.tp-team > .cont {
	padding-bottom: 100px;
}

.tp-team-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 55px;
}

.tp-card {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	aspect-ratio: 251 / 364;
	overflow: hidden;
	background-color: #C2C7CB;
	outline-offset: 4px;
}

.tp-card__img {
	position: absolute;
	inset: 0;
	background-position: center top;
	background-size: cover;
	background-repeat: no-repeat;
	transition: opacity 0.5s ease-in-out;
}

.tp-card__img--hover {
	opacity: 0;
}

.tp-card.hov_p_exists:hover .tp-card__img--hover,
.tp-card.hov_p_exists:focus-visible .tp-card__img--hover {
	opacity: 1;
}

.tp-card.hov_p_exists:hover .tp-card__img--main,
.tp-card.hov_p_exists:focus-visible .tp-card__img--main {
	opacity: 0;
}

.tp-card__text {
	position: relative;
	z-index: 2;
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 50px 20px 20px;
	background: linear-gradient(to bottom, rgba(38, 41, 41, 0) 0%, #262929 100%);
	color: #fff;
}

.tp-card .tp-card__name {
	margin: 0;
	color: #fff;
	font: 18px/1.2 'TitlingGothicFBWideMedium', sans-serif;
	transition: color 0.3s ease;
}

.tp-card:hover .tp-card__name,
.tp-card:focus-visible .tp-card__name {
	color: #D69C36;
}

.tp-card .tp-card__pos {
	margin: 0;
	color: #fff;
	font: 10px/1.4 'SackersGothicStd-Heavy', sans-serif;
	letter-spacing: 1px;
}

.tp-card.no_portrait .tp-card__text {
	background: linear-gradient(to bottom, rgba(38, 41, 41, 0) 0%, rgba(38, 41, 41, 0.85) 100%);
}

/* ==========================================================================
   Portfolio
   ========================================================================== */

main section.tp-portfolio {
	padding-top: 122px !important; /* beats .padding_t_none set on the row */
}

.tp-portfolio .tp-filters {
	margin-bottom: 100px;
}

.tp-portfolio > .cont {
	padding-bottom: 85px;
}

.tp-pgrid {
	position: relative;
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 80px 50px;
}

.tp-pcard {
	position: relative;
	aspect-ratio: 357 / 267;
	overflow: hidden;
	background-color: #272A2A;
	box-shadow: 0 7px 15px rgba(0, 0, 0, 0.16);
	outline-offset: 4px;
}

.tp-pcard__img {
	position: absolute;
	inset: 0;
	background-position: center;
	background-size: cover;
	filter: grayscale(1);
	transition: filter 0.4s ease, transform 0.6s ease;
}

/* kept from the old site: photo turns to colour on hover / when expanded */
.tp-pcard:hover .tp-pcard__img,
.tp-pcard:focus-visible .tp-pcard__img,
.tp-pcard.active .tp-pcard__img {
	filter: grayscale(0);
}

.tp-pcard:before {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 63.7%;
	z-index: 1;
	background: linear-gradient(to bottom, rgba(39, 42, 42, 0) 0%, #272A2A 100%);
}

.tp-pcard__logo {
	position: absolute;
	left: 19px;
	bottom: 18px;
	z-index: 2;
	width: calc(100% - 80px);
	line-height: 0;
}

/* Fixed box + contain: logos are SVGs, some with only a viewBox (no intrinsic size), so the box gives them a
   size and keeps very different aspect ratios visually balanced (design: ~40px tall wide logos, ~60px tall stacked). */
.tp-pcard__logo img {
	display: block;
	width: 200px;
	max-width: 100%;
	height: 46px;
	object-fit: contain;
	object-position: left bottom;
}

.tp-pcard__logo img.vert {
	width: 130px;
	height: 60px;
}

.tp-pcard__icon {
	position: absolute;
	right: 18px;
	bottom: 18px;
	z-index: 2;
	width: 14px;
	height: 13px;
	transition: transform 0.3s ease;
}

.tp-pcard.active .tp-pcard__icon {
	transform: rotate(45deg);
}

.tp-pcard__cs {
	position: absolute;
	top: 18px;
	left: 19px;
	z-index: 2;
	margin: 0;
	padding: 6px 10px;
	background: #D69C36;
	color: #fff;
	font: 10px/1.4 'SackersGothicStd-Heavy', sans-serif;
	letter-spacing: 1px;
}

/* Expanded panel (clone of .tp-detail placed after the active card's row) */
.tp-panel {
	position: relative;
	grid-column: 1 / -1;
	margin-top: -30px;
}

.tp-panel__notch {
	position: absolute;
	top: -24px;
	width: 43px;
	height: 30px;
	margin-left: -21.5px;
	z-index: 2;
	background: url(../../img/redesign/tp-notch.svg) no-repeat center top / 43.33px 29.75px;
}

/* Company detail: used in the panel and in the (mobile/hidden) List view */
.tp-detail {
	display: flex;
	align-items: flex-start;
	gap: 60px;
	padding: 50px;
	border: 1px solid var(--np-gold, #D69C36);
	background: #fff;
	box-sizing: border-box;
}

.tp-plist .tp-detail + .tp-detail {
	margin-top: 40px;
}

.tp-detail__logo {
	flex: 0 0 192px;
	width: 192px;
}

.tp-detail__logo img {
	display: block;
	max-width: 100%;
	max-height: 70px;
	width: auto;
	height: auto;
}

.tp-detail__logo h4 {
	margin: 0;
	color: #292929;
	font: 18px/1.4 'TitlingGothicFBWideMedium', sans-serif;
}

.tp-detail__body {
	display: flex;
	flex: 1 1 0;
	flex-direction: column;
	gap: 40px;
	min-width: 0;
}

.tp-detail__specs {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 20px 40px;
}

.tp-spec__label {
	margin: 0 0 12px;
	color: var(--np-gold, #D69C36);
	font: 11px/1.2 'SackersGothicStd-Heavy', sans-serif;
	text-transform: uppercase;
}

.tp-spec__value {
	margin: 0;
	color: #292929;
	font: 16px/31px 'PragmaticaBold', sans-serif;
}

.tp-spec__value a {
	color: inherit;
	text-decoration: none;
	transition: color 0.3s ease;
}

.tp-spec__value a:hover {
	color: #D69C36;
}

.tp-detail__text,
.tp-detail__text p {
	color: #292929;
	font: 16px/1.5 'PragmaticaLight', sans-serif;
}

.tp-detail__text p {
	margin: 0 0 1em;
}

.tp-detail__text p:last-child {
	margin-bottom: 0;
}

.tp-detail__text p:empty {
	display: none;
}

.tp-video {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	aspect-ratio: 1575 / 750;
	overflow: hidden;
	background: #0B1320;
}

.tp-video video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	pointer-events: none;
}

.tp-video__shade {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.2);
	transition: background-color 0.3s ease;
}

.tp-video:hover .tp-video__shade {
	background: rgba(0, 0, 0, 0.35);
}

.tp-video__play {
	position: relative;
	z-index: 1;
	width: 118px;
	height: 118px;
	margin-top: 7px;
	transition: transform 0.3s ease;
}

.tp-video:hover .tp-video__play {
	transform: scale(1.06);
}

.tp-detail__cs {
	margin: 0;
	font: 11px/1.2 'SackersGothicStd-Heavy', sans-serif;
}

.tp-detail__cs a {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	color: var(--np-gold, #D69C36);
	text-decoration: none;
}

.tp-detail__cs img {
	width: 30px;
	height: auto;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media screen and (max-width: 1439px) {
	.tp-team-grid {
		gap: 45px 30px;
	}
}

@media screen and (max-width: 1199px) {
	.tp-team-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 45px;
	}

	.tp-pgrid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 60px 40px;
	}

	.tp-detail {
		gap: 40px;
		padding: 40px;
	}

	.tp-detail__logo {
		flex-basis: 150px;
		width: 150px;
	}
}

@media screen and (max-width: 1023px) {
	.tp-team-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.tp-detail {
		flex-direction: column;
	}

	.tp-detail__logo {
		flex-basis: auto;
	}
}

@media screen and (max-width: 767px) {
	/* filters become full-bleed accordions */
	.tp-filters {
		flex-direction: column;
		width: auto;
		margin-left: -30px;
		margin-right: -30px;
	}

	.tp-filter,
	.tp-filters--portfolio .tp-filter--industry,
	.tp-filters--portfolio .tp-filter--status {
		flex: none;
		width: 100%;
		border-top: 1px solid #595E5E;
	}

	.tp-filters--portfolio .tp-filter--view {
		display: block;
	}

	.tp-filter__head {
		padding: 22px 30px;
		border-right: 0;
		cursor: pointer;
	}

	.tp-filter__chev {
		display: block;
		transform: rotate(0deg);
	}

	.tp-filter.is-open .tp-filter__chev {
		transform: rotate(180deg);
	}

	.tp-filter__opts {
		display: none;
		gap: 24px 40px;
		padding: 30px;
	}

	.tp-filter.is-open .tp-filter__opts {
		display: flex;
	}

	.tp-opt {
		padding-bottom: 5px;
	}

	.tp-team .tp-filters {
		margin-bottom: 60px;
	}

	.tp-team-grid {
		grid-template-columns: minmax(0, 271px);
		justify-content: center;
		gap: 55px;
	}

	.tp-card {
		aspect-ratio: 271 / 364;
	}

	main section.tp-portfolio {
		padding-top: 60px !important;
	}

	.tp-portfolio .tp-filters {
		margin-bottom: 60px;
	}

	.tp-pgrid {
		grid-template-columns: minmax(0, 1fr);
		gap: 50px;
	}

	.tp-pcard {
		aspect-ratio: 380 / 267;
	}

	.tp-team > .cont,
	.tp-portfolio > .cont {
		padding-bottom: 70px;
	}

	.tp-panel {
		margin-top: -20px;
	}

	.tp-detail {
		gap: 40px;
		padding: 30px 20px;
	}

	.tp-detail__logo {
		padding: 0 4px;
	}

	.tp-detail__specs {
		flex-direction: column;
		gap: 26px;
	}

	.tp-spec__label {
		margin-bottom: 8px;
	}

	.tp-spec__value {
		line-height: 1.4;
	}

	.tp-video__play {
		width: 100px;
		height: 100px;
	}
}
