/*
 * Mad Bull, "Market stall": the same look as the mobile app (mobile/STYLE_GUIDE.md).
 * The slots below are the app's theme slots. A restaurant's menu sets its own values for them on
 * `.menu-sheet` (restaurants/menu_theme.py), so every rule here reads the slots and never a colour.
 */
@font-face { font-family: "Fraunces"; font-weight: 700; font-display: swap; src: url("fonts/Fraunces-700.ttf") format("truetype"); }
@font-face { font-family: "Figtree"; font-weight: 400; font-display: swap; src: url("fonts/Figtree-400.ttf") format("truetype"); }
@font-face { font-family: "Figtree"; font-weight: 600; font-display: swap; src: url("fonts/Figtree-600.ttf") format("truetype"); }
@font-face { font-family: "Figtree"; font-weight: 700; font-display: swap; src: url("fonts/Figtree-700.ttf") format("truetype"); }

:root {
    --page: #FFFFFF; --surface: #F4F4F2; --ink: #2B1D14; --ink-soft: #6B645E; --rule: #E3E2DE;
    --primary: #D9472B; --on-primary: #FFFFFF; --tint: #EFEEEB; --on-tint: #57514B;
    --estimate: #F2C14E; --on-estimate: #3A2A00;
    --chip: #FFFFFF; --chip-line: #E3E2DE; --on-chip: #2B1D14;
    --vegan: #3F7D4E; --vegan-soft: #E3EFD9; --ask: #9A6200; --ask-soft: #FBEBCB; --not-vegan: #A3271F; --not-vegan-soft: #F9DEDC;
    --display: "Fraunces", Georgia, serif;
    --body: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --r-sm: 8px; --r-md: 14px; --r-lg: 24px; --r-full: 999px;
    --float: 0 6px 18px rgba(74, 47, 20, 0.16);
    --scrim: rgba(43, 29, 20, 0.45);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font: 400 15px/21px var(--body); background: var(--page); color: var(--ink); min-height: 100vh; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }

/* Type: the app's named styles. */
.t-hero { font: 700 40px/44px var(--display); }
.t-display, h1 { font: 700 28px/33px var(--display); }
.t-title, h2 { font: 700 21px/26px var(--display); }
.t-headline, h3 { font: 600 17px/22px var(--body); }
.t-label { font: 700 13px/18px var(--body); }
.t-caption { font: 400 12px/16px var(--body); }
.soft, .text-muted { color: var(--ink-soft); }
.tabular { font-variant-numeric: tabular-nums; }
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; }

/* The bar across the top: the bull and wordmark, then where you can go. */
.nav { display: flex; align-items: center; gap: 12px; padding: 8px 16px; background: var(--page); }
.nav-brand { display: flex; align-items: center; gap: 8px; text-decoration: none; margin-right: auto; min-width: 0; }
.nav-brand img.bull { width: 48px; height: 48px; }
.nav-brand img.wordmark { display: block; height: 30px; width: auto; }
.nav-brand small { display: block; font: 400 12px/16px var(--body); white-space: nowrap; }
.nav-links { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.nav-links a, .nav-links button { font: 700 13px/18px var(--body); text-decoration: none; padding: 8px 12px; border-radius: var(--r-full); border: 0; background: none; cursor: pointer; color: var(--ink-soft); }
.nav-links a:hover, .nav-links button:hover { background: var(--tint); color: var(--ink); }
.nav-links a.is-here { color: var(--primary); }
.nav-links form { display: inline; }
.nav-links .nav-staff { opacity: 0.75; }
.icon-disc { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0 !important; border-radius: 50%; background: var(--tint) !important; color: var(--ink-soft); }
@media (max-width: 560px) {
    .nav { flex-wrap: wrap; row-gap: 0; }
    .nav-brand img.bull { width: 40px; height: 40px; } .nav-brand img.wordmark { height: 25px; }
    .nav-links { width: 100%; justify-content: flex-start; margin-left: -8px; }
}

.container { max-width: 720px; margin: 0 auto; padding: 16px; }

/* Surfaces, buttons, fields: the app's components. */
.card { background: var(--surface); border-radius: var(--r-lg); padding: 24px; margin-bottom: 16px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 24px; border-radius: var(--r-full);
       border: 1px solid var(--rule); background: var(--surface); color: var(--ink); font: 700 17px/22px var(--display); text-decoration: none; cursor: pointer; }
.btn:hover { filter: brightness(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary, .btn-vegan { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-quiet, .btn-skip { background: transparent; border-color: transparent; }
.btn-danger { color: var(--not-vegan); }
.btn-small { min-height: 40px; padding: 0 16px; font-size: 15px; }
.btn-block { width: 100%; }

.form-group { display: grid; gap: 4px; margin-bottom: 16px; }
.form-group label { font: 700 13px/18px var(--body); }
.form-group input { height: 50px; padding: 0 24px; border-radius: var(--r-full); border: 1.5px solid var(--rule); background: var(--surface); outline: none; }
.form-group input:focus { border-color: var(--primary); }
.form-group small { font: 400 12px/16px var(--body); color: var(--ink-soft); }

.tag { display: inline-block; font: 700 13px/18px var(--body); padding: 4px 12px; border-radius: var(--r-full); background: var(--tint); color: var(--on-tint); }
.tag-leaf { background: var(--vegan-soft); color: var(--vegan); }
.chip { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 0 12px; border-radius: var(--r-full);
        border: 1px solid var(--chip-line); background: var(--chip); color: var(--on-chip); font: 700 13px/18px var(--body); cursor: default; }
button.chip { cursor: pointer; }
.chip.is-on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.chip-floating { border-color: transparent; box-shadow: var(--float); }

.alert { padding: 12px 16px; border-radius: var(--r-md); margin-bottom: 16px; font-weight: 600; }
.alert-success { background: var(--vegan-soft); color: var(--vegan); }
.alert-error { background: var(--not-vegan-soft); color: var(--not-vegan); }

.progress { height: 8px; border-radius: var(--r-full); background: var(--rule); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: var(--r-full); background: var(--primary); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.stat-box { padding: 16px; background: var(--surface); border-radius: var(--r-lg); }
.card .stat-box { background: var(--page); }
.stat-number { font: 700 40px/44px var(--display); color: var(--primary); font-variant-numeric: tabular-nums; }
.stat-label { font: 700 13px/18px var(--body); color: var(--ink-soft); margin-top: 4px; }

/* Sheets: Mad Bull asking its own question. Always in Mad Bull's look, even over a restaurant's menu. */
dialog.sheet { margin: auto; border: 0; border-radius: var(--r-lg); padding: 24px; width: min(420px, calc(100vw - 32px));
               background: #FFFFFF; color: #2B1D14; box-shadow: var(--float); font: 400 15px/21px var(--body); }
dialog.sheet::backdrop { background: var(--scrim); }
dialog.sheet h2 { font: 700 21px/26px var(--display); margin-bottom: 8px; }
dialog.sheet p { color: #6B645E; }
dialog.sheet textarea { display: block; width: 100%; min-height: 88px; margin-top: 8px; padding: 12px; border-radius: var(--r-md); border: 1.5px solid #D9472B; background: #F4F4F2; outline: none; resize: vertical; }
dialog.sheet .sheet-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
dialog.sheet .btn { background: #F4F4F2; border-color: #E3E2DE; color: #2B1D14; }
dialog.sheet .btn-primary { background: #D9472B; border-color: #D9472B; color: #fff; }
dialog.sheet .btn-quiet { background: transparent; border-color: transparent; }
dialog.sheet .btn-danger { color: #A3271F; }

.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: inline; }
