/* ===========================================================================
   MEALS: each of your own meals, diary-style. A square food snap with the
   eater's face on it, their verdict, the other one's reaction; a meal page
   whose photos run straight down; and the "what did you eat?" sheet.
   =========================================================================== */

/* ---- whose meals */
.meal-filter { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.mf {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.85rem 0.3rem 0.35rem;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: none;
  color: var(--muted);
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
}
.mf:not(.who-rabbit):not(.who-tuna) { padding-left: 0.85rem; }
.mf.is-on { color: var(--text); border-color: var(--who, var(--text)); background: color-mix(in srgb, var(--who, var(--text)) 12%, transparent); }
.mf-av { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; overflow: hidden; background: #fff6e4; }
.mf-av img, .mr-av img, .meal-by img, .mp-by img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mf-av .av-emoji { font-size: 0.95rem; }

/* ---- a diary entry */
.meal-diary .dia-entry { grid-template-columns: 3rem 120px minmax(0, 1fr); }
.meal-thumb { position: relative; }
.meal-photo {
  display: grid;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  background: var(--raise);
  border: 4px solid var(--print);
  box-shadow: 3px 6px 12px -6px rgb(0 0 0 / 0.6);
  transform: rotate(-2deg);
}
.meal-entry:nth-child(even) .meal-photo { transform: rotate(1.6deg); }
.meal-count {
  position: absolute;
  right: 4px; bottom: 6px;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: rgb(0 0 0 / 0.65);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
}
.meal-by {
  position: absolute;
  left: -8px; top: -8px;
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  overflow: hidden;
  background: #fff6e4;
  border: 2.5px solid var(--who);
  box-shadow: 0 2px 5px rgb(0 0 0 / 0.35);
}
.meal-by .av-emoji { font-size: 1rem; }
.meal-blank { display: grid; place-items: center; color: var(--print-ink); }
.meal-blank .art { width: 55%; color: color-mix(in srgb, var(--print-ink) 60%, transparent); }
.meal-loading {
  width: 60%; height: 60%;
  border-radius: 50%;
  background: linear-gradient(100deg, transparent 30%, color-mix(in srgb, var(--print-ink) 12%, transparent) 50%, transparent 70%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
.meal-verdict .dr-name { font-size: 1.05rem; }
.meal-react {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0;
  padding: 0.35rem 0.6rem;
  background: color-mix(in srgb, var(--who) 9%, transparent);
  font-size: 0.86rem;
}
.meal-react b { color: var(--who); font-family: var(--display); font-size: 1rem; }
.meal-react > span:last-child { font-family: var(--display); font-size: 1.02rem; }
.mr-av { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; overflow: hidden; background: #fff6e4; border: 2px solid var(--who); }
.mr-av .av-emoji { font-size: 0.8rem; }

/* ---- one meal: a single column, photos running straight down */
.dlg-meal { width: min(560px, calc(100vw - 2rem)); padding: 0; }
.mp { position: relative; display: grid; gap: 1rem; padding: 1.3rem; }
.mp-head { display: flex; align-items: center; gap: 0.8rem; padding-right: 2.4rem; }
.mp-head h2 { margin: 0; font-size: 1.9rem; line-height: 1.05; }
.mp-head .fp-facts, .mp-head .fp-dir { margin: 0; }
.mp-by {
  flex: none;
  display: grid;
  place-items: center;
  width: 52px; height: 52px;
  border-radius: 50%;
  overflow: hidden;
  background: #fff6e4;
  border: 3px solid var(--who);
  transform: rotate(-5deg);
}
.mp-by .av-emoji { font-size: 1.6rem; }
.mp-photos { display: grid; gap: 1.1rem; }
.mp-shot { position: relative; margin: 0; }
.mp-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  border: 8px solid var(--print);
  border-bottom-width: 26px;
  box-shadow: 4px 8px 18px -8px rgb(0 0 0 / 0.6);
  transform: rotate(-1deg);
  background: var(--raise);
}
.mp-shot:nth-child(even) .mp-img { transform: rotate(0.8deg); }
.mp-img.meal-blank { aspect-ratio: 4 / 3; }
.mp-shot-x {
  position: absolute;
  top: 14px; right: 14px;
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgb(0 0 0 / 0.6);
  color: #fff;
  cursor: pointer;
}
.mp-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.8rem;
  border: 2.5px dashed color-mix(in srgb, var(--pen) 40%, transparent);
  border-radius: 12px;
  background: none;
  color: var(--muted);
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
}
.dr-text.is-big { font-size: 1.25rem; }
.mp-mine, .mp-react { display: grid; gap: 0.45rem; padding-top: 0.7rem; border-top: 1px dashed color-mix(in srgb, var(--pen) 25%, transparent); }
.mp-mine-head { margin: 0; font-family: var(--display); font-size: 1.2rem; color: var(--who, var(--rabbit)); }
.mp-mine-actions { display: flex; justify-content: flex-end; gap: 0.5rem; }
.mp-react-row { display: flex; align-items: center; gap: 0.5rem; }
.mp-react-row .text-input { flex: 1; min-width: 0; }

/* ---- adding one: photos stack, then the details */
.dlg-addmeal { width: min(480px, calc(100vw - 2rem)); }
.am { display: grid; gap: 0.65rem; }
.am h2 { margin: 0; }
.am-photos { display: grid; gap: 0.6rem; max-height: 52vh; overflow-y: auto; padding: 2px; }
.am-shot { position: relative; margin: 0; }
.am-shot img { display: block; width: 100%; max-height: 38vh; object-fit: cover; border-radius: 12px; }
.am-shot-x {
  position: absolute;
  top: 8px; right: 8px;
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border: 0;
  border-radius: 50%;
  background: rgb(0 0 0 / 0.6);
  color: #fff;
  cursor: pointer;
}
.am-shot-n {
  position: absolute;
  left: 8px; top: 8px;
  display: grid;
  place-items: center;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--print);
  color: var(--print-ink);
  font-weight: 800;
  font-size: 0.8rem;
}
.am-photo {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 150px;
  padding: 1rem;
  border: 2.5px dashed color-mix(in srgb, var(--pen) 45%, transparent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-2) 70%, transparent);
  color: var(--muted);
  cursor: pointer;
}
.am-shot + .am-photo { min-height: 70px; }
.am-photo-empty { display: grid; justify-items: center; gap: 0.25rem; text-align: center; }
.am-photo-empty b { font-family: var(--display); font-size: 1.3rem; color: var(--text); }
.am-photo-empty small { font-size: 0.8rem; }
.am-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.5rem; }
.am-label { margin: 0.2rem 0 0; font-size: 0.82rem; color: var(--muted); font-weight: 700; }

@media (max-width: 760px) {
  .meal-diary .dia-entry { grid-template-columns: 2.1rem 84px minmax(0, 1fr); }
  .mp { padding: 1rem; gap: 0.9rem; }
  .mp-head h2 { font-size: 1.55rem; }
  .am-row { grid-template-columns: 1fr; }
  .dock-btn { font-size: 0.8rem; }
}

/* The verdict header is longer than the film one ("Tuna's verdict" + cats +
   score): let the cats drop under the name when a phone is too narrow. */
.meal-diary .dia-review .dr-head, .mp .dia-review .dr-head { flex-wrap: wrap; }
.meal-react { border-radius: 12px; }
