/*
 * Projects: the single project page (single-project.php) and the branded cover used wherever a
 * project has no sharp photograph. Loaded on every page, so it stays small.
 */

/* Branded cover: charcoal with the project's icon in a green square. */
.pj-brand { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 78% 50%, rgba(93, 190, 42, .14), rgba(93, 190, 42, 0) 55%), var(--charcoal); }
.pj-brand__icon { width: 30%; max-width: 140px; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 22%; background: var(--green); color: var(--charcoal); }
.pj-brand__icon svg { width: 52%; height: auto; }
.ph > img.pj-brand-img { object-position: 30% 50%; }
.ph > img.pj-cover-img { object-position: 50% 25%; }

/* Header. */
.pj-head { position: relative; overflow: hidden; }
.pj-head__in { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 28px; padding-top: clamp(36px, 5vw, 64px); padding-bottom: clamp(44px, 6vw, 72px); }
.pj-head__top { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; }
.pj-head__back { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 14px; font-weight: 600; text-underline-offset: 4px; }
.pj-head__row { display: flex; flex-wrap: wrap; gap: 36px clamp(40px, 5vw, 72px); align-items: center; }
.pj-head__text { flex: 1 1 460px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.pj-head__tags { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pj-head__tag { min-height: 0; padding: 5px 12px; font-size: 14px; letter-spacing: 0; text-transform: none; }
.pj-head__title { font-weight: 800; font-size: clamp(30px, 3.8vw, 50px); line-height: max(1.06, var(--lh-head, 0)); letter-spacing: -.03em; }
.pj-head__dl { margin: 0; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .14); display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px 24px; font-size: 15px; }
.pj-head__dl dt { color: #9E9E9E; margin-bottom: 4px; }
.pj-head__dl dd { margin: 0; font-weight: 600; }
.pj-head__cover { flex: 1 1 420px; min-width: 0; margin: 0; aspect-ratio: 4 / 3; }

/* About this project and At a glance. */
.pj-body { display: flex; flex-wrap: wrap; gap: 36px 72px; align-items: flex-start; padding-top: clamp(48px, 6vw, 80px); padding-bottom: 24px; }
.pj-about { flex: 999 1 560px; min-width: 0; max-width: 740px; display: flex; flex-direction: column; gap: 16px; }
.pj-about__p { font-size: clamp(18px, 1.6vw, 21px); line-height: 1.6; color: var(--ink); }
.pj-facts { flex: 1 1 280px; min-width: 0; padding: 24px; border-radius: var(--r); background: var(--surface); display: flex; flex-direction: column; gap: 14px; }
.pj-body--facts .pj-facts { max-width: 560px; }
.pj-facts__h { font-size: 12px; }
.pj-facts__dl { display: flex; flex-direction: column; gap: 12px; font-size: 15px; }
.pj-facts__dl dt { color: var(--muted); }
.pj-facts__dl dd { margin: 2px 0 0; font-weight: 700; }
.pj-facts__src { font-size: 14px; color: var(--muted); }

/* Photographs. */
.pj-photos { display: flex; flex-direction: column; gap: 20px; padding-top: 24px; padding-bottom: clamp(48px, 6vw, 80px); }
.pj-body + .pj-photos { padding-top: 24px; }
.pj-head + .pj-photos { padding-top: clamp(48px, 6vw, 80px); }
.pj-photos__head { display: flex; flex-wrap: wrap; gap: 8px 32px; align-items: flex-end; justify-content: space-between; }
.pj-photos__h, .pj-rel__h { font-weight: 800; font-size: clamp(24px, 2.4vw, 32px); line-height: 1.15; letter-spacing: -.02em; }
.pj-photos__hint { font-size: 14px; color: var(--muted); }
.pj-photos__grid { list-style: none; margin: 0; padding: 0; column-count: var(--pj-cols, 4); column-width: 220px; column-gap: 12px; }
.pj-photos__grid li { break-inside: avoid; margin-bottom: 12px; }
.pj-photo { display: block; overflow: hidden; border-radius: var(--r); background: #E4E5DF; cursor: zoom-in; }
.pj-photo img { width: 100%; height: auto; }

/* Previous and next: the words line up with the page edge; the hover fill reaches 24px past it. */
.pj-pn { --pn-x: min(24px, var(--gutter)); border-top: 1px solid #E4E5DF; border-bottom: 1px solid #E4E5DF; }
.pj-pn .wrap { padding-top: 8px; padding-bottom: 8px; }
.pj-pn__in { margin: 0 calc(-1 * var(--pn-x)); display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px; }
.pj-pn__a { display: flex; flex-direction: column; gap: 6px; padding: 24px var(--pn-x); border-radius: 6px; color: var(--ink); text-decoration: none; }
@media (hover: hover) { .pj-pn__a:hover { background: var(--surface); color: var(--ink); } }
.pj-pn__a--next { align-items: flex-end; text-align: right; }
.pj-pn__k { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: var(--green-text); }
.pj-pn__v { font-size: 17px; font-weight: 800; }

/* More documented projects. */
.pj-rel__in { display: flex; flex-direction: column; gap: 24px; padding-top: clamp(48px, 6vw, 80px); padding-bottom: clamp(48px, 6vw, 80px); }
.pj-rel__head { display: flex; flex-wrap: wrap; gap: 12px 40px; align-items: flex-end; justify-content: space-between; }
.pj-rel__all { display: inline-flex; align-items: center; min-height: 44px; font-size: 15px; font-weight: 700; color: var(--ink); text-underline-offset: 4px; }
.pj-rel__grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.pj-rel__grid li { display: flex; }
.pj-card { flex: 1; padding: 0; gap: 0; border-width: 1.5px; border-radius: var(--r); overflow: hidden; }
.pj-card__ph { display: block; aspect-ratio: 16 / 10; border-radius: 0; background: #E4E5DF; }
.pj-card__body { padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.pj-card__type { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--green-text); }
.pj-card__name { font-size: 17px; font-weight: 800; line-height: 1.3; }
.pj-card__place { font-size: 14px; color: var(--muted); }

/* Photograph viewer. */
.pj-lb { width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(18, 18, 18, .96); color: var(--white); }
.pj-lb[open] { display: flex; flex-direction: column; }
.pj-lb::backdrop { background: rgba(18, 18, 18, .6); }
.pj-lb :focus-visible { outline-color: var(--green); }
.pj-lb__bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px clamp(16px, 3vw, 32px); }
.pj-lb__count { font-size: 14px; font-weight: 600; color: var(--soft); }
.pj-lb__btn { flex: none; width: 52px; height: 52px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .08); color: var(--white); cursor: pointer; }
.pj-lb__close { width: 48px; height: 48px; }
@media (hover: hover) { .pj-lb__btn:hover { background: rgba(255, 255, 255, .16); } }
.pj-lb__stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; gap: 16px; padding: 0 clamp(8px, 2vw, 24px) 32px; }
.pj-lb__frame { flex: 0 1 auto; min-width: 0; display: flex; align-items: center; justify-content: center; }
.pj-lb__img { max-width: min(100%, 1100px); max-height: 78vh; width: auto; height: auto; object-fit: contain; border-radius: var(--r); }
html.pj-lb-open { overflow: hidden; }
@media (max-width: 600px) {
	.pj-photos__grid { columns: 2; column-gap: 8px; } /* Two per row on phones; each opens full-size in the viewer. */
	.pj-photos__grid li { margin-bottom: 8px; }
	.pj-lb__stage { flex-wrap: wrap; align-content: center; padding-bottom: 24px; }
	.pj-lb__frame { order: -1; flex-basis: 100%; }
	.pj-lb__img { max-height: 70vh; }
}

@media (prefers-reduced-motion: no-preference) {
	.pj-photo img { transition: transform .8s var(--ease); }
	@media (hover: hover) { .pj-photo:hover img { transform: scale(1.04); } }
	.pj-pn__a { transition: background-color .2s ease; }
	.pj-pn__a svg { transition: translate .35s var(--ease); }
	@media (hover: hover) { .pj-pn__a:hover svg { translate: -4px 0; } }
	@media (hover: hover) { .pj-pn__a--next:hover svg { translate: 4px 0; } }
	.pj-lb[open] { animation: peiFade .2s ease-out; }
}
/* Watch: a project's video, between About this project and the photographs. */
.pj-video { display: grid; gap: 20px; padding-top: clamp(40px, 5vw, 64px); max-width: calc(860px + 2 * var(--gutter)); }
