/* 0.8.31 — project pages and /projects/ only.
   Home page is unchanged from 0.8.30 (this file is not loaded there).
   Photos show at their real aspect ratio, or with a gentle centred crop
   of at most ~10%. No Ken Burns, hover-scale or reveal zoom.
   Frames shrink to the image so there are no letterbox bars. */

/* Scope: body.p-work is set on /projects/ and each project page. */

/* Reveal and hover zoom stay off on project imagery only. */
body.p-work .rimg{clip-path:none}
body.p-work .rimg img{transform:none}
body.p-work .rimg.in img{transform:none}
@media(hover:hover){
  body.p-work a:hover .zoom img,
  body.p-work button:hover .zoom img,
  body.p-work .zoom:hover img{transform:none!important}
}
body.p-work .zoom:active img{transform:none!important}
body.p-work .px{transform:none!important}

/* —— Interior project heroes (Prakash Veer, Praveen) ——
   Frame follows the 4:3 renders. If a max-height kicks in, the width
   shrinks with it so the photo stays 4:3, centred, with no side bars. */
body.p-work .dh{
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  background:#1a1918;
  color:var(--cream);
}
body.p-work .dh .bg{
  position:relative;
  inset:auto;
  width:100%;
  aspect-ratio:4/3;
  /* Leave room for the title band so chips stay on the first screen. */
  max-height:min(calc(100svh - var(--hh, 120px) - 200px), 720px);
  max-width:min(100%, calc(min(calc(100svh - var(--hh, 120px) - 200px), 720px) * 4 / 3));
  margin-inline:auto;
  background:#1a1918;
  overflow:hidden;
}
body.p-work .dh .bg img{
  animation:none!important;
  transform:none!important;
  width:100%;
  height:100%;
  object-fit:cover;
  object-position:50% 50%;
}
body.p-work .dh::after{display:none}
body.p-work .dh .wrap{
  position:relative;
  z-index:2;
  height:auto;
  display:block;
  padding:14px var(--pad) 18px;
  justify-content:unset;
  width:100%;
}
/* Photo-count chip sits on the image’s top-right (the button lives inside .bg). */
body.p-work .dh .scr{
  position:absolute;
  top:14px;
  right:14px;
  left:auto;
  z-index:3;
  margin-left:0;
  transform:none;
}
@media(min-width:768px){
  body.p-work .dh .wrap{padding:16px var(--pad) 22px}
}

/* —— Bali / Bowenpally drawing heroes ——
   Shrink-wrap the frame to the chosen <picture> image. max-width +
   max-height scale it uniformly, so there are no letterbox bars. */
body.p-work .bh .art,
body.p-bali .bh .art{
  display:block;
  aspect-ratio:auto;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  width:fit-content;
  max-width:100%;
  margin-inline:auto;
  background:#ece8de;
  overflow:hidden;
  position:relative;
}
body.p-work .bh .art picture{
  display:block;
  width:fit-content;
  max-width:100%;
}
body.p-work .bh .art img,
body.p-bali .bh .art img{
  display:block;
  width:auto;
  height:auto!important;
  max-width:100%;
  max-height:min(62svh, 680px);
  object-fit:contain;
  object-position:50% 50%;
  animation:none!important;
  transform:none!important;
  margin-inline:auto;
}

/* —— Galleries: each tile is the photo’s own shape —— */
body.p-work .gg button,
body.p-work .gg .f button,
body.p-work .gg figure.t button{
  aspect-ratio:auto!important;
  height:auto;
  background:transparent;
  overflow:hidden;
}
body.p-work .gg button img,
body.p-work .gg .f button img,
body.p-work .gg figure.t button img{
  position:static;
  width:100%;
  height:auto!important;
  object-fit:cover;
  object-position:50% 50%;
  transform:none!important;
  display:block;
}

/* Quote image beside project copy: natural ratio, no crop. */
body.p-work .tq .fig{
  aspect-ratio:auto!important;
  background:transparent;
}
body.p-work .tq .fig img{
  width:100%;
  height:auto!important;
  object-fit:cover;
  object-position:50% 50%;
  position:static;
  display:block;
}

/* —— /projects/ grid: photo at its real ratio, labels over the image —— */
body.p-work .pcard .im,
body.p-work .pcard:first-child .im,
body.p-work .pcard[data-cat~="architecture"] .im,
body.p-work .pcard:nth-child(1) .im,
body.p-work .pcard:nth-child(1)[data-cat~="architecture"] .im{
  aspect-ratio:auto!important;
  height:auto!important;
  background:#ece8de;
  overflow:hidden;
}
body.p-work .pcard .im img,
body.p-work .pcard .im picture,
body.p-work .pcard .im picture img,
body.p-work .pcard[data-cat~="architecture"] .im img{
  display:block;
  width:100%;
  height:auto!important;
  object-fit:cover;
  object-position:50% 50%;
  transform:none!important;
}
/* Placeholder “more work coming” tile keeps a tidy 4:3 well. */
body.p-work .pcard .im:has(.ph-tile){aspect-ratio:4/3!important}
@media(min-width:960px){
  body.p-work .pcard:nth-child(1) .im{height:auto!important}
}

/* Next-project teaser: 4:3 frame matching the render, title over the photo. */
body.p-work .nxt{
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  display:grid;
  justify-items:center;
  background:#1a1918;
}
body.p-work .nxt .bg,
body.p-work .nxt .wrap{
  grid-area:1/1;
  width:100%;
  max-width:min(100%, calc(min(56svh, 560px) * 4 / 3));
  aspect-ratio:4/3;
  max-height:min(56svh, 560px);
}
body.p-work .nxt .bg{
  background:#1a1918;
  inset:auto;
  position:relative;
}
body.p-work .nxt .bg img{
  object-fit:cover;
  object-position:50% 50%;
  width:100%;
  height:100%;
  transform:none!important;
}
body.p-work .nxt::after{
  grid-area:1/1;
  width:100%;
  max-width:min(100%, calc(min(56svh, 560px) * 4 / 3));
  aspect-ratio:4/3;
  max-height:min(56svh, 560px);
  justify-self:center;
  position:relative;
  inset:auto;
}
body.p-work .nxt .wrap{
  position:relative;
  z-index:2;
  height:100%;
  justify-self:center;
}
