/* Dinner Time — minimaliste chaleureux : blanc cassé, anthracite, vert sauge. */

:root {
  --bg: #faf7f2;
  --card: #ffffff;
  --text: #2e2a26;
  --muted: #6f6a61;
  --accent: #7d9774;
  --accent-dark: #5f7a57;
  --warm: #b3562e;
  --ring: #8ba883;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.55;
}

.container { max-width: 1000px; margin: 0 auto; padding: 24px 20px 64px; }

.hero h1 { font-size: 2rem; margin: 0 0 4px; }
.lede { color: var(--muted); margin: 0 0 24px; max-width: 60ch; }

/* Formulaire */
.search {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 1px 3px rgba(46, 42, 38, 0.08);
  margin-bottom: 32px;
}
.field label { display: block; font-weight: 600; margin-bottom: 6px; }
.field input {
  width: 100%;
  font-size: 16px; /* évite le zoom iOS */
  padding: 12px 14px;
  border: 1px solid #d9d2c7;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}
.staples {
  border: 0;
  padding: 0;
  margin: 16px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  align-items: center;
}
.staples legend { font-weight: 600; padding: 0; margin-bottom: 8px; font-size: 0.95rem; }
.staples label { display: flex; align-items: center; gap: 6px; color: var(--muted); }
button[type="submit"] {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 8px;
  padding: 12px 24px;
  cursor: pointer;
}
button[type="submit"]:hover { background: var(--accent-dark); }

:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 4px; }

/* États */
.state { color: var(--muted); background: var(--card); border-radius: var(--radius); padding: 14px 16px; }

/* Résultats */
section { margin-top: 32px; }
section h2 { font-size: 1.25rem; border-bottom: 2px solid var(--accent); padding-bottom: 6px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(46, 42, 38, 0.08);
  display: flex;
  flex-direction: column;
}
.card-image { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; }
.card-image.placeholder {
  background: #e7ecdf;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}
.card-body { padding: 14px 16px; }
.card-body h3 { margin: 0 0 6px; font-size: 1.05rem; }
.card-body h3 a { color: var(--text); text-decoration-color: var(--accent); }
.meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; color: var(--muted); font-size: 0.85rem; }
.chip { background: #eef1e8; color: var(--accent-dark); border-radius: 999px; padding: 2px 10px; }
.matched { color: var(--accent-dark); font-weight: 600; margin: 0; font-size: 0.9rem; }
.missing { color: var(--warm); margin: 4px 0 0; font-size: 0.9rem; }

/* Fiche recette */
.detail { max-width: 680px; }
.back { color: var(--accent-dark); font-weight: 600; text-decoration: none; }
.back:hover { text-decoration: underline; }
.detail-image { width: 100%; max-height: 320px; object-fit: cover; border-radius: var(--radius); }
.status { background: var(--card); border-left: 4px solid var(--accent); padding: 12px 16px; border-radius: 8px; }
.ingredient-list { padding-left: 24px; }
.ingredient-list li { padding: 4px 0; border-bottom: 1px dashed #e6e0d6; }
