/**
 * Rapport Projects — front end.
 *
 * Everything is scoped under .rp so nothing leaks into the theme, and every colour is a
 * variable so the palette can be retargeted from Additional CSS without touching this file.
 * Type family is deliberately inherited from the theme; only scale, weight and tracking
 * are set here, so the plugin reads as part of the site rather than a bolted-on widget.
 */

.rp {
	--rp-navy: #0e1c33;
	--rp-ink: #12233c;
	--rp-body: #47586c;
	--rp-muted: #7b8899;
	--rp-accent: #c2a15c;
	--rp-canvas: #efefef;
	--rp-card: #fff;
	--rp-line: #e2e5ea;
	--rp-shade: #dfe3e8;
	--rp-radius: 2px;
	--rp-gap: clamp(20px, 2.2vw, 32px);
	--rp-thumb-w: 150px;
	--rp-cols: 2;

	color: var(--rp-body);
}

.rp *,
.rp *::before,
.rp *::after {
	box-sizing: border-box;
}

.rp img {
	display: block;
	max-width: 100%;
	height: auto;
}

.rp button {
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	line-height: 1;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.rp a:focus-visible,
.rp button:focus-visible {
	outline: 2px solid var(--rp-accent);
	outline-offset: 2px;
}

.rp .rp-chev {
	width: 18px;
	height: 18px;
}

/* ---------------------------------------------------------------- Grid */

.rp-grid {
	display: grid;
	grid-template-columns: repeat(var(--rp-cols), minmax(0, 1fr));
	gap: var(--rp-gap);
}

.rp-empty {
	padding: 48px 0;
	text-align: center;
	color: var(--rp-muted);
}

/* ---------------------------------------------------------------- Card */

.rp-card {
	position: relative;
	background: var(--rp-card);
	border: 1px solid var(--rp-line);
	border-radius: var(--rp-radius);
	transition: transform .4s cubic-bezier(.22, .61, .36, 1), box-shadow .4s cubic-bezier(.22, .61, .36, 1), border-color .4s;
}

.rp-card:hover {
	transform: translateY(-3px);
	border-color: #d7dbe1;
	box-shadow: 0 24px 48px -28px rgba(14, 28, 51, .55);
}

.rp-card__media {
	position: relative;
	overflow: hidden;
	aspect-ratio: 4 / 3;
	background: var(--rp-shade);
}

.rp-card__body {
	/* Static on purpose: it lets the title's stretched link resolve against the whole card. */
	position: static;
	padding: 22px 24px 24px;
}

.rp-card__title {
	margin: 0;
	font-size: clamp(17px, .55vw + 15px, 21px);
	font-weight: 500;
	line-height: 1.3;
	letter-spacing: .005em;
}

.rp-card__title a {
	color: var(--rp-navy);
	text-decoration: none;
	box-shadow: none;
	background-image: linear-gradient(var(--rp-accent), var(--rp-accent));
	background-repeat: no-repeat;
	background-position: 0 100%;
	background-size: 0 1px;
	transition: background-size .45s cubic-bezier(.22, .61, .36, 1);
}

.rp-card:hover .rp-card__title a {
	background-size: 100% 1px;
}

/* Stretched link — the whole card is clickable, the arrows sit above it. */
.rp-card__title a::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 2;
}

.rp-card__meta {
	margin: 8px 0 0;
	font-size: 14px;
	color: var(--rp-muted);
}

/* ---------------------------------------------------------------- Card slider */

.rp-slider__track {
	display: flex;
	height: 100%;
	transition: transform .55s cubic-bezier(.22, .61, .36, 1);
	will-change: transform;
}

.rp-slider__slide {
	flex: 0 0 100%;
	height: 100%;
	margin: 0;
	padding: 0;
}

.rp-slider__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 1.1s cubic-bezier(.22, .61, .36, 1);
}

.rp-card:hover .rp-slider__img {
	transform: scale(1.045);
}

.rp-slider__nav,
.rp-stage__nav {
	position: absolute;
	top: 50%;
	z-index: 3;
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	color: var(--rp-navy);
	background: rgba(255, 255, 255, .92);
	border-radius: var(--rp-radius);
	transform: translateY(-50%);
	transition: opacity .3s, background .2s, color .2s;
}

.rp-slider__nav:hover,
.rp-stage__nav:hover {
	background: #fff;
	color: var(--rp-accent);
}

.rp-slider__nav--prev,
.rp-stage__nav--prev {
	left: 12px;
}

.rp-slider__nav--next,
.rp-stage__nav--next {
	right: 12px;
}

.rp-slider__nav {
	opacity: 0;
}

.rp-card:hover .rp-slider__nav,
.rp-slider__nav:focus-visible {
	opacity: 1;
}

@media (hover: none) {
	.rp-slider__nav {
		opacity: 1;
	}
}

.rp-slider__count {
	position: absolute;
	right: 12px;
	bottom: 12px;
	z-index: 3;
	margin: 0;
	padding: 4px 9px;
	font-size: 11px;
	font-weight: 500;
	letter-spacing: .08em;
	color: #fff;
	background: rgba(14, 28, 51, .74);
	border-radius: var(--rp-radius);
}

.rp-slider__placeholder {
	display: grid;
	place-items: center;
	height: 100%;
	background:
		repeating-linear-gradient(-45deg, #e6e9ee 0 10px, #e1e5eb 10px 20px);
	color: var(--rp-muted);
	font-size: 12px;
	letter-spacing: .14em;
	text-transform: uppercase;
}

/* ---------------------------------------------------------------- Single: gallery */

.rp-gallery {
	display: grid;
	gap: 14px;
}

.rp-gallery--right {
	grid-template-columns: minmax(0, 1fr) var(--rp-thumb-w);
}

.rp-gallery--bottom {
	grid-template-columns: minmax(0, 1fr);
}

.rp-stage {
	position: relative;
	overflow: hidden;
	aspect-ratio: 3 / 2;
	background: var(--rp-shade);
	border-radius: var(--rp-radius);
}

.rp-stage__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	cursor: zoom-in;
	transition: opacity .3s ease;
}

.rp-stage.is-swapping .rp-stage__img {
	opacity: 0;
}

.rp-stage__nav {
	opacity: .78;
}

.rp-stage:hover .rp-stage__nav,
.rp-stage__nav:focus-visible {
	opacity: 1;
}

.rp-stage__zoom {
	position: absolute;
	top: 14px;
	right: 14px;
	z-index: 3;
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	color: var(--rp-navy);
	background: rgba(255, 255, 255, .92);
	border-radius: var(--rp-radius);
	opacity: 0;
	transition: opacity .3s, color .2s;
}

.rp-stage__zoom svg {
	width: 18px;
	height: 18px;
}

.rp-stage:hover .rp-stage__zoom,
.rp-stage__zoom:focus-visible {
	opacity: 1;
}

@media (hover: none) {
	.rp-stage__zoom {
		opacity: .9;
	}
}

.rp-stage__count {
	position: absolute;
	left: 14px;
	bottom: 14px;
	z-index: 3;
	margin: 0;
	padding: 5px 10px;
	font-size: 11px;
	font-weight: 500;
	letter-spacing: .1em;
	color: #fff;
	background: rgba(14, 28, 51, .74);
	border-radius: var(--rp-radius);
}

/* Thumbnail rail. The column is relative and empty; the list fills it absolutely, so the
   rail is exactly as tall as the stage and scrolls internally however many images there are. */

.rp-thumbs {
	position: relative;
	min-height: 0;
}

.rp-thumbs__list {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: thin;
	scrollbar-color: #c8cdd4 transparent;
}

.rp-thumbs__list::-webkit-scrollbar {
	width: 4px;
	height: 4px;
}

.rp-thumbs__list::-webkit-scrollbar-thumb {
	background: #c8cdd4;
}

.rp-thumbs__item {
	position: relative;
	flex: 0 0 auto;
	overflow: hidden;
	aspect-ratio: 4 / 3;
	background: var(--rp-shade);
	border-radius: var(--rp-radius);
	opacity: .62;
	transition: opacity .28s ease;
}

.rp-thumbs__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.rp-thumbs__item:hover {
	opacity: .88;
}

.rp-thumbs__item.is-active {
	opacity: 1;
}

.rp-thumbs__item.is-active::after {
	content: "";
	position: absolute;
	inset: 0;
	border: 2px solid var(--rp-accent);
	border-radius: var(--rp-radius);
}

@media (max-width: 899px) {
	.rp-gallery--right {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* Rail below the stage: horizontal, swipeable. */
.rp-gallery--bottom .rp-thumbs {
	position: static;
	height: auto;
}

.rp-gallery--bottom .rp-thumbs__list {
	position: static;
	flex-direction: row;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x proximity;
}

.rp-gallery--bottom .rp-thumbs__item {
	flex: 0 0 108px;
	scroll-snap-align: start;
}

@media (max-width: 899px) {
	.rp-thumbs {
		position: static;
		height: auto;
	}

	.rp-thumbs__list {
		position: static;
		flex-direction: row;
		overflow-x: auto;
		overflow-y: hidden;
		scroll-snap-type: x proximity;
	}

	.rp-thumbs__item {
		flex: 0 0 104px;
		scroll-snap-align: start;
	}
}

/* ---------------------------------------------------------------- Single: page */

.rp-single {
	padding: clamp(36px, 5vw, 72px) 20px clamp(56px, 7vw, 96px);
	background: var(--rp-canvas);
}

.rp-single__inner {
	max-width: 1180px;
	margin: 0 auto;
}

.rp-back {
	margin: 0 0 20px;
	font-size: 13px;
	letter-spacing: .04em;
}

.rp-back a {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--rp-muted);
	text-decoration: none;
	transition: color .2s;
}

.rp-back a:hover {
	color: var(--rp-accent);
}

.rp-back svg {
	width: 14px;
	height: 14px;
}

.rp-eyebrow {
	margin: 0 0 10px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .22em;
	text-transform: uppercase;
	color: var(--rp-accent);
}

.rp-single__title {
	margin: 0 0 clamp(26px, 3vw, 40px);
	font-size: clamp(28px, 2.4vw + 18px, 46px);
	font-weight: 500;
	line-height: 1.14;
	letter-spacing: -.012em;
	color: var(--rp-navy);
}

.rp-single__body {
	margin-top: clamp(34px, 4vw, 54px);
}

.rp-prose {
	max-width: 74ch;
	font-size: 16.5px;
	line-height: 1.75;
	color: var(--rp-body);
}

.rp-prose > *:first-child {
	margin-top: 0;
}

.rp-prose > *:last-child {
	margin-bottom: 0;
}

.rp-prose p {
	margin: 0 0 1.15em;
}

.rp-prose h2,
.rp-prose h3 {
	margin: 1.6em 0 .6em;
	color: var(--rp-navy);
	font-weight: 500;
	line-height: 1.3;
}

.rp-prose h2 {
	font-size: 22px;
}

.rp-prose h3 {
	font-size: 18px;
}

.rp-prose a {
	color: var(--rp-navy);
	text-decoration: underline;
	text-decoration-color: var(--rp-accent);
	text-underline-offset: 3px;
}

.rp-prose ul,
.rp-prose ol {
	margin: 0 0 1.15em;
	padding-left: 1.2em;
}

.rp-prose li {
	margin-bottom: .4em;
}

/* ---------------------------------------------------------------- Single: pager */

.rp-pager {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
	margin-top: clamp(48px, 6vw, 80px);
	padding-top: 26px;
	border-top: 1px solid #dcdfe4;
}

.rp-pager__link {
	display: block;
	text-decoration: none;
	transition: transform .3s cubic-bezier(.22, .61, .36, 1);
}

.rp-pager__link--next {
	grid-column: 2;
	text-align: right;
}

.rp-pager__link--prev:hover {
	transform: translateX(-3px);
}

.rp-pager__link--next:hover {
	transform: translateX(3px);
}

.rp-pager__label {
	display: block;
	margin-bottom: 5px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .18em;
	text-transform: uppercase;
	color: var(--rp-accent);
}

.rp-pager__title {
	display: block;
	font-size: 17px;
	font-weight: 500;
	color: var(--rp-navy);
}

@media (max-width: 599px) {
	.rp-pager {
		grid-template-columns: 1fr;
	}

	.rp-pager__link--next {
		grid-column: 1;
		text-align: left;
	}
}

/* ---------------------------------------------------------------- Lightbox */

.rp-lightbox {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: grid;
	grid-template-rows: 1fr auto;
	padding: clamp(16px, 4vw, 48px);
	background: rgba(9, 17, 30, .95);
	opacity: 0;
	transition: opacity .28s ease;
}

.rp-lightbox[hidden] {
	display: none;
}

.rp-lightbox.is-open {
	opacity: 1;
}

.rp-lightbox__figure {
	display: grid;
	place-items: center;
	min-height: 0;
	margin: 0;
}

.rp-lightbox__img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
}

.rp-lightbox__close,
.rp-lightbox__nav {
	position: absolute;
	display: grid;
	place-items: center;
	width: 46px;
	height: 46px;
	color: #fff;
	background: rgba(255, 255, 255, .12);
	border-radius: var(--rp-radius);
	transition: background .2s, color .2s;
}

.rp-lightbox__close:hover,
.rp-lightbox__nav:hover {
	background: #fff;
	color: var(--rp-navy);
}

.rp-lightbox__close {
	top: 16px;
	right: 16px;
	font-size: 22px;
	line-height: 1;
}

.rp-lightbox__nav--prev {
	top: 50%;
	left: 16px;
	transform: translateY(-50%);
}

.rp-lightbox__nav--next {
	top: 50%;
	right: 16px;
	transform: translateY(-50%);
}

.rp-lightbox__nav .rp-chev {
	width: 20px;
	height: 20px;
}

.rp-lightbox__count {
	margin: 14px 0 0;
	text-align: center;
	font-size: 12px;
	letter-spacing: .14em;
	color: rgba(255, 255, 255, .66);
}

body.rp-lightbox-open {
	overflow: hidden;
}

/* ---------------------------------------------------------------- Motion */

@media (prefers-reduced-motion: reduce) {
	.rp *,
	.rp *::before,
	.rp *::after,
	.rp-lightbox,
	.rp-lightbox * {
		transition-duration: .01ms !important;
		animation-duration: .01ms !important;
	}

	.rp-card:hover {
		transform: none;
	}

	.rp-card:hover .rp-slider__img {
		transform: none;
	}
}
