/* Mega-Menue der Musterhof-Seiten. Hell, Farben nur aus
   css/thema-*.css und den neutralen Toenen der Seite. Breakpunkte 490, 768, 1040. Tippziele ab 44 px.
   Ohne JavaScript bleibt die Linkliste im Kopf wie bisher, der Menueknopf erscheint erst mit html.mh-js.
   Bewegung: nur transform, opacity und clip-path, kein filter und kein z-index in Animationen, kein backdrop-filter.
   Ken Burns wie in der Galerie (Ebene um das Foto, will-change auf der Ebene, 14 s, Zoom 1,52 bis 1,58). */

/* ------------------------------------------------ Knopf im Kopf */
.mh-menueknopf { display: none; }
.mh-js .mh-menueknopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; flex: none;
  min-block-size: 48px; min-inline-size: 48px; padding: 0 18px 0 15px; margin-inline-start: var(--a-2);
  border: 1px solid rgb(var(--thema-tief-rgb, 17 47 77) / 0.28); border-radius: 999px;
  background: var(--papier, #FFFDF8); color: var(--thema-tief, #112F4D);
  font: 600 1rem / 1 var(--f-text); cursor: pointer; box-shadow: var(--schweben);
  transition: background-color 200ms, box-shadow 300ms var(--kurve), border-color 200ms;
}
.mh-menueknopf__zeichen { position: relative; display: block; inline-size: 20px; block-size: 14px; }
.mh-menueknopf__zeichen span {
  position: absolute; inset-inline: 0; block-size: 2px; border-radius: 2px; background: currentColor;
  transition: transform 380ms var(--kurve), opacity 200ms;
}
.mh-menueknopf__zeichen span:nth-child(1) { inset-block-start: 0; }
.mh-menueknopf__zeichen span:nth-child(2) { inset-block-start: 6px; inline-size: 70%; }
.mh-menueknopf__zeichen span:nth-child(3) { inset-block-start: 12px; }
.mh-menueknopf[aria-expanded="true"] { background: var(--thema-gold-flaeche, #F1EADB); border-color: rgb(var(--thema-gold-rgb, 180 134 63) / 0.7); }
.mh-menueknopf[aria-expanded="true"] .mh-menueknopf__zeichen span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.mh-menueknopf[aria-expanded="true"] .mh-menueknopf__zeichen span:nth-child(2) { opacity: 0; transform: scaleX(0.2); }
.mh-menueknopf[aria-expanded="true"] .mh-menueknopf__zeichen span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
@media (hover: hover) and (pointer: fine) {
  .mh-menueknopf:hover { background: var(--thema-gold-flaeche, #F1EADB); box-shadow: var(--schweben-hoch); }
}
/* Schmal: nur das Zeichen sichtbar, das Wort bleibt fuer Vorleser (kein display:none) */
@media (max-width: 489.98px) {
  .mh-js .mh-menueknopf { padding: 0; }
  .mh-menueknopf__wort { position: absolute; inline-size: 1px; block-size: 1px; overflow: clip; clip-path: inset(50%); white-space: nowrap; }
}
.kopf__innen { position: relative; z-index: 3; }
/* Mit JavaScript ersetzt das Menue die Linkliste im Kopf: alle Wege stehen im Menue, nichts geht verloren.
   Ohne JavaScript bleibt die Liste wie bisher. */
.mh-js .kopf .menue { display: none; }
.mh-js .kopf__knopf { margin-inline-start: auto; white-space: nowrap; }
@media (max-width: 489.98px) {
  .mh-js .kopf__innen { gap: var(--a-2); }
  .mh-js .mh-menueknopf { inline-size: 44px; min-inline-size: 44px; min-block-size: 44px; margin-inline-start: 0; }
}
.mh-menue-offen .kopf { z-index: 70; }

/* ------------------------------------------------ Panel: gemeinsame Gestalt */
.mh-menue[hidden], .mh-schleier[hidden] { display: none; }
.mh-menue {
  position: absolute; z-index: 2; inset-inline: 0; inset-block-start: 100%;
  max-block-size: calc(100dvh - var(--mh-kopf, 76px)); overflow-y: auto; overscroll-behavior: contain;
  background:
    radial-gradient(70% 90% at 100% 0%, var(--thema-gold-flaeche, #F1EADB) 0%, transparent 62%),
    linear-gradient(180deg, var(--papier, #FFFDF8) 0%, var(--creme, #F8F3EA) 100%);
  color: var(--tinte, #2A251F);
  border-block-end: 1px solid rgb(var(--thema-gold-rgb, 180 134 63) / 0.4);
  border-end-start-radius: 28px; border-end-end-radius: 28px;
  box-shadow: 0 2px 0 rgb(255 255 255 / 0.7) inset, 0 50px 90px -40px rgb(var(--thema-tiefer-rgb, 10 31 53) / 0.55);
  --mx: 0; --my: 0;
}
.mh-schleier {
  position: fixed; z-index: 1; inset: var(--mh-kopf, 76px) 0 0 0;
  background: rgb(var(--thema-tiefer-rgb, 10 31 53) / 0.38);
}
.mh-menue__innen {
  inline-size: min(100% - 2 * var(--a-5), var(--rahmen, 76rem)); margin-inline: auto;
  display: grid; grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr); gap: var(--a-8);
  padding-block: var(--a-7) var(--a-8);
}
.mh-menue__titel, .mh-karte__titel { display: flex; align-items: center; gap: var(--a-2); margin: 0 0 var(--a-3); color: var(--tinte-weich, #4E463C); font: 600 0.9375rem / 1.3 var(--f-text); letter-spacing: 0.01em; }
.mh-menue__titel::before, .mh-karte__titel::before { content: ""; inline-size: 22px; block-size: 2px; border-radius: 2px; background: var(--thema-gold, #B4863F); }
.mh-karte__titel--gross::before { content: none; }

/* Die Wege: grosse Schrift von Musterhof, Unterzeile aus der Ueberschrift des Abschnitts */
.mh-wege { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.mh-weg {
  position: relative; display: grid; gap: 2px; min-block-size: 56px; align-content: center;
  padding: var(--a-2) var(--a-4) var(--a-2) var(--a-5); border-radius: 16px;
  color: var(--tinte, #2A251F); text-decoration: none;
  transition: background-color 260ms var(--kurve), transform 360ms var(--kurve);
}
.mh-weg::before {
  content: ""; position: absolute; inset-inline-start: 6px; inset-block: 14px; inline-size: 3px; border-radius: 3px;
  background: var(--thema-gold, #B4863F); transform: scaleY(0); transform-origin: 50% 50%; transition: transform 320ms var(--kurve);
}
.mh-weg__name { font: 500 1.75rem / 1.15 var(--f-anzeige); color: var(--thema-tief, #112F4D); }
.mh-weg__zeile { font: 400 0.9375rem / 1.4 var(--f-text); color: var(--tinte-weich, #4E463C); }
.mh-weg:focus-visible, .mh-weg.ist-vorschau { background: rgb(255 253 248 / 0.95); box-shadow: var(--schweben); }
.mh-weg:focus-visible::before, .mh-weg.ist-vorschau::before { transform: scaleY(1); }
@media (hover: hover) and (pointer: fine) {
  .mh-weg:hover { background: rgb(255 253 248 / 0.95); box-shadow: var(--schweben); transform: translateX(4px); }
  .mh-weg:hover::before { transform: scaleY(1); }
}

/* Leiste: Speisekarte, Auswahl aendern */
.mh-leiste { list-style: none; margin: var(--a-5) 0 0; padding: var(--a-4) 0 0; display: flex; flex-wrap: wrap; gap: var(--a-3);
  border-block-start: 1px solid rgb(var(--thema-gold-rgb, 180 134 63) / 0.35); }
.mh-leiste li { flex: 1 1 13rem; }
.mh-leiste__link {
  display: grid; gap: 2px; min-block-size: 56px; align-content: center; padding: var(--a-2) var(--a-4);
  border: 1px solid var(--thema-gold-rand, #DCCBA6); border-radius: 14px; background: rgb(255 253 248 / 0.75);
  color: var(--thema-tief, #112F4D); text-decoration: none; transition: background-color 200ms, box-shadow 300ms var(--kurve);
}
.mh-leiste__name { font: 600 1.0625rem / 1.25 var(--f-text); }
.mh-leiste__zeile { font: 400 0.875rem / 1.35 var(--f-text); color: var(--tinte-weich, #4E463C); }
@media (hover: hover) and (pointer: fine) { .mh-leiste__link:hover { background: var(--papier, #FFFDF8); box-shadow: var(--schweben); } }

/* ------------------------------------------------ Szene: Foto mit Ken Burns, schwebende Karten */
.mh-szene { position: relative; align-self: start; perspective: 1400px; padding-block-end: var(--a-6); }
.mh-buehne {
  position: relative; aspect-ratio: 16 / 11; border-radius: 26px; overflow: clip; background: var(--thema-hell, #EDE5D3);
  box-shadow: 0 2px 4px rgb(60 40 20 / 0.1), 0 40px 70px -34px rgb(var(--thema-tiefer-rgb, 10 31 53) / 0.6);
  translate: calc(var(--mx) * 6px) calc(var(--my) * 5px);
  transition: translate 600ms var(--kurve);
}
.mh-bild { position: absolute; inset: 0; opacity: 0; transition: opacity 520ms var(--kurve); }
.mh-bild.ist-aktiv { opacity: 1; }
.mh-bild__ebene { position: absolute; inset: 0; }
.mh-bild__ebene img { display: block; inline-size: 100%; block-size: 100%; object-fit: cover; }
.mh-buehne::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, transparent 55%, rgb(var(--thema-tiefer-rgb, 10 31 53) / 0.28) 100%);
}
.mh-buehne__ki {
  position: absolute; z-index: 2; inset-block-end: var(--a-3); inset-inline-end: var(--a-3);
  padding: 4px 10px; border-radius: 999px; background: rgb(20 16 12 / 0.8); color: #FFFDF8;
  font: 600 0.8125rem / 1.2 var(--f-text);
}
.mh-karte {
  position: relative; border-radius: 22px; padding: var(--a-5);
  background: rgb(255 253 248 / 0.97); border: 1px solid var(--thema-gold-rand, #DCCBA6);
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.8) inset, 0 2px 4px rgb(60 40 20 / 0.08), 0 30px 60px -24px rgb(var(--thema-tiefer-rgb, 10 31 53) / 0.5);
}
.mh-karte[hidden] { display: none; }
.mh-karte__titel--gross { color: var(--thema-tief, #112F4D); font: 500 1.5rem / 1.2 var(--f-anzeige); }
.mh-karte__link {
  display: inline-flex; align-items: center; min-block-size: 44px; margin-block-start: var(--a-2);
  color: var(--thema-tief, #112F4D); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px;
  text-underline-offset: 4px; text-decoration-color: var(--thema-gold, #B4863F);
}
.mh-karte__link[hidden] { display: none; }
.mh-karte__knoepfe { display: grid; gap: var(--a-3); }
.mh-karte__knoepfe .knopf { inline-size: 100%; justify-content: center; }
.mh-karte--buchen .knopf--rand { color: var(--thema-tief, #112F4D); border-color: rgb(var(--thema-tief-rgb, 17 47 77) / 0.5); }
.mh-live { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--a-3) var(--a-5); grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); }
.mh-live__punkt { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: var(--a-3); align-items: baseline; }
.mh-live__punkt-zeichen { inline-size: 10px; block-size: 10px; border-radius: 50%; background: #A33A2B; box-shadow: 0 0 0 4px rgb(163 58 43 / 0.16); transform: translateY(-1px); }
.mh-live__punkt[data-art="offen"] .mh-live__punkt-zeichen, .mh-live__punkt[data-art="frei"] .mh-live__punkt-zeichen { background: #2F7D4A; box-shadow: 0 0 0 4px rgb(47 125 74 / 0.18); }
.mh-live__punkt[data-art="pause"] .mh-live__punkt-zeichen { background: #9A6A12; box-shadow: 0 0 0 4px rgb(154 106 18 / 0.18); }
.mh-live__text { display: grid; gap: 1px; font: 400 1rem / 1.4 var(--f-text); color: var(--tinte, #2A251F); }
.mh-live__text strong { font-weight: 650; color: var(--tinte, #2A251F); }
.mh-live__zeile { color: var(--tinte-weich, #4E463C); font-size: 0.9375rem; }

/* Rechner: die Karten schweben ueber dem Foto, in eigener Tiefe */
@media (min-width: 1040px) {
  .mh-szene { padding-block-end: 0; }
  .mh-karte--live {
    margin: -6rem 0 0 calc(-1 * var(--a-7)); inline-size: min(31rem, 92%);
    translate: calc(var(--mx) * -12px) calc(var(--my) * -9px); transition: translate 600ms var(--kurve);
  }
  .mh-karte--buchen {
    position: absolute; inset-inline-end: calc(-1 * var(--a-4)); inset-block-start: calc(-1 * var(--a-5)); inline-size: min(16.5rem, 46%);
    translate: calc(var(--mx) * -18px) calc(var(--my) * -12px); transition: translate 600ms var(--kurve);
  }
}

/* ------------------------------------------------ Schmal (unter 1040): Vollbild unter der Leiste */
@media (max-width: 1039.98px) {
  .mh-menue {
    position: fixed; inset: 0; max-block-size: none; block-size: 100dvh;
    padding-block-start: var(--mh-kopf, 76px); border: 0; border-radius: 0;
    touch-action: pan-y; -webkit-overflow-scrolling: touch;
  }
  /* Reihenfolge am Handy: Foto, Live, Wege, Buchen, weitere Seiten */
  .mh-menue__innen {
    grid-template-columns: minmax(0, 1fr); gap: var(--a-5);
    grid-template-areas: "bild" "live" "titel" "wege" "buchen" "leiste";
    padding-block: var(--a-5) calc(var(--a-8) + env(safe-area-inset-bottom, 0px));
  }
  .mh-menue__wege, .mh-szene { display: contents; }
  .mh-menue__titel { grid-area: titel; margin: 0 0 calc(-1 * var(--a-4)); }
  .mh-wege { grid-area: wege; }
  .mh-leiste { grid-area: leiste; margin: 0; }
  .mh-buehne { grid-area: bild; aspect-ratio: 16 / 9; border-radius: 22px; translate: none; }
  .mh-buehne__ki { inset-block-end: auto; inset-block-start: var(--a-3); }
  .mh-karte--live { grid-area: live; margin: calc(-1 * var(--a-8)) var(--a-4) 0; }
  .mh-karte--buchen { grid-area: buchen; }
  .mh-weg__name { font-size: 1.5rem; }
  .mh-vollbild { overflow: hidden; }
  .mh-vollbild .kopf { border-block-end-color: rgb(var(--thema-gold-rgb, 180 134 63) / 0.4); }
}
/* Tablet: zwei Spalten, links die Wege, rechts Foto, Live und Buchen */
@media (min-width: 768px) and (max-width: 1039.98px) {
  .mh-menue__innen {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: var(--a-6); row-gap: var(--a-5);
    grid-template-areas: "titel bild" "wege bild" "wege live" "wege buchen" "leiste leiste";
    grid-template-rows: auto auto auto 1fr auto; padding-block-start: var(--a-6);
  }
  .mh-menue__titel { margin: 0; }
  .mh-wege { align-self: start; }
  .mh-buehne { aspect-ratio: 4 / 3; }
  .mh-karte--live { margin: -5rem var(--a-4) 0 calc(-1 * var(--a-4)); }
  .mh-karte--buchen { align-self: start; }
}
@media (max-width: 489.98px) {
  .mh-menue__innen { inline-size: min(100% - 2 * var(--a-4), var(--rahmen, 76rem)); }
  .mh-weg { padding-inline: var(--a-4) var(--a-3); }
  .mh-karte { padding: var(--a-4); }
  .mh-karte--live { margin-inline: var(--a-3); }
}

/* ------------------------------------------------ Kinomoment beim Oeffnen (nur mit Bewegung) */
@media (prefers-reduced-motion: no-preference) {
  /* Rechner: das Panel faehrt wie ein Vorhang auf, der Schleier dunkelt nach */
  .mh-menue:not([hidden]) { animation-name: mh-vorhang; animation-duration: 560ms; animation-timing-function: cubic-bezier(0.2, 0.9, 0.25, 1); animation-fill-mode: backwards; }
  .mh-schleier:not([hidden]) { animation-name: mh-auf; animation-duration: 420ms; animation-timing-function: ease-out; animation-fill-mode: backwards; }
  /* Ebenen gleiten nacheinander herein: Foto aus der Tiefe, Wege von links, Karten schwebend */
  .mh-menue:not([hidden]) .mh-buehne { animation-name: mh-tiefe; animation-duration: 900ms; animation-delay: 90ms; animation-timing-function: cubic-bezier(0.16, 0.84, 0.3, 1); animation-fill-mode: backwards; }
  .mh-menue:not([hidden]) .mh-menue__titel,
  .mh-menue:not([hidden]) .mh-wege__punkt,
  .mh-menue:not([hidden]) .mh-leiste { animation-name: mh-gleiten; animation-duration: 520ms; animation-timing-function: cubic-bezier(0.2, 0.9, 0.25, 1); animation-fill-mode: backwards; animation-delay: 140ms; }
  .mh-menue:not([hidden]) .mh-wege__punkt { animation-delay: calc(180ms + var(--i, 0) * 40ms); }
  .mh-menue:not([hidden]) .mh-leiste { animation-delay: 460ms; }
  .mh-menue:not([hidden]) .mh-karte--live { animation-name: mh-schweben; animation-duration: 760ms; animation-delay: 380ms; animation-timing-function: cubic-bezier(0.16, 0.84, 0.3, 1); animation-fill-mode: backwards; }
  .mh-menue:not([hidden]) .mh-karte--buchen { animation-name: mh-schweben; animation-duration: 760ms; animation-delay: 480ms; animation-timing-function: cubic-bezier(0.16, 0.84, 0.3, 1); animation-fill-mode: backwards; }
  /* Ken Burns nur, solange das Menue offen ist, und nur auf dem gezeigten Foto */
  .mh-menue:not([hidden]) .mh-bild.ist-aktiv .mh-bild__ebene { will-change: transform; animation-duration: 14s; animation-timing-function: ease-in-out; animation-iteration-count: infinite; }
  .mh-menue:not([hidden]) .mh-bild.ist-aktiv .kb1 { animation-name: mh-kbz1; }
  .mh-menue:not([hidden]) .mh-bild.ist-aktiv .kb2 { animation-name: mh-kbz2; }
  .mh-menue:not([hidden]) .mh-bild.ist-aktiv .kb3 { animation-name: mh-kbz3; }
  .mh-menue:not([hidden]) .mh-bild.ist-aktiv .kb4 { animation-name: mh-kbz4; }
  .mh-menue:not([hidden]) .mh-bild.ist-aktiv .kb5 { animation-name: mh-kbz5; }
  .mh-menue:not([hidden]) .mh-bild.ist-aktiv .kb6 { animation-name: mh-kbz6; }
  .mh-menue:not([hidden]) .mh-bild.ist-aktiv .kb7 { animation-name: mh-kbz7; }
  .mh-menue:not([hidden]) .mh-bild.ist-aktiv .kb8 { animation-name: mh-kbz8; }
}
/* Schmal: das Vollbild oeffnet sich als Kreis aus dem Menueknopf */
@media (prefers-reduced-motion: no-preference) and (max-width: 1039.98px) {
  .mh-menue:not([hidden]) { animation-name: mh-kreis; animation-duration: 620ms; }
}

@keyframes mh-vorhang { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 -40px 0); } }
@keyframes mh-kreis { from { clip-path: circle(24px at var(--mh-ux, 90%) var(--mh-uy, 38px)); } to { clip-path: circle(150vmax at var(--mh-ux, 90%) var(--mh-uy, 38px)); } }
@keyframes mh-auf { from { opacity: 0; } to { opacity: 1; } }
@keyframes mh-tiefe { from { opacity: 0; transform: translateY(26px) translateZ(-160px) rotateX(7deg) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes mh-gleiten { from { opacity: 0; transform: translateX(-22px); } to { opacity: 1; transform: none; } }
@keyframes mh-schweben { from { opacity: 0; transform: translateY(34px) rotateX(12deg) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes mh-kbz1 { 0% { transform: scale(1) translate(0, 0); } 50% { transform: scale(1.52) translate(0, -7.5%); } 100% { transform: scale(1) translate(0, 0); } }
@keyframes mh-kbz2 { 0% { transform: scale(1) translate(0, 0); } 50% { transform: scale(1.52) translate(0, 7.5%); } 100% { transform: scale(1) translate(0, 0); } }
@keyframes mh-kbz3 { 0% { transform: scale(1) translate(0, 0); } 50% { transform: scale(1.52) translate(-7.5%, 0); } 100% { transform: scale(1) translate(0, 0); } }
@keyframes mh-kbz4 { 0% { transform: scale(1) translate(0, 0); } 50% { transform: scale(1.52) translate(7.5%, 0); } 100% { transform: scale(1) translate(0, 0); } }
@keyframes mh-kbz5 { 0% { transform: scale(1) translate(0, 0); } 50% { transform: scale(1.58) translate(-6%, -6%); } 100% { transform: scale(1) translate(0, 0); } }
@keyframes mh-kbz6 { 0% { transform: scale(1) translate(0, 0); } 50% { transform: scale(1.58) translate(6%, -6%); } 100% { transform: scale(1) translate(0, 0); } }
@keyframes mh-kbz7 { 0% { transform: scale(1) translate(0, 0); } 50% { transform: scale(1.58) translate(-6%, 6%); } 100% { transform: scale(1) translate(0, 0); } }
@keyframes mh-kbz8 { 0% { transform: scale(1) translate(0, 0); } 50% { transform: scale(1.58) translate(6%, 6%); } 100% { transform: scale(1) translate(0, 0); } }

/* Weniger Bewegung: alles steht sofort, keine Tiefe am Zeiger */
@media (prefers-reduced-motion: reduce) {
  .mh-buehne, .mh-karte--live, .mh-karte--buchen { translate: none !important; }
  .mh-weg, .mh-menueknopf__zeichen span { transition: none; }
}
