/* QR Menu Lite — public menu. Mobile first, no external resources.
   --accent, --on-accent, --accent-ink and --accent-soft come from the settings (see index.php);
   --accent-ink is the accent adjusted to at least 4.5:1 on --bg (includes/colors.php). */

/* Web fonts (assets/fonts/, SIL Open Font License, see OFL-*.txt there). Latin + Latin Extended
   (Turkish etc.); other scripts fall back to the system font. Hanken Grotesk is a variable font (400–700). */
@font-face {
    font-family: "Hanken Grotesk"; font-style: normal; font-weight: 100 900; font-display: swap;
    src: url("../fonts/hanken-grotesk-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, 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: "Hanken Grotesk"; font-style: normal; font-weight: 100 900; font-display: swap;
    src: url("../fonts/hanken-grotesk-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+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Instrument Serif"; font-style: normal; font-weight: 400; font-display: swap;
    src: url("../fonts/instrument-serif-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, 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: "Instrument Serif"; font-style: normal; font-weight: 400; font-display: swap;
    src: url("../fonts/instrument-serif-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+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}


/* "Printed menu": paper-coloured page, serif headings, dishes as rows with thin rules (no cards).
   The restaurant's colour is only used for small accents: active tab, label dots and text. */
:root {
    --bg: #f5f4f0;
    --text: #1c1b18;
    --muted: #5b574e;          /* 6.5:1 on --bg */
    --line: #ddd9cf;           /* thin rules */
    --rule: #1c1b18;           /* the line under a category title */
    --leader: #b7b1a3;         /* dotted line between dish name and price */
    --tag-bg: #e6e1d5;         /* "Sold out" label, photo placeholders */
    --backdrop: rgba(28, 27, 24, .55);
    --focus: #1c1b18;
    --bar-h: 50px;
    --font: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-display: "Instrument Serif", Georgia, "Times New Roman", serif;   /* large headings only */
    color-scheme: light;
}

/* Dark theme (Settings › Menu theme). The accent colours are adjusted in index.php (colors.php). */
:root[data-theme="dark"] {
    --bg: #161513;
    --text: #ece9e2;
    --muted: #aba597;          /* 7.4:1 on --bg */
    --line: #36332d;
    --rule: #ece9e2;
    --leader: #5a564c;
    --tag-bg: #2e2b25;
    --backdrop: rgba(0, 0, 0, .6);
    --focus: #ece9e2;
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.5 var(--font);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

html.modal-open { overflow: hidden; }

[hidden] { display: none !important; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
a { color: inherit; }

.wrap { width: 100%; max-width: 720px; margin: 0 auto; padding-left: 20px; padding-right: 20px; }

.icon { width: 18px; height: 18px; flex: 0 0 auto; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.icon-button {
    display: inline-grid; place-items: center; width: 44px; height: 44px; flex: 0 0 auto;
    padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--text); cursor: pointer;
}

/* ---------------------------------------------------------------- Header */

.hero-media { height: 176px; overflow: hidden; background: var(--tag-bg); }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }

.hero-body { padding-top: 28px; padding-bottom: 18px; }
.has-cover .hero-body { padding-top: 20px; }
.has-cover.has-logo .hero-body { padding-top: 0; }

.logo {
    width: 64px; height: 64px; margin-bottom: 14px; border-radius: 14px; object-fit: cover;
    background: var(--bg); border: 3px solid var(--bg);
}
/* The logo sits on the lower left edge of the cover photo */
.has-cover .logo { position: relative; margin-top: -36px; }

.name {
    margin: 0; font-family: var(--font-display); font-weight: 400;
    font-size: 44px; line-height: 1; letter-spacing: -.01em; overflow-wrap: anywhere;
}

.info { display: flex; flex-direction: column; margin-top: 10px; }
.info-row {
    display: flex; align-items: center; gap: 10px; min-height: 44px;
    font-size: 15px; color: var(--muted); text-decoration: none; cursor: pointer;
}
.info-row .icon { width: 16px; height: 16px; }
.info-text { overflow-wrap: anywhere; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
a.info-row:hover .info-text { text-decoration-color: currentColor; }

.hours summary { list-style: none; }
.hours summary::-webkit-details-marker { display: none; }
.hours .chevron { width: 16px; height: 16px; transition: transform .2s; }
.hours[open] .chevron { transform: rotate(180deg); }
.hours-list { list-style: none; margin: 0 0 6px 26px; padding: 0; font-size: 15px; font-variant-numeric: tabular-nums; }
.hours-list li { padding: 3px 0; white-space: pre-wrap; }

/* ------------------------------------------------- Sticky category bar */

.catbar {
    position: sticky; top: 0; z-index: 10;
    background: var(--bg); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.catbar-inner { display: flex; align-items: stretch; padding-right: 0; }

.tabs {
    display: flex; gap: 22px; overflow-x: auto; flex: 1; min-width: 0;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
    flex: 0 0 auto; padding: 13px 0 11px; border-bottom: 2px solid transparent;
    font-size: 15px; color: var(--muted); text-decoration: none; white-space: nowrap;
}
.tab:last-child { margin-right: 20px; }
.tab:hover { color: var(--text); }
.tab:focus-visible { outline-offset: -2px; }
.tab.is-active { color: var(--text); font-weight: 600; border-bottom-color: var(--accent-ink); }

.search-open { width: 52px; height: auto; min-height: 48px; border-radius: 0; border-left: 1px solid var(--line); }
.search-open:focus-visible { outline-offset: -2px; }

.search { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; min-height: 48px; padding-right: 4px; }
.search:focus-within { box-shadow: inset 0 -2px 0 var(--text); }
.search > .icon { color: var(--muted); }
.search input {
    flex: 1; min-width: 0; padding: 12px 0; border: 0; outline: 0; background: none;
    font: inherit; font-size: 16px; color: var(--text);
}
.search input::placeholder { color: var(--muted); opacity: 1; }
.search input::-webkit-search-cancel-button { display: none; }
.catbar.is-searching .tabs, .catbar.is-searching .search-open { display: none; }

/* --------------------------------------------------------------- Menu */

.menu { padding-bottom: 8px; }

.section { padding-top: 30px; scroll-margin-top: var(--bar-h); }
.section-title {
    display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
    margin: 0; padding-bottom: 10px; border-bottom: 1px solid var(--rule);
    font-family: var(--font-display); font-weight: 400; font-size: 32px; line-height: 1.05; overflow-wrap: anywhere;
}
.section-count {
    flex: none; font-family: var(--font); font-size: 12px; font-weight: 500; line-height: 1.4;
    letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}

.item {
    display: flex; gap: 14px; width: 100%; margin: 0; padding: 16px 0;
    border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none;
    text-align: left; cursor: pointer;
}
.item:focus-visible { outline-offset: -2px; }

/* The photo is after the text in the HTML (screen readers read the name first) but shown on the left. */
.item-photo { order: -1; flex: 0 0 auto; width: 76px; height: 76px; border-radius: 8px; overflow: hidden; background: var(--tag-bg); }
.item-photo img { width: 100%; height: 100%; object-fit: cover; }

.item-body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
/* Long names wrap; the dotted line and the price stay on the name's last line */
.item-head { display: flex; align-items: baseline; align-items: last baseline; gap: 6px; }
.item-name { min-width: 0; font-size: 16px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.leader { flex: 1; min-width: 12px; border-bottom: 1.5px dotted var(--leader); transform: translateY(-4px); }
.price { flex: none; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.item-desc { margin-top: 4px; font-size: 14px; line-height: 1.45; color: var(--muted); overflow-wrap: anywhere; }
.js .item-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 8px; }

/* Labels: small capitals in the accent colour with a dot; "Sold out" on a light background */
.tag {
    display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
    font-size: 11px; font-weight: 600; line-height: 1.4; letter-spacing: .08em; text-transform: uppercase;
    color: var(--accent-ink);
}
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag-sold-out { padding: 2px 7px; border-radius: 4px; background: var(--tag-bg); color: var(--text); }
.tag-sold-out::before { content: none; }

/* Sold out: the photo fades, name and price turn grey (still 4.5:1), the price is struck through */
.is-sold-out .item-name { color: var(--muted); }
.is-sold-out .price { color: var(--muted); font-weight: 400; text-decoration: line-through; }
.is-sold-out .item-photo img, .sheet.is-sold-out .sheet-photo img { opacity: .62; }

.empty { padding: 48px 0 24px; color: var(--muted); }
.empty-title { margin: 0 0 8px; font-family: var(--font-display); font-weight: 400; font-size: 32px; line-height: 1.1; color: var(--text); }
.empty p { margin: 0; }
.link {
    padding: 0; border: 0; background: none; color: var(--text); cursor: pointer;
    font-weight: 600; text-decoration: underline; text-underline-offset: 3px;
}

.footer {
    padding-top: 36px; padding-bottom: calc(40px + env(safe-area-inset-bottom));
    font-size: 13px; color: var(--muted);
}

/* ------------------------------------------------------ Product detail */

.sheet {
    width: min(540px, 100%); max-width: 100%; max-height: min(92vh, 860px);
    padding: 0; border: 0; border-radius: 20px; overflow: auto;
    background: var(--bg); color: var(--text);
}
.sheet::backdrop { background: var(--backdrop); }
.sheet-close { position: absolute; top: 16px; right: 16px; z-index: 1; background: var(--bg); }
.sheet-photo { aspect-ratio: 13 / 9; background: var(--tag-bg); }
.sheet-photo img { width: 100%; height: 100%; object-fit: cover; }
.sheet-body { padding: 24px 22px calc(28px + env(safe-area-inset-bottom)); }
.sheet-photo[hidden] + .sheet-body { padding-top: 76px; }
.sheet-title {
    margin: 0; font-family: var(--font-display); font-weight: 400;
    font-size: 40px; line-height: 1; overflow-wrap: anywhere;
}
.sheet-desc { margin: 16px 0 0; font-size: 16px; line-height: 1.55; color: var(--muted); }
.sheet-desc:empty { display: none; }
/* Labels on the left, price on the right, above a thin rule */
.sheet-foot {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px;
    margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line);
}
.sheet-foot .price { order: 1; margin-left: auto; font-size: 24px; }

/* Phones: the detail view comes up from the bottom */
@media (max-width: 599px) {
    .sheet { margin: auto 0 0; width: 100%; max-height: 88vh; border-radius: 20px 20px 0 0; }
}
@media (prefers-reduced-motion: no-preference) {
    .sheet[open] { animation: sheet-in .28s cubic-bezier(.2, .8, .2, 1); }
    .sheet[open]::backdrop { animation: fade-in .2s ease; }
}
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ------------------------------------------------------------ Desktop */

@media (min-width: 720px) {
    .wrap { padding-left: 24px; padding-right: 24px; }
    .catbar-inner { padding-right: 24px; }
    .hero-media { height: 240px; }
    .name { font-size: 56px; }
    .section { padding-top: 40px; }
    .section-title { font-size: 36px; }
    .item-photo { width: 88px; height: 88px; }
}
