/* v48 Stage 4 — rollout of the client-approved project-detail template.
   No descriptive filler: project name + one consolidated factual block + project imagery.
   Image presentation is adjusted per source aspect ratio/project rather than forced into one crop. */

.project-v48-detail .project-v47-facts{
  grid-template-columns:repeat(2,minmax(0,1fr));
}

/* More than two secondary project images: editorial gallery, still quiet and text-free. */
.project-v48-detail .project-v48-gallery{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:26px;
  align-items:start;
}
.project-v48-detail .project-v48-gallery figure{
  min-width:0;
  overflow:hidden;
  background:#edf0f2;
}
.project-v48-detail .project-v48-gallery img{
  width:100%;
  height:auto;
}

/* A single secondary image stays full-width, matching the approved Stage 3 page. */
.project-v48-detail .project-v48-secondary:not(.project-v48-secondary-two):not(.project-v48-secondary-three) .project-v48-gallery{
  display:block;
}

/* Three secondary images: first is the visual anchor; the other two sit together below. */
.project-v48-detail .project-v48-secondary-three .project-v48-gallery figure:first-child{
  grid-column:1/-1;
}

/* Ultra-wide BIM/model views need room, not tiny half-width strips. */
.project-v48-detail .project-v48-secondary-wide-stack .project-v48-gallery{
  grid-template-columns:1fr;
  gap:30px;
}

/* Towarowa 39: both supplied source photographs are portrait. Do not stretch them across 1200px. */
.project-v48-detail .project-v48-primary-portrait{
  width:min(68%,760px);
  margin-left:auto;
  margin-right:auto;
  background:transparent;
}
.project-v48-detail .project-v48-secondary-portrait .project-v48-gallery{
  display:flex;
  justify-content:flex-end;
}
.project-v48-detail .project-v48-secondary-portrait .project-v48-gallery figure{
  width:min(66%,740px);
  background:transparent;
}

/* If the second image is portrait while the primary is landscape (e.g. museum), keep it deliberate. */
.project-v48-detail .project-v48-secondary-portrait:not(.project-v48-secondary-two):not(.project-v48-secondary-three) .project-v48-gallery{
  display:flex;
}

/* Vibracoustic: one landscape + one portrait secondary; preserve their native character. */
.project-v48-detail .project-v48-secondary-mixed .project-v48-gallery{
  grid-template-columns:minmax(0,1.42fr) minmax(240px,.72fr);
  align-items:end;
}
.project-v48-detail .project-v48-secondary-mixed figure.is-portrait{
  max-width:520px;
  justify-self:end;
}

/* Long client/company names should wrap cleanly rather than distort the factual block. */
.project-v48-detail .project-v47-fact strong{
  overflow-wrap:anywhere;
}

@media (max-width:900px){
  .project-v48-detail .project-v48-gallery{gap:18px}
  .project-v48-detail .project-v48-primary-portrait{width:min(78%,700px)}
  .project-v48-detail .project-v48-secondary-portrait .project-v48-gallery figure{width:min(76%,680px)}
  .project-v48-detail .project-v48-secondary-mixed .project-v48-gallery{grid-template-columns:1.25fr .75fr}
}

@media (max-width:640px){
  .project-v48-detail .project-v48-gallery,
  .project-v48-detail .project-v48-secondary-two .project-v48-gallery,
  .project-v48-detail .project-v48-secondary-three .project-v48-gallery,
  .project-v48-detail .project-v48-secondary-mixed .project-v48-gallery{
    grid-template-columns:1fr;
    gap:16px;
  }
  .project-v48-detail .project-v48-secondary-three .project-v48-gallery figure:first-child{grid-column:1}
  .project-v48-detail .project-v48-primary-portrait{width:100%}
  .project-v48-detail .project-v48-secondary-portrait .project-v48-gallery{display:block}
  .project-v48-detail .project-v48-secondary-portrait .project-v48-gallery figure,
  .project-v48-detail .project-v48-secondary-mixed figure.is-portrait{width:100%;max-width:none}
}
