/* /projects (2026-11-14 redesign): one card per building, every photo at its own proportions in justified rows (one
   height per row, public/js/projects-rows.js), zoom in place on the photo itself, quiet text filters with counts.
   White page, square photo edges, no shadows, badges or overlays on the photos. Own file so site.css is untouched. */

.pj-page{padding:clamp(28px,4vw,56px) 0 clamp(64px,8vw,112px);background:var(--white)}
.pj-head{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:6px 24px;margin:0 0 clamp(18px,2.2vw,28px)}
.pj-head h1{margin:0;font:800 clamp(36px,4.2vw,60px)/1 var(--display);text-transform:uppercase;letter-spacing:-.01em;color:var(--ink)}
.pj-sum{margin:0;font-size:17px;color:var(--muted);font-variant-numeric:tabular-nums}

/* Filters: plain text; the chosen type is the one solid ink block (shape and fill, not only color). */
.pj-bar{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 clamp(22px,2.8vw,36px);padding:0 0 clamp(14px,1.8vw,20px);border-bottom:1px solid var(--line)}
.pj-bar button{display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:0 14px;border:0;border-radius:2px;background:none;color:var(--ink-2);font:600 17px/1.1 var(--text);cursor:pointer;transition:background-color .15s ease,color .15s ease;-webkit-tap-highlight-color:transparent}
.pj-bar .n{font-weight:500;color:var(--muted);font-variant-numeric:tabular-nums}
.pj-bar button[aria-pressed=true]{background:var(--ink);color:#fff}
.pj-bar button[aria-pressed=true] .n{color:#c3ccd6}
.pj-bar button:focus-visible{outline:3px solid var(--focus);outline-offset:2px}
@media (hover:hover) and (pointer:fine){.pj-bar button[aria-pressed=false]:hover{background:var(--paper-2);color:var(--ink)}}
/* Phones: one row that swipes sideways (the last type is cut at the edge, which shows there is more). */
@media (max-width:599px){
  .pj-bar{flex-wrap:nowrap;gap:4px;overflow-x:auto;margin-inline:calc(var(--gutter)*-1);padding-inline:var(--gutter);scroll-padding-inline:var(--gutter);scrollbar-width:none;-webkit-overflow-scrolling:touch}
  .pj-bar::-webkit-scrollbar{display:none}
  .pj-bar button{flex:none;padding:0 12px}
}

/* Justified rows. Without JS: flex rows (each photo grows in proportion to its ratio, so a row shares one height).
   With JS (.is-laid): exact widths and one height per row, rows balanced around --rowh. */
.pj-grid{--rowh:330px;display:flex;flex-wrap:wrap;gap:clamp(30px,3vw,44px) 20px;margin:0;padding:0;list-style:none}
.pj-grid::after{content:"";flex-grow:999999}
.pj{flex:var(--ar) 1 calc(var(--ar) * var(--rowh));min-width:0;margin:0}
.pj[hidden]{display:none}
.pj-grid.is-laid .pj{flex:none}
.pj-frame{position:relative;aspect-ratio:var(--ar);overflow:hidden;background:var(--paper-2);touch-action:pan-y;contain:paint}
.pj-grid.is-laid .pj-frame{aspect-ratio:auto;height:var(--h)}
@media (max-width:1199px){.pj-grid{--rowh:290px}}
@media (max-width:899px){.pj-grid{--rowh:230px;column-gap:16px}}
@media (max-width:599px){.pj-grid{row-gap:30px}.pj{flex:1 1 100%}}

.pj-photo{display:block;width:100%;height:100%;margin:0;padding:0;border:0;border-radius:0;background:none;cursor:zoom-in;-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none}
.pj-photo:focus-visible{outline:3px solid var(--focus);outline-offset:-3px}
.pj-media{display:block;width:100%;height:100%;transform-origin:0 0}
.pj-media picture,.pj-media img{display:block;width:100%;height:100%}
.pj-media img{object-fit:cover;-webkit-user-drag:none;user-select:none;-webkit-user-select:none}
.pj.framed .pj-media img{object-position:50% 75%!important}
.pj-frame.is-zoomed .pj-photo{cursor:grab}
.pj-frame.is-zoomed .pj-media{will-change:transform}
.pj-frame.is-panning .pj-photo{cursor:grabbing}

/* Zoom button: appears when the pointer is on the photo (or it has focus), and stays while zoomed. */
.pj-zoom{position:absolute;right:12px;bottom:12px;display:grid;place-items:center;width:40px;height:40px;padding:0;border:0;border-radius:2px;background:rgba(255,255,255,.94);color:var(--ink);cursor:pointer;opacity:0;visibility:hidden;transition:opacity .16s ease,visibility 0s linear .16s}
.pj-zoom svg{width:20px;height:20px}
.pj-zoom .out,.pj-frame.is-zoomed .pj-zoom .in{display:none}
.pj-frame.is-zoomed .pj-zoom .out{display:block}
.pj-frame:focus-within .pj-zoom,.pj-frame.is-zoomed .pj-zoom{opacity:1;visibility:visible;transition-delay:0s}
@media (hover:hover) and (pointer:fine){.pj-frame:hover .pj-zoom{opacity:1;visibility:visible;transition-delay:0s}.pj-zoom:hover{background:#fff}}
@media (hover:none){.pj-zoom{width:44px;height:44px;right:10px;bottom:10px}}
.pj-zoom:active{transform:scale(.96)}

/* Title + one line of fact under each photo. */
.pj-title{margin:14px 0 0;font:600 18px/1.3 var(--text);letter-spacing:-.005em;text-transform:none;color:var(--ink)}
.pj-title a{color:inherit;text-decoration:none}
.pj-title a:focus-visible{outline:3px solid var(--focus);outline-offset:3px;border-radius:2px}
@media (hover:hover) and (pointer:fine){.pj-title a:hover{color:var(--brand)}}
.pj-meta{margin:4px 0 0;font-size:15.5px;line-height:1.35;color:var(--muted);font-variant-numeric:tabular-nums}

/* A project page's other photos: the same rows, smaller, each photo a link to its own page. */
.pj-more .pj-grid{--rowh:250px}
.pj-more .head-row{margin-bottom:clamp(20px,2.4vw,32px)}
.pj-link{display:block;cursor:pointer}
.pj-link picture,.pj-link img{display:block;width:100%;height:100%}
.pj-link img{object-fit:cover}
.pj.framed .pj-link img{object-position:50% 75%!important}
.pj-link:focus-visible{outline:3px solid var(--focus);outline-offset:-3px}
.pj-more .pj-title{margin-top:10px;font-size:17px}

/* Viewer bits that /projects can hide (one-photo buildings: no Previous/Next, no thumbnails). */
.pv [hidden]{display:none!important}

@media (prefers-reduced-motion:reduce){.pj-bar button,.pj-zoom{transition:none}}
