/* DishTile: shared photo / title / price / description tracks in each row. */
.dc-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 150px;
  grid-template-rows: repeat(4, auto);
}
.dc-row.dc-row-page { grid-auto-flow: row; }
:is(.dc-row, .mo-grid, .mo-found, .fd-tiles, .mn-tiles, .mn-page .mn-tiles, .dish-more-grid),
.menu-rail .menu-rail-row { row-gap: var(--space-8); }
.menu-rail .menu-rail-row { grid-template-rows: repeat(4, auto); }
:is(.dc-row, .mo-grid, .mo-found, .fd-tiles, .dish-more-grid) > .dc,
.mn-tiles > .mn-tile {
  display: grid;
  grid-row: span 4;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: subgrid;
  row-gap: var(--space-8);
  width: auto;
  min-width: 0;
  padding-bottom: var(--space-24);
}
.dc > .dish-card-body, .mn-tile > .dish-card-body {
  display: grid;
  grid-column: 1;
  grid-row: 2 / span 3;
  grid-template-rows: subgrid;
  row-gap: var(--space-8);
  margin: 0;
  padding: 0;
}
.dc .dc-n, .mn-tile .mn-name { grid-row: 1; }
/* описание до цены (владелец, 22.10); строки общие у ряда карточек, поэтому цены стоят на одном уровне и без описания */
.dc .mn-desc, .dc .fd-p, .mn-tile .mn-desc { grid-row: 2; }
.dc .dc-pr, .mn-tile .mn-price { grid-row: 3; }
.dc .dc-n, .mn-tile .mn-name, .post-dish-name {
  font: 600 15px/21px var(--font-text);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  max-height: 42px;
  overflow: hidden;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
  align-self: start;
}
.dc .mn-desc, .mn-tile .mn-desc {
  /* Владелец (22.10): 13 px резал глаз. Описание 15/22, до двух строк, цвет graphite (контраст 8,9:1 на cream) */
  min-height: 0;
  max-height: none;
  margin: 0;
  font: 400 15px/22px var(--font-text);
  color: var(--graphite);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.mn-tile .mn-price, .dc .dc-pr { align-self: start; padding: 0; }
.dc .dc-ph, .dc-big .dc-ph, .menu-rail .dc-ph,
.mn-tile .mn-ph, .post-dish .post-dish-ph {
  position: relative;
  grid-column: 1;
  grid-row: 1;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  align-self: start;
  margin: 0 0 var(--space-4);
  border-radius: var(--radius-m);
}
.dc-ph > img, .post-dish-ph > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Article embeds also keep nutrition after the description, when supplied. */
.post-dish {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto auto auto auto;
  row-gap: var(--space-8);
}
.post-dish > .post-dish-body {
  display: grid;
  grid-row: 2 / span 4;
  grid-template-rows: subgrid;
  row-gap: var(--space-8);
  margin: 0;
}
.post-dish-name { grid-row: 1; }
.post-dish-p, .post-dish-body > .menu-off { grid-row: 2; }
.post-dish-body > .soft { grid-row: 3; }
.post-dish-body > .soft + .soft { grid-row: 4; }
.mn-n b, .mo-extras b { font-weight: 600; }
.dc .pill, .dp .pill { border-radius: var(--radius-xs); }
.dp .mo-btn { border-radius: var(--radius-m); }

/* Recommendations stay within the same content width as their heading. */
.dp > .dish-more { width: 100%; margin-block: var(--space-32) 0; }
.dish-more .menu-rail-head { align-items: baseline; flex-wrap: nowrap; gap: var(--space-16); }
.dish-more .menu-rail-head h2 { font-size: 28px; line-height: 32px; }
.dish-more-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: var(--space-24);
  min-width: 0;
  width: 100%;
}

/* Dish page: photo spans 7 of 12 columns, content spans 5. */
.dp .dp-dish {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: stretch;
  gap: var(--space-32);
}
.dp .mo-dish-ph {
  grid-column: span 7;
  position: relative;
  top: auto;
  height: auto;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-m);
}
.dp .mo-dish-ph > img { position: absolute; inset: 0; }
.dp .mo-dish-body {
  grid-column: span 5;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-24);
  min-width: 0;
  padding: 0;
}
.dp-heading { display: flex; flex-direction: column; gap: var(--space-16); }
.dp .dp-venue, .dp .mo-dish-pr { margin: 0; }
.dp .mo-dish-t { font-size: 40px; line-height: 44px; }
.dp-details { display: grid; gap: var(--space-24); margin-block: auto; }
.dp-details .mo-block { gap: var(--space-8); }
.dp-details .mo-block + .mo-block { border-top: var(--border-rule) solid var(--line); padding-top: var(--space-24); }
.dp .mo-block h2 { font: 600 17px/24px var(--font-text); margin: 0; flex-wrap: wrap; }
.dp .mo-block > p:not(.mo-small) { font: 400 17px/26px var(--font-text); margin: 0; }
.dp .mo-kbju { border-radius: var(--radius-sheet); border-width: var(--border-panel); }
.dp .mo-kbju div { padding: var(--space-12) var(--space-8); min-width: 0; }
.dp .mo-kbju b { font-weight: 600; }
.dp .mo-small { font: 400 14px/20px var(--font-text); }
.dp-action { display: flex; flex-direction: column; gap: var(--space-12); }
.dp .dp-action .mo-note { margin: 0; }
.dp .dp-action .mo-cta {
  height: auto;
  min-height: var(--control-l);
  border-radius: var(--radius-m);
  padding: var(--space-12) var(--space-16);
  font: 700 19px/24px var(--font-text);
  white-space: nowrap; /* номер телефона не переносится */
  align-self: flex-start;
  gap: var(--space-8);
  background: var(--orange-strong);
  color: var(--cream-fixed);
}
.dp .dp-action .mo-cta:focus-visible { outline: 3px solid var(--orange-deep); outline-offset: 3px; }
.dp .dp-action .mo-cta:hover {
  background: var(--orange-strong);
  color: var(--cream-fixed);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.dp .dp-dish-compact .mo-dish-body { justify-content: center; }

@media (max-width: 899px) {
  /* на телефоне кнопка во всю ширину колонки, 17 px, чтобы «Позвонить: +375 29 327-11-11» помещалось в одну строку на 375 px */
  .dp .dp-action .mo-cta { align-self: stretch; justify-content: center; font: 600 17px/22px var(--font-text); padding-inline: var(--space-12); }
  .dp .dp-dish { display: flex; flex-direction: column; gap: var(--space-24); }
  .dp .mo-dish-body { gap: var(--space-24); }
  .dp-details { margin: 0; }
  .dp .mo-dish-t { font-size: 28px; line-height: 32px; }
}
@media (max-width: 767px) {
  .dp { padding-inline: var(--gut); }
  .mn-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dish-more-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--space-12); }
  .dish-more .menu-rail-head h2 { font-size: 22px; line-height: 26px; }
  .dish-more .menu-rail-head .link-arrow { font-size: 13px; gap: var(--space-4); }
  .dish-more .menu-rail-head .link-arrow .ico { width: 16px; height: 16px; }
}
@media (min-width: 768px) and (max-width: 899px) {
  .mn-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* КБЖУ в карточке блюда (владелец, 22.10: «дерьмово вписано»): отдельной строкой под ценой, слева, каждая пара
   «число + подпись» не рвётся. Узкая карточка на телефоне переносит «БЖУ 13/23/78» целиком на следующую строку. */
.mn-tile .mn-price, .dc .dc-pr { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 12px; row-gap: 4px; white-space: nowrap; }
.mn-tile .mn-kb, .dc .mn-kb { display: flex; flex-wrap: wrap; flex-basis: 100%; align-items: baseline; column-gap: 12px; row-gap: 2px; }
.mn-kb .mn-n { display: inline-flex; align-items: baseline; white-space: nowrap; }
.mn-kb .mn-n i { margin-left: 4px; }
.mn-kb .mn-bj i { margin: 0 4px 0 0; }

/* No dish photos on the site (owner, 24.10): the dish page is its text alone. */
.dp .dp-no-ph { display: block; max-width: 760px; }
.dp .dp-no-ph .dp-tags { position: static; margin: 0 0 var(--space-16); }

/* the «menu» block of an article: the place page's menu under the place's name (owner, 06.11) */
.post-menu { margin-block: var(--space-32); padding: var(--space-24); background: var(--surface); border: var(--border-panel, 1.5px) solid var(--line); border-radius: var(--radius-sheet); }
.post-menu .post-menu-t { margin: 0 0 var(--space-16); font: 400 28px/32px var(--font-display); color: var(--ink); }
@media (max-width: 767px) { .post-menu { padding: var(--space-16); } .post-menu .post-menu-t { font-size: 22px; line-height: 26px; } }
.post-menu > .post-card { margin: 0 0 var(--space-24); padding: 0 0 var(--space-24); border: 0; border-bottom: 1.5px solid var(--line); border-radius: 0; background: none; box-shadow: none; } /* a rule parts the place from its menu (owner, 07.11) */
/* On a phone the menu in an article fits about one screen (owner, 07.11: «не 4-5 прокрутов»): the place's card shrinks to a
   row with a small photo, and the dishes go sideways as a strip of cards, the app's own menu slider */
@media (max-width: 767px) {
  .post-menu > .post-card { margin-bottom: var(--space-16); padding-bottom: var(--space-16); gap: 12px; }
  /* the photo and the number take the full height of the text beside them (owner, 07.11) */
  .post-menu > .post-card .vtopbox { display: grid; grid-template-columns: 96px minmax(0, 1fr); column-gap: 12px; row-gap: 4px; align-items: start; }
  .post-menu > .post-card .vphoto { position: relative; width: 96px; height: auto; min-height: 72px; grid-row: 1 / 3; align-self: stretch; }
  .post-menu > .post-card .vphoto img { position: absolute; inset: 0; }
  .post-menu > .post-card .vbody { display: contents; }
  .post-menu > .post-card .vtop, .post-menu > .post-card .vrow { display: none; }
  .post-menu > .post-card .vname { grid-column: 2; font-size: 20px; line-height: 24px; margin: 0; text-align: left; }
  .post-menu > .post-card .vblurb { grid-column: 2; margin: 0; font-size: 13px; line-height: 18px; }
  .post-menu > .post-card .vname, .post-menu > .post-card .vname .vlink { justify-content: flex-start; text-align: left; }
  .post-menu > .post-card .vbtns { grid-column: 1 / -1; margin-top: 8px; flex-wrap: nowrap; }
  .post-menu > .post-card .vbtns .btn { height: 40px; padding: 0 12px; font-size: 14px; flex: 1 1 auto; white-space: nowrap; justify-content: center; }
  /* «Маршрут» keeps only its pin so the call button fits beside it; the word stays for screen readers */
  .post-menu > .post-card .vbtns .btn:not(.btn-fill) { flex: 0 0 40px; width: 40px; padding: 0; gap: 0; font-size: 0; }
  .post-menu .mn-open { width: 100%; justify-content: center; white-space: nowrap; }
  /* the card right above already names the place: the menu's title stays for screen readers only */
  .post-menu .post-menu-t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; margin: 0; }
  .post-menu > .post-card .vname { display: block; }

  .post-menu > .post-card .vname .vlink { font-size: 20px; line-height: 24px; overflow-wrap: break-word; }
  .post-menu .mn-ctl { margin-top: 0; }
  .post-menu .mn-panel .mn-lines { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
    margin: 0 calc(-1 * var(--space-16)); padding: 4px var(--space-16) 8px; scroll-padding-inline: var(--space-16); }
  .post-menu .mn-panel .mn-lines::-webkit-scrollbar { display: none; }
  /* dish cards in the strip are all one height (the row's), framed, no fill (owner, 07.11) */
  .post-menu .mn-panel .mn-line { flex: 0 0 72%; scroll-snap-align: start; padding: 12px; border: 1.5px solid var(--line); border-radius: var(--radius-m); background: none; }
  .post-menu .mn-foot { margin-top: var(--space-8); }
  .post-menu .mn-panel .mn-line .mn-desc { -webkit-line-clamp: 4; min-height: 0; max-height: 72px; } /* a dish card in the strip has room for its whole line */
}
/* on a tablet the article's menu keeps two columns of dishes, as on a desktop, so the block stays short */
@media (min-width: 768px) { .post-menu .mn-panel .mn-lines { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--space-32); } }
