/* The drink glass: a stacked-ratio picture of a drink (public/drink.js renderGlass).
 * Shared by the app (styles.css sets the page around it) and the printed and shared
 * cards (share-styles/base.css and notecard.css set the --drink-* colors from the card
 * style). Liquid colors come from the ingredient catalog and never follow the theme. */
:root {
  --drink-outline: color-mix(in srgb, var(--ink) 55%, transparent);
  --drink-sep: color-mix(in srgb, var(--paper) 80%, transparent);
  --drink-unknown: color-mix(in srgb, var(--stone) 28%, var(--paper));
  --drink-label: var(--ink);
  --drink-muted: var(--stone);
}
.drink-glass {
  margin: 0;
  display: grid;
  gap: 10px;
}
.dg-art {
  position: relative;
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  column-gap: 16px;
  height: 196px;
  /* As wide as there is room for, so the labels show whole. */
  width: 100%;
}
.dg-art svg {
  width: 140px;
  height: 196px;
  overflow: visible;
  stroke: none;
  fill: currentColor;
}
.drink-glass rect {
  stroke: none;
}
.drink-glass .layer.unknown {
  fill: var(--drink-unknown);
}
.drink-glass .layer.top {
  fill-opacity: 0.6;
}
.drink-glass .sep {
  stroke: var(--drink-sep);
  stroke-width: 0.8;
}
.drink-glass .sep.top-edge {
  stroke: var(--drink-outline);
  stroke-dasharray: 2 2;
  stroke-width: 0.6;
}
.drink-glass .dash {
  stroke-width: 1.6;
  stroke-dasharray: 3 2;
}
.drink-glass .dash.unknown {
  stroke: var(--drink-unknown);
}
.drink-glass .glass {
  fill: none;
  stroke: var(--drink-outline);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.dg-labels {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0;
  height: 100%;
}
.dg-labels li {
  position: absolute;
  left: 0;
  right: 0;
  top: var(--y);
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.86rem;
  line-height: 1.15;
  color: var(--drink-label);
}
/* The words of a label: whole, on one line beside its layer. */
.dg-labels .dg-text {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dg-labels .dot {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 25%, transparent);
}
.dg-labels .unknown .dot {
  background: var(--drink-unknown);
}
.dg-labels .dash .dot {
  height: 3px;
  border-radius: 2px;
}
.dg-labels .amt {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.dg-labels .top .amt {
  font-weight: 500;
  color: var(--drink-muted);
  font-style: italic;
}
.dg-extras {
  font-size: 0.86rem;
  color: var(--drink-muted);
}
.drink-glass {
  break-inside: avoid;
}

/* Phones: a smaller glass, and the labels become a list beside it (top of the glass
   first) that wraps, so every label shows whole however long it is. */
@media (max-width: 560px) {
  .dg-art {
    grid-template-columns: 96px minmax(0, 1fr);
    column-gap: 12px;
    align-items: center;
    height: auto;
    min-height: 150px;
    width: 100%;
    min-width: 0;
  }
  .dg-labels {
    height: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .dg-labels li {
    position: static;
    transform: none;
    align-items: flex-start;
  }
  .dg-labels .dot {
    margin-top: 0.22em;
  }
  .dg-labels .dash .dot {
    margin-top: 0.5em;
  }
  .dg-labels .dg-text {
    white-space: normal;
    overflow: visible;
  }
  .dg-art svg {
    width: 96px;
    height: 150px;
  }
  .dg-labels li {
    font-size: 0.8rem;
    gap: 6px;
  }
}
