/* Meal ideas and the recipe screen (public/ui/meals.js). */

/* The two counts at the top: a picture, a number, what it counts. */
.mealsum { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin: 0 0 .8rem; }
.msum { display: flex; align-items: center; gap: .6rem; padding: .7rem .8rem; border-radius: 18px; background: var(--card); border: 1px solid var(--line); min-width: 0; }
.msum b { display: block; font-family: var(--display); font-size: 1.9rem; line-height: 1; font-variant-numeric: tabular-nums; }
.msum span { display: block; font-size: .8rem; color: var(--muted); line-height: 1.2; margin-top: .15rem; }
.msum:first-child { background: color-mix(in srgb, var(--ok) 12%, var(--card)); }
.msum .pimg { height: 48px !important; }

.mkinds { margin: 0 -1rem .2rem; padding: 0 1rem .4rem; scrollbar-width: none; }
.mkinds::-webkit-scrollbar { display: none; }
.mkinds button { flex: none; }
.mkinds .n { opacity: .6; font-weight: 500; margin-left: .15rem; font-variant-numeric: tabular-nums; }

/* A meal in the list. */
.mrow { align-items: center; }
.mrow .mart { flex: none; width: 46px; height: 46px; display: grid; place-items: center; }
.mrow .mart img { width: 46px; height: 46px; object-fit: contain; }
.mrow .name { display: block; font-weight: 600; line-height: 1.25; }
.mrow .msub { display: flex; align-items: center; flex-wrap: wrap; gap: .25rem .5rem; margin: .25rem 0 .1rem; }
.mrow .small { display: block; }
.mrow .chev { flex: none; color: var(--muted); opacity: .6; display: grid; }
.mrow .chev .ion-ic { width: 18px; height: 18px; }
.mneed { color: var(--warn); font-weight: 600; }
.msoon { color: var(--warn); }
.mneed .ion-ic, .msoon .ion-ic { width: 13px; height: 13px; vertical-align: -2px; margin-right: .2rem; }

/* Each needed ingredient as a small picture: colour when it is on hand, pale in a dashed ring when it is not. */
.mings { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.ming { position: relative; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--ok) 14%, var(--card)); }
.ming .pimg { height: 22px !important; width: auto; max-width: 24px; object-fit: contain; }
.ming .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); }
.ming.miss { background: transparent; border: 1.5px dashed var(--warn); }
.ming.miss .pimg { opacity: .35; filter: grayscale(1); }
.ming.miss .dot { background: transparent; border: 1.5px solid var(--warn); }
.ming em { position: absolute; right: -4px; bottom: -3px; width: 15px; height: 15px; border-radius: 50%; background: var(--warn); color: #fff; display: grid; place-items: center; }
.ming em .ion-ic { width: 11px; height: 11px; }
.fx-in .ming { animation: fx-pop .4s var(--spring) backwards; animation-delay: calc(200ms + var(--i, 0) * 24ms); }
.rstate .mings .ming { width: 36px; height: 36px; }
.rstate .mings .pimg { height: 28px !important; max-width: 30px; }

/* The two counts link to their lists; the bar under them is the same split. */
a.msum { color: inherit; text-decoration: none; }
.mbar { grid-column: 1 / -1; display: flex; height: 8px; border-radius: 99px; overflow: hidden; gap: 2px; background: var(--line); }
.mbar .now { background: var(--ok); } .mbar .few { background: var(--warn); }
.mdiet { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin: 0 0 .7rem; }
.mdiet .small { flex-basis: 100%; }

/* Kinds of meal as picture buttons. */
.mkinds .cat-tile { width: 84px; }
.mkinds .cat-pic .pimg { height: 44px !important; width: auto; max-width: 48px; object-fit: contain; }

/* What the list is made from, as facts and a small diagram, at the bottom. */
.mabout { margin: 1rem 0 .6rem; }
.mflow { margin-bottom: 1rem; }

/* Recipe: picture, how many it serves, how long it takes. */
.rhero { display: flex; align-items: center; gap: 1rem; }
.rhero .rart { flex: none; width: 96px; height: 96px; display: grid; place-items: center; }
.rhero .rart img { width: 96px; height: 96px; object-fit: contain; }
.rserves { display: flex; align-items: flex-end; gap: .5rem; flex-wrap: wrap; margin-bottom: .5rem; }
.rfigs { display: flex; align-items: flex-end; gap: 1px; }
.rfigs .pimg { height: 34px !important; }
.fx-in .rfigs .pimg { animation: fx-pop .45s var(--spring) backwards; }
.fx-in .rfigs .pimg:nth-child(2) { animation-delay: 60ms; } .fx-in .rfigs .pimg:nth-child(3) { animation-delay: 120ms; } .fx-in .rfigs .pimg:nth-child(4) { animation-delay: 180ms; }
.fx-in .rfigs .pimg:nth-child(5) { animation-delay: 240ms; } .fx-in .rfigs .pimg:nth-child(6) { animation-delay: 300ms; } .fx-in .rfigs .pimg:nth-child(n+7) { animation-delay: 360ms; }
.rfact { padding: .35rem .7rem .35rem .5rem; }
.rfact .ion-ic { width: 20px; height: 20px; color: var(--pa); }
.rfact .pimg { height: 26px !important; }

.rstate { display: flex; align-items: center; gap: .6rem; padding: .7rem .9rem; border-radius: 16px; margin: 0 0 .2rem; font-size: .95rem; line-height: 1.3; }
.rstate.now { background: var(--okbg); color: var(--ok); }
.rstate.few { background: var(--warnbg); color: var(--warn); }
.rstate .mpips i { width: 11px; height: 11px; }

/* Ingredients: a tick for what is in the pantry, an empty ring for what is not. */
.ings li.ing { align-items: flex-start; gap: .7rem; padding: .6rem 0; }
.ings li.ing[data-pid] { cursor: pointer; }
.ings .name { line-height: 1.3; }
.ingpic { position: relative; flex: none; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, var(--ok) 12%, var(--card)); }
.ingpic .pimg { height: 34px !important; width: auto; max-width: 38px; object-fit: contain; }
.ingpic .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--ok); }
.ingmark { position: absolute; right: -5px; bottom: -5px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--card); box-sizing: border-box; color: #fff; background: var(--line); }
.ingmark .ion-ic { width: 12px; height: 12px; }
.ing.have .ingmark { background: var(--ok); }
.ing.missing .ingpic, .ing.skip .ingpic, .ing:not(.have) .ingpic { background: transparent; border: 1.5px dashed var(--warn); }
.ing:not(.have) .ingpic .pimg { opacity: .35; filter: grayscale(1); }
.ing:not(.have) .ingpic .dot { background: transparent; border: 1.5px solid var(--warn); }
.ing:not(.have) .ingmark { display: none; }
.ing.skip .name { color: var(--muted); }
.ing button.listed { opacity: .7; }
.ing button { flex: none; align-self: center; white-space: nowrap; }
.rbasic { margin: .5rem 0 .2rem; }
.rbasic + button { margin-top: .6rem; }
.ings + button { margin-top: .6rem; }
.fx-in .ing .ingpic { animation: fx-pop .4s var(--spring) backwards; animation-delay: calc(160ms + var(--i, 0) * 45ms); }

/* Steps: big numbers, one tap marks a step done. */
.rsteps { list-style: none; margin: 0 0 .8rem; padding: 0; display: grid; gap: .5rem; }
.rsteps button { display: flex; align-items: flex-start; gap: .8rem; width: 100%; text-align: left; padding: .8rem .9rem; border-radius: 16px; background: var(--card); border: 1px solid var(--line);
  color: var(--ink); font: inherit; font-size: 1.02rem; line-height: 1.4; font-weight: 400; min-height: 0; box-shadow: none; justify-content: flex-start; }
.stepn { flex: none; width: 1.9rem; height: 1.9rem; border-radius: 50%; display: grid; place-items: center; background: var(--pa); color: var(--pa-ink, #fff); font-weight: 700; font-family: var(--display);
  transition: background-color .25s ease, transform .3s var(--spring); }
.rsteps button[aria-pressed="true"] { color: var(--muted); background: transparent; }
.rsteps button[aria-pressed="true"] .grow { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 50%, transparent); }
.rsteps button[aria-pressed="true"] .stepn { background: var(--ok); transform: scale(.88); }
.fx-in .rsteps li { animation: fx-rise-y .4s var(--out) backwards; animation-delay: calc(140ms + var(--i, 0) * 40ms); }

@media print { .rsteps button { border: 0; padding: .2rem 0; } .ing button, #wantall, .mkinds { display: none; } }

/* Steps: a pot and a bar that fills as steps are ticked. */
.rstephead { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; }
.rprog { margin-left: auto; display: inline-flex; align-items: center; gap: .45rem; font-size: .8rem; font-weight: 600; color: var(--muted); }
.rprog .pimg { height: 30px !important; }
.rbar { width: 70px; height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.rbar span { display: block; height: 100%; width: 0; background: var(--ok); border-radius: inherit; transition: width .35s var(--out, ease); }
.rprog.done small { color: var(--ok); }
