/* Customer menu: one data/card structure, photographic grid and wide overview.
   Official local UTB Text and book symbol; white, slate and UTB orange. */
@font-face { font-family: 'UTB Text'; src: url('../fonts/UTBText-Regular.otf') format('opentype'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'UTB Text'; src: url('../fonts/UTBText-Bold.otf') format('opentype'); font-weight: 700; font-style: normal; font-display: swap; }
:root { color-scheme: light; --bg: #fff; --paper: #fff; --ink: #272b2f; --muted: #60666b; --line: #e2e5e7; --accent: #f37222; --accent-ink: #a44812; --accent-soft: #fff0e7; --slate: #46505a; --radius: 14px; --space: 18px; }
* { box-sizing: border-box; }
html { scrollbar-gutter: stable; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 'UTB Text', Arial, sans-serif; -webkit-text-size-adjust: 100%; }
button, select { font: inherit; color: inherit; }
button, a, select { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible, a:focus-visible, select:focus-visible, main:focus-visible { outline: 3px solid var(--slate); outline-offset: 3px; }
[hidden] { display: none !important; }
svg { width: 22px; height: 22px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.page { max-width: 1080px; min-height: 100dvh; margin: auto; padding: env(safe-area-inset-top) max(var(--space), env(safe-area-inset-right)) max(30px, env(safe-area-inset-bottom)) max(var(--space), env(safe-area-inset-left)); }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 72px; }
.identity { display: flex; align-items: center; gap: 18px; min-width: 0; padding-block: 18px; }
.brand-symbol { display: block; width: 18px; height: auto; aspect-ratio: 77553 / 114423; flex-shrink: 0; }
.brand-name { font-size: 18px; line-height: 1.15; font-weight: 700; overflow-wrap: anywhere; }
.canteen-picker { min-width: 0; flex: 0 1 146px; }
select { display: block; width: 100%; min-width: 0; min-height: 44px; padding: 8px 12px; background: #f3f4f5; border: 1px solid #eceef0; border-radius: 12px; font-size: 15px; font-weight: 700; text-overflow: ellipsis; }
.date-line { color: var(--muted); font-size: 14px; margin: 0 0 10px; }
.variants { display: flex; gap: 4px; padding: 4px; background: #f0f1f3; border-radius: var(--radius); margin-top: 4px; }
.variants a { display: flex; flex: 1; align-items: center; justify-content: center; min-height: 44px; padding: 10px 12px; border-radius: 10px; color: var(--muted); font-size: 17px; line-height: 1.3; text-decoration: none; transition: background .16s ease, color .16s ease; }
.variants a[aria-current] { color: var(--ink); background: var(--paper); font-weight: 700; box-shadow: 0 1px 4px #29343d14; }
.categories { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 14px; }
.categories button { flex: 0 1 auto; min-width: 0; max-width: 100%; min-height: 44px; padding: 10px 16px; background: #f1f3f4; border: 0; border-radius: 999px; color: var(--slate); text-align: center; font-size: 15px; line-height: 1.3; overflow-wrap: anywhere; transition: background .16s ease, color .16s ease; }
.categories button[aria-pressed=true] { color: var(--ink); background: var(--accent); font-weight: 700; }
.menu-section { margin-top: 28px; scroll-margin-top: 18px; }
.menu-section:first-child { margin-top: 22px; }
.section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 0 0 14px; }
.section-heading h2 { margin: 0; font-size: 23px; line-height: 1.2; letter-spacing: -.4px; font-weight: 700; overflow-wrap: anywhere; }
.section-heading span { color: var(--muted); font-size: 14px; white-space: nowrap; }
.meal-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
.meal-card { min-width: 0; display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.meal-photo { position: relative; display: block; width: calc(100% - 10px); margin: 5px 5px 0; aspect-ratio: 4/3; flex-shrink: 0; border: 0; border-radius: 10px; padding: 0; background: #f2f3f4; overflow: hidden; }
.meal-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.meal-photo:focus-visible { outline-offset: -4px; }
.expand-icon { position: absolute; right: 6px; bottom: 6px; display: grid; place-items: center; width: 24px; height: 24px; color: var(--slate); background: #fffffff2; border-radius: 4px; pointer-events: none; }
.expand-icon svg { width: 15px; height: 15px; }
.photo-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; width: 100%; height: 100%; padding: 8px; color: var(--muted); font-size: 14px; text-align: center; }
.placeholder-icon { display: grid; place-items: center; }
.placeholder-icon svg { width: 24px; height: 24px; stroke-width: 1.4; }
.meal-body { min-width: 0; padding: 10px 10px 0; flex: 1; }
.meal-body h3 { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.28; letter-spacing: -.15px; overflow-wrap: anywhere; }
.meal-translation { margin: 5px 0 0; color: var(--muted); font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.prices { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; }
.price { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.price + .price { color: var(--slate); padding-left: 24px; border-left: 1px solid var(--line); }
.price-label { font-size: 14px; color: var(--muted); }
.price-value { color: var(--accent-ink); font-size: 26px; line-height: 1.15; font-weight: 700; letter-spacing: -.4px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.price + .price .price-value { color: var(--slate); font-size: 16px; font-weight: 400; letter-spacing: 0; }
.price-missing { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.meal-card > .prices { align-items: flex-start; gap: 8px; margin: 12px 10px 10px; }
.meal-card .price { flex: 1 1 auto; flex-direction: column; align-items: flex-start; gap: 2px; }
.meal-card .price + .price { padding: 0; border: 0; }
.meal-card .price-value { font-size: 26px; line-height: 30px; }
.meal-card .price + .price .price-value { font-size: 17px; line-height: 30px; }
.meal-card .price-missing { line-height: 30px; }
.meal-facts { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; min-width: 0; margin: 0 10px; padding: 10px 0 12px; border-top: 1px solid var(--line); font-size: 14px; line-height: 1.4; }
.meal-meta, .availability { min-width: 0; margin: 0; color: var(--muted); overflow-wrap: anywhere; }
.availability { color: var(--slate); }
.availability.sold-out { color: #a83218; font-weight: 700; }
.availability.low-stock { color: var(--accent-ink); font-weight: 700; }
/* Overview follows a photo-led, full-width card. Availability stays the same
   live DOM label; positioning it over the photo does not duplicate data. */
.variant-b .meal-list { grid-template-columns: minmax(0, 1fr); gap: 20px; }
.variant-b .meal-card { position: relative; display: flex; flex-direction: column; }
.variant-b .meal-photo { width: 100%; margin: 0; aspect-ratio: 16/9; border-radius: 13px 13px 0 0; }
.variant-b .meal-body { flex: none; padding: 16px 16px 0; }
.variant-b .meal-body h3 { font-size: 22px; line-height: 1.25; letter-spacing: -.3px; }
.variant-b .meal-translation { display: none; }
.variant-b .meal-facts { order: 1; display: block; margin: 0; padding: 10px 16px 0; border: 0; }
.variant-b .availability { position: absolute; z-index: 1; top: 12px; right: 12px; max-width: calc(100% - 24px); padding: 6px 10px; border: 1px solid #ffffffb3; border-radius: 6px; background: #fffffff2; color: var(--accent-ink); font-size: 14px; font-weight: 700; line-height: 1.3; box-shadow: 0 1px 4px #29343d12; pointer-events: none; }
.variant-b .availability.sold-out { color: #a83218; background: #fff3ef; }
.variant-b .meal-card > .prices { order: 2; align-items: flex-start; gap: 12px 24px; margin: 14px 16px 16px; padding: 10px 14px; border-radius: 10px; background: #f4f5f6; }
.variant-b .meal-card .price { flex: 0 1 auto; }
.variant-b .meal-card .price-value { font-size: 30px; line-height: 34px; }
.variant-b .meal-card .price + .price { padding-left: 24px; border-left: 1px solid #dce0e3; }
.variant-b .meal-card .price + .price .price-value { font-size: 20px; line-height: 34px; }
.notice { margin: 20px 0; padding: 12px 14px; background: var(--accent-soft); border-left: 3px solid var(--accent); color: #75401f; font-size: 15px; }
#menu[aria-busy=true] { min-height: 260px; }
.menu-state { text-align: center; padding: 48px 12px; color: var(--muted); }
.state-symbol { display: block; width: 36px; height: 4px; background: var(--accent); margin: 0 auto 22px; }
.menu-state h2 { font-size: 26px; line-height: 1.2; color: var(--ink); margin: 0 0 12px; }
.menu-state p { font-size: 16px; max-width: 350px; margin: 0 auto 24px; }
#retry { border: 0; border-radius: var(--radius); background: var(--accent); color: var(--ink); min-height: 48px; padding: 12px 24px; font-weight: 700; }
footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 14px; border-top: 1px solid var(--line); margin-top: 32px; padding-top: 18px; color: var(--muted); font-size: 14px; }
.preview-note { display: block; margin-top: 4px; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 10; padding: 12px; background: white; color: var(--ink); }
.skip-link:focus { top: 10px; }
/* Compact modal: photo keeps its full source ratio; only the caption scrolls.
   Navigation lives above the photograph, never over the food or its caption. */
.gallery { position: fixed; inset: 0; margin: auto; padding: 0; border: 0; width: calc(100% - 24px); max-width: 520px; height: fit-content; max-height: calc(100dvh - 24px); background: var(--paper); color: var(--ink); border-radius: 20px; overflow: hidden; box-shadow: 0 20px 100px #0004; overscroll-behavior: contain; }
.gallery[open] { display: flex; flex-direction: column; }
.gallery::backdrop { background: #29343dd9; }
body.gallery-open { overflow: hidden; }
.gallery-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-shrink: 0; min-height: 64px; padding: 10px max(12px,env(safe-area-inset-right)) 10px max(18px,env(safe-area-inset-left)); font-size: 14px; color: var(--muted); }
#gallery-counter { margin-right: auto; white-space: nowrap; font-variant-numeric: tabular-nums; }
.gallery-navigation { display: flex; gap: 6px; }
.icon-button { border: 0; border-radius: 50%; background: #f3f4f4; color: var(--ink); display: grid; place-items: center; width: 44px; height: 44px; flex-shrink: 0; }
.icon-button:disabled { opacity: .3; }
.gallery-stage { position: relative; display: flex; flex: 0 0 auto; min-height: 0; align-items: center; justify-content: center; touch-action: pan-y pinch-zoom; background: #f6f7f7; overflow: hidden; }
#gallery-image { display: block; width: 100%; height: auto; max-height: 48dvh; object-fit: contain; user-select: none; -webkit-user-select: none; }
#gallery-error { padding: 30px 24px; text-align: center; font-size: 16px; color: var(--muted); }
.gallery-caption { flex: 0 1 auto; min-height: 80px; overflow: auto; overscroll-behavior: contain; padding: 20px max(20px,env(safe-area-inset-right)) max(22px,env(safe-area-inset-bottom)) max(20px,env(safe-area-inset-left)); }
.gallery-caption:focus-visible { outline: 3px solid var(--slate); outline-offset: -4px; }
.gallery-caption h2 { font-size: 24px; font-weight: 400; line-height: 1.25; letter-spacing: -.4px; margin: 0; overflow-wrap: anywhere; }
.gallery .prices { margin-top: 18px; }
.gallery .price-value { font-size: 32px; }
.gallery .price + .price .price-value { font-size: 21px; }
.gallery-caption p { font-size: 14px; color: var(--muted); margin: 18px 0 0; overflow-wrap: anywhere; }
@media (hover: hover) {
    .variants a:not([aria-current]):hover { color: var(--ink); background: #e7e9eb; }
    .categories button:not([aria-pressed=true]):hover { color: var(--ink); background: #e6e9ec; }
    .meal-photo:not(:disabled):hover .expand-icon { background: white; color: var(--ink); }
}
@media (max-width: 350px) {
    .canteen-picker { flex-basis: 128px; }
    select { font-size: 14px; }
    .brand-name { font-size: 17px; }
    .categories button { padding-inline: 12px; }
    .meal-card .price-value { font-size: 23px; }
    .variant-a .meal-card > .prices { flex-direction: column; gap: 4px; }
    .variant-a .meal-card .price { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; }
    .variant-a .meal-card .price-value, .variant-a .meal-card .price-missing { line-height: 1.2; }
    .meal-card .price + .price .price-value { font-size: 15px; }
}
@media (min-width: 700px) {
    :root { --space: 28px; }
    .page { padding-top: max(8px, env(safe-area-inset-top)); }
    .meal-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 20px; }
    .meal-body h3 { font-size: 19px; }
    .meal-card .price-value { font-size: 26px; }
}
@media (min-width: 960px) {
    .variant-b .meal-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
}
@media (min-width: 850px), (orientation: landscape) and (max-height: 500px) and (min-width: 560px) {
    .gallery { width: calc(100% - 48px); max-width: 1060px; height: min(448px, calc((100vw - 48px) * .36 + 64px), calc(100dvh - 32px)); max-height: calc(100dvh - 32px); }
    .gallery[open] { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(260px, 1fr); grid-template-rows: auto minmax(0, 1fr); }
    .gallery-top { grid-column: 1/-1; }
    .gallery-stage { min-width: 0; }
    #gallery-image { height: 100%; max-height: none; }
    .gallery-caption { align-self: stretch; max-height: none; padding: 24px; }
}
@media (max-height: 500px) {
    .gallery-top { min-height: 56px; padding-block: 6px; }
    .gallery-caption { padding: 16px; }
    .gallery-caption h2 { font-size: 20px; }
    .gallery .prices { margin-top: 12px; gap: 12px; }
    .gallery .price + .price { padding-left: 12px; }
    .gallery-caption p { margin-top: 12px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
