.photo-layout{grid-template-columns:repeat(var(--photo-columns,2),minmax(0,1fr));min-width:0}
.photo-layout figure{min-width:0}
.photo-layout-natural,.photo-layout-prints{align-items:start}
.photo-layout-natural img,.photo-layout-cinema img,.photo-layout-prints img{height:auto;aspect-ratio:auto;object-fit:contain;background:transparent}
.photo-layout-natural picture,.photo-layout-cinema picture,.photo-layout-prints picture{display:block}
.photo-layout-cinema{grid-template-columns:minmax(0,1fr);max-width:1180px;margin-inline:auto;gap:48px}
.photo-layout-prints{gap:36px;padding:12px 6px 28px}
.photo-layout-prints figure{padding:clamp(10px,1.5vw,22px);background:#fff;border:1px solid #d8d8d8;box-shadow:inset 0 0 0 4px #f7f7f7,0 12px 28px -18px #0008}
.photo-layout-prints figcaption{padding-top:10px;line-height:1.5}
.photo-layout a:focus-visible{outline:3px solid #ff6900;outline-offset:4px}
@media(max-width:900px){.photo-layout{grid-template-columns:repeat(2,minmax(0,1fr))}.photo-layout-cinema{grid-template-columns:minmax(0,1fr)}}
@media(max-width:600px){.photo-layout{grid-template-columns:minmax(0,1fr)}.photo-layout-cinema{gap:24px}.photo-layout-prints{gap:24px}}

/* The classic key is retained so existing galleries receive the mosaic. */
.photo-layout-classic{
  grid-template-columns:repeat(5,minmax(0,1fr));
  grid-auto-rows:clamp(140px,18vw,260px);
  gap:6px;
  padding:6px;
  background:#fff;
}
.photo-layout-classic figure{position:relative;min-height:0;overflow:hidden;background:#fff}
.photo-layout-classic figure:nth-child(11n + 1){grid-column:span 2;grid-row:span 2}
.photo-layout-classic figure:nth-child(11n + 8){grid-column:span 2}
.photo-layout-classic a,.photo-layout-classic picture{display:block;width:100%;height:100%}
.photo-layout-classic img{width:100%;height:100%;aspect-ratio:auto;object-fit:cover;background:#fff}
.photo-layout-classic figcaption{
  position:absolute;inset:auto 0 0;margin:0;padding:24px 14px 12px;
  background:linear-gradient(transparent,#000c);color:#fff;font-size:14px;line-height:1.4;
  pointer-events:none;
}
.photo-layout-classic a:focus-visible{outline-offset:-3px}
.photo-layout-classic:not(:has(figure:nth-child(5))){grid-template-columns:repeat(2,minmax(0,1fr))}
.photo-layout-classic:not(:has(figure:nth-child(5))) figure{grid-column:auto;grid-row:auto}
.photo-layout-classic:not(:has(figure:nth-child(5))) figure:only-child{grid-column:1/-1;grid-row:span 2}
@media(min-width:601px) and (max-width:900px){
  .photo-layout-classic{grid-template-columns:repeat(3,minmax(0,1fr));grid-auto-rows:clamp(150px,25vw,225px)}
  .photo-layout-classic figure:nth-child(11n + 8){grid-column:auto}
}
@media(max-width:600px){
  .photo-layout-classic,.photo-layout-classic:not(:has(figure:nth-child(5))){grid-template-columns:minmax(0,1fr);grid-auto-rows:auto;gap:4px;padding:4px}
  .photo-layout-classic figure:nth-child(n),.photo-layout-classic:not(:has(figure:nth-child(5))) figure:nth-child(n){grid-column:auto;grid-row:auto}
  .photo-layout-classic a{position:relative;height:auto;aspect-ratio:4/3}
  .photo-layout-classic a>img,.photo-layout-classic a>picture{position:absolute;inset:0}
  .photo-layout-classic figure:first-child a{aspect-ratio:4/5}
}
