/* The smartphone gallery keeps its vertical flow and original image proportions. */
@media (max-width: 700px), (orientation: landscape) and (max-height: 600px) and (hover: none) and (pointer: coarse) {
  .lookbook { --mobile-active-height: min(72vw, 56svh); }
  /* Reduce the previous 140px normal gap by one third. Caption space is
     contributed only by the active figure's visible, in-flow caption. */
  .gallery-track { gap: 93.333333px; }
  .look-item { margin-bottom: 0; }
  .look-item.active {
    height: auto;
    width: calc(var(--mobile-active-height) * var(--ratio));
  }
  .look-item.active .photo-button {
    height: var(--mobile-active-height);
    transform: none;
  }
  .look-item figcaption {
    position: static;
    top: auto;
    left: auto;
    margin: 22px 0 0 50%;
  }
}

/* The image's real dimensions animate; there is no overlay transform. */
.look-item { transition: width .4s ease-in-out, height .4s ease-in-out; }
.gallery-track.no-motion .look-item,
.gallery-track.no-motion figcaption { transition: none !important; }
@media (max-width: 700px), (orientation: landscape) and (max-height: 600px) and (hover: none) and (pointer: coarse) {
  .look-item, .look-item.active { height: auto; transition-duration: .25s; }
  .look-item .photo-button, .look-item.active .photo-button {
    height: auto;
    aspect-ratio: var(--ratio);
    transform: none;
  }
  .look-item .photo-button img { height: auto; aspect-ratio: var(--ratio); }
  .look-item figcaption {
    display: grid;
    grid-template-rows: 0fr;
    margin-top: 0;
    opacity: 0;
    transition: grid-template-rows .25s ease-in-out, margin-top .25s ease-in-out, opacity .25s ease-in-out;
  }
  .look-item figcaption dl { min-height: 0; overflow: hidden; }
  .look-item.active figcaption {
    display: grid;
    grid-template-rows: 1fr;
    margin-top: 22px;
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .look-item, .look-item figcaption { transition: none; }
}
