/* Home: "Bu gün nə yeyək?" (two questions, one recipe), "Evdə nə var?" shelf, category row. */

/* ---- Bu gün nə yeyək? ---- */
/* Tasty-style: white ground, the section heading, one row of plain selects, then recipe cards like every other
   list. No coloured block, no pills. Motion only explains the change (Emil): the old row dims while the new one
   loads, the new row comes in from a light blur; buttons scale on press. */
.ask__head { margin-bottom: 24px; }
.ask__again { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 4px; border: 0; background: none;
  font: inherit; font-size: 16px; font-weight: 700; color: var(--c-primary-ink); cursor: pointer; transition: transform 160ms var(--ease-out); }
.ask__again { white-space: nowrap; }
.ask__again img { transition: transform 300ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .ask__again:hover img { transform: rotate(90deg); } }
.ask__again:active { transform: scale(0.97); }
.ask__again:disabled { cursor: wait; }
.ask__bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 32px; }
.ask__select { appearance: none; height: 46px; min-width: 200px; padding: 0 40px 0 16px; border: 0; border-radius: 10px;
  background: #fff url("../img/icons/chevron-down.svg") right 14px center / 14px no-repeat; box-shadow: 0 0 0 1px var(--c-line);
  font: inherit; font-size: 15px; color: var(--c-ink); cursor: pointer; transition: box-shadow 150ms ease; }
@media (hover: hover) and (pointer: fine) { .ask__select:hover { box-shadow: 0 0 0 1px #9fcfc7; } }
.ask__select:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--c-primary); }
.ask__select:has(option:checked:not([value=""])) { box-shadow: 0 0 0 1.5px var(--c-primary); color: var(--c-primary-ink); font-weight: 700; }
.ask__lead { margin: -16px 0 20px; font-size: 15px; color: var(--c-muted); }
.ask__result { min-height: 200px; }
.ask__result [data-answer] { transition: opacity 200ms ease, filter 200ms ease; }
@starting-style { .ask__result [data-answer] { opacity: 0; filter: blur(4px); } }
.ask[aria-busy="true"] .ask__result [data-answer] { opacity: .45; filter: blur(2px); transition-duration: 150ms; }
.ask__empty { padding: 48px 0; color: var(--c-muted); }
@media (prefers-reduced-motion: reduce) {
  @starting-style { .ask__result [data-answer] { filter: none; } }
  .ask[aria-busy="true"] .ask__result [data-answer] { filter: none; }
  .ask__again img { transition: none; }
}

/* ---- Evdə nə var? ---- */
/* After nepisirsem.com / cooknew.ru: a box for anything not listed, ingredients in groups as text chips. */
.pantry__head { margin-bottom: 24px; }
.pantry .section-title { margin-bottom: 8px; }
.pantry__intro { color: var(--c-muted); }
.shelf__search { display: flex; gap: 12px; max-width: 720px; }
.shelf__search .input { flex: 1; min-height: 52px; background: #fff; }
.shelf__groups { display: grid; grid-template-columns: 1fr 1.6fr 1.3fr 1.3fr; gap: 20px 32px; margin-top: 28px; }
.shelf__group { border: 0; padding: 0; margin: 0; min-width: 0; }
.shelf__group legend { font-size: 14px; font-weight: 700; color: var(--c-muted); margin-bottom: 10px; }
.shelf__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.shelf__chip { cursor: pointer; }
.shelf__chip span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--c-line); background: #fff;
  font-weight: 600; font-size: 15px; transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease, transform 160ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .shelf__chip:hover span { border-color: var(--c-primary-line); } }
.shelf__chip:active span { transform: scale(0.96); }
.shelf__chip input:checked + span { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.shelf__chip input:focus-visible + span { outline: 3px solid var(--c-primary); outline-offset: 2px; }
.shelf__clear { border: 0; background: none; padding: 6px 0; font: inherit; font-weight: 700; color: var(--c-muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .shelf__clear:hover { color: var(--c-text); } }

/* Live results under the home shelf. */
.shelf__live { margin-top: 32px; border-radius: var(--radius); background: var(--c-primary-soft); padding: 24px 28px 28px; transition: opacity 150ms ease; }
.shelf__live[aria-busy="true"] { opacity: .6; }
.shelf__hint { color: var(--c-muted); font-size: 17px; text-align: center; padding: 20px 0; }
.shelf-res__head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; }
.shelf-res__sum { font-size: 17px; }
.shelf-res__sum strong { color: var(--c-primary-dark); }
.shelf-res__tools { display: flex; align-items: baseline; gap: 20px; }
.shelf-res__all { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--c-primary-dark); white-space: nowrap; }
.shelf-res__group { font-size: 16px; font-weight: 700; margin: 24px 0 12px; }
.shelf-res__list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.shelf-res__item { position: relative; display: grid; align-content: start; gap: 6px; background: #fff; border-radius: 16px; padding: 10px 10px 14px; }
.shelf-res__item .shelf-res__img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; margin-bottom: 4px; }
.shelf-res__title { font-size: 15px; font-weight: 700; line-height: 1.3; padding: 0 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (hover: hover) and (pointer: fine) { .shelf-res__item:hover .shelf-res__title { color: var(--c-primary); } }
.shelf-res__fit { font-size: 13px; color: var(--c-muted); padding: 0 4px; }

.pantry--page { display: block; margin-top: 32px; }
.pantry__title { font-size: 40px; font-weight: 800; line-height: 1.15; margin-bottom: 8px; }
.pantry--page .pantry__intro { margin-bottom: 24px; }
.pantry__summary { margin: 48px 0 32px; font-size: 17px; }
.pantry__group + .pantry__group { margin-top: 64px; }
.pantry__group-title { font-size: 22px; font-weight: 700; margin-bottom: 24px; }

/* ---- Category row: one line of round photos instead of two rows of big tiles ---- */
.cat-row { display: flex; gap: 16px; justify-content: space-between; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 2px 12px; scrollbar-width: thin; }
.cat-row__item { flex: 0 0 112px; display: grid; justify-items: center; gap: 4px; text-align: center; scroll-snap-align: start; }
.cat-row__item .cat-row__img { width: 112px !important; height: 112px !important; border-radius: 50%; object-fit: cover; margin-bottom: 8px; transition: transform 200ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .cat-row__item:hover .cat-row__img { transform: scale(1.05); } .cat-row__item:hover .cat-row__name { color: var(--c-primary); } }
.cat-row__name { font-weight: 700; font-size: 15px; line-height: 1.25; }
.cat-row__count { font-size: 13px; color: var(--c-muted); }

@media (max-width: 960px) {
  .shelf__groups { grid-template-columns: 1fr 1fr; }
  .shelf-res__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cat-row { justify-content: flex-start; }
}
@media (max-width: 560px) {
  .collection .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 12px; }
  .ask__bar { display: grid; grid-template-columns: 1fr 1fr; }
  .ask__select { min-width: 0; width: 100%; }
  .ask__select:first-child { grid-column: 1 / -1; }
  .ask__again-more { display: none; }
  /* Two small cards a row on phones, so four suggestions fit in about one screen. */
  .ask .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 12px; }
  .ask .card__title { font-size: 15px; }
  .ask .card__meta { font-size: 13px; }
  .shelf__search { flex-direction: column; }
  .shelf__groups { grid-template-columns: 1fr; gap: 18px; }
  .shelf__live { padding: 18px 14px 20px; margin-left: -4px; margin-right: -4px; }
  .shelf-res__list { gap: 10px; }
  .pantry__title { font-size: 28px; }
  .cat-row { gap: 18px; margin-right: -20px; padding-right: 20px; }
  .cat-row__item { flex-basis: 88px; }
  .cat-row__item .cat-row__img { width: 88px !important; height: 88px !important; }
  .cat-row__name { font-size: 13px; }
}

/* ---- Həftəlik menyu: one large card per day. Desktop: photo | text, the day strip and arrows stay put while the
   slides scroll under them. Phone: the strip on top, cards swipe with the next day peeking in. ---- */
.wm__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 32px; }
.wm__range { color: var(--c-muted); font-weight: 700; font-size: 15px; white-space: nowrap; }
.wm__box { position: relative; border: 1px solid var(--c-line); border-radius: 28px; overflow: hidden; background: #fff; }
.wm__days { display: flex; gap: 14px; }
.wm__day { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0; border: 0; background: none; cursor: pointer; color: inherit; font: inherit; }
.wm__dname { font-size: 13px; font-weight: 600; color: var(--c-muted); }
.wm__dnum { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; font-size: 16px; font-weight: 700; color: var(--c-text);
            transition: background-color 200ms var(--ease-out), color 200ms var(--ease-out); }
.wm__day--past .wm__dnum { color: #b3b3b3; }
.wm__day--today .wm__dname, .wm__day--today .wm__dnum { color: var(--c-primary-ink); }
.wm__day.is-active .wm__dname { color: var(--c-primary-ink); }
.wm__day.is-active .wm__dnum { background: var(--c-primary); color: #fff; }
@media (hover: hover) and (pointer: fine) { .wm__day:not(.is-active):hover .wm__dnum { background: var(--c-primary-soft); } }
.wm__day:focus-visible { outline: none; }
.wm__day:focus-visible .wm__dnum { outline: 2px solid var(--c-primary); outline-offset: 2px; }

.wm__track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.wm__track::-webkit-scrollbar { display: none; }
.wm__track:focus-visible { outline: 2px solid var(--c-primary); outline-offset: -2px; }
.wm__slide { flex: 0 0 100%; scroll-snap-align: start; scroll-snap-stop: always; display: grid; grid-template-columns: 1fr 1fr; min-height: 480px; }
.wm__media { display: block; position: relative; background: #eee; overflow: hidden; }
.wm__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.wm__body { display: flex; flex-direction: column; justify-content: space-between; gap: 28px; padding: 130px 56px 44px; }
.wm__text { display: flex; flex-direction: column; gap: 16px; }
.wm__label { color: var(--c-primary-ink); font-weight: 700; font-size: 15px; }
.wm__title { font-size: clamp(32px, 3.2vw, 46px); font-weight: 800; line-height: 1.08; letter-spacing: -0.02em; }
.wm__title a { color: inherit; }
.wm__lead { font-size: 18px; line-height: 1.55; color: #3a3a3a; max-width: 52ch; }
.wm__meta { color: var(--c-muted); font-weight: 600; font-size: 15px; }
.wm__cta { align-self: flex-start; }
.wm__nav { display: flex; align-items: center; gap: 12px; }
.wm__count { color: var(--c-muted); font-weight: 700; font-size: 15px; margin-right: 4px; font-variant-numeric: tabular-nums; }
.wm__arrow { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; border: 1px solid #d9d9d9; background: #fff; color: var(--c-text); cursor: pointer;
             transition: border-color 200ms var(--ease-out), transform 160ms var(--ease-out); }
.wm__arrow:disabled { opacity: .35; cursor: default; }
.wm__arrow:active:not(:disabled) { transform: scale(.96); }
@media (hover: hover) and (pointer: fine) { .wm__arrow:hover:not(:disabled) { border-color: var(--c-primary); color: var(--c-primary-ink); } }

@media (min-width: 961px) {
  /* Strip and arrows sit over the text half of whichever slide is showing. The slides do not scroll sideways here:
     they are stacked and cross-fade, so no photo ever passes under the strip. */
  .wm__days { position: absolute; z-index: 2; top: 44px; left: calc(50% + 56px); }
  .wm__nav { position: absolute; z-index: 2; right: 56px; bottom: 44px; }
  .wm__track { display: grid; overflow: hidden; scroll-snap-type: none; }
  .wm__slide { grid-area: 1 / 1; opacity: 0; visibility: hidden; transition: opacity 320ms var(--ease-out), visibility 0s linear 320ms; }
  .wm__slide.is-active { opacity: 1; visibility: visible; transition: opacity 320ms var(--ease-out), visibility 0s; }
  /* Without JS nothing gets .is-active: show the first day rather than an empty card. */
  .wm:not(.is-ready) .wm__slide:first-child { opacity: 1; visibility: visible; }
}
@media (max-width: 960px) {
  .wm__head { flex-direction: column; align-items: flex-start; gap: 6px; margin-bottom: 20px; }
  .wm__box { border: 0; border-radius: 0; overflow: visible; background: none; }
  .wm__days { justify-content: space-between; margin-bottom: 20px; gap: 4px; }
  .wm__dnum { width: 38px; height: 38px; }
  .wm__track { gap: 12px; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); scroll-padding-inline: var(--gutter); }
  .wm__slide { flex-basis: min(330px, 85%); grid-template-columns: 1fr; grid-template-rows: auto 1fr; min-height: 0;
               border: 1px solid var(--c-line); border-radius: 24px; overflow: hidden; background: #fff; }
  .wm__media { aspect-ratio: 330 / 236; }
  .wm__body { padding: 18px 20px 20px; gap: 18px; }
  .wm__text { gap: 10px; }
  .wm__label { font-size: 13px; }
  .wm__title { font-size: 26px; letter-spacing: -0.015em; }
  .wm__lead { font-size: 15px; line-height: 1.5; }
  .wm__meta { font-size: 13px; }
  .wm__cta { align-self: stretch; }
  .wm__nav { display: none; }
}
@media (prefers-reduced-motion: reduce) { .wm__dnum, .wm__arrow, .wm__slide { transition: none !important; } }
