/* RISE CONSTRUCTION - public project pages. Builds on site.css tokens; no sizes of its own for type. */

.pj-intro { display: grid; gap: 24px; justify-items: start; }
.pj-listing { padding-top: clamp(40px, 6vw, 72px); }

.pj-list { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(40px, 6vw, 80px) clamp(24px, 4vw, 56px); }
.pj-link { display: block; text-decoration: none; }
.pj-cover { overflow: hidden; background: var(--stone); aspect-ratio: 3 / 2; }
.pj-cover img { width: 100%; height: 100%; object-fit: cover; }
.pj-text { padding-top: 20px; border-top: 1px solid var(--rule); margin-top: 20px; }
.pj-text h2 { font-size: var(--t-h3); font-weight: 500; line-height: 1.2; }
.pj-link:hover h2 { color: var(--gold-deep); }
.pj-meta { margin: 8px 0 0; color: var(--muted); font-size: var(--t-small); }
.pj-sum { margin: 12px 0 0; color: var(--ink-soft); }
@media (min-width: 760px) {
  .pj-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pj--lead { grid-column: 1 / -1; }
  .pj--lead .pj-cover { aspect-ratio: 16 / 8; }
  .pj--lead .pj-text { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 8px 40px; align-items: baseline; }
  .pj--lead .pj-text h2 { font-size: var(--t-h2); grid-column: 1; }
  .pj--lead .pj-meta { grid-column: 2; grid-row: 1; margin: 0; }
  .pj--lead .pj-sum { grid-column: 1 / -1; }
}

/* one project */
.pj-head .wrap { display: grid; gap: 20px; justify-items: start; }
.pj-back { margin: 0; font-size: var(--t-small); }
.pj-facts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 0; color: var(--muted); }
.pj-facts li + li::before { content: ''; display: inline-block; width: 1px; height: 0.9em; margin: 0 16px; background: var(--gold); vertical-align: -0.1em; }
.pj-desc .wrap > * { font-size: var(--t-lead); line-height: 1.6; color: var(--ink-soft); max-width: 62ch; }
.pj-photos { padding-top: clamp(16px, 3vw, 32px); }

/* Masonry: photos keep their own proportions and pack into columns; the cover spans all of them. */
.pj-gallery { --gap: clamp(10px, 1.6vw, 20px); list-style: none; margin: 0; padding: 0; column-gap: var(--gap); columns: 1; }
.pj-gallery li { break-inside: avoid; margin-bottom: var(--gap); }
.pj-gallery a { display: block; background: var(--stone); cursor: zoom-in; }
.pj-gallery img { width: 100%; height: auto; }
.pj-cap { margin: 8px 0 0; font-size: var(--t-small); color: var(--muted); }
@media (min-width: 560px) { .pj-gallery { columns: 2; } .pj-first { column-span: all; } }
@media (min-width: 1100px) { .pj-gallery { columns: 3; } }

.pj-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-top: clamp(32px, 5vw, 56px); padding-top: 20px; border-top: 1px solid var(--rule); }
.pj-pager a { font-weight: 600; text-decoration: none; color: var(--gold-deep); }
.pj-pager a:hover { text-decoration: underline; }
.pj-pager span { color: var(--muted); }

.pj-next { border-top: 1px solid var(--rule); }
.pj-next a { text-decoration: none; }
.pj-next a:hover strong { color: var(--gold-deep); }

/* photo viewer (public/projects.js builds the dialog; without JS the photos link to the full image) */
.pj-viewer { border: 0; padding: 0; margin: 0; max-width: none; max-height: none; width: 100vw; height: 100vh; height: 100dvh; background: rgba(20, 19, 15, 0.96); color: var(--cream); overflow: hidden; }
.pj-viewer::backdrop { background: rgba(20, 19, 15, 0.96); }
.pj-viewer[open] { display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.pj-stage { position: relative; display: grid; place-items: center; min-height: 0; padding: clamp(8px, 3vw, 40px) clamp(8px, 6vw, 88px); touch-action: pan-y pinch-zoom; }
.pj-stage { overflow: hidden; }
.pj-stage img { max-width: 100%; max-height: calc(100vh - 120px); max-height: calc(100dvh - 120px); width: auto; height: auto; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.pj-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px clamp(16px, 4vw, 40px) max(16px, env(safe-area-inset-bottom)); font-size: var(--t-small); color: var(--muted-on-ink); }
.pj-bar p { margin: 0; max-width: 70ch; }
.pj-btn { position: absolute; display: grid; place-items: center; width: 52px; height: 52px; padding: 0; border: 1px solid var(--rule-dark); border-radius: 2px; background: rgba(41, 40, 32, 0.7); color: var(--cream); font: 400 1.5rem/1 var(--sans); cursor: pointer; }
.pj-btn:hover { background: var(--gold-deep); border-color: var(--gold-deep); }
.pj-prev { left: clamp(4px, 1.5vw, 16px); top: 50%; translate: 0 -50%; }
.pj-next-btn { right: clamp(4px, 1.5vw, 16px); top: 50%; translate: 0 -50%; }
.pj-close { right: clamp(4px, 1.5vw, 16px); top: clamp(4px, 1.5vw, 16px); }
@media (max-width: 640px) { .pj-prev, .pj-next-btn { top: auto; bottom: 8px; translate: none; width: 44px; height: 44px; } .pj-stage { padding-inline: 8px; } }
body.pj-lock { overflow: hidden; }

/* home page teaser: up to three recent projects */
.pj-recent { padding-top: 0; }
.pj-recent-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; margin-bottom: clamp(24px, 4vw, 40px); }
.pj-all { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; color: var(--gold-deep); }
@media (min-width: 760px) {
  .pj-recent-list.pj-recent--1 { grid-template-columns: minmax(0, 1fr); max-width: 40rem; }
}
@media (min-width: 900px) {
  .pj-recent-list.pj-recent--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 899px) { .pj-recent .pj-cover { aspect-ratio: 16 / 10; } }
