/* =========================================================
   Skorpion Café – Getränkekarte
   Mobile-first, alle Farben über CSS-Variablen
   ========================================================= */

/* ---------- Design-Tokens ---------- */
:root {
    /* Palette (kann später geändert werden) */
    --copper: #a8763e;
    --ivory-mist: #f7f3e3;
    --onyx: #121212;
    --dark-coffee: #2b2118;

    /* Abgeleitete Farben */
    --bg: var(--ivory-mist);
    --ink: #2a2118;
    --ink-soft: #6b5d4c;
    --ink-faint: #8a7a66;
    --accent: var(--copper);
    --accent-soft: rgba(168, 118, 62, 0.35);
    --accent-faint: rgba(168, 118, 62, 0.12);
    --line: rgba(43, 33, 24, 0.14);
    --header-bg: var(--dark-coffee);
    --on-dark: var(--ivory-mist);
    --on-dark-soft: rgba(247, 243, 227, 0.72);
    --error: #8c3a2b;

    /* Typo & Layout */
    --font-heading: "Playfair Display", Georgia, "Times New Roman", serif;
    --font-body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
    --content-max: 680px;
    --content-max-wide: 1100px;
    --nav-height: 44px;
    --focus-ring: 2px solid var(--accent);
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-height) + 16px);
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--bg);
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
}

/* Sichtbarer Fokus für Tastaturnutzer */
:focus-visible {
    outline: var(--focus-ring);
    outline-offset: 2px;
}

/* ---------- Header ---------- */
.site-header {
    background: var(--header-bg);
    color: var(--on-dark);
    text-align: center;
    padding: 40px 20px 32px;
    padding-top: calc(40px + env(safe-area-inset-top));
}

.site-name {
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 6px;
}

.site-title {
    font-family: var(--font-heading);
    font-size: clamp(1.9rem, 8vw, 2.6rem);
    font-weight: 600;
    letter-spacing: 0.04em;
    line-height: 1.15;
}

/* ---------- Kategorie-Navigation ---------- */
.category-nav {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bg);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    height: var(--nav-height);
    display: flex;
    gap: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 12px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.category-nav::-webkit-scrollbar {
    display: none;
}

.category-nav a {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    height: 100%;
    padding: 0 12px;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--ink-soft);
    text-decoration: none;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.category-nav a:hover {
    color: var(--accent);
}

.category-nav a:focus-visible {
    outline-offset: -2px;
}

/* ---------- Menü ---------- */
.menu {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 32px 20px 48px;
}

/* Laden / Fehler */
.menu-loading,
.menu-error,
.noscript-message {
    padding: 64px 16px;
    text-align: center;
    font-size: 0.95rem;
    color: var(--ink-soft);
}

.menu-loading::after {
    content: "";
    display: inline-block;
    width: 1em;
    animation: blink 1.2s steps(1) infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

.menu-error {
    color: var(--error);
}

.noscript-message {
    background: var(--accent-faint);
    border: 1px solid var(--accent-soft);
    border-radius: 8px;
    margin: 24px auto;
    max-width: var(--content-max);
}

/* Kategorien */
.menu-section {
    margin-top: 40px;
    scroll-margin-top: calc(var(--nav-height) + 16px);
}

.menu-section:first-child {
    margin-top: 8px;
}

.category-heading {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 6px;
}

.category-heading::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--accent-soft), transparent);
}

/* ---------- Menüeintrag ---------- */
.menu-item {
    display: block;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

/* Preiszeile unter Größe/Einheit: Preis am rechten Rand */
.menu-item-row.is-price-only {
    justify-content: flex-end;
    margin-top: 4px;
}

.menu-item-name {
    font-size: 1.02rem;
    font-weight: 500;
    color: var(--ink);
    min-width: 0;
}

.menu-item-leader {
    flex: 1;
    min-width: 24px;
    border-bottom: 1px dotted var(--accent-soft);
    transform: translateY(-4px);
}

.menu-item-price {
    font-size: 1.02rem;
    font-weight: 600;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.menu-item-meta {
    font-size: 0.82rem;
    color: var(--ink-faint);
    letter-spacing: 0.02em;
    margin-top: 1px;
}

.menu-item-meta + .menu-item-row {
    margin-top: 4px;
}

.menu-item-desc {
    font-size: 0.88rem;
    color: var(--ink-soft);
    margin-top: 3px;
}

/* Preis fehlt → dezent markieren, nicht "null €" */
.menu-item-price.is-missing {
    color: var(--ink-faint);
    font-weight: 400;
    font-size: 0.85rem;
}

/* ---------- Footer ---------- */
.site-footer {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 24px 20px 40px;
    padding-bottom: calc(40px + env(safe-area-inset-bottom));
    text-align: center;
    font-size: 0.8rem;
    color: var(--ink-faint);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* ---------- Scroll nach oben ---------- */
.scroll-top {
    position: fixed;
    right: 20px;
    bottom: calc(20px + env(safe-area-inset-bottom));
    z-index: 20;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    line-height: 1;
    color: var(--accent);
    background: var(--bg);
    border: 1px solid var(--accent-soft);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(18, 18, 18, 0.12);
    transition: transform 0.15s ease, background-color 0.15s ease,
        color 0.15s ease, border-color 0.15s ease;
}

/* hidden-Attribut wieder wirksam machen (display:flex überschreibt es sonst) */
.scroll-top[hidden] {
    display: none;
}

/* Invertierte Anzeige bei Hover, Klick und Fokus – statt Browser-Default */
.scroll-top:hover,
.scroll-top:active,
.scroll-top:focus {
    background: var(--accent);
    color: var(--ivory-mist);
    border-color: var(--accent);
}

/* Kein Focus-Ring – die invertierte Füllung ist bereits die
   sichtbare Fokus-Anzeige (sonst bleibt nach einem Tippen ein Ring hängen) */
.scroll-top:focus,
.scroll-top:focus-visible {
    outline: none;
}

.scroll-top:active {
    transform: scale(0.94);
}

/* ---------- Tablet / Desktop ---------- */
@media (min-width: 768px) {
    .site-header {
        padding-top: 56px;
        padding-bottom: 44px;
    }

    .menu {
        padding-top: 40px;
        padding-bottom: 64px;
    }

    .menu-section {
        margin-top: 48px;
    }

    .category-nav a {
        font-size: 0.9rem;
        padding: 0 14px;
    }
}

@media (min-width: 1024px) {
    .menu {
        max-width: var(--content-max-wide);
        display: grid;
        grid-template-columns: 1fr 1fr;
        column-gap: 64px;
        align-items: start;
    }

    .menu-section {
        margin-top: 56px;
    }

    /* Desktop: Kategorien brechen auf mehrere Zeilen statt zu scrollen
       und sind zentriert. --nav-height dient nur als (größerer)
       Scroll-Offset, damit die sticky Navigation keine
       Kategorie-Überschriften abdeckt. */
    :root {
        --nav-height: 150px;
    }

    .category-nav {
        height: auto;
        overflow: visible;
        flex-wrap: wrap;
        justify-content: center;
        row-gap: 2px;
        padding: 12px 24px;
    }

    .category-nav a {
        height: auto;
        padding: 8px 14px;
    }
}

/* ---------- Bewegung reduzieren ---------- */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .category-nav a {
        transition: none;
    }

    .menu-loading::after {
        animation: none;
    }
}

/* ---------- Drucken (Grundgerüst für zukünftiges Print-PDF) ---------- */
@media print {
    .category-nav,
    .scroll-top,
    .menu-loading,
    .menu-error {
        display: none !important;
    }

    body {
        background: #fff;
        color: #000;
        font-size: 12pt;
    }

    .site-header {
        background: none;
        color: #000;
        padding: 0 0 16px;
    }

    .site-title,
    .category-heading {
        color: #000;
    }

    .menu {
        max-width: none;
        display: block;
        padding: 0;
    }

    .menu-section {
        break-inside: avoid-page;
        margin-top: 24px;
    }

    .site-footer {
        padding: 16px 0 0;
    }
}
