/* --------------------------------------------------------------------------
   smažák — vizuál vychází z vytištěného meníčka přilepeného na dveřích:
   strohý seznam, čísla jídel jako pořadová čísla objednávky, a jediná
   hlasitá věc na stránce je zlatý zvýrazňovač na smažáku.
   -------------------------------------------------------------------------- */

:root {
    --ink:      #0d0d0f;  /* podklad */
    --surface:  #18181b;
    --line:     #2b2b31;
    --text:     #f4f4f5;
    --heading:  #ffffff;
    --muted:    #8e8e97;
    --gold:     #f5b72e;  /* strouhanka — jediná barva na stránce, drží ji ikona */
    --gold-ink: #141410;

    --display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
    --body:    "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --mono:    "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

    --gap:  1rem;
    --edge: clamp(1rem, 4vw, 2.5rem);
}

*, *::before, *::after { box-sizing: border-box; }


body {
    margin: 0;
    padding: var(--edge) var(--edge) 3rem;   /* záloha pro prohlížeče bez env() */
    padding:
        max(var(--edge), env(safe-area-inset-top))
        max(var(--edge), env(safe-area-inset-right))
        max(3rem, env(safe-area-inset-bottom))
        max(var(--edge), env(safe-area-inset-left));
    background: var(--ink);
    color: var(--text);
    overflow-x: hidden;   /* drobky odlétají mimo kartu, ať kvůli nim nevznikne vodorovný posuvník */
    font-family: var(--body);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* --- hlavička ----------------------------------------------------------- */

.head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.25rem 1rem;
    padding-bottom: 0.9rem;
    margin-bottom: 1.75rem;
    border-bottom: 1px solid var(--line);
}

.today {
    margin: 0;
    color: var(--heading);
    line-height: 0.95;
    font-family: var(--display);
    font-weight: 800;
    font-size: clamp(2.4rem, 9vw, 3.6rem);
    letter-spacing: -0.045em;
    line-height: 0.95;
}

/* Datum je zároveň tlačítko na přenačtení — vypadá pořád jako nadpis. */
.today__refresh {
    display: block;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.today__refresh:active     { opacity: 0.6; }
.today__refresh.is-loading { opacity: 0.4; }

/* --- mřížka podniků ----------------------------------------------------- */

.places {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;   /* karty v řádku začínají nahoře, nedotahují se na výšku */
    gap: var(--gap);
}

@media (min-width: 46rem) { .places { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 74rem) { .places { grid-template-columns: repeat(3, 1fr); } }

.place {
    margin: 0;
    padding: 1.15rem 1.2rem 1.25rem;
    background: var(--surface);
    border-radius: 2px;
    animation: rise 0.45s cubic-bezier(0.2, 0.7, 0.3, 1) backwards;
    animation-delay: calc(var(--i, 0) * 60ms);
}

.place--empty {
    padding-bottom: 1.15rem;
    background: none;
    box-shadow: inset 0 0 0 1px var(--line);
}

.place__name {
    margin: 0;
    color: var(--heading);
    font-family: var(--display);
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
}

.place__name a {
    color: inherit;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.22em;
    text-decoration-color: transparent;
    transition: text-decoration-color 0.15s;
}

.place__name a:hover,
.place__name a:focus-visible { text-decoration-color: var(--gold); }

.place--empty .place__name a { color: var(--muted); }

/* --- jídla -------------------------------------------------------------- */

.menu {
    margin: 0.85rem 0 0;
    padding: 0;
    list-style: none;
}

.dish {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    align-items: baseline;
    gap: 0 0.6rem;
    padding: 0.5rem 0;
    border-top: 1px solid var(--line);
    font-size: 0.95rem;
}

.dish:first-child { border-top: 0; padding-top: 0; }

.dish__price {
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.dish__price { text-align: right; white-space: nowrap; }

/* --- označení smažáku ---------------------------------------------------

   Žádné pozadí — jen samotný smažák z ikony na konci názvu. Zůstává tam
   napořád, takže se dá při scrollování chytit očima. Při načtení z něj
   jednou vyskočí pár drobků jako konfety a zmizí.                       */

.dish__name.is-smazak {
    color: var(--heading);
    font-weight: 500;
}

.mark,
.mark i {
    background: url("icons/smazak-sprite.png") center / contain no-repeat;
}

.mark {
    position: relative;
    display: inline-block;
    width: 1.15em;
    height: 1.15em;
    margin-left: 0.4em;
    vertical-align: -0.22em;
    animation: bob 4.5s ease-in-out infinite;
}

/* Drobky. Každý letí jinam, jinak velký a s jiným zpožděním —
   souřadnice jsou v em, takže se to škáluje s velikostí písma. */
.mark i {
    position: absolute;
    inset: 0;
    animation: crumb 1.15s cubic-bezier(0.15, 0.75, 0.35, 1) both;
    animation-delay: calc(var(--i, 0) * 60ms + var(--d, 0s) + 0.35s);
}

.mark i:nth-child(1) { --x: -1.7em; --y: -1.5em; --s: 0.50; --r:  190deg; --d: 0.00s; }
.mark i:nth-child(2) { --x:  1.5em; --y: -1.9em; --s: 0.36; --r: -150deg; --d: 0.09s; }
.mark i:nth-child(3) { --x:  1.9em; --y:  1.0em; --s: 0.44; --r:  120deg; --d: 0.18s; }
.mark i:nth-child(4) { --x: -1.2em; --y:  1.5em; --s: 0.30; --r: -210deg; --d: 0.05s; }

@keyframes crumb {
    0%   { transform: translate(0, 0) scale(0.25) rotate(0deg); opacity: 0; }
    20%  { opacity: 1; }
    100% { transform: translate(var(--x), var(--y)) scale(var(--s)) rotate(var(--r)); opacity: 0; }
}

@keyframes bob {
    0%, 100% { transform: translateY(0) rotate(-4deg); }
    50%      { transform: translateY(-0.16em) rotate(4deg); }
}

/* --- ostatní ------------------------------------------------------------ */

a:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
}

@keyframes rise {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .place,
    .mark { animation: none; }
    .mark i { display: none; }
}
