/* wall-menu.css : styles for the menu button and its list. Loaded after wall.css.

   As written in the page the menu is a <details> element that opens with no script: its
   <summary> is the button. menu.js swaps in a real <button> (class "menu-live" on the box) and
   then opens and closes the list with the class "menu-open".

   Closed: one cream pill at the bottom of the screen (centred on upright screens, bottom right on
   wide ones). Open: a sheet of cream paper above the button, a paper ticket at its head, the page
   behind dimmed a little. */

.menu {
  position: fixed; z-index: 8; left: 0; right: 0; bottom: 0; height: 0;
  --menu-foot: max(12px, env(safe-area-inset-bottom));
}

/* ------------------------------------------------------------------ the button */

.menu-button {
  position: absolute; left: 0; right: 0; bottom: var(--menu-foot);
  display: flex; align-items: center; justify-content: center; gap: .62em;
  width: max-content; min-height: 52px; margin: 0 auto; padding: .2em 1.2em .2em 1.05em;
  font: 700 .82rem/1 "Unbounded", "Arial Black", Arial, sans-serif;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink); background: var(--cream);
  border: 2px solid var(--ink); border-radius: 999px;
  box-shadow: 4px 4px 0 var(--crimson);
  cursor: pointer; list-style: none;
  -webkit-appearance: none; appearance: none;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform .15s ease, box-shadow .15s ease;
}
.menu-button::-webkit-details-marker { display: none; }
.menu-button::marker { content: ""; }
.menu-button:hover { transform: translate(-1px, -1px); box-shadow: 6px 6px 0 var(--crimson); }
.menu-button:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--crimson); }
.menu-button:focus-visible { outline: 3px solid var(--orange); outline-offset: 4px; }

/* While the list of tickets is under it, the button steps aside (menu.js adds "menu-aside"), so it
   never lies on a ticket; it is back once the last ticket is above it. The keyboard still reaches
   it, and then it shows. */
.menu-live .menu-button { transition: transform .15s ease, box-shadow .15s ease, opacity .18s ease; }
.menu-aside .menu-button:not(:focus-visible) { opacity: 0; pointer-events: none; }

.menu-icon { flex: none; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; }

/* "Menu" and three lines while it is closed, "Close" and a cross while it is open */
.menu-word-shut, .menu-icon-shut { display: none; }
.menu[open] .menu-word-open, .menu.menu-open .menu-word-open,
.menu[open] .menu-icon-open, .menu.menu-open .menu-icon-open { display: none; }
.menu[open] .menu-word-shut, .menu.menu-open .menu-word-shut,
.menu[open] .menu-icon-shut, .menu.menu-open .menu-icon-shut { display: inline; }

/* ------------------------------------------------------------------ the page behind, dimmed a little */

.menu-dim {
  position: fixed; z-index: -1; top: 0; left: 0; width: 100%; height: 100vh; height: 100lvh;
  background: rgba(7, 1, 13, .5);
  cursor: pointer; -webkit-tap-highlight-color: transparent;      /* a tap on it closes the menu (iPhone Safari needs the pointer to send the tap) */
  opacity: 0; visibility: hidden;
  transition: opacity .22s ease, visibility 0s linear .22s;
}
.menu-open > .menu-dim { opacity: 1; visibility: visible; transition: opacity .22s ease, visibility 0s linear 0s; }

/* ------------------------------------------------------------------ the sheet: cream paper, printed in purple */

.menu-sheet {
  position: absolute; left: 12px; right: 12px; bottom: calc(var(--menu-foot) + 52px + 14px);
  max-width: 23rem; margin: 0 auto; padding: 14px 16px 8px;
  max-height: calc(100vh - var(--menu-foot) - 52px - 30px); max-height: calc(100dvh - var(--menu-foot) - 52px - 30px);
  overflow-y: auto; overscroll-behavior: contain;
  color: #3B1A5E;
  background: #F1DEBD linear-gradient(170deg, rgba(255, 255, 255, .26), rgba(255, 255, 255, 0) 38%, rgba(160, 110, 50, .14));
  border-radius: 3px;
  outline: 1.5px solid rgba(59, 26, 94, .3); outline-offset: -6px;      /* the printed frame of the sheet */
  box-shadow: 5px 6px 0 rgba(7, 1, 13, .55);
}
/* with the script on, the sheet rises from the bottom */
.menu-live .menu-sheet {
  opacity: 0; visibility: hidden; transform: translateY(26px);
  transition: opacity .2s ease, transform .24s cubic-bezier(.2, .85, .3, 1), visibility 0s linear .24s;
}
.menu-live.menu-open .menu-sheet { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }

.menu-items { list-style: none; margin: 0; padding: 0; }
.menu-item + .menu-item + .menu-item { border-top: 1.5px dashed rgba(59, 26, 94, .26); }

.menu-link {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: .5em;
  min-height: 44px; padding: .14em .3em 0;
  font-family: "Big Shoulders Display", Impact, "Arial Narrow", sans-serif;
  font-weight: 900; font-size: 1.5rem; line-height: 1; letter-spacing: .022em; text-transform: uppercase; text-decoration: none;
  color: #3B1A5E;      /* flat purple: nothing behind the letters */
  -webkit-tap-highlight-color: rgba(255, 61, 142, .25);
}
.menu-link:hover { color: #6A1B9A; }
.menu-link:focus-visible { outline: 3px solid #3B1A5E; outline-offset: -2px; border-radius: 3px; }

/* the section that is on screen now: a pink star at the end of its line */
.menu-link[aria-current="true"]::after {
  content: ""; flex: none; width: .72em; height: .72em; margin-bottom: .1em;
  background: #D4126A;      /* the deeper pink the tickets are printed in: it reads on cream paper */
  clip-path: polygon(50% 0%, 62% 34%, 98% 36%, 70% 58%, 80% 92%, 50% 72%, 20% 92%, 30% 58%, 2% 36%, 38% 34%);
}

/* "Book your set", first and biggest: a paper ticket lying on the sheet */
.menu-ticket {
  justify-content: center;
  width: min(100%, 15.5rem); aspect-ratio: 2566 / 1152; min-height: 0; margin: 0 auto 10px; padding: .1em 6% 0 14%;
  font-size: 1.95rem; letter-spacing: .02em; white-space: nowrap;
  isolation: isolate;
  transform: rotate(-2deg);
  transition: transform .15s ease;
}
/* The paper and its hard shadow lie on a layer of their own, under the words. The words are flat now, and Chrome
   can lose flat words that sit INSIDE a tilted element with a drop-shadow filter: so the filter is on the paper
   only, never on the words. */
.menu-ticket::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: url(/assets/opening/s6-ticket-1024.webp) center / 100% 100% no-repeat;
  filter: drop-shadow(3px 4px 0 rgba(7, 1, 13, .5));
}
.menu-ticket:hover { transform: rotate(-3deg) translate(-1px, -2px); color: #3B1A5E; }
.menu-ticket:active { transform: rotate(-2deg) translate(1px, 2px); }
.menu-ticket[aria-current="true"]::after { position: absolute; top: 12%; right: 7%; margin: 0; width: .5em; height: .5em; }

/* a section the menu has just landed on holds the keyboard focus: no ring round a whole section */
.menu-landed:focus { outline: none; }

/* ------------------------------------------------------------------ room at the bottom, so the button never lies on what must be pressed or read */

/* The ticket list and the last lines keep their own room for the button (wall-booth.css, wall-end.css):
   scrolled to its end, each stops clear above it. Here: whatever the keyboard lands on is scrolled clear of it too. */
html { scroll-padding-bottom: calc(max(12px, env(safe-area-inset-bottom)) + 52px + 14px); }

/* ------------------------------------------------------------------ upright and short (a small phone, or a phone whose browser buttons are showing):
   the ticket and the lines drawn a little closer, so the whole sheet still fits above the button */

@media (max-aspect-ratio: 99/100) and (max-height: 640px) {
  .menu-sheet { padding: 8px 14px 7px; }
  /* each line as tall as the screen allows, between 38 and 44 px */
  .menu-link { min-height: 38px; min-height: clamp(38px, calc((100dvh - 207px) / 9), 44px); font-size: 1.36rem; }
  .menu-ticket { width: min(100%, 11.5rem); min-height: 0; margin-bottom: 7px; font-size: 1.5rem; }
}

/* ------------------------------------------------------------------ the plain page (no 3D wall, or no script): its words and its first button
   stand on the left, so on upright screens the menu button sits bottom right, clear of them. The sheet stays centred. */

@media (max-aspect-ratio: 99/100) {
  html:not(.wall-on) .menu-button { left: auto; right: 12px; margin: 0; }
}
@media (max-aspect-ratio: 99/100) and (max-width: 345px) {
  html:not(.wall-on) .menu-button { right: 8px; gap: .45em; padding-left: .75em; padding-right: .8em; }
}

/* ------------------------------------------------------------------ wide screens: bottom right, a compact panel above the button */

@media (min-aspect-ratio: 1/1) {
  .menu { --menu-foot: max(18px, env(safe-area-inset-bottom)); }
  .menu-button { left: auto; right: var(--edge); margin: 0; }
  .menu-sheet { left: auto; right: var(--edge); width: 20.5rem; max-width: calc(100% - 2 * var(--edge)); margin: 0; }
}
/* wide and low (a phone on its side, a low window): two columns, the ticket lying at the head
   of the first, beside the first two lines of the second */
@media (min-aspect-ratio: 1/1) and (max-height: 680px) {
  .menu-sheet { width: 33rem; padding-top: 10px; }
  .menu-items { display: grid; grid-template-columns: 1fr 1fr; column-gap: 18px; }
  .menu-item-book { grid-column: 1; grid-row: 1 / span 2; align-self: center; }
  .menu-link { min-height: 40px; min-height: clamp(40px, calc((100dvh - 123px) / 6), 44px); font-size: 1.26rem; white-space: nowrap; }
  .menu-ticket { width: 10.5rem; min-height: 0; margin-bottom: 0; font-size: 1.32rem; }
}

@media (prefers-reduced-motion: reduce) {
  .menu-button, .menu-live .menu-button, .menu-dim, .menu-open > .menu-dim, .menu-live .menu-sheet, .menu-live.menu-open .menu-sheet, .menu-ticket { transition: none; }
  .menu-live .menu-sheet { transform: none; }
}
