/* Uploaded memories retain their natural composition, including group portraits. */
.family .public-gallery__item:nth-child(n){height:auto;align-self:start}
.family .public-gallery__item img{height:auto;aspect-ratio:auto;object-fit:contain}
.family-lemon .lemon-upload{height:auto;aspect-ratio:auto;object-fit:contain}
.family-lemon .lemon-gallery .lemon-upload{aspect-ratio:auto}
/* The lead portrait has its own frame, outside the photo gallery. */
.family-diary .diary-personal{width:fit-content;max-width:100%;box-sizing:border-box}
.family-diary .diary-personal img{width:auto;height:auto;max-width:100%;max-height:500px;aspect-ratio:auto;object-fit:contain}
.family-diary .diary-polaroid img{height:auto;aspect-ratio:auto;object-fit:contain}
.family .warm-gallery img,
.family .jasmine-gallery img{height:auto;aspect-ratio:auto;object-fit:contain}

/* One or two memories form a centred group, never an unfinished grid row. */
.family :is(.lemon-gallery,.jasmine-gallery,.warm-gallery,.diary-gallery,.public-gallery):not(.invitation-carousel):has(> :only-child),
.family :is(.lemon-gallery,.jasmine-gallery,.warm-gallery,.diary-gallery,.public-gallery):not(.invitation-carousel):has(> :nth-child(2):last-child){
  display:flex;flex-wrap:wrap;justify-content:center;align-items:flex-start;
}
.family :is(.lemon-gallery,.jasmine-gallery,.warm-gallery,.diary-gallery,.public-gallery):not(.invitation-carousel):has(> :only-child)>*,
.family :is(.lemon-gallery,.jasmine-gallery,.warm-gallery,.diary-gallery,.public-gallery):not(.invitation-carousel):has(> :nth-child(2):last-child)>*{
  flex:0 1 auto;width:calc((100% - 28px)/2);max-width:360px;margin:0;
}
.family :is(.lemon-gallery,.jasmine-gallery):not(.invitation-carousel):has(> :only-child)>*,
.family :is(.lemon-gallery,.jasmine-gallery):not(.invitation-carousel):has(> :nth-child(2):last-child)>*{width:calc((100% - 28px)/3)}
.family-lemon .lemon-venue + p{margin-top:20px}
@media(max-width:600px){
  .family :is(.lemon-gallery,.jasmine-gallery):not(.invitation-carousel):has(> :only-child)>*,
  .family :is(.lemon-gallery,.jasmine-gallery):not(.invitation-carousel):has(> :nth-child(2):last-child)>*{width:calc((100% - 14px)/2)}
}
