/*
 * Dop & Kreef concept — sliding rows, shared by the one-pager (/) and the five pages (/multi/).
 * Menu items, products and photos sit in horizontal rows instead of long stacks: scroll-snap, no scrollbar, edges
 * that fade while there is more to see (rows.js keeps the fades true). Category chips above a row filter it
 * (row-filter.js); the chips never move and the row's height eases to its new size (Waldo, 5 Oct 2026).
 */
@property --row-fade-start { syntax: "<length>"; inherits: false; initial-value: 0px; }
@property --row-fade-end { syntax: "<length>"; inherits: false; initial-value: 0px; }

:root {
  /* the always-there bars, so a photo row never grows past the room between them */
  --bars-top: 112px;
  --bars-bottom: 0px;
  --row-fade: 36px;
}
@media (max-width: 767px) {
  :root { --bars-top: 100px; --bars-bottom: calc(49px + env(safe-area-inset-bottom)); }
}

[hidden] { display: none !important; }

/* a scroller whose edges fade while there is more to see in that direction */
.fade-x {
  --row-fade-start: 0px;
  --row-fade-end: var(--row-fade);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 var(--row-fade-start), #000 calc(100% - var(--row-fade-end)), transparent);
  mask-image: linear-gradient(to right, transparent, #000 var(--row-fade-start), #000 calc(100% - var(--row-fade-end)), transparent);
  transition: --row-fade-start 200ms ease-out, --row-fade-end 200ms ease-out;
}
.fade-x::-webkit-scrollbar { display: none; }
.fade-x.is-scrolled { --row-fade-start: var(--row-fade); }
.fade-x.is-at-end { --row-fade-end: 0px; }

/* the row: a frame that holds the sliding cards, with a bar of chips above it or, for a mouse, Previous/Next under it */
.row-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.row-bar:not(:has(.filter-chips)) { justify-content: flex-end; }
/* the arrows sit inside the frame that holds the cards, on its left and right edges halfway up, so they never move
   while the cards slide and a chip bar above the row doesn't push them off centre (Waldo, 29 Oct 2026) */
.row-frame > .row-bar { position: absolute; inset: 0 12px; margin: 0; pointer-events: none; }
.row-frame > .row-bar .row-nav { width: 100%; justify-content: space-between; }
.row-frame > .row-bar .row-btn { background: color-mix(in srgb, var(--bg) 85%, transparent); border-color: color-mix(in srgb, var(--cream) 55%, transparent); }
.row-frame > .row-bar .row-btn:not([aria-disabled="true"]) { pointer-events: auto; }
/* on the Spyskaart the arrows centre on the dish cards, below each section's heading (.cat: 8px + 46px icon + 14px) */
.menu-row .row-frame > .row-bar { top: 68px; }
.row-nav { display: none; gap: 8px; flex: none; }
@media (hover: hover) and (pointer: fine) {
  .row-nav { display: flex; }
}
@media not ((hover: hover) and (pointer: fine)) {
  .row-bar:not(:has(.filter-chips)) { display: none; }
}
.row-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-2); background: transparent; color: var(--cream); display: grid; place-items: center; cursor: pointer; padding: 0; transition: opacity 200ms ease-out; }
.row-btn:hover { border-color: var(--cream-2); }
/* everywhere on the site, an arrow that can't go further fades away and keeps its place (Waldo, 18 Nov 2026) */
.row-btn[aria-disabled="true"] { opacity: 0; pointer-events: none; cursor: default; }
@media (prefers-reduced-motion: reduce) { .row-btn { transition: none; } }
.row-nav.is-not-needed { visibility: hidden; }
.row-btn .text-icon { margin: 0; width: 18px; height: 18px; }
.row-btn-prev .text-icon { transform: scaleX(-1); }

.row-frame { position: relative; transition: height 220ms ease-out, opacity 200ms ease-out; }
.row-frame.is-easing { overflow: hidden; }
.row-frame.is-fading { opacity: 0; transition: none; }

.row-scroller {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(80%, 300px);
  gap: 14px;
  /* room for the focus ring, which the scroller would otherwise clip */
  padding: 6px;
  margin: -6px;
  scroll-padding: 0 6px;
  scroll-snap-type: x mandatory;
  list-style: none;
}
.row-scroller > * { scroll-snap-align: start; min-width: 0; }
.row-scroller:focus-visible { outline-offset: -2px; }
/* a mouse can click and drag a row (row-drag.js): an open hand over it, a closed one while dragging. Snapping is off
   while the row follows the pointer, then row-drag.js glides it onto a card and snapping returns. */
@media (hover: hover) and (pointer: fine) {
  .row-scroller { cursor: grab; }
  .row-scroller.is-dragging { cursor: grabbing; scroll-snap-type: none; user-select: none; }
}

/* photo rows may be taller than card rows, but never taller than the room between the bars */
.photo-row { grid-auto-columns: min(82%, 420px); }
.photo-row > .tile { max-height: calc(100svh - var(--bars-top) - var(--bars-bottom) - 32px); }

/* category chips: a sliding row of their own; pressing one changes its colour only, so nothing moves */
.filter-chips { display: flex; gap: 8px; flex: 1; min-width: 0; padding: 4px; margin: -4px; }
.filter-chip { flex: none; display: inline-grid; place-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--cream-2); font: 700 13px/1 "Nunito", sans-serif; letter-spacing: .02em; cursor: pointer; white-space: nowrap; }
.filter-chip:hover { border-color: var(--cream-2); color: var(--cream); }
/* the chosen chip: an amber tint and border with cream words, one step from the others, not a solid block (Waldo, 7 Oct 2026) */
.filter-chip[aria-pressed="true"] { background: color-mix(in srgb, var(--amber) 16%, transparent); border-color: color-mix(in srgb, var(--amber) 60%, transparent); color: var(--cream); }
/* both languages share one cell, so a chip keeps its width when AF/EN swaps it */
.filter-chip > .af, .filter-chip > .en { grid-area: 1 / 1; }
body:not(.en) .filter-chip > .en, body.en .filter-chip > .af { display: block !important; visibility: hidden; }

@media (prefers-reduced-motion: reduce) {
  .fade-x, .row-frame { transition: none; }
}
