/* Lunch & dinner: what this page needs beyond site.css. Runs in reading order. */

/* Section room, kept inside the band measure. */
.pad-lunch { padding-block: clamp(1.25rem, 4vh, 2.5rem) clamp(2rem, 7vh, 4.5rem); }

/* Opening and dishes share one frame. On a phone it is a column in reading order: h1, its line,
   the plate, the list, the prices. */
.lay-plates {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-block: clamp(0.75rem, 2.5vh, 1.5rem) clamp(2rem, 7vh, 4.5rem);
}
.lay-plates > * { min-width: 0; }
.part-dishes { padding-top: 0.75rem; }

/* Desk: the h1 runs the full width; under it the words take the left column and the plate takes
   the right one, starting level with the line under the h1. The prices close the right column
   on the list's last rule. */
@media (min-width: 48em) {
  .lay-plates {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 44%);
    grid-template-rows: auto auto 1fr auto;
    align-items: start;
    gap: 1rem clamp(1.5rem, 4vw, 3rem);
  }
  .lay-plates > h1 { grid-column: 1 / -1; grid-row: 1; }
  .lay-plates > .say-slogan { grid-column: 1; grid-row: 2; }
  .lay-plates > .part-dishes { grid-column: 1; grid-row: 3 / 5; }
  .lay-plates > .hold-photo { grid-column: 2; grid-row: 2 / 4; align-self: start; }
  .lay-plates > .read-prices { grid-column: 2; grid-row: 4; align-self: end; }

  /* With script the plate is one tall box that fits the window and stays with the list
     while the list runs past it, on its own solid ground. */
  .js .lay-plates > .hold-photo {
    position: sticky;
    top: 1rem;
    padding-bottom: 0.25rem;
    background: var(--tone-floor);
  }
  .js .lay-plates .stack-plates {
    height: clamp(18rem, calc(100vh - 16rem), 36rem);
    grid-template-rows: minmax(0, 1fr);
  }
  .js .lay-plates .show-plate { min-height: 0; }
  .js .lay-plates .show-plate img {
    flex: 1 1 0;
    min-height: 0;
    height: auto;
    aspect-ratio: auto;
    object-fit: cover;
  }
}

/* The line that tells a visitor the picture follows the row: caption size, under the plate.
   It is only true with script, so it only shows with script. */
.hint-dishes { display: none; font-size: var(--step-fine); line-height: 1.35; }
.js .hint-dishes { display: block; }

/* Dish rows: each one rests on a slanted rule, low left to high right, the table edge. */
.list-dishes { display: flex; flex-direction: column; padding: 0; list-style: none; }
.list-dishes > .serve-row {
  padding-block: 0.9rem 0;
  border-top: 0;
}
.list-dishes > .serve-row:last-child { border-bottom: 0; }
.list-dishes > .serve-row::after {
  content: "";
  flex: 0 0 100%;
  height: 0.75rem;
  background: currentColor;
  clip-path: polygon(0 calc(100% - 0.25rem), 100% 0, 100% 0.25rem, 0 100%);
}
.js .serve-row[data-pick-dish] { cursor: pointer; }
.list-dishes .count-row { font-size: 1.75rem; }
.list-dishes .tell-row p { max-width: 34rem; }

/* The picked row is marked by the blue bar beside its name. The numeral keeps its ink. */
.js .list-dishes .name-dish::before {
  content: "";
  display: inline-block;
  width: 0;
  height: var(--measure-bar);
  margin-right: 0;
  vertical-align: 0.2em;
  background: var(--tone-bar);
  transition: width 180ms, margin-right 180ms;
}
.js .serve-row.picked .name-dish::before,
.js .serve-row:is(:hover, :focus-within) .name-dish::before { width: 1.1em; margin-right: 0.55em; }
.js .lay-plates:has(.serve-row:is(:hover, :focus-within)) .serve-row.picked:not(:hover):not(:focus-within) .name-dish::before {
  width: 0;
  margin-right: 0;
}

/* Prices line. */
.read-prices {
  padding: 0.5rem 0 0.5rem 0.9rem;
  border-left: var(--measure-bar) solid var(--tone-bar);
}
.read-prices strong { font-family: var(--face-board); font-weight: 500; }

/* The one plate: four pictures in one box. Without script they run in a column. */
.stack-plates { display: flex; flex-direction: column; gap: var(--measure-part); }
.show-plate { display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; }
.show-plate img { aspect-ratio: 4 / 3; height: auto; }

.js .stack-plates { display: grid; gap: 0; }
.js .show-plate { grid-area: 1 / 1; align-self: stretch; visibility: hidden; }
.js .show-plate.picked { visibility: visible; }

/* Pointer or focus on a row takes the plate until it leaves; the hidden ones stay visibility:hidden. */
.js .lay-plates:has(.serve-row:is(:hover, :focus-within)) .show-plate { visibility: hidden; }
.js .lay-plates:has([data-pick-dish="fish-and-chips"]:is(:hover, :focus-within)) [data-show-dish="fish-and-chips"],
.js .lay-plates:has([data-pick-dish="sandwiches"]:is(:hover, :focus-within)) [data-show-dish="sandwiches"],
.js .lay-plates:has([data-pick-dish="burgers"]:is(:hover, :focus-within)) [data-show-dish="burgers"],
.js .lay-plates:has([data-pick-dish="homemade-cobbler"]:is(:hover, :focus-within)) [data-show-dish="homemade-cobbler"] {
  visibility: visible;
}

/* Hand-off: the heading at left with the two next pages as action markers at the right end of
   its line; under it the call-ahead words run the width of the grid in two columns. */
.close-lunch { display: flex; flex-direction: column; gap: 1rem; }
.head-close {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.5rem 2rem;
}
.head-close > * { min-width: 0; }
.take-next { justify-content: flex-end; gap: 0 2rem; }
.take-next .pass-way { font-size: var(--step-read); line-height: 1.3; min-height: var(--measure-tap); }
.tell-close {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: 1em clamp(1.5rem, 4vw, 3rem);
}
.tell-close > * { min-width: 0; }
