/* Shared layout for the Menu.ca directories. Each site's own stylesheet sets the tokens. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
.wrap { width: min(1200px, 100% - 32px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 30; padding: 10px 14px; background: var(--ink); color: var(--bg); border-radius: 8px; }
.skip:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

/* ---------- header */
.top { position: relative; z-index: 5; }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }
.top-links { display: flex; align-items: center; gap: 8px; }
.lang {
  border: 0; background: none; cursor: pointer; padding: 8px 10px; border-radius: 999px;
  font-size: .9rem; color: var(--muted);
}
.lang:hover { color: var(--ink); }

/* ---------- controls */
.controls {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding-block: 12px;
}
.controls-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.search {
  flex: 1 1 260px; display: flex; align-items: center; gap: 8px;
  height: 46px; padding-inline: 14px;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 999px;
}
.search:focus-within { border-color: var(--ink); }
.search svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.search input {
  flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none;
  font: 500 1rem var(--body); color: var(--ink);
}
.search input::placeholder { color: var(--muted); opacity: .85; }
.search input::-webkit-search-cancel-button { cursor: pointer; }

.toggle {
  display: inline-flex; align-items: center; gap: 10px; height: 46px; padding: 0 16px 0 10px;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 999px; cursor: pointer;
  font-weight: 600; font-size: .95rem; white-space: nowrap;
}
.switch {
  position: relative; width: 36px; height: 22px; border-radius: 999px; background: var(--line);
  transition: background .2s;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .25); transition: transform .2s;
}
.toggle[aria-pressed="true"] { border-color: var(--ok); }
.toggle[aria-pressed="true"] .switch { background: var(--ok); }
.toggle[aria-pressed="true"] .switch::after { transform: translateX(14px); }

.area-row { display: none; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-block: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 38px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--surface); font-weight: 600; font-size: .9rem;
  white-space: nowrap;
}
.chip small { font: 500 .75rem var(--mono); color: var(--muted); margin-left: 2px; }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip[aria-pressed="true"] small { color: inherit; opacity: .75; }

/* ---------- results */
.results-bar { display: flex; align-items: baseline; gap: 16px; padding-block: 22px 14px; }
#count { margin: 0; font: 500 .85rem var(--mono); letter-spacing: .02em; color: var(--muted); }
.clear {
  border: 0; background: none; padding: 0; cursor: pointer; font-weight: 600; font-size: .9rem;
  color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px;
}

.grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
}
.cell[hidden] { display: none; }
.card {
  position: relative; display: flex; flex-direction: column; height: 100%;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
}
a.card:hover, .chain-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--ink) 30%, var(--line)); box-shadow: 0 10px 28px -14px rgb(16 43 54 / .35); }
.plate {
  position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9;
  background: var(--plate); border-bottom: 5px solid var(--brand);
}
.plate img { position: absolute; inset: 0; margin: auto; width: auto; height: auto; max-width: 72%; max-height: 64%; object-fit: contain; }
.letter { font: 800 3rem var(--display); color: var(--brand); }
.body { display: flex; flex-direction: column; gap: 3px; padding: 14px 16px 16px; flex: 1; }
.name { font: 700 1.12rem/1.2 var(--display); letter-spacing: -.01em; }
.meta { font-size: .88rem; font-weight: 600; color: var(--accent-ink); }
.where { font-size: .88rem; color: var(--muted); }
.status { font: 500 .78rem/1.4 var(--mono); color: var(--muted); margin-top: 6px; min-height: 1.1em; }
.status.is-open { color: var(--ok-ink); }
.status.is-open::before {
  content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%;
  background: var(--ok); vertical-align: 1px; box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 22%, transparent);
}
.go {
  position: absolute; right: 14px; bottom: 14px; display: inline-flex; align-items: center; gap: 4px;
  font-size: .85rem; font-weight: 700; color: var(--accent-ink);
  opacity: 0; transform: translateX(-4px); transition: opacity .18s, transform .18s;
}
.go svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
a.card:hover .go, a.card:focus-visible .go { opacity: 1; transform: none; }
a.card:hover .status, a.card:focus-visible .status { opacity: 0; }

/* chain card: one card, every location inside */
.chain-card summary { list-style: none; cursor: pointer; display: flex; flex-direction: column; height: 100%; }
.chain-card summary::-webkit-details-marker { display: none; }
.pick { margin-top: 6px; font-size: .85rem; font-weight: 700; color: var(--accent-ink); }
.pick::after { content: " ▾"; }
.chain-card[open] .pick::after { content: " ▴"; }
.chain-card[open] { grid-row: span 2; }
.locs { list-style: none; margin: 0; padding: 0 8px 10px; max-height: 340px; overflow-y: auto; }
.locs li[hidden] { display: none; }
.locs a {
  display: flex; flex-direction: column; padding: 9px 8px; border-radius: 8px; text-decoration: none;
  border-top: 1px solid var(--line);
}
.locs li:first-child a { border-top: 0; }
.locs a:hover { background: var(--bg); }
.loc-name { font-size: .9rem; font-weight: 600; }
.locs .status { margin-top: 1px; }

.empty { padding: 48px 0; text-align: center; }
.empty p { font: 700 1.3rem var(--display); margin: 0 0 8px; }
.fineprint { margin: 28px 0 0; font-size: .8rem; color: var(--muted); }

.foot { border-top: 1px solid var(--line); margin-top: 72px; }
.foot-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; min-height: 76px; font-size: .88rem; color: var(--muted); }
.foot a { color: var(--ink); text-decoration-color: var(--line); text-underline-offset: 3px; }

@media (max-width: 640px) {
  .controls-row { gap: 8px; flex-wrap: nowrap; }
  .controls-row > .chips { display: none; }
  .search { flex: 1 1 0; min-width: 0; padding-inline: 12px; }
  .toggle { padding: 0 12px 0 8px; gap: 8px; font-size: .88rem; }
  .status { font: 600 .76rem/1.35 var(--body); }
  .grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .body { padding: 10px 12px 12px; }
  .name { font-size: 1rem; }
  .where { font-size: .8rem; }
  .go { display: none; }
  .chain-card[open] { grid-column: 1 / -1; }
}
@media (max-width: 640px) { .area-row { display: block; margin-top: 8px; } }
@media (max-width: 360px) { .grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
  html { scroll-behavior: auto; }
}
