/*
 * Project page — Figma: 3.0-project-page (1400px frame, 48px gutters) and
 * 3.0-project-page_M (420px, 24px gutters). Vertical rhythm between the
 * big blocks is 72px throughout.
 */

/* -- breadcrumb (base styles: layout.css) -- */

.breadcrumb__category,
.project-head__meta-item--category {
	text-transform: capitalize; /* category names are stored lowercase */
}

/* -- head: text column (529) + featured image (751×503) -- */

.project-head {
	display: flex;
	gap: 24px;
	margin-top: 12px;
	padding: 0 48px;
}

.project-head__content {
	flex: 0 0 529px;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: space-between;
	gap: 24px;
}

.project-head__top {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 24px;
}

.project-head__title {
	margin: 0;
	font-family: var(--font-display);
	font-size: 48px;
	font-weight: 500;
	line-height: 50px;
}

.project-head__line {
	display: block;
	width: 37px;
	height: 1px;
	background: var(--rds-beige);
}

.project-head__meta {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.project-head__meta-row {
	display: flex;
	flex-wrap: wrap;
	column-gap: 24px;
	row-gap: 12px;
}

.project-head__meta-item {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 16px;
	line-height: 22px;
	letter-spacing: 0.32px;
	color: var(--rds-dark-grey);
}

a.project-head__meta-item:hover,
.project-head__author:hover {
	color: var(--rds-black);
}

.project-head__bottom {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 24px;
	width: 100%;
}

.project-head__media {
	flex: 1 1 751px;
	min-width: 0;
	aspect-ratio: 751 / 503;
}

.project-head__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* -- tags + actions (shared by the head and the bottom row) -- */

.project-tags {
	margin: 0;
	font-size: 16px;
	line-height: 22px;
	letter-spacing: 0.32px;
}

.project-tags a {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.project-actions {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 18px;
}

.project-actions__buttons {
	display: flex;
	gap: 18px;
}

/* Bookmark + "Save project" (Figma 3.0 head: 45px button, 12px gap, text). */
.project-actions__save {
	display: inline-flex;
	align-items: center;
	gap: 12px;
}

.project-actions__save-label {
	font-size: 16px;
	line-height: 22px;
	letter-spacing: 0.32px;
	color: var(--rds-dark-grey);
	cursor: pointer;
	white-space: nowrap;
}

.project-actions__saved-text,
.icon-button.is-saved + .project-actions__save-label .project-actions__save-text {
	display: none;
}

.icon-button.is-saved + .project-actions__save-label .project-actions__saved-text {
	display: inline;
}

.icon-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 45px;
	height: 45px;
	padding: 10px;
	border: 1px solid var(--rds-beige);
	border-radius: 8px;
	background: transparent;
	cursor: pointer;
	transition: background-color 0.2s;
}

.icon-button:hover {
	background: var(--rds-light-grey);
}

.icon-button.is-saved {
	background: var(--rds-black);
	border-color: var(--rds-black);
}

.icon-button.is-saved img {
	filter: invert(1);
}

.icon-button--text {
	width: auto;
	padding: 0 14px;
	font-family: var(--font-body);
	font-size: 14px;
	line-height: 20px;
	color: var(--rds-black);
	text-decoration: none;
}

.project-actions__share {
	display: flex;
	align-items: center;
	gap: 18px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.project-actions__share a {
	display: block;
	transition: opacity 0.2s;
}

.project-actions__share a:hover {
	opacity: 0.6;
}

/* -- description + video -- */

.project__content {
	display: flex;
	flex-direction: column;
	gap: 24px;
	max-width: 640px;
	margin: 72px auto 0;
	font-size: 16px;
	line-height: 22px;
	letter-spacing: 0.32px;
}

.project__content > * {
	margin: 0;
}

.project__content a {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.project__video {
	max-width: 1082px;
	margin: 72px auto 0;
	aspect-ratio: 16 / 9;
}

.project__video iframe {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
}

/* -- gallery -- */

.project-gallery {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-top: 72px;
	padding: 0 48px;
}

.gallery-row {
	display: grid;
	column-gap: 24px;
	row-gap: 12px;
	align-items: start;
}

.gallery-row--full  { grid-template-columns: 1fr; }
.gallery-row--l3    { grid-template-columns: repeat(3, 1fr); }
.gallery-row--l2    { grid-template-columns: repeat(2, 1fr); }
.gallery-row--p4    { grid-template-columns: repeat(4, 1fr); }
.gallery-row--mixed { grid-template-columns: 861fr 419fr; } /* same height: 861×578 + 419×578 */

/* 2–3 leftover portraits: keep the p4 column width, centered */
.gallery-row--p1,
.gallery-row--p2,
.gallery-row--p3 {
	grid-auto-flow: column;
	grid-auto-columns: calc((100% - 72px) / 4);
	justify-content: center;
}

.gallery-item {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 12px;
	margin: 0;
	min-width: 0;
}

.gallery-item__image {
	width: 100%;
	aspect-ratio: 3 / 2;
	object-fit: cover;
}

.gallery-row--p4 .gallery-item__image,
.gallery-row--p1 .gallery-item__image,
.gallery-row--p2 .gallery-item__image,
.gallery-row--p3 .gallery-item__image {
	aspect-ratio: 308 / 425;
}

.gallery-row--mixed .gallery-item:first-child .gallery-item__image {
	aspect-ratio: 861 / 578;
}

.gallery-row--mixed .gallery-item:last-child .gallery-item__image {
	aspect-ratio: 419 / 578;
}

.gallery-item__caption {
	font-size: 12px;
	line-height: 15.7px;
	letter-spacing: 1.2px;
	text-transform: uppercase;
	color: var(--rds-dark-grey);
}

/* -- credits table -- */

.project-credits {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-top: 48px;
	padding: 24px 48px;
	border-top: 1px solid var(--rds-mid-grey);
	border-bottom: 1px solid var(--rds-mid-grey);
}

.project-credits__title {
	margin: 0;
	font-family: var(--font-body);
	font-size: 14px;
	font-weight: 600;
	line-height: 20px;
}

.project-credits__list {
	display: flex;
	flex-wrap: wrap;
	row-gap: 12px;
	/* every item has a left divider; the list is pulled 25px to the left and
	   clips, so the divider of the first item on each wrapped line is hidden */
	margin: 0 0 0 -25px;
	overflow: hidden;
}

.project-credits__item {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin-left: -1px;
	padding: 0 24px 0 25px;
	border-left: 1px solid var(--rds-mid-grey);
	font-size: 14px;
	line-height: 20px;
}

.project-credits__link:hover {
	color: #777777;
}

.project-credits__item dt {
	color: #777777;
}

.project-credits__item dd {
	margin: 0;
}

/* -- bottom tags/actions + related -- */

.project__bottom-actions {
	display: flex;
	flex-direction: column;
	gap: 24px;
	margin-top: 72px;
	padding: 12px 48px 0;
}

.project-related {
	margin-top: 72px;
	padding: 48px;
	border-top: 1px solid var(--rds-mid-grey);
}


/* -- responsive -- */

@media (max-width: 1100px) {
	.project-head__content {
		flex-basis: 420px;
	}

	.project-head__title {
		font-size: 40px;
		line-height: 44px;
	}
}

@media (max-width: 900px) {
	.breadcrumb {
		margin-top: 0;
		padding: 18px 24px;
	}

	/* current page title truncates with an ellipsis, like the mobile design */
	.breadcrumb__list {
		flex-wrap: nowrap;
	}

	.breadcrumb__list li[aria-current] {
		display: block;
		flex: 1 1 0;
		min-width: 0;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	.breadcrumb__list li[aria-current]::before {
		margin-right: 8px;
	}

	.project-head {
		flex-direction: column;
		gap: 12px;
		margin-top: 0;
		padding: 0 24px;
	}

	.project-head__media {
		order: -1;
		flex: none;
		width: 100%;
		aspect-ratio: 3 / 2;
	}

	.project-head__content {
		flex: none;
		width: 100%;
	}

	.project-head__title {
		font-size: 36px;
		line-height: 40px;
	}

	.project__content {
		margin-top: 0;
		padding: 48px 24px;
		max-width: none;
	}

	.project__video {
		margin: 0 24px;
	}

	.project-gallery {
		margin-top: 48px;
		padding: 0 24px;
	}

	.gallery-row {
		column-gap: 12px;
	}

	.project-credits {
		padding: 24px;
	}

	.project__bottom-actions {
		margin-top: 24px;
		padding: 0 24px;
	}

	.project-related {
		margin-top: 48px;
		padding: 36px 24px;
	}
}

@media (max-width: 560px) {
	.gallery-row--full,
	.gallery-row--l3,
	.gallery-row--l2,
	.gallery-row--mixed {
		grid-template-columns: 1fr;
	}

	.gallery-row--mixed .gallery-item:first-child .gallery-item__image {
		aspect-ratio: 3 / 2;
	}

	.gallery-row--p4,
	.gallery-row--p2,
	.gallery-row--p3 {
		grid-auto-flow: row;
		grid-template-columns: repeat(2, 1fr);
		grid-auto-columns: auto;
	}

	.gallery-row--p1 {
		grid-auto-columns: 100%;
	}

	.project-credits__list {
		flex-direction: column;
		margin-left: 0;
	}

	.project-credits__item {
		margin-left: 0;
		padding: 0;
		border-left: 0;
	}

	.project-credits__item + .project-credits__item {
		padding-top: 12px;
		border-top: 1px solid var(--rds-mid-grey);
	}

}

/* -- lightbox (PhotoSwipe) -- */

.gallery-item__link,
a.project-head__media {
	display: block;
	cursor: zoom-in;
}

.gallery-item__link:focus-visible,
a.project-head__media:focus-visible {
	outline: 2px solid var(--rds-beige);
	outline-offset: 2px;
}

.pswp__rds-caption {
	position: absolute;
	left: 50%;
	bottom: 24px;
	transform: translateX(-50%);
	max-width: calc(100% - 48px);
	padding: 6px 12px;
	border-radius: 4px;
	background: rgba(0, 0, 0, 0.6);
	color: var(--rds-white);
	font-family: var(--font-body);
	font-size: 12px;
	line-height: 15.7px;
	letter-spacing: 1.2px;
	text-transform: uppercase;
	text-align: center;
}

/* -- premium articles (inc/paywall.php): faded first lines + paywall box,
      and the free member's "x of 3 left" line -- */

.project__content--teaser {
	position: relative;
}

.project__content--teaser::after {
	content: "";
	position: absolute;
	inset: auto 0 0;
	height: 44px;
	background: linear-gradient(rgba(255, 255, 255, 0), var(--rds-white));
	pointer-events: none;
}

.paywall {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 18px;
	max-width: 640px;
	margin: 36px auto 72px;
	padding: 48px 36px;
	background: var(--rds-light-grey);
	text-align: center;
}

.paywall__eyebrow {
	margin: 0;
	font-size: 12px;
	line-height: 16px;
	letter-spacing: 1.2px;
	text-transform: uppercase;
	color: var(--rds-beige);
}

.paywall__title {
	margin: 0;
	font-family: var(--font-display);
	font-size: 30px;
	font-weight: 500;
	line-height: 34px;
}

.paywall__text,
.paywall__login {
	margin: 0;
	font-size: 16px;
	line-height: 22px;
	letter-spacing: 0.32px;
}

.paywall__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 12px 24px;
	margin-top: 6px;
}

.paywall__login a {
	color: var(--rds-black);
	text-decoration: underline;
}

.paywall__login a:hover {
	color: #777777;
}

.paywall-allowance {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 12px;
	max-width: 640px;
	margin: 48px auto -36px;
	font-size: 14px;
	line-height: 20px;
	color: var(--rds-dark-grey);
}

.paywall-allowance__badge {
	padding: 2px 8px;
	border: 1px solid var(--rds-beige);
	border-radius: 4px;
	font-size: 12px;
	letter-spacing: 1.2px;
	text-transform: uppercase;
	color: var(--rds-beige);
}

.paywall-allowance__link {
	color: var(--rds-beige);
}

@media (max-width: 900px) {
	.paywall {
		margin: 24px 24px 48px;
		padding: 32px 24px;
	}

	.paywall-allowance {
		margin: 24px 24px 0;
	}
}

/* -- phone, Figma 3.0-project-page_M (420 wide): 42/48 title, icon-only
      action buttons (share icons on the same row), credits as label |
      value rows with dividers, related posts scroll sideways like the
      homepage's Partners Content. -- */

@media (max-width: 600px) {
	.project-head__content {
		gap: 24px;
	}

	.project-head__top {
		gap: 18px;
	}

	.project-head__title {
		font-size: 42px;
		line-height: 48px;
	}

	.project-head__meta-row {
		column-gap: 18px;
	}

	.project-actions__save-label {
		display: none; /* the button carries its own aria-label */
	}

	.project-head .project-actions__buttons {
		gap: 24px;
	}

	.project__bottom-actions {
		gap: 36px;
		padding-top: 12px;
	}

	.project-credits {
		gap: 18px;
		padding: 24px 24px 36px;
	}

	.project-credits__item {
		flex-direction: row;
		justify-content: space-between;
		gap: 12px;
	}

	.project-credits__item dd {
		text-align: right;
	}

	.project-related {
		padding-right: 0;
	}
}

/* Designer / Studio → their page on RDB (internal link, so no ↗) */
.project-credits__link--designer {
	text-decoration: underline;
	text-decoration-color: rgba(0, 0, 0, 0.35);
	text-underline-offset: 3px;
}

/* -- partner content (client 2026-11-12, ID31) -- */

.partner-label {
	align-self: flex-start;
	margin: 0 0 12px;
	padding: 6px 12px;
	border-radius: 4px;
	background: #f3f1ef;
	font-size: 12px;
	font-weight: 600;
	line-height: 16px;
	letter-spacing: 1.2px;
	text-transform: uppercase;
}

.project-head__partner {
	flex-wrap: wrap;
	align-items: center;
}

.project-head__partner-brand {
	display: inline-flex;
	align-items: center;
	color: inherit;
	text-decoration: none;
}

.project-head__partner-logo {
	display: block;
	width: auto;
	max-width: 160px;
	height: auto;
	max-height: 24px;
	object-fit: contain;
}

.project-head__partner-logo--text {
	max-height: none;
	font-weight: 600;
}

.partner-box {
	display: flex;
	align-items: center;
	gap: 36px;
	max-width: 1050px;
	margin: 48px auto;
	padding: 36px 48px;
	border-radius: 8px;
	background: #f3f1ef;
}

.partner-box__logo {
	flex: 0 0 160px;
	display: flex;
	justify-content: center;
	padding-right: 36px;
	border-right: 1px solid #d8cdc5;
}

.partner-box__logo-image {
	display: block;
	width: auto;
	max-width: 140px;
	height: auto;
	max-height: 80px;
	object-fit: contain;
}

.partner-box__logo-image--text {
	font-family: var(--font-display);
	font-size: 28px;
	line-height: 32px;
}

.partner-box__body {
	flex: 1 1 auto;
	min-width: 0;
}

.partner-box__eyebrow {
	margin: 0 0 6px;
	font-size: 12px;
	line-height: 16px;
	letter-spacing: 1.2px;
	text-transform: uppercase;
	color: var(--rds-beige);
}

.partner-box__text {
	margin: 0;
	font-size: 15px;
	line-height: 22px;
}

.partner-box__button {
	flex-shrink: 0;
}

@media (max-width: 900px) {
	.partner-box {
		flex-direction: column;
		align-items: flex-start;
		gap: 18px;
		margin: 36px 24px;
		padding: 24px;
	}

	.partner-box__logo {
		flex: none;
		justify-content: flex-start;
		padding: 0;
		border-right: 0;
	}
}
