/* The menu's sections, chalked on a slate (js/site/chalk-index.js): on the
   menu page and the order page. Laptops and desktops: the sections chalked
   across the slate, the one you're on underlined. Phones: one chalk line
   that opens the slate as a numbered list. The doubled class outweighs the
   pages' own chip styles.

   .chalk-board: a bar that is itself the chalkboard, in a wooden frame top
   and bottom (the menu's strip, the order page's). Sections on it are
   chalked straight on the board, with no slate of their own. */

.chalk-board {
  background: #1f2a24 radial-gradient(ellipse at 30% 0%, rgba(255, 255, 255, 0.07), transparent 60%);
  box-shadow: inset 0 3px 0 #4a3626, inset 0 4px 0 #2a1f17, inset 0 -4px 0 #4a3626, inset 0 -5px 0 #2a1f17, 0 8px 18px -10px rgba(0, 0, 0, 0.5);
  color: #f4ead9;
}
.chalk-board .chalk-index.chalk-index {
  margin: 0; padding: 0.2rem 0.4rem 0 0.2rem; border-radius: 0; background: none; box-shadow: none;
  /* it fades at whichever end has more (js/site/chalk-index.js) */
  /* clear under the arrow, then the chalk comes back */
  --clear-l: 0px; --fade-l: 0px; --clear-r: 0px; --fade-r: 0px;
  -webkit-mask-image: linear-gradient(90deg, transparent var(--clear-l), #000 var(--fade-l), #000 calc(100% - var(--fade-r)), transparent calc(100% - var(--clear-r)));
  mask-image: linear-gradient(90deg, transparent var(--clear-l), #000 var(--fade-l), #000 calc(100% - var(--fade-r)), transparent calc(100% - var(--clear-r)));
}
.chalk-rail.has-prev > .chalk-index.chalk-index { --clear-l: 1.9rem; --fade-l: 4.5rem; }
.chalk-rail.has-next > .chalk-index.chalk-index { --clear-r: 1.9rem; --fade-r: 4.5rem; }

/* The row and its two arrows. The rail takes the row's place in the bar. */
.chalk-rail { position: relative; display: flex; min-width: 0; grid-area: chips; }
.chalk-rail > .chalk-index { flex: 1 1 auto; min-width: 0; }
.chalk-step {
  position: absolute; z-index: 1; top: 50%; translate: 0 -50%; display: grid; place-items: center;
  width: 2rem; height: 2rem; padding: 0; border: 0; border-radius: 999px; background: none;
  color: rgba(244, 234, 217, 0.75); opacity: 0; pointer-events: none; cursor: pointer;
  transition: opacity 0.35s ease, color 0.25s ease;
}
.chalk-step--prev { left: -0.2rem; }
.chalk-step--next { right: -0.2rem; }
.chalk-step .arrow { width: 1.15rem; height: 1.15rem; }
.chalk-step:hover { color: #fff; }
.chalk-rail.has-prev > .chalk-step--prev, .chalk-rail.has-next > .chalk-step--next { opacity: 1; pointer-events: auto; }
@media (max-width: 640px) { .chalk-step { display: none; } }
.chalk-board .chalk-pick { border-radius: 10px; background: rgba(244, 234, 217, 0.05); box-shadow: inset 0 0 0 1px rgba(244, 234, 217, 0.22); }
@media (max-width: 640px) { .chalk-board .chalk-index.chalk-index { padding: 0; -webkit-mask-image: none; mask-image: none; } }

.chalk-index.chalk-index {
  --slate: #1f2a24 radial-gradient(ellipse at 30% 20%, rgba(255, 255, 255, 0.07), transparent 60%);
  --slate-frame: inset 0 0 0 3px #4a3626, inset 0 0 0 4px #2a1f17;
  -webkit-mask-image: none; mask-image: none;
}
.chalk-pick, .chalk-list { display: none; }

/* ---------- laptops and desktops: chalk across the slate ---------- */
@media (min-width: 641px) {
  .chalk-index.chalk-index {
    align-items: center; gap: 1.15rem; margin: 0; padding: 0.35rem 1rem 0.15rem; border-radius: 4px;
    background: var(--slate); box-shadow: var(--slate-frame);
  }
  .chalk-index.chalk-index > :not(.chalk-pick) {
    position: relative; flex: none; padding: 0.1rem 0 0.45rem; border: 0; border-radius: 0; background: none;
    color: rgba(244, 234, 217, 0.58); font: 600 1.32rem/1 'Caveat', cursive; text-decoration: none; white-space: nowrap; cursor: pointer;
  }
  .chalk-index.chalk-index > :not(.chalk-pick):hover { color: rgba(244, 234, 217, 0.85); }
  /* the boards view lights its chip in cream (css/menu.css): not on the slate */
  .chalk-index.chalk-index > .is-on:not(.chalk-pick) { color: #fff; background: none; border-color: transparent; }
  .chalk-index.chalk-index > :not(.chalk-pick):focus-visible { outline: 1.5px dashed rgba(255, 217, 154, 0.7); outline-offset: 3px; }
}

/* the chalk underline under the one you're on */
.chalk-index.chalk-index > .is-on:not(.chalk-pick)::after,
.chalk-pick__now::after,
.chalk-list__i.is-on span::after {
  content: ''; position: absolute; left: -2px; right: -4px; bottom: 0.05rem; height: 4px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 6' preserveAspectRatio='none'%3E%3Cpath d='M1 4C20 1 45 5 70 2.5S95 3 99 2' fill='none' stroke='%23ffd99a' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}
@media (max-width: 640px) { .chalk-index.chalk-index > .is-on:not(.chalk-pick)::after { content: none; } }

/* ---------- phones: one chalk line, and the slate as a list ---------- */
@media (max-width: 640px) {
  .chalk-index.chalk-index { overflow: visible; }
  .chalk-index.chalk-index > :not(.chalk-pick) { display: none; }
  .chalk-pick:not([hidden]) { display: flex; }
  .chalk-list:not([hidden]) { display: block; }
}
.chalk-pick {
  flex: 1; min-width: 0; align-items: center; gap: 0.55rem; margin: 0; padding: 0.5rem 0.85rem;
  border: 0; border-radius: 4px; background: var(--slate); box-shadow: var(--slate-frame); color: #f4ead9;
  font: inherit; text-align: left; cursor: pointer;
}
.chalk-pick:focus-visible { outline: 2px solid #ffd99a; outline-offset: 2px; }
.chalk-pick__no { flex: none; font: 500 0.62rem/1 'Switzer', system-ui, sans-serif; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(244, 234, 217, 0.55); }
.chalk-pick__now { position: relative; min-width: 0; padding-bottom: 0.2rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 1.42rem/1 'Caveat', cursive; }
.chalk-pick em { flex: none; margin-left: auto; font: 400 0.78rem/1 'Switzer', system-ui, sans-serif; font-style: normal; color: rgba(244, 234, 217, 0.6); }

.chalk-list {
  position: fixed; z-index: 60; max-height: min(70vh, 28rem); overflow: auto; padding: 0.55rem 0.5rem 0.65rem;
  border-radius: 4px; color: rgba(244, 234, 217, 0.8);
  background: #1f2a24 radial-gradient(ellipse at 30% 15%, rgba(255, 255, 255, 0.07), transparent 60%);
  box-shadow: inset 0 0 0 4px #4a3626, inset 0 0 0 5px #2a1f17, 0 18px 36px rgba(0, 0, 0, 0.45);
}
.chalk-list__i {
  display: flex; align-items: baseline; gap: 0.6rem; width: 100%; margin: 0; padding: 0.22rem 0.55rem; border: 0; border-radius: 4px;
  background: none; color: inherit; font: 600 1.32rem/1.15 'Caveat', cursive; text-align: left; cursor: pointer;
}
.chalk-list__i small { flex: none; width: 1.4rem; font: 500 0.72rem 'Switzer', system-ui, sans-serif; color: rgba(255, 217, 154, 0.6); }
.chalk-list__i span { position: relative; }
.chalk-list__i em { margin-left: auto; font: 400 0.74rem 'Switzer', system-ui, sans-serif; font-style: normal; color: rgba(244, 234, 217, 0.5); }
.chalk-list__i:hover, .chalk-list__i:focus-visible { background: rgba(244, 234, 217, 0.06); outline: none; }
.chalk-list__i.is-on { color: #fff; }

/* Search on the board (the menu's strip, the order page's): only the
   magnifier until it's tapped; then the field slides out from it,
   unhurried, and the words fade in once there's room. The pages say what
   searching does (js/menu/menu.js, js/order/order.js). */
.chalk-search {
  grid-area: search; justify-self: end; position: relative; display: flex; align-items: center;
  width: 2.4rem; height: 2.4rem; flex: none; margin-left: auto; overflow: hidden; border-radius: 999px; border: 1px solid rgba(244, 234, 217, 0.32);
  transition: width 0.65s cubic-bezier(0.22, 0.8, 0.24, 1), background-color 0.45s ease, border-color 0.45s ease;
}
.chalk-search.is-open { width: 15rem; background: rgba(244, 234, 217, 0.06); border-color: rgba(244, 234, 217, 0.42); }
.chalk-search:focus-within { outline: 1.5px solid rgba(255, 217, 154, 0.7); outline-offset: 2px; }
.chalk-search__btn { position: absolute; z-index: 1; top: 0; left: 0; display: grid; place-items: center; width: calc(2.4rem - 2px); height: 100%; padding: 0; border: 0; border-radius: 999px; background: none; color: rgba(244, 234, 217, 0.82); transition: color 0.45s ease; }
.chalk-search:not(.is-open) .chalk-search__btn:hover { background: rgba(244, 234, 217, 0.08); }
.chalk-search.is-open .chalk-search__btn { color: var(--lamp); }
.chalk-search__btn:focus-visible { outline: none; }
.chalk-search svg { width: 1.05rem; height: 1.05rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.chalk-search input {
  width: 100%; min-width: 0; height: 100%; padding: 0 0.9rem 0 2.35rem; border: 0; background: none; color: #f4ead9; font: inherit; font-size: 0.92rem;
  opacity: 0; translate: 0.6rem 0; pointer-events: none; transition: opacity 0.25s ease, translate 0.45s ease;
}
.chalk-search.is-open input { opacity: 1; translate: 0; pointer-events: auto; transition-delay: 0.2s; }
.chalk-search input:focus-visible { outline: none; }
.chalk-search input::-webkit-search-cancel-button { display: none; }
.chalk-search input::placeholder { color: rgba(244, 234, 217, 0.55); }
@media (max-width: 640px) { .chalk-search.is-open { width: 100%; } }
@media (prefers-reduced-motion: reduce) { .chalk-search, .chalk-search input { transition: none; } }
