.wines-opening { border-bottom: var(--line); }
.wines-opening .opening__meta { justify-content: space-between; }
.wine-ledger { position: relative; }
.wine-row { position: relative; }
.wine-row__label { position: relative; }
.wine-row__label > span:first-child { position: relative; z-index: 1; }
.sweetness-tick {
  position: absolute;
  z-index: 0;
  left: 0;
  top: 50%;
  width: 100%;
  height: 0.1875rem;
  background: var(--second);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.55s var(--ease);
}
.wine-row.is-ticked .sweetness-tick { transform: scaleX(1); }
.wine-group {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--pad);
  padding: var(--pad);
}
.wine-group__photo { width: 100%; }
.wine-group__photo img { width: 100%; object-fit: cover; }
/* Every shelf entry opens the same way: picture left or right of a sentence, and the picture
   always fills the height its row gives it - the sweet row included, even with one wine in it. */
.wine-group__photo--1 img { aspect-ratio: 3 / 2; }
.wine-group__photo--2 img { aspect-ratio: 4 / 5; }
.wine-group__photo--3 img { aspect-ratio: 3 / 2; }
.wine-group__photo--4 img { aspect-ratio: 4 / 5; }
.wine-group__list { min-width: 0; }
.wine-group__search { margin: 0 0 0.6rem; }
.wine-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.2rem 0.75rem;
  align-items: baseline;
  min-height: 3.25rem;
  padding: 0.6rem 0;
  border-top: var(--line);
  color: inherit;
  text-decoration: none;
}
.wine-line__name { grid-column: 1; font: 400 1rem/1.3 var(--text); }
.wine-line__kind { grid-column: 1; color: var(--accent); font-size: 0.9rem; }
.wine-line__price { grid-column: 2; grid-row: 1 / span 2; font: 400 1.0625rem/1.3 var(--display); white-space: nowrap; }
.wine-line::after {
  content: "";
  grid-column: 1 / -1;
  height: 0.125rem;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--draw) var(--ease);
}
.wine-line:hover::after, .wine-line:focus-visible::after { transform: scaleX(1); }
.wine-line:focus-visible { outline-offset: -0.125rem; }
.wines-handoff { margin-top: clamp(1.5rem, 5vh, 3.5rem); }
.wines-handoff__body { display: grid; gap: 0.6rem; }
@media (min-width: 48rem) {
  .wine-group {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    align-items: stretch;
  }
  /* One alignment down the whole page: the picture and the list both start at the top of the cell. */
  .wine-group__list {
    align-self: start;
    padding-top: 0.15rem;
  }
  /* Every picture fills the height its row gives it, cropped to the column. */
  .wine-group__photo,
  .wine-group__photo--4 {
    position: relative;
    align-self: stretch;
    width: 100%;
    min-height: clamp(11rem, 28vh, 20rem);
  }
  .wine-group__photo img,
  .wine-group__photo--1 img,
  .wine-group__photo--2 img,
  .wine-group__photo--3 img,
  .wine-group__photo--4 img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    object-fit: cover;
  }
  .wine-line {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto;
    gap: 0.75rem;
  }
  .wine-line__name, .wine-line__kind, .wine-line__price {
    grid-column: auto;
    grid-row: auto;
  }
  .wine-line__name, .wine-line__kind, .wine-line__price { align-self: baseline; }
}
@media (prefers-reduced-motion: reduce) {
  .sweetness-tick, .wine-line::after { transition: none; }
  .sweetness-tick { transform: scaleX(1); }
}
