/* Phone-only detail rails: every photograph shares one fixed 5:4 viewport.
   Source photographs stay untouched. The cup's very shallow source studies
   use individually framed areas instead of magnifying their central strip. */
@media (max-width: 760px) {
  #tea .tea46-preview-grid {
    align-items: flex-start;
  }
  #tea .tea46-preview-grid > .tea46-preview {
    display: grid;
    grid-template-rows: auto auto auto;
    align-content: start;
    align-self: flex-start;
    min-height: 0;
  }
  #tea .tea46-preview-image {
    --tea-preview-source-aspect: 1.145;
    position: relative;
    display: block;
    grid-row: 1;
    align-self: start;
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
    aspect-ratio: 5 / 4;
    overflow: hidden;
  }
  #tea .tea46-preview-title { grid-row: 2; }
  #tea .tea46-preview-copy { grid-row: 3; }

  /* Source crop ratios, not new photographic crops or distortion. */
  #tea46-panel-0 .tea46-preview:nth-child(3) .tea46-preview-image { --tea-preview-source-aspect: 1.14; }
  #tea46-panel-1 .tea46-preview:nth-child(1) .tea46-preview-image { --tea-preview-source-aspect: 1.5588235294; }
  #tea46-panel-1 .tea46-preview:nth-child(2) .tea46-preview-image { --tea-preview-source-aspect: 1.5131578947; }
  #tea46-panel-1 .tea46-preview:nth-child(3) .tea46-preview-image { --tea-preview-source-aspect: 1.5747800587; }
  #tea46-panel-2 .tea46-preview:nth-child(1) .tea46-preview-image { --tea-preview-source-aspect: 3.1666666667; }
  #tea46-panel-2 .tea46-preview:nth-child(2) .tea46-preview-image { --tea-preview-source-aspect: 1.9147286822; }
  #tea46-panel-2 .tea46-preview:nth-child(3) .tea46-preview-image { --tea-preview-source-aspect: 2.5524475524; }

  #tea .tea46-preview-image > svg {
    position: absolute;
    top: 50%;
    left: 50%;
    width: max(100%, calc(100% * var(--tea-preview-source-aspect) / 1.25));
    height: max(100%, calc(100% * 1.25 / var(--tea-preview-source-aspect)));
    max-width: none;
    max-height: none;
    margin: 0;
    transform: translate(-50%, -50%);
    transform-origin: center;
    overflow: hidden;
  }
  #tea .tea46-preview-image > img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: cover;
    object-position: center;
    transform: none;
  }

  /* Show a useful amount of the actual rim, glaze and foot. SVG still maps its
     original source coordinates uniformly, but may paint beyond its shallow
     viewport; the fixed parent supplies the final 5:4 photograph window.
     Source areas: 435 700 500 400 / 495 812 420 336 / 500 910 420 336. */
  #tea46-panel-2 .tea46-preview:nth-child(1) .tea46-preview-image {
    --tea-detail-left: -3.4%;
    --tea-detail-top: 5.5%;
    --tea-detail-width: 114%;
    --tea-detail-height: 45%;
  }
  #tea46-panel-2 .tea46-preview:nth-child(2) .tea46-preview-image {
    --tea-detail-left: -5%;
    --tea-detail-top: 1.1904761905%;
    --tea-detail-width: 117.619047619%;
    --tea-detail-height: 76.7857142857%;
  }
  #tea46-panel-2 .tea46-preview:nth-child(3) .tea46-preview-image {
    --tea-detail-left: 4.7619047619%;
    --tea-detail-top: 43.4523809524%;
    --tea-detail-width: 86.9047619048%;
    --tea-detail-height: 42.5595238095%;
  }
  #tea #tea46-panel-2 .tea46-preview-image > svg {
    top: var(--tea-detail-top);
    left: var(--tea-detail-left);
    width: var(--tea-detail-width);
    height: var(--tea-detail-height);
    overflow: visible;
    transform: none;
    transition: none;
  }
}
@media (max-width: 760px) and (hover: hover) and (pointer: fine) {
  #tea .tea46-preview:hover .tea46-preview-image > svg { transform: translate(-50%, -50%) scale(1.035); }
  #tea .tea46-preview:hover .tea46-preview-image > img { transform: scale(1.035); }
}
@media (max-width: 760px) and (prefers-reduced-motion: reduce) {
  #tea .tea46-preview:hover .tea46-preview-image > svg { transform: translate(-50%, -50%); }
  #tea .tea46-preview:hover .tea46-preview-image > img { transform: none; }
}
