/* Recetario web público.
   Implementación del mockup aprobado (docs/mockup-recetario.html, §A1–A4 del
   diseño). Los valores vienen de ahí tal cual; los colores y tipografías, de
   estilos/tokens.css. */

body { background: var(--shell); }

/* El mockup encuadra el sitio en 1160 px; fuera de ese ancho queda el malva
   del showcase. */
#app {
  max-width: var(--wrap);
  margin: 0 auto;
  background: var(--paper);
  min-height: 100vh;
}

/* ---------- Portada ---------- */
.hero {
  padding: 34px 32px 26px;
  background:
    radial-gradient(700px 240px at 82% -40px, rgba(127, 176, 58, .10), transparent 70%),
    var(--paper);
  border-bottom: 1px solid var(--line);
}
.hero__top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.hero__logo { height: 52px; width: auto; }
.navlink { font-weight: 700; color: var(--ink-soft); font-size: 14px; text-decoration: none; }
.navlink:hover { color: var(--morado-700); }
.hero__ded {
  margin-top: 22px; font-family: var(--font-display); font-weight: 700;
  font-size: clamp(20px, 3.4vw, 30px); color: var(--ink); max-width: 22ch; line-height: 1.2;
}
.hero__sub { margin-top: 8px; color: var(--ink-soft); max-width: 52ch; }

.search {
  margin-top: 20px; display: flex; align-items: center; gap: 10px;
  background: #fff; border: 2px solid var(--line); border-radius: var(--pill);
  padding: 12px 18px; max-width: 440px; box-shadow: var(--shadow-sm);
}
.search:focus-within { border-color: var(--morado); }
.search svg { flex: none; color: var(--ink-soft); }
.search input { border: 0; outline: 0; font: inherit; font-size: 15px; width: 100%; background: transparent; color: var(--ink); }
.search input::placeholder { color: #a99cb5; }

.gridwrap { padding: 26px 32px 36px; }
.gridwrap__meta { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.gridwrap__meta .lbl { font-weight: 800; font-family: var(--font-display); font-size: 18px; color: var(--ink); }
.gridwrap__meta .count { font-size: 13px; color: var(--ink-soft); font-weight: 700; }

.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
@media (max-width: 900px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 620px) { .grid { grid-template-columns: repeat(2, 1fr); } }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card a { display: block; color: inherit; text-decoration: none; }
.card a:focus-visible { outline: 3px solid var(--morado); outline-offset: -3px; }
.card__art { aspect-ratio: 1/1; position: relative; display: grid; place-items: center; overflow: hidden; }
.card__art img { width: 100%; height: 100%; object-fit: cover; }
.card__art--ph::before {
  content: ""; position: absolute; inset: 0;
  background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, .10) 0 12px, transparent 12px 24px);
}
.phmark { width: 44%; max-width: 74px; opacity: .62; }
.card__num {
  position: absolute; top: 10px; left: 10px; background: rgba(255, 255, 255, .85);
  color: var(--ink); font-weight: 800; font-family: var(--font-display); font-size: 13px;
  width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; z-index: 2;
}
.card__body { padding: 12px 14px 15px; }
.card__name { font-size: 17px; color: var(--ink); line-height: 1.15; }
.noresult { grid-column: 1/-1; text-align: center; color: var(--ink-soft); padding: 30px; font-weight: 600; }

/* ---------- Página de receta ---------- */
.recipe { background: var(--surface); min-height: 100vh; }
.rhead {
  background: var(--recipe); color: var(--recipe-on); padding: 30px 34px;
  display: grid; grid-template-columns: 1.4fr .9fr; gap: 24px; align-items: center;
}
.rhead__k { font-family: var(--font-sans); font-weight: 800; text-transform: uppercase; letter-spacing: .16em; font-size: 12px; opacity: .85; }
.rhead h1 { font-size: clamp(32px, 5vw, 48px); margin-top: 8px; line-height: 1.02; }
.rhead__sub { margin-top: 12px; font-size: 16px; opacity: .9; max-width: 38ch; }
.rhead__art { border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-md); aspect-ratio: 1/1; background: rgba(255, 255, 255, .15); }
.rhead__art img { width: 100%; height: 100%; object-fit: cover; }

.rbody { padding: 30px 34px 34px; display: grid; grid-template-columns: 340px 1fr; gap: 38px; background: var(--surface); }
.rbody h2 {
  font-size: 15px; text-transform: uppercase; letter-spacing: .12em;
  font-family: var(--font-sans); font-weight: 800; color: var(--recipe-deep);
  margin-bottom: 14px; padding-bottom: 8px; border-bottom: 2px solid var(--line);
}

.ings { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ings li { display: flex; gap: 10px; font-size: 15.5px; color: var(--ink); }
.ings li::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--choclo); margin-top: 9px; }

.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; display: flex; flex-direction: column; gap: 16px; }
.steps li { display: flex; gap: 14px; }
.steps li::before {
  counter-increment: s; content: counter(s); flex: none;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--recipe); color: var(--recipe-on);
  font-family: var(--font-display); font-weight: 800; font-size: 15px;
  display: grid; place-items: center;
}
.steps li p { padding-top: 3px; font-size: 15.5px; }

/* Subgrupos y notas del cuaderno: seis recetas parten la lista
   ("Relleno 1", "Para los frijoles") y la causa cierra con una nota. */
.grupo {
  font-family: var(--font-display); font-weight: 800; font-size: 16px;
  color: var(--recipe-deep); margin-top: 6px;
}
.ings .grupo::before, .steps .grupo::before { content: none; counter-increment: none; }
.ings .grupo, .steps .grupo { display: block; }
.nota {
  font-style: italic; color: var(--ink-soft); font-size: 14.5px;
  border-left: 3px solid var(--choclo); padding-left: 12px; margin-top: 4px;
}
.ings .nota::before, .steps .nota::before { content: none; counter-increment: none; }
.ings .nota, .steps .nota { display: block; }

.resena { margin-top: 26px; grid-column: 1/-1; border-top: 1px solid var(--line); padding-top: 22px; display: flex; gap: 16px; align-items: flex-start; }
.resena__q { font-family: var(--font-display); font-size: 52px; line-height: .7; color: var(--recipe); flex: none; }
.resena p { font-style: italic; font-size: 17px; color: var(--ink-soft); max-width: 62ch; }

.rpie { grid-column: 1/-1; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 26px; }
.volver, .compartir {
  font: inherit; font-weight: 800; font-size: 14px; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--pill); padding: 9px 18px;
  background: var(--surface); color: var(--recipe-deep); text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px;
}
.volver:hover, .compartir:hover { background: var(--surface-2); }

@media (max-width: 760px) {
  .rhead { grid-template-columns: 1fr; }
  .rhead__art { max-width: 260px; }
  .rbody { grid-template-columns: 1fr; gap: 26px; }
  .hero, .gridwrap { padding-inline: 20px; }
  .rhead, .rbody { padding-inline: 20px; }
}

/* ---------- Pie ---------- */
.pie { padding: 40px 20px 60px; text-align: center; color: var(--ink-soft); font-size: 14px; background: var(--paper); }
.pie .mk { font-family: var(--font-display); font-weight: 800; color: var(--morado); font-size: 16px; }

/* ---------- Estados ---------- */
.cargando, .fallo { padding: 60px 32px; text-align: center; color: var(--ink-soft); font-weight: 600; }
[hidden] { display: none !important; }
