/* recipes and cookbooks (shared styles live in ../style.css) */

/* ---------- list: search and tag filter ---------- */
.recipe-intro { margin: 0; }
.recipe-search { display: flex; gap: 8px; }
.recipe-search input { flex: 1; min-width: 0; }
.recipe-filter { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-chip { color: var(--muted); padding: 4px 12px; }
.tag-chip:hover { text-decoration: none; border-color: var(--primary); color: var(--text); }
.tag-chip.active { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }

/* ---------- recipe cards ---------- */
.recipe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.recipe-card {
  display: flex; flex-direction: column; min-width: 0; color: var(--text); background: var(--card-alt);
  border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden;
  transition: transform .15s, box-shadow .15s;
}
.recipe-card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow); }
.recipe-thumb { aspect-ratio: 4 / 3; background: var(--title-bg); overflow: hidden; }
.recipe-thumb > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.recipe-placeholder {
  width: 100%; height: 100%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--title-bg), var(--pink-soft));
}
.recipe-placeholder img { width: 46%; max-width: 84px; height: auto; }
.recipe-card-body { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px 10px; min-width: 0; }
.recipe-card-title {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
  line-height: 1.25; overflow-wrap: anywhere;
}
.recipe-card-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recipe-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.recipe-tags .chip { font-size: .7rem; padding: 1px 7px; background: var(--card); }
.recipe-share-hint, .recipe-private-hint { margin: 10px 0 0; }

/* ---------- recipe page ---------- */
.recipe-hero { display: block; background: var(--card-alt); border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; }
.recipe-hero img { display: block; width: 100%; max-height: 420px; object-fit: cover; }
.recipe-title { margin: 0; overflow-wrap: anywhere; }
.recipe-byline { display: flex; align-items: center; gap: 10px; }
.recipe-description { margin: 0; overflow-wrap: anywhere; }
.recipe-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.recipe-meta .tag-chip { padding: 2px 10px; }
.recipe-saved { color: var(--ok); border-color: var(--ok); }

.recipe-ingredients { list-style: none; margin: 0; padding: 0; }
.recipe-ingredients li + li { border-top: 1px dashed var(--line); }
.recipe-ingredients label {
  display: flex; align-items: flex-start; gap: 10px; padding: 9px 2px; cursor: pointer;
  font-weight: 400; font-size: 1rem; color: var(--text);
}
.recipe-ingredients input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--primary); }
.recipe-ingredients span { min-width: 0; overflow-wrap: anywhere; }
.recipe-ingredients input:checked + span { text-decoration: line-through; color: var(--muted); }
.recipe-tick-hint { margin: 10px 0 0; }

.recipe-steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 12px; }
.recipe-steps li {
  counter-increment: step; position: relative; padding-left: 40px; min-height: 28px; overflow-wrap: anywhere;
}
.recipe-steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: .85rem;
  background: var(--primary); color: var(--primary-ink);
}

.recipe-shares { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.recipe-shares li { display: flex; align-items: center; gap: 6px; }
.recipe-share-form { display: flex; flex-wrap: wrap; gap: 8px; }
.recipe-share-form select { flex: 1; min-width: 180px; }

.recipe-made-form > summary { list-style: none; cursor: pointer; }
.recipe-made-form > summary::-webkit-details-marker { display: none; }
.recipe-made-form[open] > summary { margin-bottom: 12px; }
.made-photo { display: block; margin-top: 8px; max-width: 320px; }
.made-photo img { display: block; width: 100%; border-radius: var(--radius-sm); }
.recipe-page .comment-body { overflow-wrap: anywhere; }

/* ---------- recipe form ---------- */
.recipe-vegan-hint { margin: -6px 0 0; }
.recipe-field-hint { font-weight: 400; margin-left: 6px; }
.recipe-tag-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.recipe-tag-option {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--card-alt); color: var(--text); font-weight: 600;
}
.recipe-tag-option input { margin: 0; accent-color: var(--primary); }
.recipe-tag-option:has(input:checked) { border-color: var(--primary); background: var(--title-bg); }
.recipe-current-photo { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.recipe-current-photo img { width: 120px; height: 90px; object-fit: cover; border-radius: var(--radius-sm); }

@media (min-width: 700px) {
  .recipe-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
}
