/* ============================================================
   Online Speisekarte – OnQR  |  Schönfelder EDV
   Statischer 1:1-Nachbau der Divi/WordPress-Vorlage
   100 % HTML5 / CSS3 / Vanilla-JS · DSGVO-konform (keine
   externen Ressourcen, keine Cookies) · responsiv · SEO-optimiert
   ============================================================ */

/* ---------- Self-hosted Open Sans (Variable, DSGVO-konform) ---------- */
@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url(../fonts/opensans-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url(../fonts/opensans-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308,
    U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Open Sans';
  font-style: italic;
  font-weight: 300 800;
  font-display: swap;
  src: url(../fonts/opensans-italic-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Open Sans';
  font-style: italic;
  font-weight: 300 800;
  font-display: swap;
  src: url(../fonts/opensans-italic-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308,
    U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Design-Tokens ---------- */
:root {
  --color-bg: #ffffff;
  --color-text: #666666;
  --color-heading: #333333;
  --color-accent: #e02b20;       /* Logo-/Aktiv-Rot */
  --color-nav: #000000;
  --color-line: #333333;          /* gepunktete Preislinie */
  --color-header-shadow: rgba(0, 0, 0, .08);
  --font-base: 'Open Sans', 'Helvetica Neue', Arial, sans-serif;
  --container: 1080px;
  --row-width: 80%;
}

/* ---------- Reset / Basis ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-base);
  font-size: 14px;
  line-height: 1.7em;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; border: 0; }
a { color: var(--color-accent); text-decoration: none; transition: color .3s ease, opacity .3s ease; }
a:hover { opacity: .75; }
h1, h2, h3, h4, h5, h6 { color: var(--color-heading); font-weight: 500; line-height: 1.3; }
ul { margin: 0; padding: 0; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 1000;
  background: #fff; color: var(--color-accent); padding: 10px 16px;
  border: 1px solid var(--color-accent);
}
.skip-link:focus { left: 8px; top: 8px; }

.container {
  width: var(--row-width);
  max-width: var(--container);
  margin-inline: auto;
}

/* ============================================================
   Kopfbereich / Navigation
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  box-shadow: 0 1px 0 var(--color-header-shadow);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 80px;
  padding: 10px 0;
}
.site-logo { flex: 0 1 auto; line-height: 0; }
.site-logo img { width: 100%; max-width: 316px; height: auto; }

.nav-toggle {
  display: none;
  flex: 0 0 auto;
  width: 44px; height: 44px;
  padding: 0;
  background: none; border: 0;
  cursor: pointer;
  color: var(--color-heading);
}
.nav-toggle__bar,
.nav-toggle__bar::before,
.nav-toggle__bar::after {
  display: block;
  width: 26px; height: 2px;
  margin: 0 auto;
  background: currentColor;
  transition: transform .3s ease, opacity .3s ease;
}
.nav-toggle__bar { position: relative; }
.nav-toggle__bar::before { content: ''; position: absolute; top: -8px; left: 0; }
.nav-toggle__bar::after  { content: ''; position: absolute; top: 8px;  left: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar::before { transform: translateY(8px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar::after  { transform: translateY(-8px) rotate(-45deg); }

.main-nav__list {
  display: flex;
  align-items: center;
  gap: 22px;
  list-style: none;
}
.main-nav__link {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-nav);
  white-space: nowrap;
}
.main-nav__link:hover { color: var(--color-accent); opacity: 1; }
.main-nav__item.is-current .main-nav__link,
.main-nav__link[aria-current="page"] { color: var(--color-accent); }

/* ============================================================
   Hauptinhalt / Speisekarte
   ============================================================ */
.site-main { padding: 4% 0 2%; }

.menu-section { padding: 0 0 1.5%; }
.menu-section + .menu-section { padding-top: 1%; }

.category-title {
  text-align: center;
  font-size: 30px;
  font-weight: 500;
  color: var(--color-heading);
  margin: 0 0 40px;
  line-height: 1.2;
}

.menu-grid {
  display: grid;
  grid-template-columns: 1fr;
  column-gap: 50px;
  row-gap: 0;
}

.menu-item {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  margin-bottom: 50px;
}
.menu-item__thumb {
  flex: 0 0 100px;
  width: 100px;
  line-height: 0;
  display: block;
  cursor: zoom-in;
}
.menu-item__thumb img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  display: block;
}
.menu-item__details { flex: 1 1 auto; min-width: 0; }

.menu-item__head {
  display: flex;
  align-items: center;
  width: 100%;
}
.menu-item__name {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-heading);
  text-transform: none;
  /* Im Flex-Layout schrumpfen lassen (sonst drückt ein langer Name den Preis aus dem Viewport).
     break-word bricht nur ein einzelnes zu langes Wort – normale Wörter bleiben ganz. */
  min-width: 0;
  overflow-wrap: break-word;
}
.menu-item__leader {
  flex: 1 1 auto;
  border-top: 1px dotted var(--color-line);
  min-width: 25px;
  margin: 0 10px;
  align-self: flex-end;
  position: relative;
  bottom: 5px;
}
.menu-item__price {
  flex: 0 0 auto;
  font-size: 18px;
  line-height: 1;
  color: var(--color-heading);
  white-space: nowrap;
}
.menu-item__price .currency { font-style: normal; }

.menu-item__ingredients {
  list-style: none;
  margin: 5px 0 0;
  padding: 0;
  font-size: 14px;
  line-height: 1.6;
}
.menu-item__ingredients li { display: inline; }
.menu-item__ingredients li:not(:last-child)::after { content: ', '; }

.menu-item__desc {
  margin: 5px 0 0;
  font-size: 14px;
  line-height: 1.6;
}

/* Items ohne Bild (EN/ES wie im Original) */
.menu-item--no-image .menu-item__details { width: 100%; }

/* ============================================================
   Rechtstexte (Impressum / Datenschutz)
   ============================================================ */
.legal { padding: 4% 0 4%; }
.legal h1 { font-size: 30px; margin: 0 0 24px; }
.legal h2 { font-size: 22px; margin: 32px 0 12px; }
.legal h3 { font-size: 18px; margin: 24px 0 10px; }
.legal h4, .legal h5 { font-size: 15px; margin: 18px 0 8px; }
.legal p { margin: 0 0 14px; }
.legal a { word-break: break-word; }
.legal ul { margin: 0 0 14px; padding-left: 1.4em; list-style: disc; }
.legal li { margin-bottom: .4em; }

/* ============================================================
   Fußbereich
   ============================================================ */
.site-footer {
  background: #fff;
  border-top: 1px solid #ececec;
  padding: 36px 0;
}
.site-footer__inner {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  gap: 24px;
}
.social-list { display: flex; gap: 8px; list-style: none; }
.social-list__link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: 3px;
  color: #fff;
  transition: opacity .3s ease;
}
.social-list__link:hover { opacity: .75; }
.social-list__link svg { width: 16px; height: 16px; fill: currentColor; }
.social-list__link--facebook  { background: #3b5998; }
.social-list__link--instagram { background: #ea2c59; }
.social-list__link--x         { background: #000000; }

.footer-logo { text-align: center; line-height: 0; }
.footer-logo img { width: 100%; max-width: 316px; height: auto; }

.footer-copy {
  text-align: right;
  font-size: 14px;
  color: var(--color-text);
}
.footer-copy b { color: var(--color-heading); }

.footer-logo--full { grid-column: 1 / -1; }

/* ============================================================
   Fehlerseite (404)
   ============================================================ */
.error-page { text-align: center; padding: 8% 0; }
.error-page__code {
  font-size: 72px;
  font-weight: 700;
  color: var(--color-accent);
  margin: 0;
  line-height: 1;
}
.error-page__title { font-size: 24px; margin: 16px 0 8px; }
.error-page__home { display: inline-block; margin-top: 20px; font-weight: 700; }

/* ============================================================
   Lightbox (Vanilla-JS, nur DE-Seite)
   ============================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(11, 11, 11, .85);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox__img {
  max-width: 90vw;
  max-height: 85vh;
  width: auto; height: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
  background: #fff;
}
.lightbox__close {
  position: absolute;
  top: 18px; right: 24px;
  width: 44px; height: 44px;
  font-size: 30px;
  line-height: 1;
  color: #fff;
  background: none; border: 0;
  cursor: pointer;
}
.lightbox__close:hover { opacity: .75; }

/* ============================================================
   Responsiv
   ============================================================ */
@media (min-width: 768px) {
  .menu-grid { grid-template-columns: 1fr 1fr; }
}

/* Tablet / Mobil: Navigation einklappen */
@media (max-width: 980px) {
  .site-header__inner { min-height: 64px; justify-content: space-between; }
  .nav-toggle { display: inline-flex; align-items: center; }
  .main-nav {
    position: absolute;
    left: 0; right: 0;
    top: 100%;
    background: #fff;
    box-shadow: 0 8px 16px rgba(0, 0, 0, .08);
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease;
  }
  .main-nav.is-open { max-height: 70vh; }
  .main-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 0;
  }
  .main-nav__link { padding: 12px 24px; }
  .site-logo { margin: 0 auto; text-align: center; }
  .site-logo img { max-width: 260px; }
  .site-header__inner { position: relative; }
}

@media (max-width: 767px) {
  .site-main { padding: 30px 0 0; }
  .category-title { font-size: 26px; margin-bottom: 30px; }
  .footer-logo { order: -1; }
}

/* Schmale Displays (Smartphones): Gericht-Schrift etwas kleiner + kompakteres Thumbnail,
   damit Name und Preis in eine Zeile passen – statt harter Wortumbrüche. */
@media (max-width: 600px) {
  /* Bündige Preis-Spalte per CSS-Grid: Spalte 1 = Name (1fr, bricht um), Spalte 2 = Preis (auto).
     Dadurch steht der Preis bei JEDEM Gericht in exakt derselben rechten Spalte – egal wie lang
     der Name ist oder ob er umbricht. Der Punkte-Leader entfällt auf schmalen Displays. */
  .menu-item__head {
    display: grid;
    grid-template-columns: 1fr auto;
    column-gap: 10px;
    align-items: baseline;
  }
  .menu-item__leader { display: none; }
  .menu-item__name { font-size: 16px; min-width: 0; }
  .menu-item__price { font-size: 15px; text-align: right; }
  .menu-item__thumb,
  .menu-item__thumb img { flex-basis: 88px; width: 88px; height: 88px; }
}

@media (max-width: 640px) {
  .site-footer__inner {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 18px;
  }
  .footer-copy { text-align: center; }
  .social-list { justify-content: center; }
}

/* ============================================================
   Druck
   ============================================================ */
@media print {
  .site-header, .site-footer, .nav-toggle, .lightbox { display: none !important; }
  body { color: #000; }
  .menu-grid { grid-template-columns: 1fr 1fr; }
  a { color: #000; }
}

/* ============================================================
   Erweiterungen (dynamische App): Filter, Kennzeichnungs-Legende, Badges
   ============================================================ */
.menu-filters { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin: 0 0 30px; font-size: 14px; }
.menu-filters label { cursor: pointer; }
.badge { font-size: .62em; font-weight: 700; color: var(--color-accent); vertical-align: super; margin-left: 2px; }
.badge--additive { color: var(--color-text); }
.menu-legend { border-top: 1px solid #ececec; margin-top: 20px; padding-top: 18px; }
.menu-legend .legend { font-size: 13px; line-height: 1.9; }
.legend__item { white-space: nowrap; }

/* Sichtbare Tastatur-Fokusanzeige (WCAG 2.4.7) */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; border-radius: 2px; }
