/*
 * Traum Cafe: Speisekarte.
 * Liste ohne Bilder; das Foto kommt beim Darüberfahren (Maus) bzw. Antippen (Handy).
 * Abschnitt, Tisch und Milchglas: siehe sections.css. Tokens: hero.css.
 */

.menu__inner {
  width: min(100%, 72rem);
  margin-inline: auto;
}

/* ---------- Kopf ---------- */

.menu__head {
  display: grid;
  justify-items: center;
  gap: 1rem;
  text-align: center;
}

.menu__hint {
  margin: 0;
  color: var(--muted);
}

.menu__hint-touch {
  display: none;
}

.menu__hint-price {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.8125rem;
}

@media (hover: none), (pointer: coarse) {
  .menu__hint-hover {
    display: none;
  }

  .menu__hint-touch {
    display: inline;
  }
}

.menu__cats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  margin: 0.25rem 0 0;
  padding: 0;
  list-style: none;
}

.menu__cat {
  display: inline-flex;
  align-items: center;
  min-height: 2.6rem;
  padding: 0 1.05rem;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: color-mix(in oklab, var(--bg) 80%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color 0.25s,
    border-color 0.25s,
    color 0.25s;
}

.menu__cat:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--bg);
}

/* ---------- Karte: zwei feste Spalten wie gedruckt ---------- */

/* Feste Spalten statt CSS-Spalten: ein aufgeklapptes Foto soll keine
   Kategorie in die andere Spalte schieben */
.menu__card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  align-items: start;
  column-gap: clamp(2.5rem, 6vw, 5rem);
  margin-top: 2.5rem;
  padding: clamp(1.5rem, 4vw, 3.25rem) clamp(1.25rem, 4vw, 3.5rem);
  border-radius: 1.5rem;
}

.menu-cat {
  padding-bottom: 2.25rem;
  scroll-margin-top: calc(var(--header-h) + 1rem);
}

.menu__col:last-child .menu-cat:last-child {
  padding-bottom: 0;
}

.menu-cat__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 800;
  font-stretch: 75%;
  line-height: 1;
  text-transform: uppercase;
}

.menu-cat__note {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.8125rem;
}

.menu-cat__list {
  margin: 0.8rem 0 0;
  padding: 0;
  list-style: none;
}

/* Trennlinie im Knopf: zwischen zwei Gerichten verlässt die Maus nie einen Knopf */
.dish-row + .dish-row > .dish-row__button {
  border-top: 1px solid var(--line);
}

.dish-row__button {
  display: grid;
  gap: 0.25rem;
  width: 100%;
  padding: 0.8rem 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.dish-row__button:focus-visible {
  border-radius: 0.5rem;
  outline: 3px solid var(--tomato-text);
  outline-offset: 3px;
}

.dish-row__line {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}

.dish-row__name {
  font-size: 1.0625rem;
  font-weight: 650;
  line-height: 1.3;
  transition:
    color 0.2s,
    translate 0.3s var(--ease-out);
}

/* Punktlinie zwischen Name und Preis */
.dish-row__dots {
  flex: 1;
  min-width: 1.25rem;
  border-bottom: 2px dotted color-mix(in oklab, var(--ink) 28%, transparent);
  translate: 0 -0.3em;
}

.dish-row__price {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.dish-row__from {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
}

.dish-row__desc {
  padding-right: 3rem;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.45;
  text-wrap: pretty;
}

/* Pfeil: nur auf Touch-Geräten, zeigt, dass Antippen das Foto öffnet */
.dish-row__caret {
  display: none;
  flex: none;
  align-self: center;
  width: 1rem;
  height: 1rem;
  color: var(--muted);
  transition: rotate 0.25s var(--ease-out);
}

.dish-row__button[aria-expanded="true"] .dish-row__caret {
  rotate: 180deg;
}

@media (hover: hover) and (pointer: fine) {
  .dish-row__button:hover .dish-row__name {
    color: var(--tomato-text);
    translate: 0.35rem 0;
  }
}

@media (hover: none), (pointer: coarse) {
  .menu.is-enhanced .dish-row__caret {
    display: block;
  }
}

/* Foto in der Liste (Antippen) */
.dish-row__photo {
  padding: 0.25rem 0 1.25rem;
}

.dish-row__photo[hidden] {
  display: none;
}

.dish-row__photo img {
  display: block;
  /* Handy quer: das Foto muss samt Gerichtzeile unter die Kopfzeile passen */
  width: min(100%, 18rem, 100svh - var(--header-h) - 7rem);
  height: auto;
  margin-inline: auto;
  filter: drop-shadow(0 16px 22px rgb(48 22 8 / 0.28));
}

/* ---------- Ganze Karte ---------- */

.menu__more {
  display: grid;
  justify-items: center;
  gap: 1rem;
  margin-top: 2rem;
  text-align: center;
}

.menu__more p {
  max-width: 34rem;
  margin: 0;
  color: var(--muted);
}

/* ---------- Foto am Mauszeiger ---------- */

.menu-preview {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9; /* unter der Kopfzeile */
  width: clamp(14rem, 21vw, 19rem);
  aspect-ratio: 1;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.18s,
    visibility 0s 0.18s;
  will-change: transform;
}

.menu-preview.is-visible {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.18s;
}

.menu-preview img {
  display: block;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 26px 30px rgb(48 22 8 / 0.35));
}

@media (hover: none), (pointer: coarse) {
  .menu-preview {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dish-row__name,
  .dish-row__caret,
  .menu__cat {
    transition: none;
  }
}

/* Tablet hochkant und Handy quer: auch hier zwei Spalten statt einer sehr langen */
@media (min-width: 700px) and (max-width: 1000px) {
  .menu__card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 2rem;
  }
}

/* ---------- Handy ---------- */

@media (max-width: 640px) {
  .menu__card {
    margin-top: 1.75rem;
    border-radius: 1.25rem;
  }

  .menu__cats {
    gap: 0.35rem;
  }

  .menu__cat {
    min-height: 2.4rem;
    padding: 0 0.85rem;
    font-size: 0.875rem;
  }

  .dish-row__desc {
    padding-right: 1.6rem;
  }
}

/* Finger statt Maus: Tippfläche mindestens 44 px hoch (Apple HIG / WCAG 2.5.5) */
@media (pointer: coarse) {
  .menu__cat {
    min-height: 2.75rem;
  }
}
