/* ==========================================================================
   Piren: the julbord drinks menu (components/drink-menu), in a modal dialog.

   PAGE-SCOPED like julbord.css: only julbord.html and en/julbord.html link
   it, after julbord.css and before layout.css. The rows are menu-item rows
   from sections.css; this file only sizes the dialog, lays the groups out in
   two columns, and lets a long price wrap under its name.
   ========================================================================== */

/* --- The trigger, in the #dryck intro (benefit-columns show-dialog-cta) ----
   It ships hidden until drink-menu.js has a dialog to open. .btn sets
   display, which beats the UA rule for [hidden], so it is said again here. */
.benefit-columns__dialog-cta{margin-block-start:var(--space-hair)}
.benefit-columns__dialog-cta[hidden]{display:none}

/* The page behind a modal should not scroll under the visitor's finger. */
html:has(.drink-menu[open]){overflow:hidden}

/* --- The dialog ------------------------------------------------------------
   --row-wrap:wrap lets a two-tier wine price drop under the name when the
   column is narrow, instead of squeezing the name to a word per line; the
   body's 14rem basis below is what decides when. */
.drink-menu{
  --row-dir:row;
  --row-wrap:wrap;
  inline-size:min(100% - 2 * var(--space-tight), 64rem);
  max-inline-size:none;
  max-block-size:calc(100vh - 2 * var(--space-tight));
  max-block-size:calc(100dvh - 2 * var(--space-tight));
  margin:auto;
  padding:0;
  border:0;
  overflow-y:auto;
  overscroll-behavior:contain;
  background:var(--surface-page);
  color:var(--text-body);
  box-shadow:var(--shadow-supersoft);
}
.drink-menu::backdrop{
  background:rgb(25 28 23 / .6);
  background:color-mix(in srgb, var(--color-primary-950) 60%, transparent);
}

.drink-menu__panel{
  container-type:inline-size;
  container-name:drinkmenu;
  display:flex;
  flex-direction:column;
  align-items:stretch;
}

/* The header stays put while the list scrolls, so the close button is
   always one tap away. NO RULE UNDER IT, at the client's request: the
   header is set apart by staying put, not by a line. */
.drink-menu__head{
  position:sticky;
  inset-block-start:0;
  z-index:1;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:var(--space-tight);
  padding:var(--space-tight) var(--space-snug);
  background:var(--surface-page);
}
.drink-menu__titles{
  display:flex;
  flex-flow:row wrap;
  align-items:baseline;
  gap:var(--space-hair) var(--space-tight);
}
.drink-menu__title{
  font-family:var(--font-display);
  font-weight:var(--font-display-bold);
  font-size:var(--type-h3);
  line-height:var(--line-height-snug);
  color:var(--text-heading);
}
.drink-menu__close{
  flex:none;
  padding:.45em 1em;
  font-size:var(--type-sm);
}

/* TWO COLUMNS AT MOST, each at least 22rem: on a laptop the ten groups
   balance into two columns, on a phone they stack. Columns rather than a
   grid because the groups are of very different lengths (eight red wines,
   one alcohol-free snaps) and a grid would leave a hole beside every short
   one. A group never breaks across the two columns. */
.drink-menu__body{
  columns:22rem 2;
  column-gap:var(--space-loose);
  padding:var(--space-hair) var(--space-snug) var(--space-snug);
}
.drink-menu__group{
  break-inside:avoid;
  padding-block-end:var(--space-snug);
}
.drink-menu__group .menu-group__title{margin-block-end:var(--space-hair)}
.drink-menu__group .menu-item__body{flex:1 1 14rem}

/* NO HAIRLINE BETWEEN DRINKS. On /menyer each dish has a rule under it; in
   two columns the rules from both sides stacked into a grid of stripes and
   the client found it messy. The row's own padding keeps the drinks apart. */
.drink-menu .menu-item{border-block-end:0}

/* On a phone the dialog is the whole screen: a floating card with a margin
   round it only wastes the width the drink names need. */
@media (max-width: 40rem){
  .drink-menu{
    inline-size:100%;
    max-block-size:100vh;
    max-block-size:100dvh;
    block-size:100%;
  }
  .drink-menu__head,
  .drink-menu__body{padding-inline:var(--space-tight)}
}

@media (prefers-reduced-motion: no-preference){
  .drink-menu[open]{animation:drink-menu-in var(--duration-fast) var(--ease-emphasis)}
}
@keyframes drink-menu-in{
  from{opacity:0;transform:translateY(.75rem)}
}
